]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
perf tools: Add processor socket info to hist_entry and addr_location
authorKan Liang <kan.liang@intel.com>
Fri, 4 Sep 2015 14:45:42 +0000 (10:45 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 14 Sep 2015 15:50:29 +0000 (12:50 -0300)
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 <kan.liang@intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1441377946-44429-1-git-send-email-kan.liang@intel.com
[ Don't blindly use env->cpu[al.cpu].socket_id & use machine->env, fixes by Jiri & Arnaldo ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/event.c
tools/perf/util/hist.c
tools/perf/util/sort.h
tools/perf/util/symbol.h

index 7ff61274ed57f5219416c69767fac9acca21e091..497157affc9c2f6646695478aff9a3f69ea0ec2d 100644 (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;
index 48d5906a3f9f9c36c51372b956e8f12a0009c63d..d2b94c4c8fec3f8a996a1f4dd55137badea3a85b 100644 (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,
index 3c2a399f8f5b9ca093efe7afac24e9034376310b..7cf1cf7d2406d2904da9d6dbf9c2b752cab9bec6 100644 (file)
@@ -90,6 +90,7 @@ struct hist_entry {
        struct comm             *comm;
        u64                     ip;
        u64                     transaction;
+       s32                     socket;
        s32                     cpu;
        u8                      cpumode;
 
index 440ba8ae888f0a2fcbc91cb67a85a206bb7ca1c1..40073c60b83d6b7e91fe2e3208f50210cf61f6ce 100644 (file)
@@ -191,6 +191,7 @@ struct addr_location {
        u8            filtered;
        u8            cpumode;
        s32           cpu;
+       s32           socket;
 };
 
 struct symsrc {