ROOT  6.06/09
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 Provides the interface for the PROOF internal performance measurement
14 and event tracing.
15 */
16 
17 
18 #include "TVirtualPerfStats.h"
19 #include "TThreadSlots.h"
20 
21 
23 
24 
25 static const char *gEventTypeNames[] = {
26  "UnDefined",
27  "Packet",
28  "Start",
29  "Stop",
30  "File",
31  "FileOpen",
32  "FileRead",
33  "Rate"
34 };
35 
36 ////////////////////////////////////////////////////////////////////////////////
37 /// Return the current ROOT perf stats if any.
38 
40 {
41  static TVirtualPerfStats *currentPerfStats = 0;
42  if (!gThreadTsd) {
43  return currentPerfStats;
44  } else {
45  return *(TVirtualPerfStats**)(*gThreadTsd)(&currentPerfStats,ROOT::kPerfStatsThreadSlot);
46  }
47 }
48 
49 ////////////////////////////////////////////////////////////////////////////////
50 /// Return the name of the event type.
51 
53 {
54  if (type < kUnDefined || type >= kNumEventType) {
55  return "Illegal EEventType";
56  } else {
57  return gEventTypeNames[type];
58  }
59 }
Provides the interface for the PROOF internal performance measurement and event tracing.
static TVirtualPerfStats *& CurrentPerfStats()
Return the current ROOT perf stats if any.
static const char * EventType(EEventType type)
Return the name of the event type.
ClassImp(TVirtualPerfStats) static const char *gEventTypeNames[]
R__EXTERN void **(* gThreadTsd)(void *, Int_t)
Definition: TThreadSlots.h:42
int type
Definition: TGX11.cxx:120