HPCToolkit
papi.c File Reference
#include <alloca.h>
#include <assert.h>
#include <ctype.h>
#include <papi.h>
#include <setjmp.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ucontext.h>
#include <stdbool.h>
#include <pthread.h>
#include <monitor.h>
#include "simple_oo.h"
#include "sample_source_obj.h"
#include "common.h"
#include <hpcrun/hpcrun_options.h>
#include <hpcrun/hpcrun_stats.h>
#include <hpcrun/metrics.h>
#include <hpcrun/safe-sampling.h>
#include <hpcrun/sample_sources_registered.h>
#include <hpcrun/sample_event.h>
#include <hpcrun/thread_data.h>
#include <sample-sources/blame-shift/blame-shift.h>
#include <utilities/tokenize.h>
#include <messages/messages.h>
#include <lush/lush-backtrace.h>
#include <lib/prof-lean/hpcrun-fmt.h>
#include "ss_obj.h"
Include dependency graph for papi.c:

Go to the source code of this file.

Classes

struct  papi_source_info_t
 

Macros

#define OVERFLOW_MODE   0
 
#define WEIGHT_METRIC   0
 
#define DEFAULT_THRESHOLD   2000000L
 
#define ss_name   papi
 
#define ss_cls   SS_HARDWARE
 
#define ss_sort_order   70
 

Functions

static void papi_event_handler (int event_set, void *pc, long long ovec, void *context)
 
static int event_is_derived (int ev_code)
 
static void event_fatal_error (int ev_code, int papi_ret)
 
static const char * strip_papi_prefix (const char *str)
 
static void METHOD_FN (init)
 
static void METHOD_FN (thread_init)
 
static void METHOD_FN (thread_init_action)
 
static void METHOD_FN (start)
 
static void METHOD_FN (thread_fini_action)
 
static void METHOD_FN (stop)
 
static void METHOD_FN (shutdown)
 
static bool METHOD_FN (supports_event, const char *ev_str)
 
static void METHOD_FN (process_event_list, int lush_metrics)
 
static void METHOD_FN (gen_event_set, int lush_metrics)
 
static void METHOD_FN (display_events)
 
void hpcrun_disable_papi_cuda (void)
 

Variables

static int papi_unavail = 0
 
static int derived [MAX_EVENTS]
 
static int some_derived
 
static int some_overflow
 
__thread bool hpcrun_thread_suppress_sample
 

Macro Definition Documentation

◆ DEFAULT_THRESHOLD

#define DEFAULT_THRESHOLD   2000000L

Definition at line 105 of file papi.c.

◆ OVERFLOW_MODE

#define OVERFLOW_MODE   0

Definition at line 103 of file papi.c.

◆ ss_cls

#define ss_cls   SS_HARDWARE

Definition at line 599 of file papi.c.

◆ ss_name

#define ss_name   papi

Definition at line 598 of file papi.c.

◆ ss_sort_order

#define ss_sort_order   70

Definition at line 600 of file papi.c.

◆ WEIGHT_METRIC

#define WEIGHT_METRIC   0

Definition at line 104 of file papi.c.

Function Documentation

◆ event_fatal_error()

static void event_fatal_error ( int  ev_code,
int  papi_ret 
)
static

Definition at line 644 of file papi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ event_is_derived()

static int event_is_derived ( int  ev_code)
static

Definition at line 624 of file papi.c.

Here is the caller graph for this function:

◆ hpcrun_disable_papi_cuda()

void hpcrun_disable_papi_cuda ( void  )

Definition at line 612 of file papi.c.

◆ METHOD_FN() [1/11]

static void METHOD_FN ( init  )
static

Definition at line 170 of file papi.c.

Here is the call graph for this function:

◆ METHOD_FN() [2/11]

static void METHOD_FN ( thread_init  )
static

Definition at line 211 of file papi.c.

Here is the call graph for this function:

◆ METHOD_FN() [3/11]

static void METHOD_FN ( thread_init_action  )
static

Definition at line 225 of file papi.c.

Here is the call graph for this function:

◆ METHOD_FN() [4/11]

static void METHOD_FN ( start  )
static

Definition at line 239 of file papi.c.

Here is the call graph for this function:

◆ METHOD_FN() [5/11]

static void METHOD_FN ( thread_fini_action  )
static

Definition at line 279 of file papi.c.

◆ METHOD_FN() [6/11]

static void METHOD_FN ( stop  )
static

Definition at line 291 of file papi.c.

◆ METHOD_FN() [7/11]

static void METHOD_FN ( shutdown  )
static

Definition at line 324 of file papi.c.

◆ METHOD_FN() [8/11]

static bool METHOD_FN ( supports_event  ,
const char *  ev_str 
)
static

Definition at line 338 of file papi.c.

Here is the call graph for this function:

◆ METHOD_FN() [9/11]

static void METHOD_FN ( process_event_list  ,
int  lush_metrics 
)
static

Definition at line 358 of file papi.c.

Here is the call graph for this function:

◆ METHOD_FN() [10/11]

static void METHOD_FN ( gen_event_set  ,
int  lush_metrics 
)
static

Definition at line 459 of file papi.c.

Here is the call graph for this function:

◆ METHOD_FN() [11/11]

static void METHOD_FN ( display_events  )
static

Definition at line 523 of file papi.c.

Here is the call graph for this function:

◆ papi_event_handler()

static void papi_event_handler ( int  event_set,
void *  pc,
long long  ovec,
void *  context 
)
static

Definition at line 662 of file papi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ strip_papi_prefix()

static const char* strip_papi_prefix ( const char *  str)
static

Definition at line 156 of file papi.c.

Here is the caller graph for this function:

Variable Documentation

◆ derived

int derived[MAX_EVENTS]
static

Definition at line 139 of file papi.c.

◆ hpcrun_thread_suppress_sample

__thread bool hpcrun_thread_suppress_sample

Definition at line 193 of file main.c.

◆ papi_unavail

int papi_unavail = 0
static

Definition at line 136 of file papi.c.

◆ some_derived

int some_derived
static

Definition at line 140 of file papi.c.

◆ some_overflow

int some_overflow
static

Definition at line 141 of file papi.c.