Linux Perf
switch-tracking.c File Reference
#include <sys/time.h>
#include <sys/prctl.h>
#include <errno.h>
#include <time.h>
#include <stdlib.h>
#include "parse-events.h"
#include "evlist.h"
#include "evsel.h"
#include "thread_map.h"
#include "cpumap.h"
#include "tests.h"
Include dependency graph for switch-tracking.c:

Go to the source code of this file.

Classes

struct  switch_tracking
 
struct  event_node
 

Functions

static int spin_sleep (void)
 
static int check_comm (struct switch_tracking *switch_tracking, union perf_event *event, const char *comm, int nr)
 
static int check_cpu (struct switch_tracking *switch_tracking, int cpu)
 
static int process_sample_event (struct perf_evlist *evlist, union perf_event *event, struct switch_tracking *switch_tracking)
 
static int process_event (struct perf_evlist *evlist, union perf_event *event, struct switch_tracking *switch_tracking)
 
static int add_event (struct perf_evlist *evlist, struct list_head *events, union perf_event *event)
 
static void free_event_nodes (struct list_head *events)
 
static int compar (const void *a, const void *b)
 
static int process_events (struct perf_evlist *evlist, struct switch_tracking *switch_tracking)
 
int test__switch_tracking (struct test *test __maybe_unused, int subtest __maybe_unused)
 

Function Documentation

◆ add_event()

static int add_event ( struct perf_evlist evlist,
struct list_head *  events,
union perf_event event 
)
static

Definition at line 205 of file switch-tracking.c.

Here is the call graph for this function:

◆ check_comm()

static int check_comm ( struct switch_tracking switch_tracking,
union perf_event event,
const char *  comm,
int  nr 
)
static

Definition at line 64 of file switch-tracking.c.

◆ check_cpu()

static int check_cpu ( struct switch_tracking switch_tracking,
int  cpu 
)
static

Definition at line 82 of file switch-tracking.c.

◆ compar()

static int compar ( const void *  a,
const void *  b 
)
static

Definition at line 245 of file switch-tracking.c.

◆ free_event_nodes()

static void free_event_nodes ( struct list_head *  events)
static

Definition at line 234 of file switch-tracking.c.

Here is the call graph for this function:

◆ process_event()

static int process_event ( struct perf_evlist evlist,
union perf_event event,
struct switch_tracking switch_tracking 
)
static

Definition at line 165 of file switch-tracking.c.

Here is the call graph for this function:

◆ process_events()

static int process_events ( struct perf_evlist evlist,
struct switch_tracking switch_tracking 
)
static

Definition at line 254 of file switch-tracking.c.

Here is the call graph for this function:

◆ process_sample_event()

static int process_sample_event ( struct perf_evlist evlist,
union perf_event event,
struct switch_tracking switch_tracking 
)
static

Definition at line 115 of file switch-tracking.c.

Here is the call graph for this function:

◆ spin_sleep()

static int spin_sleep ( void  )
static

Definition at line 15 of file switch-tracking.c.

◆ test__switch_tracking()

int test__switch_tracking ( struct test *test  __maybe_unused,
int subtest  __maybe_unused 
)

test__switch_tracking - test using sched_switch and tracking events.

This function implements a test that checks that sched_switch events and tracking events can be recorded for a workload (current process) using the evsel->system_wide and evsel->tracking flags (respectively) with other events sometimes enabled or disabled.

Definition at line 316 of file switch-tracking.c.

Here is the call graph for this function: