diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-09 03:50:04 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-09 04:01:38 -0400 |
commit | b3828ebb3901adfe989d8d4157ed28247aeec132 (patch) | |
tree | 0248af2c72bd6bc47b2cea01037304096065283b /Documentation | |
parent | 888fcee066a2f4abd0d0bc9418c0535f9b01e6e5 (diff) |
perf_counter tools: include PID in perf-report output, tweak user/kernel printut
It's handier than an <unknown> entry.
Also replace the kernel/user column with a more compact version:
0.52 cc1 [k] page_fault
0.57 :0 [k] _spin_lock
0.59 :7506 [.] <unknown>
0.69 as [.] /usr/bin/as: <unknown>
0.76 cc1 [.] /lib64/libc-2.8.so: _int_free
0.92 cc1 [k] clear_page_c
1.00 :7465 [.] <unknown>
1.43 cc1 [.] /lib64/libc-2.8.so: memset
1.86 cc1 [.] /lib64/libc-2.8.so: _int_malloc
70.33 cc1 [.] /usr/libexec/gcc/x86_64-redhat-linux/4.3.2/cc1: <unknown>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/perf_counter/perf-report.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Documentation/perf_counter/perf-report.cc b/Documentation/perf_counter/perf-report.cc index 09da0ba482cd..1727317352bf 100644 --- a/Documentation/perf_counter/perf-report.cc +++ b/Documentation/perf_counter/perf-report.cc | |||
@@ -277,10 +277,17 @@ static std::multimap<int, std::string> rev_hist; | |||
277 | 277 | ||
278 | static std::string resolve_comm(int pid) | 278 | static std::string resolve_comm(int pid) |
279 | { | 279 | { |
280 | std::string comm = "<unknown>"; | 280 | std::string comm; |
281 | |||
281 | std::map<int, std::string>::const_iterator ci = comms.find(pid); | 282 | std::map<int, std::string>::const_iterator ci = comms.find(pid); |
282 | if (ci != comms.end()) | 283 | if (ci != comms.end()) { |
283 | comm = ci->second; | 284 | comm = ci->second; |
285 | } else { | ||
286 | char pid_str[30]; | ||
287 | |||
288 | sprintf(pid_str, ":%d", pid); | ||
289 | comm = pid_str; | ||
290 | } | ||
284 | 291 | ||
285 | return comm; | 292 | return comm; |
286 | } | 293 | } |
@@ -422,13 +429,13 @@ more: | |||
422 | char output[1024]; | 429 | char output[1024]; |
423 | 430 | ||
424 | if (event->header.misc & PERF_EVENT_MISC_KERNEL) { | 431 | if (event->header.misc & PERF_EVENT_MISC_KERNEL) { |
425 | level = "[kernel]"; | 432 | level = " [k] "; |
426 | sym = resolve_kernel_symbol(event->ip.ip); | 433 | sym = resolve_kernel_symbol(event->ip.ip); |
427 | } else if (event->header.misc & PERF_EVENT_MISC_USER) { | 434 | } else if (event->header.misc & PERF_EVENT_MISC_USER) { |
428 | level = "[ user ]"; | 435 | level = " [.] "; |
429 | sym = resolve_user_symbol(event->ip.pid, event->ip.ip); | 436 | sym = resolve_user_symbol(event->ip.pid, event->ip.ip); |
430 | } else { | 437 | } else { |
431 | level = "[ hv ]"; | 438 | level = " [H] "; |
432 | } | 439 | } |
433 | comm = resolve_comm(event->ip.pid); | 440 | comm = resolve_comm(event->ip.pid); |
434 | 441 | ||