diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-10-10 14:49:21 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-10-14 10:41:25 -0400 |
commit | 2a1731fb85ec96a1f6a326fb2d52cd93494dafa2 (patch) | |
tree | 2b55d616d523092a367436035558a8a3677d3ad4 | |
parent | 95e8d97e9b78040285defe482e1edf8b6341a4c1 (diff) |
perf session: Remove last reference to hists struct
Now perf_session doesn't require that the evsels in its evlist are hists
containing ones.
Tools that are hists based and want to do per evsel events_stats
updates, if at some point this turns into a necessity, should do it in
the tool specific code, keeping the session class hists agnostic.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-cli1bgwpo82mdikuhy3djsuy@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-annotate.c | 1 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 1 | ||||
-rw-r--r-- | tools/perf/util/hist.c | 16 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 1 | ||||
-rw-r--r-- | tools/perf/util/session.c | 7 | ||||
-rw-r--r-- | tools/perf/util/session.h | 1 |
6 files changed, 19 insertions, 8 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index c9a119e2113d..a5969fa64503 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -214,6 +214,7 @@ static int __cmd_annotate(struct perf_annotate *ann) | |||
214 | 214 | ||
215 | if (dump_trace) { | 215 | if (dump_trace) { |
216 | perf_session__fprintf_nr_events(session, stdout); | 216 | perf_session__fprintf_nr_events(session, stdout); |
217 | perf_evlist__fprintf_nr_events(session->evlist, stdout); | ||
217 | goto out; | 218 | goto out; |
218 | } | 219 | } |
219 | 220 | ||
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 3750d635f0f7..8043b5a7240a 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -487,6 +487,7 @@ static int __cmd_report(struct report *rep) | |||
487 | 487 | ||
488 | if (dump_trace) { | 488 | if (dump_trace) { |
489 | perf_session__fprintf_nr_events(session, stdout); | 489 | perf_session__fprintf_nr_events(session, stdout); |
490 | perf_evlist__fprintf_nr_events(session->evlist, stdout); | ||
490 | return 0; | 491 | return 0; |
491 | } | 492 | } |
492 | } | 493 | } |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index f72ad9c36e39..b143e404e5b1 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include "hist.h" | 3 | #include "hist.h" |
4 | #include "session.h" | 4 | #include "session.h" |
5 | #include "sort.h" | 5 | #include "sort.h" |
6 | #include "evlist.h" | ||
6 | #include "evsel.h" | 7 | #include "evsel.h" |
7 | #include "annotate.h" | 8 | #include "annotate.h" |
8 | #include <math.h> | 9 | #include <math.h> |
@@ -1405,6 +1406,21 @@ int hists__link(struct hists *leader, struct hists *other) | |||
1405 | return 0; | 1406 | return 0; |
1406 | } | 1407 | } |
1407 | 1408 | ||
1409 | |||
1410 | size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp) | ||
1411 | { | ||
1412 | struct perf_evsel *pos; | ||
1413 | size_t ret = 0; | ||
1414 | |||
1415 | evlist__for_each(evlist, pos) { | ||
1416 | ret += fprintf(fp, "%s stats:\n", perf_evsel__name(pos)); | ||
1417 | ret += events_stats__fprintf(&evsel__hists(pos)->stats, fp); | ||
1418 | } | ||
1419 | |||
1420 | return ret; | ||
1421 | } | ||
1422 | |||
1423 | |||
1408 | u64 hists__total_period(struct hists *hists) | 1424 | u64 hists__total_period(struct hists *hists) |
1409 | { | 1425 | { |
1410 | return symbol_conf.filter_relative ? hists->stats.total_non_filtered_period : | 1426 | return symbol_conf.filter_relative ? hists->stats.total_non_filtered_period : |
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 04a46e32f42f..a039cd22b23c 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -139,6 +139,7 @@ size_t events_stats__fprintf(struct events_stats *stats, FILE *fp); | |||
139 | 139 | ||
140 | size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, | 140 | size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, |
141 | int max_cols, float min_pcnt, FILE *fp); | 141 | int max_cols, float min_pcnt, FILE *fp); |
142 | size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp); | ||
142 | 143 | ||
143 | void hists__filter_by_dso(struct hists *hists); | 144 | void hists__filter_by_dso(struct hists *hists); |
144 | void hists__filter_by_thread(struct hists *hists); | 145 | void hists__filter_by_thread(struct hists *hists); |
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 66cae50b5c4c..896bac73ea08 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -1375,16 +1375,9 @@ size_t perf_session__fprintf_dsos_buildid(struct perf_session *session, FILE *fp | |||
1375 | 1375 | ||
1376 | size_t perf_session__fprintf_nr_events(struct perf_session *session, FILE *fp) | 1376 | size_t perf_session__fprintf_nr_events(struct perf_session *session, FILE *fp) |
1377 | { | 1377 | { |
1378 | struct perf_evsel *pos; | ||
1379 | size_t ret = fprintf(fp, "Aggregated stats:\n"); | 1378 | size_t ret = fprintf(fp, "Aggregated stats:\n"); |
1380 | 1379 | ||
1381 | ret += events_stats__fprintf(&session->stats, fp); | 1380 | ret += events_stats__fprintf(&session->stats, fp); |
1382 | |||
1383 | evlist__for_each(session->evlist, pos) { | ||
1384 | ret += fprintf(fp, "%s stats:\n", perf_evsel__name(pos)); | ||
1385 | ret += events_stats__fprintf(&evsel__hists(pos)->stats, fp); | ||
1386 | } | ||
1387 | |||
1388 | return ret; | 1381 | return ret; |
1389 | } | 1382 | } |
1390 | 1383 | ||
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index ffb440462008..a4be851f1a90 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define __PERF_SESSION_H | 2 | #define __PERF_SESSION_H |
3 | 3 | ||
4 | #include "trace-event.h" | 4 | #include "trace-event.h" |
5 | #include "hist.h" | ||
6 | #include "event.h" | 5 | #include "event.h" |
7 | #include "header.h" | 6 | #include "header.h" |
8 | #include "machine.h" | 7 | #include "machine.h" |