-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathperfcount.h
40 lines (32 loc) · 1.02 KB
/
perfcount.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* =====================================================================================
*
* Filename: perfcount.h
*
* Description:
*
* Version: 1.0
* Created: 14.02.2012 10:02:12
* Revision: none
* Compiler: gcc
*
* Author: Christian Spoo (cs) (),
* Company:
*
* =====================================================================================
*/
#ifndef PERFCOUNT_H
#define PERFCOUNT_H
#include "stddef.h"
#define PERFCOUNT_L1DATA (uint64_t)0xFF000151ull
#define PERFCOUNT_L2 (uint64_t)0xFF000224ull
#define PERFCOUNT_L3 (uint64_t)0xFF000309ull
#define PERFCOUNT_CORE_PMC(n) (n & 0x7F)
#define PERFCOUNT_UNCORE_PMC(n) (n | 0x80)
void perfcount_init(unsigned int counter, uint64_t config);
uint64_t perfcount_raw(uint8_t event, uint8_t umask);
void perfcount_start(unsigned int counter);
void perfcount_stop(unsigned int counter);
void perfcount_reset(unsigned int counter);
uint64_t perfcount_read(unsigned int counter);
#endif