23 using namespace edm::service;
44 if (
void *sym = dlsym(
nullptr,
"igprof_dump_now")) {
45 dump_ = __extension__(
void (*)(
const char *)) sym;
47 edm::LogWarning(
"IgProfModule") <<
"IgProfModule requested but application is not"
48 <<
" currently being profiled with igprof\n";
63 std::sort(modules_.begin(), modules_.end());
64 std::sort(moduleTypes_.begin(), moduleTypes_.end());
83 if (not modules_.empty()
or not moduleTypes_.empty()) {
168 if (!
dump_ || format.empty())
178 final =
replace(
final,
"%M", moduleLabel);
179 dump_(
final.c_str());
184 size_t patlen = strlen(pat);
186 while ((pos = result.find(pat, pos)) != std::string::npos) {
188 int n = sprintf(buf,
"%d", val);
189 result.replace(pos, patlen, buf);
190 pos = pos - patlen +
n;
198 size_t patlen = strlen(pat);
200 while ((pos = result.find(pat, pos)) != std::string::npos) {
202 int n = sprintf(buf,
"%llu", val);
203 result.replace(pos, patlen, buf);
204 pos = pos - patlen +
n;
212 size_t patlen = strlen(pat);
214 while ((pos = result.find(pat, pos)) != std::string::npos) {
215 result.replace(pos, patlen, val.data());
216 pos = pos - patlen + val.size();
std::string atPreModuleEvent_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
void watchPreEvent(PreEvent::slot_type const &iSlot)
std::string atPostEndLumi_
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
void postOpenFile(std::string const &)
std::string atPostEndJob_
void watchPostEvent(PostEvent::slot_type const &iSlot)
LuminosityBlockID const & luminosityBlockID() const
std::string const & moduleName() const
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
void watchPostGlobalBeginLumi(PostGlobalBeginLumi::slot_type const &iSlot)
IgProfService(const ParameterSet &, ActivityRegistry &)
void postEndRun(GlobalContext const &gc)
edm::LuminosityBlockNumber_t nlumi_
std::string const & moduleLabel() const
std::string atPostBeginRun_
void preModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc)
std::string atPostOpenFile_
static std::string replaceU64(const std::string &s, const char *pat, unsigned long long val)
void watchPostGlobalBeginRun(PostGlobalBeginRun::slot_type const &iSlot)
void postEvent(StreamContext const &sc)
void watchPostCloseFile(PostCloseFile::slot_type const &iSlot)
void makeDump(const std::string &format, std::string_view moduleLabel="")
std::string atPostEndRun_
ModuleDescription const * moduleDescription() const
std::vector< std::string > modules_
std::string atPostCloseFile_
void watchPostGlobalEndLumi(PostGlobalEndLumi::slot_type const &iSlot)
std::string atPostModuleEvent_
void postCloseFile(std::string const &)
void(* dump_)(const char *)
void postBeginLumi(GlobalContext const &gc)
#define DEFINE_FWK_SERVICE(type)
std::vector< std::string > moduleTypes_
std::string atPostBeginLumi_
void postEndLumi(GlobalContext const &gc)
edm::EventNumber_t nevent_
void watchPostGlobalEndRun(PostGlobalEndRun::slot_type const &iSlot)
LuminosityBlockNumber_t luminosityBlock() const
void watchPostOpenFile(PostOpenFile::slot_type const &iSlot)
void postModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc)
void preEvent(StreamContext const &sc)
EventID const & eventID() const
Log< level::Warning, false > LogWarning
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
void postBeginRun(GlobalContext const &gc)