HPCToolkit
perf-util.c File Reference
#include <linux/version.h>
#include <ctype.h>
#include <hpcrun/cct_insert_backtrace.h>
#include <hpcrun/utilities/tokenize.h>
#include <lib/support-lean/OSUtil.h>
#include <include/linux_info.h>
#include "perf-util.h"
#include "perf_skid.h"
Include dependency graph for perf-util.c:

Go to the source code of this file.

Macros

#define HPCRUN_OPTION_PERF_COUNT   "HPCRUN_PERF_COUNT"
 
#define DEFAULT_THRESHOLD   300
 
#define MAX_BUFFER_LINUX_KERNEL   128
 

Functions

static cct_node_tperf_split_retained_node (cct_node_t *node)
 
static cct_node_tperf_insert_cct (uint16_t lm_id, cct_node_t *parent, u64 ip)
 
static int perf_util_get_kptr_restrict ()
 
static uint16_t perf_get_kernel_lm_id ()
 
static int perf_util_kernel_syms_avail ()
 
static int perf_util_get_max_sample_rate ()
 
static void set_default_threshold ()
 
void perf_util_init ()
 
bool perf_util_is_ksym_available ()
 
void perf_util_get_default_threshold (struct event_threshold_s *threshold)
 
cct_node_tperf_util_add_kernel_callchain (cct_node_t *leaf, void *data_aux)
 
int perf_util_attr_init (const char *event_name, struct perf_event_attr *attr, bool usePeriod, u64 threshold, u64 sampletype)
 

Variables

const u64 anomalous_ip = 0xffffffffffffff80
 
static uint16_t perf_kernel_lm_id = 0
 
static enum perf_ksym_e ksym_status = PERF_UNDEFINED
 
static struct event_threshold_s default_threshold = {DEFAULT_THRESHOLD, FREQUENCY}
 
static spinlock_t perf_lock = SPINLOCK_UNLOCKED
 

Macro Definition Documentation

◆ DEFAULT_THRESHOLD

#define DEFAULT_THRESHOLD   300

Definition at line 77 of file perf-util.c.

◆ HPCRUN_OPTION_PERF_COUNT

#define HPCRUN_OPTION_PERF_COUNT   "HPCRUN_PERF_COUNT"

Definition at line 67 of file perf-util.c.

◆ MAX_BUFFER_LINUX_KERNEL

#define MAX_BUFFER_LINUX_KERNEL   128

Definition at line 78 of file perf-util.c.

Function Documentation

◆ perf_get_kernel_lm_id()

static uint16_t perf_get_kernel_lm_id ( )
static

Definition at line 196 of file perf-util.c.

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

◆ perf_insert_cct()

static cct_node_t* perf_insert_cct ( uint16_t  lm_id,
cct_node_t parent,
u64  ip 
)
static

Definition at line 153 of file perf-util.c.

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

◆ perf_split_retained_node()

static cct_node_t* perf_split_retained_node ( cct_node_t node)
static

Definition at line 123 of file perf-util.c.

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

◆ perf_util_add_kernel_callchain()

cct_node_t* perf_util_add_kernel_callchain ( cct_node_t leaf,
void *  data_aux 
)

Definition at line 358 of file perf-util.c.

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

◆ perf_util_attr_init()

int perf_util_attr_init ( const char *  event_name,
struct perf_event_attr *  attr,
bool  usePeriod,
u64  threshold,
u64  sampletype 
)

Definition at line 403 of file perf-util.c.

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

◆ perf_util_get_default_threshold()

void perf_util_get_default_threshold ( struct event_threshold_s threshold)

Definition at line 347 of file perf-util.c.

Here is the caller graph for this function:

◆ perf_util_get_kptr_restrict()

static int perf_util_get_kptr_restrict ( )
static

Definition at line 178 of file perf-util.c.

Here is the caller graph for this function:

◆ perf_util_get_max_sample_rate()

static int perf_util_get_max_sample_rate ( )
static

Definition at line 251 of file perf-util.c.

Here is the caller graph for this function:

◆ perf_util_init()

void perf_util_init ( )

Definition at line 303 of file perf-util.c.

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

◆ perf_util_is_ksym_available()

bool perf_util_is_ksym_available ( )

Definition at line 339 of file perf-util.c.

Here is the caller graph for this function:

◆ perf_util_kernel_syms_avail()

static int perf_util_kernel_syms_avail ( )
static

Definition at line 227 of file perf-util.c.

Here is the caller graph for this function:

◆ set_default_threshold()

static void set_default_threshold ( )
static

Definition at line 273 of file perf-util.c.

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

Variable Documentation

◆ anomalous_ip

const u64 anomalous_ip = 0xffffffffffffff80

Definition at line 85 of file perf-util.c.

◆ default_threshold

struct event_threshold_s default_threshold = {DEFAULT_THRESHOLD, FREQUENCY}
static

Definition at line 101 of file perf-util.c.

◆ ksym_status

enum perf_ksym_e ksym_status = PERF_UNDEFINED
static

Definition at line 99 of file perf-util.c.

◆ perf_kernel_lm_id

uint16_t perf_kernel_lm_id = 0
static

Definition at line 97 of file perf-util.c.

◆ perf_lock

spinlock_t perf_lock = SPINLOCK_UNLOCKED
static

Definition at line 116 of file perf-util.c.