Linux Perf
parse-events.c File Reference
#include "parse-events.h"
#include "evsel.h"
#include "evlist.h"
#include <api/fs/fs.h>
#include "tests.h"
#include "debug.h"
#include "util.h"
#include <dirent.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <linux/kernel.h>
#include <linux/hw_breakpoint.h>
#include <api/fs/tracing_path.h>
Include dependency graph for parse-events.c:

Go to the source code of this file.

Classes

struct  evlist_test
 
struct  terms_test
 

Macros

#define PERF_TP_SAMPLE_TYPE
 
#define TEST_EVENTS(tests)
 

Functions

static int test__checkevent_tracepoint (struct perf_evlist *evlist)
 
static int test__checkevent_tracepoint_multi (struct perf_evlist *evlist)
 
static int test__checkevent_raw (struct perf_evlist *evlist)
 
static int test__checkevent_numeric (struct perf_evlist *evlist)
 
static int test__checkevent_symbolic_name (struct perf_evlist *evlist)
 
static int test__checkevent_symbolic_name_config (struct perf_evlist *evlist)
 
static int test__checkevent_symbolic_alias (struct perf_evlist *evlist)
 
static int test__checkevent_genhw (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_x (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_r (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_w (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_rw (struct perf_evlist *evlist)
 
static int test__checkevent_tracepoint_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_tracepoint_multi_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_raw_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_numeric_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_symbolic_name_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_exclude_host_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_exclude_guest_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_symbolic_alias_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_genhw_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_exclude_idle_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_exclude_idle_modifier_1 (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_x_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_r_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_w_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_rw_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_pmu (struct perf_evlist *evlist)
 
static int test__checkevent_list (struct perf_evlist *evlist)
 
static int test__checkevent_pmu_name (struct perf_evlist *evlist)
 
static int test__checkevent_pmu_partial_time_callgraph (struct perf_evlist *evlist)
 
static int test__checkevent_pmu_events (struct perf_evlist *evlist)
 
static int test__checkevent_pmu_events_mix (struct perf_evlist *evlist)
 
static int test__checkterms_simple (struct list_head *terms)
 
static int test__group1 (struct perf_evlist *evlist)
 
static int test__group2 (struct perf_evlist *evlist)
 
static int test__group3 (struct perf_evlist *evlist __maybe_unused)
 
static int test__group4 (struct perf_evlist *evlist __maybe_unused)
 
static int test__group5 (struct perf_evlist *evlist __maybe_unused)
 
static int test__group_gh1 (struct perf_evlist *evlist)
 
static int test__group_gh2 (struct perf_evlist *evlist)
 
static int test__group_gh3 (struct perf_evlist *evlist)
 
static int test__group_gh4 (struct perf_evlist *evlist)
 
static int test__leader_sample1 (struct perf_evlist *evlist)
 
static int test__leader_sample2 (struct perf_evlist *evlist __maybe_unused)
 
static int test__checkevent_pinned_modifier (struct perf_evlist *evlist)
 
static int test__pinned_group (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_len (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_len_w (struct perf_evlist *evlist)
 
static int test__checkevent_breakpoint_len_rw_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_precise_max_modifier (struct perf_evlist *evlist)
 
static int test__checkevent_config_symbol (struct perf_evlist *evlist)
 
static int test__checkevent_config_raw (struct perf_evlist *evlist)
 
static int test__checkevent_config_num (struct perf_evlist *evlist)
 
static int test__checkevent_config_cache (struct perf_evlist *evlist)
 
static int test__intel_pt (struct perf_evlist *evlist)
 
static int count_tracepoints (void)
 
static int test__all_tracepoints (struct perf_evlist *evlist)
 
static int test_event (struct evlist_test *e)
 
static int test_events (struct evlist_test *events, unsigned cnt)
 
static int test_term (struct terms_test *t)
 
static int test_terms (struct terms_test *terms, unsigned cnt)
 
static int test_pmu (void)
 
static int test_pmu_events (void)
 
int test__parse_events (struct test *test __maybe_unused, int subtest __maybe_unused)
 

Variables

static struct evlist_test test__events []
 
static struct evlist_test test__events_pmu []
 
static struct terms_test test__terms []
 

Macro Definition Documentation

◆ PERF_TP_SAMPLE_TYPE

#define PERF_TP_SAMPLE_TYPE
Value:
(PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \
PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD)

Definition at line 18 of file parse-events.c.

◆ TEST_EVENTS

#define TEST_EVENTS (   tests)
Value:
do { \
ret1 = test_events(tests, ARRAY_SIZE(tests)); \
if (!ret2) \
ret2 = ret1; \
} while (0)
static const char * tests[][MAX_ARGS]
Definition: numa.c:1728
static int test_events(struct evlist_test *events, unsigned cnt)

Function Documentation

◆ count_tracepoints()

static int count_tracepoints ( void  )
static

Definition at line 1320 of file parse-events.c.

◆ test__all_tracepoints()

static int test__all_tracepoints ( struct perf_evlist evlist)
static

Definition at line 1366 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint()

static int test__checkevent_breakpoint ( struct perf_evlist evlist)
static

Definition at line 125 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_len()

static int test__checkevent_breakpoint_len ( struct perf_evlist evlist)
static

Definition at line 1226 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_len_rw_modifier()

static int test__checkevent_breakpoint_len_rw_modifier ( struct perf_evlist evlist)
static

Definition at line 1257 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_len_w()

static int test__checkevent_breakpoint_len_w ( struct perf_evlist evlist)
static

Definition at line 1241 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_modifier()

static int test__checkevent_breakpoint_modifier ( struct perf_evlist evlist)
static

Definition at line 338 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_r()

static int test__checkevent_breakpoint_r ( struct perf_evlist evlist)
static

Definition at line 152 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_r_modifier()

static int test__checkevent_breakpoint_r_modifier ( struct perf_evlist evlist)
static

Definition at line 367 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_rw()

static int test__checkevent_breakpoint_rw ( struct perf_evlist evlist)
static

Definition at line 182 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_rw_modifier()

static int test__checkevent_breakpoint_rw_modifier ( struct perf_evlist evlist)
static

Definition at line 395 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_w()

static int test__checkevent_breakpoint_w ( struct perf_evlist evlist)
static

Definition at line 167 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_w_modifier()

static int test__checkevent_breakpoint_w_modifier ( struct perf_evlist evlist)
static

Definition at line 381 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_x()

static int test__checkevent_breakpoint_x ( struct perf_evlist evlist)
static

Definition at line 139 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_breakpoint_x_modifier()

static int test__checkevent_breakpoint_x_modifier ( struct perf_evlist evlist)
static

Definition at line 353 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_config_cache()

static int test__checkevent_config_cache ( struct perf_evlist evlist)
static

Definition at line 1304 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_config_num()

static int test__checkevent_config_num ( struct perf_evlist evlist)
static

Definition at line 1296 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_config_raw()

static int test__checkevent_config_raw ( struct perf_evlist evlist)
static

Definition at line 1288 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_config_symbol()

static int test__checkevent_config_symbol ( struct perf_evlist evlist)
static

Definition at line 1280 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_exclude_guest_modifier()

static int test__checkevent_exclude_guest_modifier ( struct perf_evlist evlist)
static

Definition at line 274 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_exclude_host_modifier()

static int test__checkevent_exclude_host_modifier ( struct perf_evlist evlist)
static

Definition at line 264 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_exclude_idle_modifier()

static int test__checkevent_exclude_idle_modifier ( struct perf_evlist evlist)
static

Definition at line 308 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_exclude_idle_modifier_1()

static int test__checkevent_exclude_idle_modifier_1 ( struct perf_evlist evlist)
static

Definition at line 323 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_genhw()

static int test__checkevent_genhw ( struct perf_evlist evlist)
static

Definition at line 115 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_genhw_modifier()

static int test__checkevent_genhw_modifier ( struct perf_evlist evlist)
static

Definition at line 296 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_list()

static int test__checkevent_list ( struct perf_evlist evlist)
static

Definition at line 428 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_numeric()

static int test__checkevent_numeric ( struct perf_evlist evlist)
static

Definition at line 62 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_numeric_modifier()

static int test__checkevent_numeric_modifier ( struct perf_evlist evlist)
static

Definition at line 240 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_pinned_modifier()

static int test__checkevent_pinned_modifier ( struct perf_evlist evlist)
static

Definition at line 1182 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_pmu()

static int test__checkevent_pmu ( struct perf_evlist evlist)
static

Definition at line 409 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_pmu_events()

static int test__checkevent_pmu_events ( struct perf_evlist evlist)
static

Definition at line 521 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_pmu_events_mix()

static int test__checkevent_pmu_events_mix ( struct perf_evlist evlist)
static

Definition at line 539 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_pmu_name()

static int test__checkevent_pmu_name ( struct perf_evlist evlist)
static

Definition at line 467 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_pmu_partial_time_callgraph()

static int test__checkevent_pmu_partial_time_callgraph ( struct perf_evlist evlist)
static

Definition at line 488 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_precise_max_modifier()

static int test__checkevent_precise_max_modifier ( struct perf_evlist evlist)
static

Definition at line 1269 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_raw()

static int test__checkevent_raw ( struct perf_evlist evlist)
static

Definition at line 52 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_raw_modifier()

static int test__checkevent_raw_modifier ( struct perf_evlist evlist)
static

Definition at line 228 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_symbolic_alias()

static int test__checkevent_symbolic_alias ( struct perf_evlist evlist)
static

Definition at line 104 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_symbolic_alias_modifier()

static int test__checkevent_symbolic_alias_modifier ( struct perf_evlist evlist)
static

Definition at line 284 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_symbolic_name()

static int test__checkevent_symbolic_name ( struct perf_evlist evlist)
static

Definition at line 72 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_symbolic_name_config()

static int test__checkevent_symbolic_name_config ( struct perf_evlist evlist)
static

Definition at line 83 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_symbolic_name_modifier()

static int test__checkevent_symbolic_name_modifier ( struct perf_evlist evlist)
static

Definition at line 252 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_tracepoint()

static int test__checkevent_tracepoint ( struct perf_evlist evlist)
static

Definition at line 21 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_tracepoint_modifier()

static int test__checkevent_tracepoint_modifier ( struct perf_evlist evlist)
static

Definition at line 197 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkevent_tracepoint_multi()

static int test__checkevent_tracepoint_multi ( struct perf_evlist evlist)
static

Definition at line 34 of file parse-events.c.

◆ test__checkevent_tracepoint_multi_modifier()

static int test__checkevent_tracepoint_multi_modifier ( struct perf_evlist evlist)
static

Definition at line 210 of file parse-events.c.

Here is the call graph for this function:

◆ test__checkterms_simple()

static int test__checkterms_simple ( struct list_head *  terms)
static

Definition at line 568 of file parse-events.c.

Here is the call graph for this function:

◆ test__group1()

static int test__group1 ( struct perf_evlist evlist)
static

Definition at line 611 of file parse-events.c.

Here is the call graph for this function:

◆ test__group2()

static int test__group2 ( struct perf_evlist evlist)
static

Definition at line 653 of file parse-events.c.

Here is the call graph for this function:

◆ test__group3()

static int test__group3 ( struct perf_evlist *evlist  __maybe_unused)
static

Definition at line 708 of file parse-events.c.

Here is the call graph for this function:

◆ test__group4()

static int test__group4 ( struct perf_evlist *evlist  __maybe_unused)
static

Definition at line 800 of file parse-events.c.

Here is the call graph for this function:

◆ test__group5()

static int test__group5 ( struct perf_evlist *evlist  __maybe_unused)
static

Definition at line 844 of file parse-events.c.

Here is the call graph for this function:

◆ test__group_gh1()

static int test__group_gh1 ( struct perf_evlist evlist)
static

Definition at line 930 of file parse-events.c.

Here is the call graph for this function:

◆ test__group_gh2()

static int test__group_gh2 ( struct perf_evlist evlist)
static

Definition at line 970 of file parse-events.c.

Here is the call graph for this function:

◆ test__group_gh3()

static int test__group_gh3 ( struct perf_evlist evlist)
static

Definition at line 1010 of file parse-events.c.

Here is the call graph for this function:

◆ test__group_gh4()

static int test__group_gh4 ( struct perf_evlist evlist)
static

Definition at line 1050 of file parse-events.c.

Here is the call graph for this function:

◆ test__intel_pt()

static int test__intel_pt ( struct perf_evlist evlist)
static

Definition at line 1312 of file parse-events.c.

Here is the call graph for this function:

◆ test__leader_sample1()

static int test__leader_sample1 ( struct perf_evlist evlist)
static

Definition at line 1090 of file parse-events.c.

Here is the call graph for this function:

◆ test__leader_sample2()

static int test__leader_sample2 ( struct perf_evlist *evlist  __maybe_unused)
static

Definition at line 1143 of file parse-events.c.

Here is the call graph for this function:

◆ test__parse_events()

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

Definition at line 1827 of file parse-events.c.

Here is the call graph for this function:

◆ test__pinned_group()

static int test__pinned_group ( struct perf_evlist evlist)
static

Definition at line 1195 of file parse-events.c.

Here is the call graph for this function:

◆ test_event()

static int test_event ( struct evlist_test e)
static

Definition at line 1687 of file parse-events.c.

Here is the call graph for this function:

◆ test_events()

static int test_events ( struct evlist_test events,
unsigned  cnt 
)
static

Definition at line 1709 of file parse-events.c.

Here is the call graph for this function:

◆ test_pmu()

static int test_pmu ( void  )
static

Definition at line 1763 of file parse-events.c.

◆ test_pmu_events()

static int test_pmu_events ( void  )
static

Definition at line 1778 of file parse-events.c.

Here is the call graph for this function:

◆ test_term()

static int test_term ( struct terms_test t)
static

Definition at line 1726 of file parse-events.c.

Here is the call graph for this function:

◆ test_terms()

static int test_terms ( struct terms_test terms,
unsigned  cnt 
)
static

Definition at line 1746 of file parse-events.c.

Here is the call graph for this function:

Variable Documentation

◆ test__events

struct evlist_test test__events[]
static

Definition at line 1381 of file parse-events.c.

◆ test__events_pmu

struct evlist_test test__events_pmu[]
static
Initial value:
= {
{
.name = "cpu/config=10,config1,config2=3,period=1000/u",
.id = 0,
},
{
.name = "cpu/config=1,name=krava/u,cpu/config=2/u",
.id = 1,
},
{
.name = "cpu/config=1,call-graph=fp,time,period=100000/,cpu/config=2,call-graph=no,time=0,period=2000/",
.id = 2,
},
}
static int test__checkevent_pmu_partial_time_callgraph(struct perf_evlist *evlist)
Definition: parse-events.c:488
static int test__checkevent_pmu(struct perf_evlist *evlist)
Definition: parse-events.c:409
static int test__checkevent_pmu_name(struct perf_evlist *evlist)
Definition: parse-events.c:467

Definition at line 1656 of file parse-events.c.

◆ test__terms

struct terms_test test__terms[]
static
Initial value:
= {
[0] = {
.str = "config=10,config1,config2=3,umask=1",
},
}
static int test__checkterms_simple(struct list_head *terms)
Definition: parse-events.c:568

Definition at line 1680 of file parse-events.c.