Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147357
b: refs/heads/master
c: b3828eb
h: refs/heads/master
i:
  147355: f6daace
v: v3
  • Loading branch information
Ingo Molnar committed Apr 9, 2009
1 parent 7508280 commit 100d57a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 888fcee066a2f4abd0d0bc9418c0535f9b01e6e5
refs/heads/master: b3828ebb3901adfe989d8d4157ed28247aeec132
17 changes: 12 additions & 5 deletions trunk/Documentation/perf_counter/perf-report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,17 @@ static std::multimap<int, std::string> rev_hist;

static std::string resolve_comm(int pid)
{
std::string comm = "<unknown>";
std::string comm;

std::map<int, std::string>::const_iterator ci = comms.find(pid);
if (ci != comms.end())
if (ci != comms.end()) {
comm = ci->second;
} else {
char pid_str[30];

sprintf(pid_str, ":%d", pid);
comm = pid_str;
}

return comm;
}
Expand Down Expand Up @@ -422,13 +429,13 @@ int main(int argc, char *argv[])
char output[1024];

if (event->header.misc & PERF_EVENT_MISC_KERNEL) {
level = "[kernel]";
level = " [k] ";
sym = resolve_kernel_symbol(event->ip.ip);
} else if (event->header.misc & PERF_EVENT_MISC_USER) {
level = "[ user ]";
level = " [.] ";
sym = resolve_user_symbol(event->ip.pid, event->ip.ip);
} else {
level = "[ hv ]";
level = " [H] ";
}
comm = resolve_comm(event->ip.pid);

Expand Down

0 comments on commit 100d57a

Please sign in to comment.