diff options
Diffstat (limited to 'tools/perf/builtin-test.c')
-rw-r--r-- | tools/perf/builtin-test.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c index 58bfe8bde5ee..86874238a350 100644 --- a/tools/perf/builtin-test.c +++ b/tools/perf/builtin-test.c | |||
@@ -877,6 +877,22 @@ static int test__checkevent_genhw_modifier(struct perf_evlist *evlist) | |||
877 | return test__checkevent_genhw(evlist); | 877 | return test__checkevent_genhw(evlist); |
878 | } | 878 | } |
879 | 879 | ||
880 | static int test__checkevent_pmu(struct perf_evlist *evlist) | ||
881 | { | ||
882 | |||
883 | struct perf_evsel *evsel = list_entry(evlist->entries.next, | ||
884 | struct perf_evsel, node); | ||
885 | |||
886 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); | ||
887 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | ||
888 | TEST_ASSERT_VAL("wrong config", 10 == evsel->attr.config); | ||
889 | TEST_ASSERT_VAL("wrong config1", 1 == evsel->attr.config1); | ||
890 | TEST_ASSERT_VAL("wrong config2", 3 == evsel->attr.config2); | ||
891 | TEST_ASSERT_VAL("wrong period", 1000 == evsel->attr.sample_period); | ||
892 | |||
893 | return 0; | ||
894 | } | ||
895 | |||
880 | static struct test__event_st { | 896 | static struct test__event_st { |
881 | const char *name; | 897 | const char *name; |
882 | __u32 type; | 898 | __u32 type; |
@@ -958,6 +974,10 @@ static struct test__event_st { | |||
958 | .name = "L1-dcache-load-miss:kp", | 974 | .name = "L1-dcache-load-miss:kp", |
959 | .check = test__checkevent_genhw_modifier, | 975 | .check = test__checkevent_genhw_modifier, |
960 | }, | 976 | }, |
977 | { | ||
978 | .name = "cpu/config=10,config1,config2=3,period=1000/u", | ||
979 | .check = test__checkevent_pmu, | ||
980 | }, | ||
961 | }; | 981 | }; |
962 | 982 | ||
963 | #define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st)) | 983 | #define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st)) |