Logo ROOT  
Reference Guide
TVirtualPerfStats.cxx
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Kristjan Gulbrandsen 11/05/04
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /** \class TVirtualPerfStats
13 \ingroup Base
14 
15 Provides the interface for the PROOF internal performance measurement
16 and event tracing.
17 */
18 
19 
20 #include "TVirtualPerfStats.h"
21 #include "TThreadSlots.h"
22 
23 
25 
26 
27 static const char *gEventTypeNames[] = {
28  "UnDefined",
29  "Packet",
30  "Start",
31  "Stop",
32  "File",
33  "FileOpen",
34  "FileRead",
35  "Rate"
36 };
37 
38 ////////////////////////////////////////////////////////////////////////////////
39 /// Return the current ROOT perf stats if any.
40 
42 {
43  static TVirtualPerfStats *currentPerfStats = 0;
44  if (!gThreadTsd) {
45  return currentPerfStats;
46  } else {
47  return *(TVirtualPerfStats**)(*gThreadTsd)(&currentPerfStats,ROOT::kPerfStatsThreadSlot);
48  }
49 }
50 
51 ////////////////////////////////////////////////////////////////////////////////
52 /// Return the name of the event type.
53 
55 {
56  if (type < kUnDefined || type >= kNumEventType) {
57  return "Illegal EEventType";
58  } else {
59  return gEventTypeNames[type];
60  }
61 }
TVirtualPerfStats.h
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TVirtualPerfStats::kNumEventType
@ kNumEventType
Definition: TVirtualPerfStats.h:45
TVirtualPerfStats
Definition: TVirtualPerfStats.h:31
TVirtualPerfStats::EventType
static const char * EventType(EEventType type)
Return the name of the event type.
Definition: TVirtualPerfStats.cxx:54
TVirtualPerfStats::EEventType
EEventType
Definition: TVirtualPerfStats.h:36
TThreadSlots.h
gEventTypeNames
static const char * gEventTypeNames[]
Definition: TVirtualPerfStats.cxx:27
gThreadTsd
R__EXTERN void **(* gThreadTsd)(void *, Int_t)
Definition: TThreadSlots.h:40
type
int type
Definition: TGX11.cxx:121
ROOT::kPerfStatsThreadSlot
@ kPerfStatsThreadSlot
Definition: TThreadSlots.h:45
TVirtualPerfStats::CurrentPerfStats
static TVirtualPerfStats *& CurrentPerfStats()
Return the current ROOT perf stats if any.
Definition: TVirtualPerfStats.cxx:41