[tip:perfcounters/core] perf_counter tools: include PID in perf-report output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  9280c1799e3d2a0017dc90286ebd6732e9006f7b
Gitweb:     http://git.kernel.org/tip/9280c1799e3d2a0017dc90286ebd6732e9006f7b
Author:     Ingo Molnar <mingo@xxxxxxx>
AuthorDate: Thu, 9 Apr 2009 09:50:04 +0200
Committer:  Ingo Molnar <mingo@xxxxxxx>
CommitDate: Thu, 9 Apr 2009 09:50:04 +0200

perf_counter tools: include PID in perf-report output

It's handier than an <unknown> entry.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>


---
 Documentation/perf_counter/perf-report.cc |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/Documentation/perf_counter/perf-report.cc b/Documentation/perf_counter/perf-report.cc
index 09da0ba..990d04b 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;
 
 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, "<PID:%d>", pid);
+		comm = pid_str;
+	}
 
 	return comm;
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux