CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Typedefs | Functions | Variables
edm::service Namespace Reference

Classes

class  AbstractMLscribe
 
struct  close_and_delete
 
class  ConcurrentModuleTimer
 
class  CondorStatusService
 
class  CPU
 
class  ELadministrator
 
class  ELdestControl
 
class  ELdestination
 
class  ELlimitsTable
 
class  ELoutput
 
struct  ELsetS
 
class  ELstatistics
 
class  EnableFloatingPointExceptions
 
class  IgProfService
 
class  InitRootHandlers
 
class  JobReportService
 
class  LoadAllDictionaries
 
class  MainThreadMLscribe
 
class  MessageLogger
 
struct  MessageLoggerDefaults
 
class  MessageLoggerScribe
 
class  MessageServicePresence
 
class  MessageServicePSetValidation
 
class  NamedDestination
 
class  PrescaleService
 
struct  ProcInfo
 
class  ProcInfoFetcher
 
class  RandomNumberGeneratorService
 
class  ResourceEnforcer
 
class  SilentMLscribe
 
class  SimpleMemoryCheck
 
class  SingleThreadMSPresence
 
class  SiteLocalConfigService
 
struct  smapsInfo
 
class  StallMonitor
 
class  SystemBounds
 
class  ThreadQueue
 
class  ThreadSafeLogMessageLoggerScribe
 
class  Timing
 
class  Tracer
 
class  TriggerNamesService
 
class  UnixSignalService
 

Typedefs

typedef std::set< ELsetSELset_string
 

Functions

int cmssw_stacktrace (void *)
 
static void cmssw_stacktrace_fork ()
 
static std::string d2str (double d)
 
static std::string d2str (double d)
 
static ELstring formatTime (const time_t t)
 
static double getCPU ()
 
static double getTime ()
 
static std::string i2str (int i)
 
bool isProcessWideService (void const *)
 
bool isProcessWideService (JobReportService const *)
 
bool isProcessWideService (TFileAdaptor const *)
 
bool isProcessWideService (CPU const *)
 
bool isProcessWideService (SiteLocalConfigService const *)
 
bool isProcessWideService (TFileService const *)
 
bool isProcessWideService (InitRootHandlers const *)
 
bool isProcessWideService (MessageLogger const *)
 
static std::vector< double > & moduleTimeStack ()
 
std::ostream & operator<< (std::ostream &os, SimpleMemoryCheck::SignificantEvent const &se)
 
std::ostream & operator<< (std::ostream &os, SimpleMemoryCheck::SignificantModule const &se)
 
static std::string summarizeContext (const std::string &c)
 
static std::string ui2str (unsigned int i)
 

Variables

static char dashC [] = "-c"
 
static const ELstring hereMsg = "available via this destination"
 
static const ELstring noClearSummaryMsg = "No clearSummary()"
 
static const ELstring noosMsg = "No ostream"
 
static const ELstring noSummarizationMsg = "No summarization()"
 
static const ELstring noSummaryMsg = "No summary()"
 
static const ELstring notELoutputMsg = "This destination is not an ELoutput"
 
static char pstackName [] = "(CMSSW stack trace helper)"
 

Typedef Documentation

Definition at line 33 of file ELset.h.

Function Documentation

int edm::service::cmssw_stacktrace ( void *  )

Definition at line 714 of file InitRootHandlers.cc.

References cmsStageWithFailover::argv, and edm::service::InitRootHandlers::getPstackArgv().

Referenced by cmssw_stacktrace_fork().

715  {
717  // NOTE: this is NOT async-signal-safe at CERN's lxplus service.
718  // CERN uses LD_PRELOAD to replace execv with a function from libsnoopy which
719  // calls dlsym.
720 #ifdef __linux__
721  syscall(SYS_execve, "/bin/sh", argv, __environ);
722 #else
723  execv("/bin/sh", argv);
724 #endif
725  ::abort();
726  return 1;
727  }
static char *const * getPstackArgv()
void edm::service::cmssw_stacktrace_fork ( )
static

Definition at line 680 of file InitRootHandlers.cc.

References clone(), cmssw_stacktrace(), sysUtil::pid, and mps_update::status.

Referenced by edm::service::InitRootHandlers::stacktraceHelperThread().

681  {
682  char child_stack[4*1024];
683  char *child_stack_ptr = child_stack + 4*1024;
684  // On Linux, we currently use jemalloc. This registers pthread_atfork handlers; these
685  // handlers are *not* async-signal safe. Hence, a deadlock is possible if we invoke
686  // fork() from our signal handlers. Accordingly, we use clone (not POSIX, but AS-safe)
687  // as that is closer to the 'raw metal' syscall and avoids pthread_atfork handlers.
688  int pid =
689 #ifdef __linux__
690  clone(edm::service::cmssw_stacktrace, child_stack_ptr, CLONE_VM|CLONE_FS|SIGCHLD, nullptr);
691 #else
692  fork();
693  if (child_stack_ptr) {} // Suppress 'unused variable' warning on non-Linux
694  if (pid == 0) {edm::service::cmssw_stacktrace(nullptr); ::abort();}
695 #endif
696  if (pid == -1)
697  {
698  full_cerr_write("(Attempt to perform stack dump failed.)\n");
699  }
700  else
701  {
702  int status;
703  if (waitpid(pid, &status, 0) == -1)
704  {
705  full_cerr_write("(Failed to wait on stack dump output.)\n");
706  }
707  if (status)
708  {
709  full_cerr_write("(GDB stack trace failed unexpectedly)\n");
710  }
711  }
712  }
int cmssw_stacktrace(void *)
tuple pid
Definition: sysUtil.py:22
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
tuple status
Definition: mps_update.py:57
static std::string edm::service::d2str ( double  d)
static

Definition at line 82 of file Timing.cc.

References ztail::d, and t.

82  {
83  std::stringstream t;
84  t << d;
85  return t.str();
86  }
tuple d
Definition: ztail.py:151
static std::string edm::service::d2str ( double  d)
static

Definition at line 293 of file SimpleMemoryCheck.cc.

References ztail::d, and t.

Referenced by edm::service::SimpleMemoryCheck::eventStatOutput(), edm::service::Timing::postEndJob(), edm::service::CPU::postEndJob(), and edm::service::SimpleMemoryCheck::postEndJob().

293  {
294  std::ostringstream t;
295  t << d;
296  return t.str();
297  }
tuple d
Definition: ztail.py:151
static ELstring edm::service::formatTime ( const time_t  t)
static

Definition at line 100 of file ELoutput.cc.

References b, and mps_fire::result.

Referenced by edm::service::ELoutput::changeFile(), edm::service::ELoutput::ELoutput(), Vx3DHLTAnalyzer::endLuminosityBlock(), edm::service::ELoutput::log(), Vx3DHLTAnalyzer::reset(), and Vx3DHLTAnalyzer::writeToFile().

100  { // Change log 7
101 
102  static char const dummy[] = "dd-Mon-yyyy hh:mm:ss TZN "; // Change log 7 for length only
103  char ts[sizeof(dummy)]; // Change log 7
104 
105  struct tm timebuf; // Change log 7
106 
107  strftime( ts, sizeof(dummy), "%d-%b-%Y %H:%M:%S %Z", localtime_r(&t, &timebuf) ); // Change log 7
108  // mf 4-9-04
109 
110 #ifdef STRIP_TRAILING_BLANKS_IN_TIMEZONE
111  // strip trailing blanks that would come when the time zone is not as
112  // long as the maximum allowed - probably not worth the time
113  unsigned int b = strlen(ts);
114  while (ts[--b] == ' ') {ts[b] = 0;}
115 #endif
116 
117  ELstring result(ts); // Change log 7
118  return result; // Change log 7
119 } // formatTime()
tuple result
Definition: mps_fire.py:84
double b
Definition: hdecay.h:120
std::string ELstring
Definition: ELstring.h:26
static double edm::service::getCPU ( )
static

Definition at line 102 of file Timing.cc.

Referenced by edm::service::Timing::getTotalCPU(), edm::service::Timing::postBeginJob(), edm::service::Timing::postEndJob(), and edm::service::Timing::Timing().

102  {
103  struct rusage usage;
104  getrusage(RUSAGE_SELF, &usage);
105 
106  double totalCPUTime = 0.0;
107  // User code
108  totalCPUTime = (double)usage.ru_utime.tv_sec + (double(usage.ru_utime.tv_usec) * 1E-6);
109  // System functions
110  totalCPUTime += (double)usage.ru_stime.tv_sec + (double(usage.ru_stime.tv_usec) * 1E-6);
111 
112  // Additionally, add in CPU usage from our child processes.
113  getrusage(RUSAGE_CHILDREN, &usage);
114  totalCPUTime += (double)usage.ru_utime.tv_sec + (double(usage.ru_utime.tv_usec) * 1E-6);
115  totalCPUTime += (double)usage.ru_stime.tv_sec + (double(usage.ru_stime.tv_usec) * 1E-6);
116 
117  return totalCPUTime;
118  }
void usage()
Definition: array2xmlEB.cc:14
static double edm::service::getTime ( )
static

Definition at line 95 of file Timing.cc.

References Exception.

Referenced by edm::service::Timing::postBeginJob(), edm::service::Timing::postEndJob(), edm::service::Timing::postEvent(), edm::service::Timing::postModule(), edm::service::Timing::preEvent(), edm::service::Timing::preModule(), and edm::service::Timing::Timing().

95  {
96  struct timeval t;
97  if(gettimeofday(&t, 0) < 0)
98  throw cms::Exception("SysCallFailed", "Failed call to gettimeofday");
99  return static_cast<double>(t.tv_sec) + (static_cast<double>(t.tv_usec) * 1E-6);
100  }
static std::string edm::service::i2str ( int  i)
static

Definition at line 299 of file SimpleMemoryCheck.cc.

References i, and t.

Referenced by edm::service::SimpleMemoryCheck::eventStatOutput(), edm::service::CPU::postEndJob(), and edm::service::SimpleMemoryCheck::postEndJob().

299  {
300  std::ostringstream t;
301  t << i;
302  return t.str();
303  }
int i
Definition: DBlmapReader.cc:9
bool edm::service::isProcessWideService ( void const *  )
inline

Definition at line 30 of file ServiceMakerBase.h.

30  {
31  return false;
32  }
bool edm::service::isProcessWideService ( JobReportService const *  )
inline

Definition at line 47 of file JobReportService.h.

47  {
48  return true;
49  }
bool edm::service::isProcessWideService ( TFileAdaptor const *  )
inline

Definition at line 55 of file TFileAdaptor.h.

55  {
56  return true;
57  }
bool edm::service::isProcessWideService ( CPU const *  )
inline

Definition at line 59 of file CPU.cc.

59  {
60  return true;
61  }
bool edm::service::isProcessWideService ( SiteLocalConfigService const *  )
inline

Definition at line 91 of file SiteLocalConfigService.h.

91  {
92  return true;
93  }
bool edm::service::isProcessWideService ( TFileService const *  )
inline

Definition at line 99 of file TFileService.h.

Referenced by edm::serviceregistry::ServiceMaker< T, TMaker >::processWideService().

99  {
100  return true;
101  }
bool edm::service::isProcessWideService ( InitRootHandlers const *  )
inline

Definition at line 132 of file InitRootHandlers.cc.

132  {
133  return true;
134  }
bool edm::service::isProcessWideService ( MessageLogger const *  )
inline

Definition at line 178 of file MessageLogger.h.

178  {
179  return true;
180  }
static std::vector<double>& edm::service::moduleTimeStack ( )
static

Definition at line 124 of file Timing.cc.

Referenced by edm::service::Timing::postModule(), and edm::service::Timing::preModule().

124  {
125  static thread_local std::vector<double> s_stack;
126  return s_stack;
127  }
std::ostream & edm::service::operator<< ( std::ostream &  os,
SimpleMemoryCheck::SignificantEvent const &  se 
)

Definition at line 1037 of file SimpleMemoryCheck.cc.

References edm::service::SimpleMemoryCheck::SignificantEvent::count, edm::service::SimpleMemoryCheck::SignificantEvent::deltaRss, edm::service::SimpleMemoryCheck::SignificantEvent::deltaVsize, edm::service::SimpleMemoryCheck::SignificantEvent::event, edm::service::SimpleMemoryCheck::SignificantEvent::monitorPssAndPrivate, edm::service::SimpleMemoryCheck::SignificantEvent::privateSize, edm::service::SimpleMemoryCheck::SignificantEvent::pss, edm::service::SimpleMemoryCheck::SignificantEvent::rss, and edm::service::SimpleMemoryCheck::SignificantEvent::vsize.

1038  {
1039  os << "[" << se.count << "] "
1040  << se.event << " vsize = " << se.vsize
1041  << " deltaVsize = " << se.deltaVsize
1042  << " rss = " << se.rss << " delta = " << se.deltaRss;
1043 
1044  if (se.monitorPssAndPrivate) {
1045  os <<" private = "<<se.privateSize<<" pss = "<<se.pss;
1046  }
1047  return os;
1048  }
std::ostream & edm::service::operator<< ( std::ostream &  os,
SimpleMemoryCheck::SignificantModule const &  se 
)

Definition at line 1051 of file SimpleMemoryCheck.cc.

References edm::service::SimpleMemoryCheck::SignificantModule::eventMaxDeltaV, edm::service::SimpleMemoryCheck::SignificantModule::maxDeltaVsize, edm::service::SimpleMemoryCheck::SignificantModule::maxEarlyVsize, edm::service::SimpleMemoryCheck::SignificantModule::postEarlyCount, edm::service::SimpleMemoryCheck::SignificantModule::totalDeltaVsize, and edm::service::SimpleMemoryCheck::SignificantModule::totalEarlyVsize.

1052  {
1053  if(sm.postEarlyCount > 0) {
1054  os << "\nPost Early Events: TotalDeltaVsize: " << sm.totalDeltaVsize
1055  << " (avg: " << sm.totalDeltaVsize/sm.postEarlyCount
1056  << "; max: " << sm.maxDeltaVsize
1057  << " during " << sm.eventMaxDeltaV << ")";
1058  }
1059  if(sm.totalEarlyVsize > 0) {
1060  os << "\n Early Events: TotalDeltaVsize: " << sm.totalEarlyVsize
1061  << " (max: " << sm.maxEarlyVsize << ")";
1062  }
1063 
1064  return os;
1065  }
static std::string edm::service::summarizeContext ( const std::string &  c)
static

Definition at line 162 of file ELstatistics.cc.

References EnergyCorrector::c, event(), DTTTrigCorrFirst::run, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edm::service::ELstatistics::log().

163  {
164  if ( c.substr (0,4) != "Run:" ) return c;
165  std::istringstream is (c);
166  std::string runWord;
167  int run;
168  is >> runWord >> run;
169  if (!is) return c;
170  if (runWord != "Run:") return c;
171  std::string eventWord;
172  int event;
173  is >> eventWord >> event;
174  if (!is) return c;
175  if (eventWord != "Event:") return c;
176  std::ostringstream os;
177  os << run << "/" << event;
178  return os.str();
179  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
static std::string edm::service::ui2str ( unsigned int  i)
static

Definition at line 88 of file Timing.cc.

References i, and t.

Referenced by edm::service::Timing::postEndJob().

88  {
89  std::stringstream t;
90  t << i;
91  return t.str();
92  }
int i
Definition: DBlmapReader.cc:9

Variable Documentation

char edm::service::dashC[] = "-c"
static

Definition at line 760 of file InitRootHandlers.cc.

const ELstring edm::service::hereMsg = "available via this destination"
static
const ELstring edm::service::noClearSummaryMsg = "No clearSummary()"
static

Definition at line 93 of file ELdestination.cc.

Referenced by edm::service::ELdestination::clearSummary().

const ELstring edm::service::noosMsg = "No ostream"
static
const ELstring edm::service::noSummarizationMsg = "No summarization()"
static

Definition at line 91 of file ELdestination.cc.

Referenced by edm::service::ELdestination::summarization().

const ELstring edm::service::noSummaryMsg = "No summary()"
static

Definition at line 92 of file ELdestination.cc.

Referenced by edm::service::ELdestination::summary().

const ELstring edm::service::notELoutputMsg = "This destination is not an ELoutput"
static

Definition at line 96 of file ELdestination.cc.

Referenced by edm::service::ELdestination::changeFile().

char edm::service::pstackName[] = "(CMSSW stack trace helper)"
static

Definition at line 759 of file InitRootHandlers.cc.