Skip to content

Commit

Permalink
perf tests: Add a testcase for histogram output sorting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Namhyung Kim authored and Jiri Olsa committed May 21, 2014
1 parent 4e754e1 commit f21d181
Show file tree
Hide file tree
Showing 7 changed files with 628 additions and 2 deletions.
1 change: 1 addition & 0 deletions tools/perf/Makefile.perf
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ LIB_OBJS += $(OUTPUT)tests/pmu.o
LIB_OBJS += $(OUTPUT)tests/hists_common.o
LIB_OBJS += $(OUTPUT)tests/hists_link.o
LIB_OBJS += $(OUTPUT)tests/hists_filter.o
LIB_OBJS += $(OUTPUT)tests/hists_output.o
LIB_OBJS += $(OUTPUT)tests/python-use.o
LIB_OBJS += $(OUTPUT)tests/bp_signal.o
LIB_OBJS += $(OUTPUT)tests/bp_signal_overflow.o
Expand Down
4 changes: 4 additions & 0 deletions tools/perf/tests/builtin-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ static struct test {
.desc = "Test thread mg sharing",
.func = test__thread_mg_share,
},
{
.desc = "Test output sorting of hist entries",
.func = test__hists_output,
},
{
.func = NULL,
},
Expand Down
4 changes: 2 additions & 2 deletions tools/perf/tests/hists_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ void print_hists_out(struct hists *hists)
he = rb_entry(node, struct hist_entry, rb_node);

if (!he->filtered) {
pr_info("%2d: entry: %-8s [%-8s] %20s: period = %"PRIu64"\n",
i, thread__comm_str(he->thread),
pr_info("%2d: entry: %8s:%5d [%-8s] %20s: period = %"PRIu64"\n",
i, thread__comm_str(he->thread), he->thread->tid,
he->ms.map->dso->short_name,
he->ms.sym->name, he->stat.period);
}
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/hists_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ int test__hists_filter(void)
out:
/* tear down everything */
perf_evlist__delete(evlist);
reset_output_field();
machines__exit(&machines);

return err;
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/hists_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ int test__hists_link(void)
out:
/* tear down everything */
perf_evlist__delete(evlist);
reset_output_field();
machines__exit(&machines);

return err;
Expand Down
Loading

0 comments on commit f21d181

Please sign in to comment.