Logo ROOT   6.18/05
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
15Provides the interface for the PROOF internal performance measurement
16and event tracing.
17*/
18
19
20#include "TVirtualPerfStats.h"
21#include "TThreadSlots.h"
22
23
25
26
27static 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}
#define ClassImp(name)
Definition: Rtypes.h:365
int type
Definition: TGX11.cxx:120
R__EXTERN void **(* gThreadTsd)(void *, Int_t)
Definition: TThreadSlots.h:40
static const char * gEventTypeNames[]
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.
@ kPerfStatsThreadSlot
Definition: TThreadSlots.h:33