From: Ian Rogers Date: Thu, 11 Nov 2021 00:21:02 +0000 (-0800) Subject: perf test: Add expr test for events with hyphens X-Git-Tag: v6.6.17~8807^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=604ce2f00465efdf6efa9708c0b9b1fc302f46f0;p=platform%2Fkernel%2Flinux-rpi.git perf test: Add expr test for events with hyphens An example of such an event is topdown-fe-bound. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul A . Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Song Liu Cc: Wan Jiabing Cc: Yury Norov Link: https://lore.kernel.org/r/20211111002109.194172-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c index 0c041ac..48c62d0 100644 --- a/tools/perf/tests/expr.c +++ b/tools/perf/tests/expr.c @@ -134,6 +134,16 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u TEST_ASSERT_VAL("find ids", hashmap__find(ctx->ids, "EVENT2,param=3@", (void **)&val_ptr)); + expr__ctx_clear(ctx); + TEST_ASSERT_VAL("find ids", + expr__find_ids("dash\\-event1 - dash\\-event2", + NULL, ctx) == 0); + TEST_ASSERT_VAL("find ids", hashmap__size(ctx->ids) == 2); + TEST_ASSERT_VAL("find ids", hashmap__find(ctx->ids, "dash-event1", + (void **)&val_ptr)); + TEST_ASSERT_VAL("find ids", hashmap__find(ctx->ids, "dash-event2", + (void **)&val_ptr)); + /* Only EVENT1 or EVENT2 need be measured depending on the value of smt_on. */ expr__ctx_clear(ctx); TEST_ASSERT_VAL("find ids",