perf tools: Add processor socket info to hist_entry and addr_location

This information will come from perf.data files of from the current
system, cached when needed, such as when the 'socket' sort order gets
introduced.

Signed-off-by: Kan Liang <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Wang Nan <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
[ Don't blindly use env->cpu[al.cpu].socket_id & use machine->env, fixes by Jiri & Arnaldo ]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
Kan Liang authored and Arnaldo Carvalho de Melo committed 2015-09-14 12:50:29 -03:00
1 parent 4cde998d20
commit 0c4c4debb0
4 files changed
+11

No files matched your search

+8
View File
@@ -1021,6 +1021,14 @@ int perf_event__preprocess_sample(const union perf_event *event,
al->sym = NULL;
al->cpu = sample->cpu;
al->socket = -1;
if (al->cpu >= 0) {
struct perf_env *env = machine->env;
if (env && env->cpu)
al->socket = env->cpu[al->cpu].socket_id;
}
if (al->map) {
struct dso *dso = al->map->dso;
+1
View File
@@ -453,6 +453,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,
+1
View File
@@ -90,6 +90,7 @@ struct hist_entry {
struct comm *comm;
u64 ip;
u64 transaction;
s32 socket;
s32 cpu;
u8 cpumode;
+1
View File
@@ -191,6 +191,7 @@ struct addr_location {
u8 filtered;
u8 cpumode;
s32 cpu;
s32 socket;
};
struct symsrc {