Skip to contentSkip to conversation

perf evlist: Adopt events_stats from perf_session

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Feb 26, 2015 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  75be989a7a18e9666efd92b846ee48bed79e8086
Gitweb:     http://git.kernel.org/tip/75be989a7a18e9666efd92b846ee48bed79e8086
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Sat, 14 Feb 2015 14:50:11 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Sun, 22 Feb 2015 22:22:57 -0300

perf evlist: Adopt events_stats from perf_session

For tools that don't deal with perf.data files, thus do not need to use perf_session.

Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Don Zickus <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/builtin-sched.c |  6 +++---
 tools/perf/builtin-top.c   |  4 ++--
 tools/perf/util/evlist.h   |  1 +
 tools/perf/util/session.c  | 54 +++++++++++++++++++++++-----------------------
 tools/perf/util/session.h  |  1 -
 5 files changed, 33 insertions(+), 33 deletions(-)
tools/perf/builtin-sched.c +3 -3
index 891c393..7ce2966 100644
@@ -1473,9 +1473,9 @@ static int perf_sched__read_events(struct perf_sched *sched,
 			goto out_delete;
 		}
 
-		sched->nr_events      = session->stats.nr_events[0];
-		sched->nr_lost_events = session->stats.total_lost;
-		sched->nr_lost_chunks = session->stats.nr_events[PERF_RECORD_LOST];
+		sched->nr_events      = session->evlist->stats.nr_events[0];
+		sched->nr_lost_events = session->evlist->stats.total_lost;
+		sched->nr_lost_chunks = session->evlist->stats.nr_events[PERF_RECORD_LOST];
 	}
 
 	if (psession)
tools/perf/builtin-top.c +2 -2
index c4c7eac..5fb8723 100644
@@ -716,7 +716,7 @@ static void perf_event__process_sample(struct perf_tool *tool,
 
 	if (!machine) {
 		pr_err("%u unprocessable samples recorded.\r",
-		       top->session->stats.nr_unprocessable_samples++);
+		       top->session->evlist->stats.nr_unprocessable_samples++);
 		return;
 	}
 
@@ -856,7 +856,7 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
 			hists__inc_nr_events(evsel__hists(evsel), event->header.type);
 			machine__process_event(machine, event, &sample);
 		} else
-			++session->stats.nr_unknown_events;
+			++session->evlist->stats.nr_unknown_events;
 next_event:
 		perf_evlist__mmap_consume(top->evlist, idx);
 	}
tools/perf/util/evlist.h +1 -0
index c19ff45..d4768a3 100644
@@ -51,6 +51,7 @@ struct perf_evlist {
 	struct thread_map *threads;
 	struct cpu_map	  *cpus;
 	struct perf_evsel *selected;
+	struct events_stats stats;
 };
 
 struct perf_evsel_str_handler {
tools/perf/util/session.c +27 -27

130 lines not on this page · raw message

tools/perf/util/session.h +0 -1
index 6d663dc..fe859f3 100644
@@ -20,7 +20,6 @@ struct perf_session {
 	struct machines		machines;
 	struct perf_evlist	*evlist;
 	struct trace_event	tevent;
-	struct events_stats	stats;
 	bool			repipe;
 	bool			one_mmap;
 	void			*one_mmap_addr;