8000 GitHub - jattle/pprof-cpp: cpp implementation of pprof utilities, aim for fast processing of profile data
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jattle/pprof-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Provide efficient parsing and convertion for gperftools CPU/MEM Profile.
incldudes:

  • profile IO
  • local generation of symbolized profile it can be submmited to remote server for later processing, such as flamegraph generation.
  • others more utility comming soon.

Dependencies

GNU binutils lib, if not exists on current os, install it using yum or other package tools according to your os:

yum install binutils-devel.x86_64

examples

online processing

#include "profiling/cpu_profile.h"

int GenerateSymbolizedProfile(const std::string &file, std::string *output) {
    pprofcpp::CPUProfile profile{file};
    if (auto st = profile.Parse(); st != pprofcpp::ReaderRetCode::kOK) {
        return static_cast<int>(st);
    }
    pprofcpp::BfdSymbolLocator locator;
    RawProfileMeta meta;
    meta.program_path = "testbin";
    if (auto st = profile.GenerateRawProfile(meta, &locator, output); st != pprofcpp::CPUProfileRetCode::kOK) {
        return static_cast<int>(st);
    }
    return 0;
}

offline processing

see tools/profile_printer and tools/addr2symbol.

About

cpp implementation of pprof utilities, aim for fast processing of profile data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0