perf test: Fix parse events test to follow proper raw event name
Following commit changed raw event names to carry event modificator.
perf evsel: Reconstruct raw event with modifiers from perf_event_attr
commit 6eef3d9c2b
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
The perf_evsel__name function now returns ':mod' suffix for raw events,
so we need to follow that in current tests.
All tests pass now for 'perf test parse' suite.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1340274316-5161-1-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
35a4687322
commit
7a25b2d32b
@@ -413,19 +413,20 @@ static int test__checkevent_pmu_name(struct perf_evlist *evlist)
|
|||||||
{
|
{
|
||||||
struct perf_evsel *evsel;
|
struct perf_evsel *evsel;
|
||||||
|
|
||||||
/* cpu/config=1,name=krava1/u */
|
/* cpu/config=1,name=krava/u */
|
||||||
evsel = list_entry(evlist->entries.next, struct perf_evsel, node);
|
evsel = list_entry(evlist->entries.next, struct perf_evsel, node);
|
||||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries);
|
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries);
|
||||||
TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type);
|
TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type);
|
||||||
TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config);
|
TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config);
|
||||||
TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "krava"));
|
TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "krava"));
|
||||||
|
|
||||||
/* cpu/config=2/" */
|
/* cpu/config=2/u" */
|
||||||
evsel = list_entry(evsel->node.next, struct perf_evsel, node);
|
evsel = list_entry(evsel->node.next, struct perf_evsel, node);
|
||||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries);
|
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries);
|
||||||
TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type);
|
TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type);
|
||||||
TEST_ASSERT_VAL("wrong config", 2 == evsel->attr.config);
|
TEST_ASSERT_VAL("wrong config", 2 == evsel->attr.config);
|
||||||
TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "raw 0x2"));
|
TEST_ASSERT_VAL("wrong name",
|
||||||
|
!strcmp(perf_evsel__name(evsel), "raw 0x2:u"));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user