Skip to content

Commit f21d181

Browse files
namhyungolsajiri
authored andcommitted
perf tests: Add a testcase for histogram output sorting
With new output fields option, its internal implementation was changed so add a new testcase to verify whether it breaks things. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1400480762-22852-21-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
1 parent 4e754e1 commit f21d181

7 files changed

Lines changed: 628 additions & 2 deletions

File tree

‎tools/perf/Makefile.perf‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ LIB_OBJS += $(OUTPUT)tests/pmu.o
399399
LIB_OBJS += $(OUTPUT)tests/hists_common.o
400400
LIB_OBJS += $(OUTPUT)tests/hists_link.o
401401
LIB_OBJS += $(OUTPUT)tests/hists_filter.o
402+
LIB_OBJS += $(OUTPUT)tests/hists_output.o
402403
LIB_OBJS += $(OUTPUT)tests/python-use.o
403404
LIB_OBJS += $(OUTPUT)tests/bp_signal.o
404405
LIB_OBJS += $(OUTPUT)tests/bp_signal_overflow.o

‎tools/perf/tests/builtin-test.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ static struct test {
135135
.desc = "Test thread mg sharing",
136136
.func = test__thread_mg_share,
137137
},
138+
{
139+
.desc = "Test output sorting of hist entries",
140+
.func = test__hists_output,
141+
},
138142
{
139143
.func = NULL,
140144
},

‎tools/perf/tests/hists_common.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ void print_hists_out(struct hists *hists)
193193
he = rb_entry(node, struct hist_entry, rb_node);
194194

195195
if (!he->filtered) {
196-
pr_info("%2d: entry: %-8s [%-8s] %20s: period = %"PRIu64"\n",
197-
i, thread__comm_str(he->thread),
196+
pr_info("%2d: entry: %8s:%5d [%-8s] %20s: period = %"PRIu64"\n",
197+
i, thread__comm_str(he->thread), he->thread->tid,
198198
he->ms.map->dso->short_name,
199199
he->ms.sym->name, he->stat.period);
200200
}

‎tools/perf/tests/hists_filter.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ int test__hists_filter(void)
283283
out:
284284
/* tear down everything */
285285
perf_evlist__delete(evlist);
286+
reset_output_field();
286287
machines__exit(&machines);
287288

288289
return err;

‎tools/perf/tests/hists_link.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ int test__hists_link(void)
332332
out:
333333
/* tear down everything */
334334
perf_evlist__delete(evlist);
335+
reset_output_field();
335336
machines__exit(&machines);
336337

337338
return err;

0 commit comments

Comments
 (0)