diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2013-08-27 04:23:03 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-08-29 10:51:31 -0400 |
commit | 314add6b1f045b59ca39683bd0cbc5310cd203f2 (patch) | |
tree | e0583a022963b6e02b6f587db07f8b52985b4532 /tools/perf/util/build-id.c | |
parent | 00e4cb1ced1b17c35465defafe86d156cbd7544e (diff) |
perf tools: change machine__findnew_thread() to set thread pid
Add a new parameter for 'pid' to machine__findnew_thread().
Change callers to pass 'pid' when it is known.
Note that callers sometimes want to find the main thread
which has the memory maps. The main thread has tid == pid
so the usage in that case is:
machine__findnew_thread(machine, pid, pid)
whereas the usage to find the specific thread is:
machine__findnew_thread(machine, pid, tid)
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/1377591794-30553-2-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/build-id.c')
-rw-r--r-- | tools/perf/util/build-id.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index 5295625c0c00..0f9d27a6bc8f 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c | |||
@@ -24,7 +24,8 @@ int build_id__mark_dso_hit(struct perf_tool *tool __maybe_unused, | |||
24 | { | 24 | { |
25 | struct addr_location al; | 25 | struct addr_location al; |
26 | u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; | 26 | u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; |
27 | struct thread *thread = machine__findnew_thread(machine, event->ip.pid); | 27 | struct thread *thread = machine__findnew_thread(machine, event->ip.pid, |
28 | event->ip.pid); | ||
28 | 29 | ||
29 | if (thread == NULL) { | 30 | if (thread == NULL) { |
30 | pr_err("problem processing %d event, skipping it.\n", | 31 | pr_err("problem processing %d event, skipping it.\n", |
@@ -47,7 +48,9 @@ static int perf_event__exit_del_thread(struct perf_tool *tool __maybe_unused, | |||
47 | __maybe_unused, | 48 | __maybe_unused, |
48 | struct machine *machine) | 49 | struct machine *machine) |
49 | { | 50 | { |
50 | struct thread *thread = machine__findnew_thread(machine, event->fork.tid); | 51 | struct thread *thread = machine__findnew_thread(machine, |
52 | event->fork.pid, | ||
53 | event->fork.tid); | ||
51 | 54 | ||
52 | dump_printf("(%d:%d):(%d:%d)\n", event->fork.pid, event->fork.tid, | 55 | dump_printf("(%d:%d):(%d:%d)\n", event->fork.pid, event->fork.tid, |
53 | event->fork.ppid, event->fork.ptid); | 56 | event->fork.ppid, event->fork.ptid); |