Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
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 an internal performance measurement
16and event tracing.
17*/
18
19
20#include "TVirtualPerfStats.h"
21#include "TThreadSlots.h"
22
23
24
25
26static const char *gEventTypeNames[] = {
27 "UnDefined",
28 "Packet",
29 "Start",
30 "Stop",
31 "File",
32 "FileOpen",
33 "FileRead",
34 "Rate"
35};
36
37////////////////////////////////////////////////////////////////////////////////
38/// Return the current ROOT perf stats if any.
39
41{
42 static TVirtualPerfStats *currentPerfStats = nullptr;
43 if (!gThreadTsd) {
44 return currentPerfStats;
45 } else {
46 return *(TVirtualPerfStats**)(*gThreadTsd)(&currentPerfStats,ROOT::kPerfStatsThreadSlot);
47 }
48}
49
50////////////////////////////////////////////////////////////////////////////////
51/// Return the name of the event type.
52
54{
55 if (type < kUnDefined || type >= kNumEventType) {
56 return "Illegal EEventType";
57 } else {
58 return gEventTypeNames[type];
59 }
60}
R__EXTERN void **(* gThreadTsd)(void *, Int_t)
static const char * gEventTypeNames[]
Provides the interface for the an 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