23 using namespace edm::service;
47 if (
void *sym = dlsym(0,
"igprof_dump_now")) {
48 dump_ = __extension__ (
void(*)(
const char *)) sym;
51 <<
"IgProfModule requested but application is not"
52 <<
" currently being profiled with igprof\n";
155 if (!
dump_ || format.empty())
158 std::string
final(
format);
165 dump_(
final.c_str());
171 size_t patlen = strlen(pat);
173 while ((pos = result.find(pat, pos)) != std::string::npos)
176 int n = sprintf(buf,
"%d", val);
177 result.replace(pos, patlen, buf);
178 pos = pos - patlen +
n;
void watchPostBeginRun(PostBeginRun::slot_type const &iSlot)
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
std::string atPostEndLumi_
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
std::string atPostEndJob_
void postEvent(Event const &ev, EventSetup const &es)
void watchPreProcessEvent(PreProcessEvent::slot_type const &iSlot)
void preEvent(EventID const &id, Timestamp const &ts)
void watchPostEndLumi(PostEndLumi::slot_type const &iSlot)
IgProfService(const ParameterSet &, ActivityRegistry &)
string format
Some error handling for the usage.
void postBeginRun(Run const &run, EventSetup const &es)
std::string atPostBeginRun_
void postBeginLumi(LuminosityBlock const &run, EventSetup const &es)
LuminosityBlockNumber_t luminosityBlock() const
std::string atPostOpenFile_
void watchPostProcessEvent(PostProcessEvent::slot_type const &iSlot)
void watchPostCloseFile(PostCloseFile::slot_type const &iSlot)
std::string atPostEndRun_
void postEndRun(Run const &run, EventSetup const &es)
std::string atPostCloseFile_
void watchPostBeginLumi(PostBeginLumi::slot_type const &iSlot)
void(* dump_)(const char *)
#define DEFINE_FWK_SERVICE(type)
std::string atPostBeginLumi_
void watchPostOpenFile(PostOpenFile::slot_type const &iSlot)
void postEndLumi(LuminosityBlock const &run, EventSetup const &es)
void watchPostEndRun(PostEndRun::slot_type const &iSlot)
void makeDump(const std::string &format)
std::string atPostBeginJob_
static std::string replace(const std::string &s, const char *pat, int val)
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal