HPCToolkit
perfmon-util.c File Reference
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <stdarg.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <regex.h>
#include <linux/perf_event.h>
#include <hpcrun/messages/messages.h>
#include "perf-util.h"
#include "perf_event_open.h"
#include "sample-sources/display.h"
#include <perfmon/pfmlib.h>
Include dependency graph for perfmon-util.c:

Go to the source code of this file.

Classes

struct  pfm_perf_encode_arg_t
 

Macros

#define MAX_EVENT_NAME_CHARS   256
 
#define MAX_EVENT_DESC_CHARS   4096
 
#define EVENT_IS_PROFILABLE   0
 
#define EVENT_MAY_NOT_PROFILABLE   1
 
#define EVENT_FATAL_ERROR   -1
 

Functions

int pfmu_getEventType (const char *eventname, u64 *code, u64 *type)
 
static int event_has_pname (char *s)
 
static int create_event (uint64_t code, uint64_t type)
 
static int test_pmu (char *evname)
 
static int show_event_info (pfm_event_info_t *info)
 
static int show_info (char *event)
 
int pfmu_getEventAttribute (const char *eventname, struct perf_event_attr *event_attr)
 
int pfmu_isSupported (const char *eventname)
 
int pfmu_init ()
 
void pfmu_fini ()
 
int pfmu_showEventList ()
 

Macro Definition Documentation

◆ EVENT_FATAL_ERROR

#define EVENT_FATAL_ERROR   -1

Definition at line 115 of file perfmon-util.c.

◆ EVENT_IS_PROFILABLE

#define EVENT_IS_PROFILABLE   0

Definition at line 113 of file perfmon-util.c.

◆ EVENT_MAY_NOT_PROFILABLE

#define EVENT_MAY_NOT_PROFILABLE   1

Definition at line 114 of file perfmon-util.c.

◆ MAX_EVENT_DESC_CHARS

#define MAX_EVENT_DESC_CHARS   4096

Definition at line 111 of file perfmon-util.c.

◆ MAX_EVENT_NAME_CHARS

#define MAX_EVENT_NAME_CHARS   256

Definition at line 110 of file perfmon-util.c.

Function Documentation

◆ create_event()

static int create_event ( uint64_t  code,
uint64_t  type 
)
static

Definition at line 145 of file perfmon-util.c.

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

◆ event_has_pname()

static int event_has_pname ( char *  s)
static

Definition at line 131 of file perfmon-util.c.

Here is the caller graph for this function:

◆ pfmu_fini()

void pfmu_fini ( )

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

◆ pfmu_getEventAttribute()

int pfmu_getEventAttribute ( const char *  eventname,
struct perf_event_attr *  event_attr 
)

get the complete perf event attribute for a given pmu

Returns
1 if successful -1 otherwise

Definition at line 313 of file perfmon-util.c.

◆ pfmu_getEventType()

int pfmu_getEventType ( const char *  eventname,
u64 code,
u64 type 
)

Definition at line 336 of file perfmon-util.c.

Here is the caller graph for this function:

◆ pfmu_init()

int pfmu_init ( )

Initializing perfmon return 1 if the initialization passes successfully

Definition at line 377 of file perfmon-util.c.

◆ pfmu_isSupported()

int pfmu_isSupported ( const char *  eventname)

Definition at line 365 of file perfmon-util.c.

Here is the call graph for this function:

◆ pfmu_showEventList()

int pfmu_showEventList ( )

Definition at line 412 of file perfmon-util.c.

Here is the call graph for this function:

◆ show_event_info()

static int show_event_info ( pfm_event_info_t *  info)
static

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

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

◆ show_info()

static int show_info ( char *  event)
static

Definition at line 257 of file perfmon-util.c.

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

◆ test_pmu()

static int test_pmu ( char *  evname)
static

Definition at line 173 of file perfmon-util.c.

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