Support for the –prof commandline option.
More...
Support for the –prof commandline option.
Definition at line 13 of file ProfilerSupport.cxx.
ana::ProfilerSupport::~ProfilerSupport |
( |
| ) |
|
|
inline |
Definition at line 16 of file ProfilerSupport.cxx.
18 if(getenv(
"CPUPROFILE")){
19 char tmp[] =
"/tmp/XXXXXX.pdf";
22 const char* pd = getenv(
"GPERFTOOLS_DIR");
24 std::cout <<
"Couldn't find pprof executable" << std::endl;
27 const std::string perfdir = pd;
29 const std::string pprof = perfdir +
"/bin/pprof";
32 setenv(
"PATH", (perfdir+
"/bin/:"+std::string(getenv(
"PATH"))).c_str(), 1);
33 setenv(
"LD_LIBRARY_PATH", (perfdir+
"/lib/:"+std::string(getenv(
"LD_LIBRARY_PATH"))).c_str(), 1);
35 std::cout <<
"Creating profile. This can take some time..." << std::endl;
36 const std::string cmd1 = pprof +
" --pdf `which root.exe` " + std::string(getenv(
"CPUPROFILE")) +
" > " + tmp;
38 const int ret = system(cmd1.c_str());
41 std::cout <<
"Displaying profile..." << std::endl;
42 const std::string cmd2 =
"evince "+std::string(tmp);
BEGIN_PROLOG could also be cout
The documentation for this class was generated from the following file: