Skip to content
Snippets Groups Projects
Commit 6668c8a1 authored by Tatiana Ovsiannikova's avatar Tatiana Ovsiannikova
Browse files

PerfMon cleanup, leaveing only MT related part

parent 248d1a01
No related branches found
No related tags found
No related merge requests found
Pipeline #8420567 passed
......@@ -17,7 +17,9 @@ atlas_add_library( PerfMonEvent
LINK_LIBRARIES ${Python_LIBRARIES} CxxUtils GaudiKernel rt nlohmann_json::nlohmann_json CxxUtils
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
atlas_add_dictionary( PerfMonEvent/selection.xml
atlas_add_dictionary( PerfMonEventDict
PerfMonEvent/PerfMonEventDict.h
PerfMonEvent/selection.xml
INCLUDE_DIRS ${Python_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${Python_LIBRARIES} ${ROOT_LIBRARIES} rt GaudiKernel PerfMonEvent )
// this is -*- C++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PERFMONEVENT_PERFMONEVENTDICT_H
#define PERFMONEVENT_PERFMONEVENTDICT_H
#include "PerfMonEvent/DataModel.h"
/* POSIX includes */
#include <time.h>
namespace PerfMon {
inline
struct timespec clock_gettime()
{
struct timespec res;
#ifndef __APPLE__
/*int sc = */::clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &res);
#endif
return res;
}
struct Clock
{
struct timespec start;
struct timespec stop;
static struct timespec resolution()
{
struct timespec r;
#ifndef __APPLE__
/*sc*/clock_getres(CLOCK_PROCESS_CPUTIME_ID, &r);
#endif
// std::cout << "::pmon:: resolution: " << r.tv_sec << ":" << r.tv_nsec
// << std::endl;
return r;
}
Clock()
: stop()
{
this->start = PerfMon::clock_gettime();
}
struct timespec diff()
{
this->stop = PerfMon::clock_gettime();
struct timespec delta;
if ((stop.tv_nsec-start.tv_nsec)<0) {
delta.tv_sec = stop.tv_sec-start.tv_sec-1;
delta.tv_nsec = 1000000000+stop.tv_nsec-start.tv_nsec;
} else {
delta.tv_sec = stop.tv_sec-start.tv_sec;
delta.tv_nsec = stop.tv_nsec-start.tv_nsec;
}
return delta;
}
};
}
namespace PerfMonEventDict {
struct dict
{
struct timespec m_1;
};
//clock_gettime
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment