HPCToolkit
kernel_blocking.c File Reference
#include <assert.h>
#include <include/linux_info.h>
#include "kernel_blocking.h"
#include "perf-util.h"
#include "perf_mmap.h"
#include "event_custom.h"
Include dependency graph for kernel_blocking.c:

Go to the source code of this file.

Macros

#define KERNEL_BLOCKING_DEBUG   0
 
#define EVNAME_KERNEL_BLOCK   "BLOCKTIME"
 
#define EVNAME_CONTEXT_SWITCHES   "CS"
 

Functions

static void blame_kernel_time (cct_node_t *cct_kernel, perf_mmap_data_t *mmap_data)
 
static void kernel_block_handler (event_handler_arg_t *args)
 
static int register_blocking (sample_source_t *self, event_custom_t *event, struct event_threshold_s *period)
 
void kernel_blocking_init ()
 

Variables

static int metric_blocking_index = -1
 
static __thread u64 time_cs_out = 0
 
static __thread cct_node_tcct_kernel = NULL
 
static __thread u32 cpu = 0
 
static __thread u32 pid = 0
 
static __thread u32 tid = 0
 

Macro Definition Documentation

◆ EVNAME_CONTEXT_SWITCHES

#define EVNAME_CONTEXT_SWITCHES   "CS"

Definition at line 76 of file kernel_blocking.c.

◆ EVNAME_KERNEL_BLOCK

#define EVNAME_KERNEL_BLOCK   "BLOCKTIME"

Definition at line 75 of file kernel_blocking.c.

◆ KERNEL_BLOCKING_DEBUG

#define KERNEL_BLOCKING_DEBUG   0

WARNING : THIS IS AN EXPERIMENTAL FEATURE

Kernel blocking event is not validated yet, and only works for Kernel 4.3 (at least). This file will be updated once we find a way to make it work properly.

Definition at line 69 of file kernel_blocking.c.

Function Documentation

◆ blame_kernel_time()

static void blame_kernel_time ( cct_node_t cct_kernel,
perf_mmap_data_t mmap_data 
)
static

Definition at line 104 of file kernel_blocking.c.

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

◆ kernel_block_handler()

static void kernel_block_handler ( event_handler_arg_t args)
static

Definition at line 156 of file kernel_blocking.c.

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

◆ kernel_blocking_init()

void kernel_blocking_init ( )

Definition at line 301 of file kernel_blocking.c.

Here is the caller graph for this function:

◆ register_blocking()

static int register_blocking ( sample_source_t self,
event_custom_t event,
struct event_threshold_s period 
)
static

Definition at line 238 of file kernel_blocking.c.

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

Variable Documentation

◆ cct_kernel

__thread cct_node_t* cct_kernel = NULL
static

Definition at line 95 of file kernel_blocking.c.

◆ cpu

__thread u32 cpu = 0
static

Definition at line 96 of file kernel_blocking.c.

◆ metric_blocking_index

int metric_blocking_index = -1
static

Definition at line 92 of file kernel_blocking.c.

◆ pid

__thread u32 pid = 0
static

Definition at line 97 of file kernel_blocking.c.

◆ tid

__thread u32 tid = 0
static

Definition at line 97 of file kernel_blocking.c.

◆ time_cs_out

__thread u64 time_cs_out = 0
static

Definition at line 94 of file kernel_blocking.c.