diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-11-19 16:26:19 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-11-19 19:09:26 +0100 |
commit | 99459a84d5870a88274b4f10bc85c3e39e1d642c (patch) | |
tree | 777a3e06a3f80e63216389d13b3d3f93e4afcbc2 /tools/perf/util/sort.c | |
parent | Merge tag 'perf-core-for-mingo-5.5-20191119' of git://git.kernel.org/pub/scm/... (diff) | |
download | linux-99459a84d5870a88274b4f10bc85c3e39e1d642c.tar.xz linux-99459a84d5870a88274b4f10bc85c3e39e1d642c.zip |
perf map: Move maj/min/ino/ino_generation to separate struct
And this patch highlights where these fields are being used: in the sort
order where it uses it to compare maps and classify samples taking into
account not just the DSO, but those DSO id fields.
I think these should be used to differentiate DSOs with the same name
but different 'struct dso_id' fields, i.e. these fields should move to
'struct dso' and then be used as part of the key when doing lookups for
DSOs, in addition to the DSO name.
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>
Link: https://lkml.kernel.org/n/tip-8v5isitqy0dup47nnwkpc80f@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/sort.c')
-rw-r--r-- | tools/perf/util/sort.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 6b626e6b111e..bc589438cd12 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -1212,17 +1212,17 @@ sort__dcacheline_cmp(struct hist_entry *left, struct hist_entry *right) if (!l_map) return -1; if (!r_map) return 1; - if (l_map->maj > r_map->maj) return -1; - if (l_map->maj < r_map->maj) return 1; + if (l_map->dso_id.maj > r_map->dso_id.maj) return -1; + if (l_map->dso_id.maj < r_map->dso_id.maj) return 1; - if (l_map->min > r_map->min) return -1; - if (l_map->min < r_map->min) return 1; + if (l_map->dso_id.min > r_map->dso_id.min) return -1; + if (l_map->dso_id.min < r_map->dso_id.min) return 1; - if (l_map->ino > r_map->ino) return -1; - if (l_map->ino < r_map->ino) return 1; + if (l_map->dso_id.ino > r_map->dso_id.ino) return -1; + if (l_map->dso_id.ino < r_map->dso_id.ino) return 1; - if (l_map->ino_generation > r_map->ino_generation) return -1; - if (l_map->ino_generation < r_map->ino_generation) return 1; + if (l_map->dso_id.ino_generation > r_map->dso_id.ino_generation) return -1; + if (l_map->dso_id.ino_generation < r_map->dso_id.ino_generation) return 1; /* * Addresses with no major/minor numbers are assumed to be @@ -1234,8 +1234,8 @@ sort__dcacheline_cmp(struct hist_entry *left, struct hist_entry *right) if ((left->cpumode != PERF_RECORD_MISC_KERNEL) && (!(l_map->flags & MAP_SHARED)) && - !l_map->maj && !l_map->min && !l_map->ino && - !l_map->ino_generation) { + !l_map->dso_id.maj && !l_map->dso_id.min && + !l_map->dso_id.ino && !l_map->dso_id.ino_generation) { /* userspace anonymous */ if (left->thread->pid_ > right->thread->pid_) return -1; @@ -1271,8 +1271,8 @@ static int hist_entry__dcacheline_snprintf(struct hist_entry *he, char *bf, if ((he->cpumode != PERF_RECORD_MISC_KERNEL) && map && !(map->prot & PROT_EXEC) && (map->flags & MAP_SHARED) && - (map->maj || map->min || map->ino || - map->ino_generation)) + (map->dso_id.maj || map->dso_id.min || + map->dso_id.ino || map->dso_id.ino_generation)) level = 's'; else if (!map) level = 'X'; |