perf session: Move threads to struct machine
The 'machine' abstraction was introduced with 'perf kvm' where we could have samples for the host and multiple guests, but at the time we ended up keeping the list of all machines threads all in session->host_machine. Move the threads rb_tree to struct machine to separate the namespaces. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> 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-mdg7sm6j3va09vtgj49gbsrp@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@ -61,7 +61,7 @@ static size_t thread__fprintf(struct thread *self, FILE *fp)
|
||||
map_groups__fprintf(&self->mg, verbose, fp);
|
||||
}
|
||||
|
||||
struct thread *perf_session__findnew(struct perf_session *self, pid_t pid)
|
||||
struct thread *machine__findnew_thread(struct machine *self, pid_t pid)
|
||||
{
|
||||
struct rb_node **p = &self->threads.rb_node;
|
||||
struct rb_node *parent = NULL;
|
||||
@ -125,12 +125,12 @@ int thread__fork(struct thread *self, struct thread *parent)
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t perf_session__fprintf(struct perf_session *self, FILE *fp)
|
||||
size_t machine__fprintf(struct machine *machine, FILE *fp)
|
||||
{
|
||||
size_t ret = 0;
|
||||
struct rb_node *nd;
|
||||
|
||||
for (nd = rb_first(&self->threads); nd; nd = rb_next(nd)) {
|
||||
for (nd = rb_first(&machine->threads); nd; nd = rb_next(nd)) {
|
||||
struct thread *pos = rb_entry(nd, struct thread, rb_node);
|
||||
|
||||
ret += thread__fprintf(pos, fp);
|
||||
|
Reference in New Issue
Block a user