summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-diff.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-10-15 11:54:14 +0200
committerIngo Molnar <mingo@kernel.org>2014-10-15 11:54:14 +0200
commitec4212d88a77eb6caec10777ddd629b702a5ebbd (patch)
tree03b4b08df9d633e15df8c0ff27444324adf4a312 /tools/perf/builtin-diff.c
parent77654908ff1a58cee4886298968b5262884aff0b (diff)
parent2c241bd35e6f626ad6f867dcf9fefdc2315f125f (diff)
downloadlinux-ec4212d88a77eb6caec10777ddd629b702a5ebbd.tar.bz2
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: Infrastructure fixes and changes: * Fix off-by-one bugs in map->end handling (Stephane Eranian) * Fix off-by-one bug in maps__find(), also related to map->end handling (Namhyung Kim) * Make struct symbol->end be the first addr after the symbol range, to make it match the convention used for struct map->end. (Arnaldo Carvalho de Melo) * Fix perf_evlist__add_pollfd() error handling in 'perf kvm stat live' (Jiri Olsa) * Fix python test build by moving callchain_param to an object linked into the python binding (Jiri Olsa) * Do not include a struct hists per perf_evsel, untangling the histogram code from perf_evsel, to pave the way for exporting a minimalistic tools/lib/api/perf/ library usable by tools/perf and initially by the rasd daemon being developed by Borislav Petkov, Robert Richter and Jean Pihet. (Arnaldo Carvalho de Melo) * Make perf_evlist__open(evlist, NULL, NULL), i.e. without cpu and thread maps mean syswide monitoring, reducing the boilerplate for tools that only want system wide mode. (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/builtin-diff.c')
-rw-r--r--tools/perf/builtin-diff.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index a3ce19f7aebd..8c5c11ca8c53 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -327,6 +327,7 @@ static int diff__process_sample_event(struct perf_tool *tool __maybe_unused,
struct machine *machine)
{
struct addr_location al;
+ struct hists *hists = evsel__hists(evsel);
if (perf_event__preprocess_sample(event, machine, &al, sample) < 0) {
pr_warning("problem processing %d event, skipping it.\n",
@@ -334,7 +335,7 @@ static int diff__process_sample_event(struct perf_tool *tool __maybe_unused,
return -1;
}
- if (hists__add_entry(&evsel->hists, &al, sample->period,
+ if (hists__add_entry(hists, &al, sample->period,
sample->weight, sample->transaction)) {
pr_warning("problem incrementing symbol period, skipping event\n");
return -1;
@@ -346,9 +347,9 @@ static int diff__process_sample_event(struct perf_tool *tool __maybe_unused,
* hists__output_resort() and precompute needs the total
* period in order to sort entries by percentage delta.
*/
- evsel->hists.stats.total_period += sample->period;
+ hists->stats.total_period += sample->period;
if (!al.filtered)
- evsel->hists.stats.total_non_filtered_period += sample->period;
+ hists->stats.total_non_filtered_period += sample->period;
return 0;
}
@@ -382,7 +383,7 @@ static void perf_evlist__collapse_resort(struct perf_evlist *evlist)
struct perf_evsel *evsel;
evlist__for_each(evlist, evsel) {
- struct hists *hists = &evsel->hists;
+ struct hists *hists = evsel__hists(evsel);
hists__collapse_resort(hists, NULL);
}
@@ -631,24 +632,26 @@ static void data_process(void)
bool first = true;
evlist__for_each(evlist_base, evsel_base) {
+ struct hists *hists_base = evsel__hists(evsel_base);
struct data__file *d;
int i;
data__for_each_file_new(i, d) {
struct perf_evlist *evlist = d->session->evlist;
struct perf_evsel *evsel;
+ struct hists *hists;
evsel = evsel_match(evsel_base, evlist);
if (!evsel)
continue;
- d->hists = &evsel->hists;
+ hists = evsel__hists(evsel);
+ d->hists = hists;
- hists__match(&evsel_base->hists, &evsel->hists);
+ hists__match(hists_base, hists);
if (!show_baseline_only)
- hists__link(&evsel_base->hists,
- &evsel->hists);
+ hists__link(hists_base, hists);
}
fprintf(stdout, "%s# Event '%s'\n#\n", first ? "" : "\n",
@@ -659,7 +662,7 @@ static void data_process(void)
if (verbose || data__files_cnt > 2)
data__fprintf();
- hists__process(&evsel_base->hists);
+ hists__process(hists_base);
}
}