cregit-Linux how code gets into the kernel

Release 4.10 tools/perf/tests/parse-events.c

Directory: tools/perf/tests
#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 <linux/hw_breakpoint.h>
#include <api/fs/fs.h>


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


static int test__checkevent_tracepoint(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong number of groups", 0 == evlist->nr_groups); TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); TEST_ASSERT_VAL("wrong sample_type", PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa7385.88%250.00%
namhyung kimnamhyung kim1112.94%125.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.18%125.00%
Total85100.00%4100.00%


static int test__checkevent_tracepoint_multi(struct perf_evlist *evlist) { struct perf_evsel *evsel; TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1); TEST_ASSERT_VAL("wrong number of groups", 0 == evlist->nr_groups); evlist__for_each_entry(evlist, evsel) { TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); TEST_ASSERT_VAL("wrong sample_type", PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); } return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa7484.09%240.00%
namhyung kimnamhyung kim1112.50%120.00%
arnaldo carvalho de meloarnaldo carvalho de melo33.41%240.00%
Total88100.00%5100.00%


static int test__checkevent_raw(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); TEST_ASSERT_VAL("wrong config", 0x1a == evsel->attr.config); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa6098.36%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.64%150.00%
Total61100.00%2100.00%


static int test__checkevent_numeric(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", 1 == evsel->attr.type); TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa6098.36%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.64%150.00%
Total61100.00%2100.00%


static int test__checkevent_symbolic_name(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa6098.36%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.64%150.00%
Total61100.00%2100.00%


static int test__checkevent_symbolic_name_config(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); /* * The period value gets configured within perf_evlist__config, * while this test executes only parse events method. */ TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); TEST_ASSERT_VAL("wrong config1", 0 == evsel->attr.config1); TEST_ASSERT_VAL("wrong config2", 1 == evsel->attr.config2); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa10099.01%266.67%
arnaldo carvalho de meloarnaldo carvalho de melo10.99%133.33%
Total101100.00%3100.00%


static int test__checkevent_symbolic_alias(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->attr.type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_SW_PAGE_FAULTS == evsel->attr.config); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa6098.36%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.64%150.00%
Total61100.00%2100.00%


static int test__checkevent_genhw(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->attr.type); TEST_ASSERT_VAL("wrong config", (1 << 16) == evsel->attr.config); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa6498.46%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.54%150.00%
Total65100.00%2100.00%


static int test__checkevent_breakpoint(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) == evsel->attr.bp_type); TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 == evsel->attr.bp_len); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa9098.90%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.10%150.00%
Total91100.00%2100.00%


static int test__checkevent_breakpoint_x(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); TEST_ASSERT_VAL("wrong bp_type", HW_BREAKPOINT_X == evsel->attr.bp_type); TEST_ASSERT_VAL("wrong bp_len", sizeof(long) == evsel->attr.bp_len); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa8998.89%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.11%150.00%
Total90100.00%2100.00%


static int test__checkevent_breakpoint_r(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); TEST_ASSERT_VAL("wrong bp_type", HW_BREAKPOINT_R == evsel->attr.bp_type); TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 == evsel->attr.bp_len); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa8698.85%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.15%150.00%
Total87100.00%2100.00%


static int test__checkevent_breakpoint_w(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); TEST_ASSERT_VAL("wrong bp_type", HW_BREAKPOINT_W == evsel->attr.bp_type); TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 == evsel->attr.bp_len); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa8698.85%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.15%150.00%
Total87100.00%2100.00%


static int test__checkevent_breakpoint_rw(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R|HW_BREAKPOINT_W) == evsel->attr.bp_type); TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 == evsel->attr.bp_len); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa9098.90%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.10%150.00%
Total91100.00%2100.00%


static int test__checkevent_tracepoint_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); return test__checkevent_tracepoint(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa7298.63%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.37%150.00%
Total73100.00%2100.00%


static int test__checkevent_tracepoint_multi_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel; TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1); evlist__for_each_entry(evlist, evsel) { TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); } return test__checkevent_tracepoint_multi(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa8496.55%133.33%
arnaldo carvalho de meloarnaldo carvalho de melo33.45%266.67%
Total87100.00%3100.00%


static int test__checkevent_raw_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); return test__checkevent_raw(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa7198.61%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.39%150.00%
Total72100.00%2100.00%


static int test__checkevent_numeric_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); return test__checkevent_numeric(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa7198.61%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.39%150.00%
Total72100.00%2100.00%


static int test__checkevent_symbolic_name_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); return test__checkevent_symbolic_name(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa7298.63%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.37%150.00%
Total73100.00%2100.00%


static int test__checkevent_exclude_host_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); return test__checkevent_symbolic_name(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa4998.00%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo12.00%150.00%
Total50100.00%2100.00%


static int test__checkevent_exclude_guest_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); return test__checkevent_symbolic_name(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa4998.00%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo12.00%150.00%
Total50100.00%2100.00%


static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); return test__checkevent_symbolic_alias(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa7298.63%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.37%150.00%
Total73100.00%2100.00%


static int test__checkevent_genhw_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); return test__checkevent_genhw(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa7198.61%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.39%150.00%
Total72100.00%2100.00%


static int test__checkevent_exclude_idle_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude idle", evsel->attr.exclude_idle); TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); return test__checkevent_symbolic_name(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa110100.00%1100.00%
Total110100.00%1100.00%


static int test__checkevent_exclude_idle_modifier_1(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude idle", evsel->attr.exclude_idle); TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); return test__checkevent_symbolic_name(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa107100.00%1100.00%
Total107100.00%1100.00%


static int test__checkevent_breakpoint_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "mem:0:u")); return test__checkevent_breakpoint(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa8797.75%250.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.12%125.00%
robert richterrobert richter11.12%125.00%
Total89100.00%4100.00%


static int test__checkevent_breakpoint_x_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "mem:0:x:k")); return test__checkevent_breakpoint_x(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa8797.75%250.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.12%125.00%
robert richterrobert richter11.12%125.00%
Total89100.00%4100.00%


static int test__checkevent_breakpoint_r_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "mem:0:r:hp")); return test__checkevent_breakpoint_r(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa8697.73%250.00%
robert richterrobert richter11.14%125.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.14%125.00%
Total88100.00%4100.00%


static int test__checkevent_breakpoint_w_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "mem:0:w:up")); return test__checkevent_breakpoint_w(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa8697.73%250.00%
robert richterrobert richter11.14%125.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.14%125.00%
Total88100.00%4100.00%


static int test__checkevent_breakpoint_rw_modifier(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "mem:0:rw:kp")); return test__checkevent_breakpoint_rw(evlist); }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa8697.73%250.00%
arnaldo carvalho de meloarnaldo carvalho de melo11.14%125.00%
robert richterrobert richter11.14%125.00%
Total88100.00%4100.00%


static int test__checkevent_pmu(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); TEST_ASSERT_VAL("wrong config", 10 == evsel->attr.config); TEST_ASSERT_VAL("wrong config1", 1 == evsel->attr.config1); TEST_ASSERT_VAL("wrong config2", 3 == evsel->attr.config2); /* * The period value gets configured within perf_evlist__config, * while this test executes only parse events method. */ TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa10099.01%266.67%
arnaldo carvalho de meloarnaldo carvalho de melo10.99%133.33%
Total101100.00%3100.00%


static int test__checkevent_list(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->nr_entries); /* r1 */ TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); TEST_ASSERT_VAL("wrong config1", 0 == evsel->attr.config1); TEST_ASSERT_VAL("wrong config2", 0 == evsel->attr.config2); TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); /* syscalls:sys_enter_openat:k */ evsel = perf_evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); TEST_ASSERT_VAL("wrong sample_type", PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); /* 1:1:hp */ evsel = perf_evsel__next(evsel); TEST_ASSERT_VAL("wrong type", 1 == evsel->attr.type); TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
jiri olsajiri olsa30097.40%250.00%
arnaldo carvalho de meloarnaldo carvalho de melo72.27%125.00%
riku voipioriku voipio10.32%125.00%
Total308100.00%4100.00%


static int test__checkevent_pmu_name(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); /* cpu/config=1,name=krava/u */ TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->