CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Functions | Variables
ProfilingTools.cc File Reference
#include "../interface/ProfilingTools.h"
#include <stdio.h>
#include <dlfcn.h>
#include <signal.h>
#include <sys/types.h>
#include <unistd.h>
#include <boost/unordered_map.hpp>

Go to the source code of this file.

Namespaces

 runtimedef
 

Functions

int runtimedef::get (const char *name)
 
int runtimedef::get (const std::string &name)
 
void igProfDumpNow (int)
 
void runtimedef::set (const std::string &name, int value)
 set the flag, with a run-time name More...
 
bool setupIgProfDumpHook ()
 

Variables

boost::unordered_map< const
char *, std::pair< int, int > > 
runtimedef::defines_
 
boost::unordered_map
< std::string, int > 
runtimedef::definesByString_
 
int igProfDumpNumber_ = 0
 
void(* igProfRequestDump_ )(const char *)
 
boost::unordered_map< const
char *, PerfCounter
perfCounters_
 

Function Documentation

void igProfDumpNow ( int  )

Definition at line 15 of file ProfilingTools.cc.

References igProfDumpNumber_, and igProfRequestDump_.

Referenced by setupIgProfDumpHook().

15  {
16  char buff[50];
18  sprintf(buff,"dump.%d.%d.out.gz", getpid(), igProfDumpNumber_);
19  igProfRequestDump_(buff);
20  fprintf(stderr, "Dumped to %s\n", buff); fflush(stderr);
21 }
int igProfDumpNumber_
void(* igProfRequestDump_)(const char *)
bool setupIgProfDumpHook ( )

Definition at line 23 of file ProfilingTools.cc.

References igProfDumpNow(), and igProfRequestDump_.

23  {
24  if (void *sym = dlsym(0, "igprof_dump_now")) {
25  igProfRequestDump_ = __extension__ (void(*)(const char *)) sym;
26  fprintf(stderr, "IgProf dump hook enabled. Do kill -USR2 %d to request a dump.\n", int(getpid())); fflush(stderr);
27  } else {
28  fprintf(stderr, "Not being profiled by IgProf. The command you should use to profile this is:\n");
29  fprintf(stderr, " igprof -mp -z -t combine combine datacard [options]\n\n");
30  fflush(stderr);
31  return false;
32  }
33  signal(SIGUSR2,igProfDumpNow);
34  return true;
35 }
void igProfDumpNow(int)
void(* igProfRequestDump_)(const char *)
double a
Definition: hdecay.h:121

Variable Documentation

int igProfDumpNumber_ = 0

Definition at line 13 of file ProfilingTools.cc.

Referenced by igProfDumpNow().

void(* igProfRequestDump_)(const char *)

Definition at line 12 of file ProfilingTools.cc.

Referenced by igProfDumpNow(), and setupIgProfDumpHook().

boost::unordered_map<const char *, PerfCounter> perfCounters_

Definition at line 38 of file ProfilingTools.cc.

Referenced by PerfCounter::get(), and PerfCounter::printAll().