PAPI 7.1.0.0
Loading...
Searching...
No Matches
perfnec.h
Go to the documentation of this file.
1#ifndef _PAPI_PERFNEC_H
2#define _PAPI_PERFNEC_H
3/*
4* File: perfmon.h
5* Author: Philip Mucci
6* mucci@cs.utk.edu
7*
8*/
9#include <stdio.h>
10#include <stdlib.h>
11#include <stdarg.h>
12#include <unistd.h>
13#include <assert.h>
14#include <errno.h>
15#include <string.h>
16#include <math.h>
17#include <limits.h>
18#include <time.h>
19#include <fcntl.h>
20#include <ctype.h>
21#include <inttypes.h>
22#include <libgen.h>
23#include <sys/mman.h>
24#include <sys/syscall.h>
25#include <sys/types.h>
26#include <sys/time.h>
27#include <sys/times.h>
28#include <sys/ucontext.h>
29#include <sys/ptrace.h>
30#include <sys/stat.h>
31#include <fcntl.h>
32//#include "perfnec/pfmlib.h"
33//#include "perfnec/perfmon_dfl_smpl.h"
34#include "papi_lock.h"
35
36
37#include "linux-context.h"
38
39#if defined(DEBUG)
40#define DEBUGCALL(a,b) { if (ISLEVEL(a)) { b; } }
41#else
42#define DEBUGCALL(a,b)
43#endif
44
45#define PFNECLIB_MAX_PMDS 32
46
49
52typedef int pfnec_register_t;
55
56#define PKG_NUM_EVENTS 16
57
59 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
61 = {"EX", "VX", "FPEC", "VE", "VECC", "L1MCC", "VE2", "VAREC",
62 "VLDEC", "PCCC", "VLDCC", "VLEC", "VLCME2", "FMAEC", "PTCC", "TTCC"};
63static const char *pkg_units[PKG_NUM_EVENTS]
64 = {"", "", "", "",
65 "", "", "", "",
66 "", "", "", "",
67 "", "", "", ""
68 };
69static const char *pkg_event_descs[PKG_NUM_EVENTS] = {
70 "Execution count",
71 "Vector execution count",
72 "Floating point data element count",
73 "Vector elements count",
74 "Vector execution clock count",
75 "L1 cache miss clock count",
76 "Vector elements count 2",
77 "Vector arithmetic execution clock count",
78 "Vector load execution clock count",
79 "Port conflict clock count",
80 "Vector load packet count",
81 "Vector load element count",
82 "Vector load cache miss element count 2",
83 "Fused multiply add element count",
84 "Power throttling clock count",
85 "Thermal throttling clock count"};
86
87typedef struct _perfnec_register {
88 unsigned int selector;
90
91typedef struct _perfnec_native_event_entry {
94 char description[PAPI_MAX_STR_LEN];
98 int type;
102
104
105/***************************************************************************/
106/****** BEGIN FUNCTIONS USED INTERNALLY SPECIFIC TO THIS COMPONENT *******/
107/***************************************************************************/
108
109/* Null terminated version of strncpy */
110static
111char *_local_strlcpy( char *dst, const char *src, size_t size )
112{
113 char *retval = strncpy( dst, src, size );
114 if ( size > 0 ) dst[size-1] = '\0';
115
116 return( retval );
117}
118
119
120#define MAX_COUNTERS PFMLIB_MAX_PMCS
121#define MAX_COUNTER_TERMS PFMLIB_MAX_PMCS
122
123typedef struct
124{
125 /* Context structure to kernel, different for attached */
129 long long which_counter[PKG_NUM_EVENTS];
131
132typedef struct
133{
134#if defined(USE_PROC_PTTIMER)
135 int stat_fd;
136#endif
137 /* Main context structure to kernel */
139 /* Address of mmap()'ed sample buffer */
140 void *smpl_buf;
142
143/* typedefs to conform to PAPI component layer code. */
144/* these are void * in the PAPI framework layer code. */
149
150#endif
static long count
#define PAPI_MIN_STR_LEN
Definition: f90papi.h:208
#define PAPI_MAX_STR_LEN
Definition: f90papi.h:77
int pfnec_reg_alloc_t
Definition: perfnec.h:48
pfnec_register_t cmp_register_t
Definition: perfnec.h:146
int pfnec_dfl_smpl_entry_t
Definition: perfnec.h:54
#define PKG_NUM_EVENTS
Definition: perfnec.h:56
#define PFNECLIB_MAX_PMDS
Definition: perfnec.h:45
static _perfnec_native_event_entry_t perfnec_ntv_events[PKG_NUM_EVENTS]
Definition: perfnec.h:103
static char * _local_strlcpy(char *dst, const char *src, size_t size)
Definition: perfnec.h:111
int pfnec_register_map_t
Definition: perfnec.h:47
static const char * pkg_event_descs[PKG_NUM_EVENTS]
Definition: perfnec.h:69
static int pkg_events[PKG_NUM_EVENTS]
Definition: perfnec.h:59
int pfnec_dfl_smpl_arg_t
Definition: perfnec.h:50
pfnec_reg_alloc_t cmp_reg_alloc_t
Definition: perfnec.h:145
static const char * pkg_units[PKG_NUM_EVENTS]
Definition: perfnec.h:64
int pfneclib_regmask_t
Definition: perfnec.h:53
int pfnec_register_t
Definition: perfnec.h:52
static const char * pkg_event_names[PKG_NUM_EVENTS]
Definition: perfnec.h:61
pfnec_control_state_t _perfnec_control_state_t
Definition: perfnec.h:147
pfnec_context_t _perfnec_context_t
Definition: perfnec.h:148
int pfnec_dfl_smpl_hdr_t
Definition: perfnec.h:51
char units[MAX_EVENTS][BUFSIZ]
Definition: powercap_plot.c:15
const char * name
Definition: rocs.c:225
Definition: perfnec.h:91
int return_type
Definition: perfnec.h:99
_perfnec_register_t resources
Definition: perfnec.h:100
int component_id
Definition: perfnec.h:96
int event_id
Definition: perfnec.h:97
int socket_id
Definition: perfnec.h:95
int type
Definition: perfnec.h:98
unsigned int selector
Definition: perfnec.h:88
void * smpl_buf
Definition: perfnec.h:140
int retval
Definition: zero_fork.c:53