aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-04-27 20:17:50 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-04-27 20:17:50 -0400
commit23346f21b277e3aae5e9989e711a11cbe8133a45 (patch)
tree21f11a72cf21d4eb3d824f46e274dc8f9815d749 /tools/perf/util/session.h
parent462b04e28a7ec1339c892117c3f20a40e55d0e83 (diff)
perf tools: Rename "kernel_info" to "machine"
struct kernel_info and kerninfo__ are too vague, what they really describe are machines, virtual ones or hosts. There are more changes to introduce helpers to shorten function calls and to make more clear what is really being done, but I left that for subsequent patches. Cc: Avi Kivity <avi@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Zhang, Yanmin <yanmin_zhang@linux.intel.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.h')
-rw-r--r--tools/perf/util/session.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 796e2291ebd..71252723a17 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -25,7 +25,7 @@ struct perf_session {
25 unsigned long mmap_window; 25 unsigned long mmap_window;
26 struct rb_root threads; 26 struct rb_root threads;
27 struct thread *last_match; 27 struct thread *last_match;
28 struct rb_root kerninfo_root; 28 struct rb_root machines;
29 struct events_stats events_stats; 29 struct events_stats events_stats;
30 struct rb_root stats_by_id; 30 struct rb_root stats_by_id;
31 unsigned long event_total[PERF_RECORD_MAX]; 31 unsigned long event_total[PERF_RECORD_MAX];
@@ -102,4 +102,29 @@ int perf_session__browse_hists(struct rb_root *hists, u64 nr_hists,
102 u64 session_total, const char *helpline, 102 u64 session_total, const char *helpline,
103 const char *input_name); 103 const char *input_name);
104#endif 104#endif
105
106static inline
107struct machine *perf_session__find_host_machine(struct perf_session *self)
108{
109 return machines__find_host(&self->machines);
110}
111
112static inline
113struct machine *perf_session__find_machine(struct perf_session *self, pid_t pid)
114{
115 return machines__find(&self->machines, pid);
116}
117
118static inline
119struct machine *perf_session__findnew_machine(struct perf_session *self, pid_t pid)
120{
121 return machines__findnew(&self->machines, pid);
122}
123
124static inline
125void perf_session__process_machines(struct perf_session *self,
126 machine__process_t process)
127{
128 return machines__process(&self->machines, process, self);
129}
105#endif /* __PERF_SESSION_H */ 130#endif /* __PERF_SESSION_H */