ATLAS Offline Software
Control
PerformanceMonitoring
PerfMonEvent
PerfMonEvent
PerfMonEventDict.h
Go to the documentation of this file.
1
// this is -*- C++ -*-
2
3
/*
4
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
#ifndef PERFMONEVENT_PERFMONEVENTDICT_H
8
#define PERFMONEVENT_PERFMONEVENTDICT_H
9
10
#include "
PerfMonEvent/PyStore.h
"
11
#include "
PerfMonEvent/PyChrono.h
"
12
#include "
PerfMonEvent/DataModel.h
"
13
#include "
PerfMonEvent/MemStatsHooks.h
"
14
#include "
PerfMonEvent/MallocStats.h
"
15
16
/* POSIX includes */
17
#include <time.h>
18
19
namespace
PerfMon
{
20
inline
21
struct
timespec
clock_gettime
()
22
{
23
struct
timespec
res
;
24
#ifndef __APPLE__
25
/*int sc = */
::clock_gettime
(CLOCK_PROCESS_CPUTIME_ID, &
res
);
26
#endif
27
return
res
;
28
}
29
30
struct
Clock
31
{
32
struct
timespec
start
;
33
struct
timespec
stop
;
34
35
static
struct
timespec
resolution
()
36
{
37
struct
timespec
r
;
38
#ifndef __APPLE__
39
/*sc*/
clock_getres(CLOCK_PROCESS_CPUTIME_ID, &
r
);
40
#endif
41
// std::cout << "::pmon:: resolution: " << r.tv_sec << ":" << r.tv_nsec
42
// << std::endl;
43
return
r
;
44
}
45
46
Clock
()
47
:
stop
()
48
{
49
this->start =
PerfMon::clock_gettime
();
50
}
51
struct
timespec
diff
()
52
{
53
this->stop =
PerfMon::clock_gettime
();
54
struct
timespec delta;
55
if
((
stop
.tv_nsec-
start
.tv_nsec)<0) {
56
delta.tv_sec =
stop
.tv_sec-
start
.tv_sec-1;
57
delta.tv_nsec = 1000000000+
stop
.tv_nsec-
start
.tv_nsec;
58
}
else
{
59
delta.tv_sec =
stop
.tv_sec-
start
.tv_sec;
60
delta.tv_nsec =
stop
.tv_nsec-
start
.tv_nsec;
61
}
62
return
delta;
63
}
64
};
65
}
66
67
namespace
PerfMonEventDict
{
68
69
struct
dict
70
{
71
struct
timespec
m_1
;
72
};
73
74
//clock_gettime
75
76
}
77
78
#endif
beamspotman.r
def r
Definition:
beamspotman.py:676
MallocStats.h
PerfMonEventDict
Definition:
PerfMonEventDict.h:67
PerfMon
a simple malloc wrapper that keeps track of the amount of memory allocated on the heap.
Definition:
CallGraphAuditor.cxx:24
PerfMon::Clock::resolution
static struct timespec resolution()
Definition:
PerfMonEventDict.h:35
res
std::pair< std::vector< unsigned int >, bool > res
Definition:
JetGroupProductTest.cxx:14
PerfMonEventDict::dict::m_1
struct timespec m_1
Definition:
PerfMonEventDict.h:71
PerfMon::clock_gettime
struct timespec clock_gettime()
Definition:
PerfMonEventDict.h:21
PerfMon::Clock::start
struct timespec start
Definition:
PerfMonEventDict.h:32
PerfMon::Clock::stop
struct timespec stop
Definition:
PerfMonEventDict.h:33
PerfMonEventDict::dict
Definition:
PerfMonEventDict.h:70
PerfMon::Clock::Clock
Clock()
Definition:
PerfMonEventDict.h:46
PerfMon::Clock
Definition:
PerfMonEventDict.h:31
MemStatsHooks.h
DataModel.h
PerfMon::Clock::diff
struct timespec diff()
Definition:
PerfMonEventDict.h:51
PyStore.h
PyChrono.h
Generated on Tue Jul 2 2024 21:24:00 for ATLAS Offline Software by
1.8.18