Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf map: Improve map/unmap parameter names

The u64 values are either absolute or relative, try to hint better in
the parameter names.

Suggested-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Changbin Du <changbin.du@huawei.com>
Cc: Colin Ian King <colin.i.king@gmail.com>
Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
Cc: German Gomez <german.gomez@arm.com>
Cc: Guilherme Amadio <amadio@gentoo.org>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Li Dong <lidong@vivo.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Ming Wang <wangming01@loongson.cn>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Steinar H. Gunderson <sesse@google.com>
Cc: Vincent Whitchurch <vincent.whitchurch@axis.com>
Cc: Wenyu Liu <liuwenyu7@huawei.com>
Cc: Yang Jihong <yangjihong1@huawei.com>
Link: https://lore.kernel.org/r/20231207011722.1220634-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
5cc47ffb 67bc9934

+8 -8
+8 -8
tools/perf/util/map.h
··· 105 105 } 106 106 107 107 /* dso rip -> ip */ 108 - static inline u64 map__dso_unmap_ip(const struct map *map, u64 ip) 108 + static inline u64 map__dso_unmap_ip(const struct map *map, u64 rip) 109 109 { 110 - return ip + map__start(map) - map__pgoff(map); 110 + return rip + map__start(map) - map__pgoff(map); 111 111 } 112 112 113 - static inline u64 map__map_ip(const struct map *map, u64 ip) 113 + static inline u64 map__map_ip(const struct map *map, u64 ip_or_rip) 114 114 { 115 115 if ((RC_CHK_ACCESS(map)->mapping_type) == MAPPING_TYPE__DSO) 116 - return map__dso_map_ip(map, ip); 116 + return map__dso_map_ip(map, ip_or_rip); 117 117 else 118 - return ip; 118 + return ip_or_rip; 119 119 } 120 120 121 - static inline u64 map__unmap_ip(const struct map *map, u64 ip) 121 + static inline u64 map__unmap_ip(const struct map *map, u64 ip_or_rip) 122 122 { 123 123 if ((RC_CHK_ACCESS(map)->mapping_type) == MAPPING_TYPE__DSO) 124 - return map__dso_unmap_ip(map, ip); 124 + return map__dso_unmap_ip(map, ip_or_rip); 125 125 else 126 - return ip; 126 + return ip_or_rip; 127 127 } 128 128 129 129 /* rip/ip <-> addr suitable for passing to `objdump --start-address=` */