sys-sage
Loading...
Searching...
No Matches
ss_papi.hpp
1#ifdef SS_PAPI
2
3#ifndef SRC_EXTERNAL_INTERFACES_SS_PAPI_HPP
4#define SRC_EXTERNAL_INTERFACES_SS_PAPI_HPP
5
6#include <papi.h>
7#include <unordered_map>
8#include <vector>
9#include <ostream>
10
13namespace sys_sage {
14
18 struct Metric {
19 unsigned long long timestamp;
20 long long value;
21 bool permanent;
22 };
23
27 struct CpuMetrics {
28 std::vector<Metric> entries;
29 int cpuNum;
30 };
31
48 int SS_PAPI_start(int eventSet, Relation **metrics);
49
60 int SS_PAPI_reset(Relation *metrics);
61
76 int SS_PAPI_read(Relation *metrics, Component *root, bool permanent = false,
77 unsigned long long *timestamp = nullptr);
78
93 int SS_PAPI_accum(Relation *metrics, Component *root, bool permanent = false,
94 unsigned long long *timestamp = nullptr);
95
110 int SS_PAPI_stop(Relation *metrics, Component *root, bool permanent = false,
111 unsigned long long *timestamp = nullptr);
112
113}
114
118std::ostream &operator<<(std::ostream &stream, const sys_sage::Metric &metric);
119
120#endif // SRC_EXTERNAL_INTERFACES_SS_PAPI_HPP
121
122#endif // SS_PAPI