perf tools: struct thread has a tid not a pid
As evident from 'machine__process_fork_event()' and 'machine__process_exit_event()' the 'pid' member of struct thread is actually the tid. Rename 'pid' to 'tid' in struct thread accordingly. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1372944040-32690-13-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
27389d7823
commit
380512345e
@ -233,7 +233,7 @@ void machines__set_id_hdr_size(struct machines *machines, u16 id_hdr_size)
|
||||
return;
|
||||
}
|
||||
|
||||
static struct thread *__machine__findnew_thread(struct machine *machine, pid_t pid,
|
||||
static struct thread *__machine__findnew_thread(struct machine *machine, pid_t tid,
|
||||
bool create)
|
||||
{
|
||||
struct rb_node **p = &machine->threads.rb_node;
|
||||
@ -241,23 +241,23 @@ static struct thread *__machine__findnew_thread(struct machine *machine, pid_t p
|
||||
struct thread *th;
|
||||
|
||||
/*
|
||||
* Font-end cache - PID lookups come in blocks,
|
||||
* Front-end cache - TID lookups come in blocks,
|
||||
* so most of the time we dont have to look up
|
||||
* the full rbtree:
|
||||
*/
|
||||
if (machine->last_match && machine->last_match->pid == pid)
|
||||
if (machine->last_match && machine->last_match->tid == tid)
|
||||
return machine->last_match;
|
||||
|
||||
while (*p != NULL) {
|
||||
parent = *p;
|
||||
th = rb_entry(parent, struct thread, rb_node);
|
||||
|
||||
if (th->pid == pid) {
|
||||
if (th->tid == tid) {
|
||||
machine->last_match = th;
|
||||
return th;
|
||||
}
|
||||
|
||||
if (pid < th->pid)
|
||||
if (tid < th->tid)
|
||||
p = &(*p)->rb_left;
|
||||
else
|
||||
p = &(*p)->rb_right;
|
||||
@ -266,7 +266,7 @@ static struct thread *__machine__findnew_thread(struct machine *machine, pid_t p
|
||||
if (!create)
|
||||
return NULL;
|
||||
|
||||
th = thread__new(pid);
|
||||
th = thread__new(tid);
|
||||
if (th != NULL) {
|
||||
rb_link_node(&th->rb_node, parent, p);
|
||||
rb_insert_color(&th->rb_node, &machine->threads);
|
||||
@ -276,14 +276,14 @@ static struct thread *__machine__findnew_thread(struct machine *machine, pid_t p
|
||||
return th;
|
||||
}
|
||||
|
||||
struct thread *machine__findnew_thread(struct machine *machine, pid_t pid)
|
||||
struct thread *machine__findnew_thread(struct machine *machine, pid_t tid)
|
||||
{
|
||||
return __machine__findnew_thread(machine, pid, true);
|
||||
return __machine__findnew_thread(machine, tid, true);
|
||||
}
|
||||
|
||||
struct thread *machine__find_thread(struct machine *machine, pid_t pid)
|
||||
struct thread *machine__find_thread(struct machine *machine, pid_t tid)
|
||||
{
|
||||
return __machine__findnew_thread(machine, pid, false);
|
||||
return __machine__findnew_thread(machine, tid, false);
|
||||
}
|
||||
|
||||
int machine__process_comm_event(struct machine *machine, union perf_event *event)
|
||||
|
||||
Reference in New Issue
Block a user