Skip to content

Commit 604ce2f

Browse files
captain5050acmel
authored andcommitted
perf test: Add expr test for events with hyphens
An example of such an event is topdown-fe-bound. Signed-off-by: Ian Rogers <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: John Garry <[email protected]> Cc: Kajol Jain <[email protected]> Cc: Kan Liang <[email protected]> Cc: Madhavan Srinivasan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul A . Clarke <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Riccardo Mancini <[email protected]> Cc: Song Liu <[email protected]> Cc: Wan Jiabing <[email protected]> Cc: Yury Norov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent b47d2fb commit 604ce2f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/perf/tests/expr.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u
134134
TEST_ASSERT_VAL("find ids", hashmap__find(ctx->ids, "EVENT2,param=3@",
135135
(void **)&val_ptr));
136136

137+
expr__ctx_clear(ctx);
138+
TEST_ASSERT_VAL("find ids",
139+
expr__find_ids("dash\\-event1 - dash\\-event2",
140+
NULL, ctx) == 0);
141+
TEST_ASSERT_VAL("find ids", hashmap__size(ctx->ids) == 2);
142+
TEST_ASSERT_VAL("find ids", hashmap__find(ctx->ids, "dash-event1",
143+
(void **)&val_ptr));
144+
TEST_ASSERT_VAL("find ids", hashmap__find(ctx->ids, "dash-event2",
145+
(void **)&val_ptr));
146+
137147
/* Only EVENT1 or EVENT2 need be measured depending on the value of smt_on. */
138148
expr__ctx_clear(ctx);
139149
TEST_ASSERT_VAL("find ids",

0 commit comments

Comments
 (0)