public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] perf,tools: add processor socket info in hist_entry and addr_location
@ 2015-09-04 14:45 kan.liang
  2015-09-04 14:45 ` [PATCH 2/5] perf,tools: Support new sort type --socket kan.liang
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: kan.liang @ 2015-09-04 14:45 UTC (permalink / raw)
  To: acme; +Cc: jolsa, namhyung, adrian.hunter, eranian, ak, linux-kernel,
	Kan Liang

From: Kan Liang <kan.liang@intel.com>

Add processor socket id info in hist_entry and addr_location.
For perf report, the socket id info is from perf.data.
For others, the socket id info is from current system.

Signed-off-by: Kan Liang <kan.liang@intel.com>
---
 tools/perf/builtin-report.c | 4 ++++
 tools/perf/util/event.c     | 1 +
 tools/perf/util/hist.c      | 1 +
 tools/perf/util/sort.h      | 1 +
 tools/perf/util/symbol.h    | 1 +
 5 files changed, 8 insertions(+)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 62b285e..affd70d 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -149,6 +149,7 @@ static int process_sample_event(struct perf_tool *tool,
 		.add_entry_cb 		= hist_iter__report_callback,
 	};
 	int ret = 0;
+	struct perf_env *env = evsel->evlist->env;
 
 	if (perf_event__preprocess_sample(event, machine, &al, sample) < 0) {
 		pr_debug("problem processing %d event, skipping it.\n",
@@ -156,6 +157,9 @@ static int process_sample_event(struct perf_tool *tool,
 		return -1;
 	}
 
+	/* read socket id from perf.data for perf report */
+	al.socket = env->cpu[al.cpu].socket_id;
+
 	if (rep->hide_unresolved && al.sym == NULL)
 		goto out_put;
 
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 7ff6127..0bf8c98 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -1021,6 +1021,7 @@ int perf_event__preprocess_sample(const union perf_event *event,
 
 	al->sym = NULL;
 	al->cpu = sample->cpu;
+	al->socket = cpu_map__get_socket_id(al->cpu);
 
 	if (al->map) {
 		struct dso *dso = al->map->dso;
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 08b6cd9..80c4683 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -452,6 +452,7 @@ struct hist_entry *__hists__add_entry(struct hists *hists,
 			.map	= al->map,
 			.sym	= al->sym,
 		},
+		.socket	 = al->socket,
 		.cpu	 = al->cpu,
 		.cpumode = al->cpumode,
 		.ip	 = al->addr,
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 3c2a399..7cf1cf7 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -90,6 +90,7 @@ struct hist_entry {
 	struct comm		*comm;
 	u64			ip;
 	u64			transaction;
+	s32			socket;
 	s32			cpu;
 	u8			cpumode;
 
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 440ba8a..40073c6 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -191,6 +191,7 @@ struct addr_location {
 	u8	      filtered;
 	u8	      cpumode;
 	s32	      cpu;
+	s32	      socket;
 };
 
 struct symsrc {
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-09-15  7:06 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-04 14:45 [PATCH 1/5] perf,tools: add processor socket info in hist_entry and addr_location kan.liang
2015-09-04 14:45 ` [PATCH 2/5] perf,tools: Support new sort type --socket kan.liang
2015-09-04 22:41   ` Arnaldo Carvalho de Melo
2015-09-04 22:52     ` Arnaldo Carvalho de Melo
2015-09-04 23:06       ` Arnaldo Carvalho de Melo
2015-09-04 23:25         ` Arnaldo Carvalho de Melo
2015-09-04 23:26           ` Arnaldo Carvalho de Melo
2015-09-04 23:30             ` Arnaldo Carvalho de Melo
2015-09-15  7:05   ` [tip:perf/core] perf tools: Introduce new sort type "socket" for the processor socket tip-bot for Kan Liang
2015-09-04 14:45 ` [PATCH 3/5] perf,report: introduce socket-filter option kan.liang
2015-09-15  7:05   ` [tip:perf/core] perf report: Introduce --socket-filter option tip-bot for Kan Liang
2015-09-04 14:45 ` [PATCH 4/5] perf,tools: zoom in/out for processor socket kan.liang
2015-09-04 22:09   ` Andi Kleen
2015-09-15  7:06   ` [tip:perf/core] perf hists browser: Zoom in/ out " tip-bot for Kan Liang
2015-09-04 14:45 ` [PATCH 5/5] perf,test: test hists socket filter kan.liang
2015-09-15  7:06   ` [tip:perf/core] perf test: Add entry for " tip-bot for Kan Liang
2015-09-15  7:05 ` [tip:perf/core] perf tools: Add processor socket info to hist_entry and addr_location tip-bot for Kan Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox