diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2013-07-04 09:20:31 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-07-12 12:53:50 -0400 |
commit | 380512345e13c3af64e59627f1b993c4faa94a84 (patch) | |
tree | d8ea8dbe6602f88fa83b8f2b388a8dd636a68b5c /tools/perf/util/machine.c | |
parent | 27389d7823f573be8eaff32fb4abe564e181eb71 (diff) |
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>
Diffstat (limited to 'tools/perf/util/machine.c')
-rw-r--r-- | tools/perf/util/machine.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 93527afb09d5..5dd5026a82ef 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -233,7 +233,7 @@ void machines__set_id_hdr_size(struct machines *machines, u16 id_hdr_size) | |||
233 | return; | 233 | return; |
234 | } | 234 | } |
235 | 235 | ||
236 | static struct thread *__machine__findnew_thread(struct machine *machine, pid_t pid, | 236 | static struct thread *__machine__findnew_thread(struct machine *machine, pid_t tid, |
237 | bool create) | 237 | bool create) |
238 | { | 238 | { |
239 | struct rb_node **p = &machine->threads.rb_node; | 239 | struct rb_node **p = &machine->threads.rb_node; |
@@ -241,23 +241,23 @@ static struct thread *__machine__findnew_thread(struct machine *machine, pid_t p | |||
241 | struct thread *th; | 241 | struct thread *th; |
242 | 242 | ||
243 | /* | 243 | /* |
244 | * Font-end cache - PID lookups come in blocks, | 244 | * Front-end cache - TID lookups come in blocks, |
245 | * so most of the time we dont have to look up | 245 | * so most of the time we dont have to look up |
246 | * the full rbtree: | 246 | * the full rbtree: |
247 | */ | 247 | */ |
248 | if (machine->last_match && machine->last_match->pid == pid) | 248 | if (machine->last_match && machine->last_match->tid == tid) |
249 | return machine->last_match; | 249 | return machine->last_match; |
250 | 250 | ||
251 | while (*p != NULL) { | 251 | while (*p != NULL) { |
252 | parent = *p; | 252 | parent = *p; |
253 | th = rb_entry(parent, struct thread, rb_node); | 253 | th = rb_entry(parent, struct thread, rb_node); |
254 | 254 | ||
255 | if (th->pid == pid) { | 255 | if (th->tid == tid) { |
256 | machine->last_match = th; | 256 | machine->last_match = th; |
257 | return th; | 257 | return th; |
258 | } | 258 | } |
259 | 259 | ||
260 | if (pid < th->pid) | 260 | if (tid < th->tid) |
261 | p = &(*p)->rb_left; | 261 | p = &(*p)->rb_left; |
262 | else | 262 | else |
263 | p = &(*p)->rb_right; | 263 | p = &(*p)->rb_right; |
@@ -266,7 +266,7 @@ static struct thread *__machine__findnew_thread(struct machine *machine, pid_t p | |||
266 | if (!create) | 266 | if (!create) |
267 | return NULL; | 267 | return NULL; |
268 | 268 | ||
269 | th = thread__new(pid); | 269 | th = thread__new(tid); |
270 | if (th != NULL) { | 270 | if (th != NULL) { |
271 | rb_link_node(&th->rb_node, parent, p); | 271 | rb_link_node(&th->rb_node, parent, p); |
272 | rb_insert_color(&th->rb_node, &machine->threads); | 272 | rb_insert_color(&th->rb_node, &machine->threads); |
@@ -276,14 +276,14 @@ static struct thread *__machine__findnew_thread(struct machine *machine, pid_t p | |||
276 | return th; | 276 | return th; |
277 | } | 277 | } |
278 | 278 | ||
279 | struct thread *machine__findnew_thread(struct machine *machine, pid_t pid) | 279 | struct thread *machine__findnew_thread(struct machine *machine, pid_t tid) |
280 | { | 280 | { |
281 | return __machine__findnew_thread(machine, pid, true); | 281 | return __machine__findnew_thread(machine, tid, true); |
282 | } | 282 | } |
283 | 283 | ||
284 | struct thread *machine__find_thread(struct machine *machine, pid_t pid) | 284 | struct thread *machine__find_thread(struct machine *machine, pid_t tid) |
285 | { | 285 | { |
286 | return __machine__findnew_thread(machine, pid, false); | 286 | return __machine__findnew_thread(machine, tid, false); |
287 | } | 287 | } |
288 | 288 | ||
289 | int machine__process_comm_event(struct machine *machine, union perf_event *event) | 289 | int machine__process_comm_event(struct machine *machine, union perf_event *event) |