Linux Perf
perf-hooks.c File Reference
#include <errno.h>
#include <stdlib.h>
#include <setjmp.h>
#include <linux/err.h>
#include <linux/kernel.h>
#include "util/util.h"
#include "util/debug.h"
#include "util/perf-hooks.h"
#include "perf-hooks-list.h"
Include dependency graph for perf-hooks.c:

Go to the source code of this file.

Macros

#define PERF_HOOK(name)
 
#define PERF_HOOK(name)   &__perf_hook_desc_##name,
 

Functions

void perf_hooks__invoke (const struct perf_hook_desc *desc)
 
void perf_hooks__recover (void)
 
int perf_hooks__set_hook (const char *hook_name, perf_hook_func_t hook_func, void *hook_ctx)
 
perf_hook_func_t perf_hooks__get_hook (const char *hook_name)
 

Variables

static sigjmp_buf jmpbuf
 
static const struct perf_hook_desccurrent_perf_hook
 
static struct perf_hook_descperf_hooks []
 

Macro Definition Documentation

◆ PERF_HOOK [1/2]

#define PERF_HOOK (   name)
Value:
perf_hook_func_t __perf_hook_func_##name = NULL; \
struct perf_hook_desc __perf_hook_desc_##name = \
{.hook_name = #name, \
.p_hook_func = &__perf_hook_func_##name, \
.hook_ctx = NULL};
void(* perf_hook_func_t)(void *ctx)
Definition: perf-hooks.h:9
const char * name

Definition at line 52 of file perf-hooks.c.

◆ PERF_HOOK [2/2]

#define PERF_HOOK (   name)    &__perf_hook_desc_##name,

Definition at line 52 of file perf-hooks.c.

Function Documentation

◆ perf_hooks__get_hook()

perf_hook_func_t perf_hooks__get_hook ( const char *  hook_name)

Definition at line 79 of file perf-hooks.c.

◆ perf_hooks__invoke()

void perf_hooks__invoke ( const struct perf_hook_desc desc)

Definition at line 21 of file perf-hooks.c.

◆ perf_hooks__recover()

void perf_hooks__recover ( void  )

Definition at line 37 of file perf-hooks.c.

◆ perf_hooks__set_hook()

int perf_hooks__set_hook ( const char *  hook_name,
perf_hook_func_t  hook_func,
void *  hook_ctx 
)

Definition at line 60 of file perf-hooks.c.

Variable Documentation

◆ current_perf_hook

const struct perf_hook_desc* current_perf_hook
static

Definition at line 19 of file perf-hooks.c.

◆ jmpbuf

sigjmp_buf jmpbuf
static

Definition at line 18 of file perf-hooks.c.

◆ perf_hooks

struct perf_hook_desc* perf_hooks[]
static
Initial value:
= {
}

Definition at line 55 of file perf-hooks.c.