diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-01-07 03:02:25 -0500 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-06-01 08:35:05 -0400 |
commit | 9d3c02d7188866299eebe3c4a652c08140a71f40 (patch) | |
tree | 1a45d4db4976bb33a0f315d24f6fa7f70aef1c66 /tools/perf/tests | |
parent | 2bf1a12340bda1bf621f27b9892094a51b1297fd (diff) |
perf tools: Add callback function to hist_entry_iter
The new ->add_entry_cb() will be called after an entry was added to
the histogram. It's used for code sharing between perf report and
perf top. Note that ops->add_*_entry() should set iter->he properly
in order to call the ->add_entry_cb.
Also pass @arg to the callback function. It'll be used by perf top
later.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arun Sharma <asharma@fb.com>
Tested-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/87k393g999.fsf@sejong.aot.lge.com
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r-- | tools/perf/tests/hists_filter.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/hists_output.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c index 76b02e1de701..3539403bbad4 100644 --- a/tools/perf/tests/hists_filter.c +++ b/tools/perf/tests/hists_filter.c | |||
@@ -82,7 +82,7 @@ static int add_hist_entries(struct perf_evlist *evlist, | |||
82 | goto out; | 82 | goto out; |
83 | 83 | ||
84 | if (hist_entry_iter__add(&iter, &al, evsel, &sample, | 84 | if (hist_entry_iter__add(&iter, &al, evsel, &sample, |
85 | PERF_MAX_STACK_DEPTH) < 0) | 85 | PERF_MAX_STACK_DEPTH, NULL) < 0) |
86 | goto out; | 86 | goto out; |
87 | 87 | ||
88 | fake_samples[i].thread = al.thread; | 88 | fake_samples[i].thread = al.thread; |
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c index 1308f88a9169..d40461ecd210 100644 --- a/tools/perf/tests/hists_output.c +++ b/tools/perf/tests/hists_output.c | |||
@@ -71,7 +71,7 @@ static int add_hist_entries(struct hists *hists, struct machine *machine) | |||
71 | goto out; | 71 | goto out; |
72 | 72 | ||
73 | if (hist_entry_iter__add(&iter, &al, evsel, &sample, | 73 | if (hist_entry_iter__add(&iter, &al, evsel, &sample, |
74 | PERF_MAX_STACK_DEPTH) < 0) | 74 | PERF_MAX_STACK_DEPTH, NULL) < 0) |
75 | goto out; | 75 | goto out; |
76 | 76 | ||
77 | fake_samples[i].thread = al.thread; | 77 | fake_samples[i].thread = al.thread; |