diff options
-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 | ||