PAPI 7.1.0.0
Loading...
Searching...
No Matches
components/perfmon2/perfmon.h
Go to the documentation of this file.
1#ifndef _PAPI_PERFMON_H
2#define _PAPI_PERFMON_H
3/*
4* File: perfmon.h
5* Author: Philip Mucci
6* mucci@cs.utk.edu
7*
8*/
9
10#include <stdio.h>
11#include <stdlib.h>
12#include <stdarg.h>
13#include <unistd.h>
14#include <assert.h>
15#include <errno.h>
16#include <string.h>
17#include <math.h>
18#include <limits.h>
19#include <time.h>
20#include <fcntl.h>
21#include <ctype.h>
22#include <inttypes.h>
23#include <libgen.h>
24#include <sys/mman.h>
25#include <sys/syscall.h>
26#include <sys/types.h>
27#include <sys/time.h>
28#include <sys/times.h>
29#include <sys/ucontext.h>
30#include <sys/ptrace.h>
31#include "perfmon/pfmlib.h"
33#include "papi_lock.h"
34
35
36#include "linux-context.h"
37
38#if defined(DEBUG)
39#define DEBUGCALL(a,b) { if (ISLEVEL(a)) { b; } }
40#else
41#define DEBUGCALL(a,b)
42#endif
43
46typedef int pfm_reg_alloc_t;
47
48#define MAX_COUNTERS PFMLIB_MAX_PMCS
49#define MAX_COUNTER_TERMS PFMLIB_MAX_PMCS
50
51typedef struct
52{
53 /* Context structure to kernel, different for attached */
54 int ctx_fd;
56 /* Load structure to kernel, different for attached */
58 /* Which counters to use? Bits encode counters to use, may be duplicates */
60 /* Buffer to pass to library to control the counters */
62 /* Buffer to pass from the library to control the counters */
64 /* Is this eventset multiplexed? Actually it holds the microseconds of the switching interval, 0 if not mpx. */
66 /* Arguments to kernel for multiplexing, first number of sets */
68 /* Arguments to kernel to set up the sets */
70 /* Buffer to get information out of the sets when reading */
72 /* Arguments to the kernel */
74 /* Arguments to the kernel */
76 /* Buffer to gather counters */
77 long long counts[PFMLIB_MAX_PMDS];
79
80typedef struct
81{
82#if defined(USE_PROC_PTTIMER)
83 int stat_fd;
84#endif
85 /* Main context structure to kernel */
86 int ctx_fd;
88 /* Main load structure to kernel */
90 /* Structure to inform the kernel about sampling */
92 /* Address of mmap()'ed sample buffer */
93 void *smpl_buf;
95
96/* typedefs to conform to PAPI component layer code. */
97/* these are void * in the PAPI framework layer code. */
102
103#endif
pfm_context_t cmp_context_t
int pfm_register_map_t
pfmlib_event_t pfm_register_t
pfm_reg_alloc_t cmp_reg_alloc_t
pfm_register_t cmp_register_t
pfm_control_state_t cmp_control_state_t
#define PFMLIB_MAX_PMCS
Definition: pfmlib.h:41
#define PFMLIB_MAX_PMDS
Definition: pfmlib.h:42
pfm_dfl_smpl_arg_t smpl