diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-28 15:00:29 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-06-05 09:09:54 -0400 |
commit | 27de9b2bd996de0ca4079c42c81c85158e10145c (patch) | |
tree | 98202794dad73383f1a5e865445c3c04b91d068c /tools/perf/tests/parse-events.c | |
parent | 9d0199cd2a7a326510fc7f731d7974ef2fbc03d0 (diff) |
perf evsel: Add has_callchain() helper to make code more compact/clear
Its common to have the (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN),
so add an evsel__has_callchain(evsel) helper.
This will actually get more uses as we check that instead of
symbol_conf.use_callchain in places where that produces the same result
but makes this decision to be more fine grained, per evsel.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-145340oytbthatpfeaq1do18@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/parse-events.c')
-rw-r--r-- | tools/perf/tests/parse-events.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index b9ebe15afb13..7d4077068454 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c | |||
@@ -499,7 +499,7 @@ static int test__checkevent_pmu_partial_time_callgraph(struct perf_evlist *evlis | |||
499 | * while this test executes only parse events method. | 499 | * while this test executes only parse events method. |
500 | */ | 500 | */ |
501 | TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); | 501 | TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); |
502 | TEST_ASSERT_VAL("wrong callgraph", !(PERF_SAMPLE_CALLCHAIN & evsel->attr.sample_type)); | 502 | TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); |
503 | TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->attr.sample_type)); | 503 | TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->attr.sample_type)); |
504 | 504 | ||
505 | /* cpu/config=2,call-graph=no,time=0,period=2000/ */ | 505 | /* cpu/config=2,call-graph=no,time=0,period=2000/ */ |
@@ -512,7 +512,7 @@ static int test__checkevent_pmu_partial_time_callgraph(struct perf_evlist *evlis | |||
512 | * while this test executes only parse events method. | 512 | * while this test executes only parse events method. |
513 | */ | 513 | */ |
514 | TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); | 514 | TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); |
515 | TEST_ASSERT_VAL("wrong callgraph", !(PERF_SAMPLE_CALLCHAIN & evsel->attr.sample_type)); | 515 | TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); |
516 | TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->attr.sample_type)); | 516 | TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->attr.sample_type)); |
517 | 517 | ||
518 | return 0; | 518 | return 0; |