linux-stable/tools/perf/util
Arnaldo Carvalho de Melo c5c584d2db perf maps: Do not use an rbtree to sort by map name
This is only used for the kernel maps, shave 24 bytes out 'struct map'
and just traverse the existing per ip rbtree to look for maps by name,
use a front end cache to reuse the last search if its the same name.

After this 'struct map' is down to just two cachelines:

  $ pahole -C map ~/bin/perf
  struct map {
  	union {
  		struct rb_node rb_node __attribute__((__aligned__(8))); /*     0    24 */
  		struct list_head node;                   /*     0    16 */
  	} __attribute__((__aligned__(8)));                                               /*     0    24 */
  	u64                        start;                /*    24     8 */
  	u64                        end;                  /*    32     8 */
  	_Bool                      erange_warned;        /*    40     1 */

  	/* XXX 3 bytes hole, try to pack */

  	u32                        priv;                 /*    44     4 */
  	u32                        prot;                 /*    48     4 */
  	u32                        flags;                /*    52     4 */
  	u64                        pgoff;                /*    56     8 */
  	/* --- cacheline 1 boundary (64 bytes) --- */
  	u64                        reloc;                /*    64     8 */
  	u32                        maj;                  /*    72     4 */
  	u32                        min;                  /*    76     4 */
  	u64                        ino;                  /*    80     8 */
  	u64                        ino_generation;       /*    88     8 */
  	u64                        (*map_ip)(struct map *, u64); /*    96     8 */
  	u64                        (*unmap_ip)(struct map *, u64); /*   104     8 */
  	struct dso *               dso;                  /*   112     8 */
  	refcount_t                 refcnt;               /*   120     4 */

  	/* size: 128, cachelines: 2, members: 17 */
  	/* sum members: 121, holes: 1, sum holes: 3 */
  	/* padding: 4 */
  	/* forced alignments: 1 */
  } __attribute__((__aligned__(8)));
  $

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-bvr8fqfgzxtgnhnwt5sssx5g@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-11-18 11:19:51 -03:00
..
c++
cs-etm-decoder
include
intel-pt-decoder
libunwind
scripting-engines perf callchain: Use 'struct map_symbol' in 'struct callchain_cursor_node' 2019-11-12 08:20:53 -03:00
annotate.c perf annotate: Stop using map->groups, use map_symbol->mg instead 2019-11-12 08:20:53 -03:00
annotate.h perf annotate: Pass a 'map_symbol' in places receiving a pair of 'map' and 'symbol' pointers 2019-11-12 08:20:53 -03:00
archinsn.h
arm-spe-pkt-decoder.c
arm-spe-pkt-decoder.h
arm-spe.c
arm-spe.h
auxtrace.c
auxtrace.h
block-info.c
block-info.h
block-range.c
block-range.h
bpf-event.c
bpf-event.h
bpf-loader.c
bpf-loader.h
bpf-prologue.c
bpf-prologue.h
bpf_map.c
bpf_map.h
branch.c
branch.h
Build
build-id.c
build-id.h
cache.h
cacheline.c
cacheline.h
call-path.c
call-path.h
callchain.c perf tools: Add a 'struct map_groups' pointer to 'struct map_symbol' 2019-11-12 08:20:53 -03:00
callchain.h perf callchain: Use 'struct map_symbol' in 'struct callchain_cursor_node' 2019-11-12 08:20:53 -03:00
cap.c
cap.h
cgroup.c
cgroup.h
cloexec.c
cloexec.h
color.c
color.h
color_config.c
comm.c
comm.h
compress.h
config.c
config.h
copyfile.c
copyfile.h
counts.c
counts.h
cpu-set-sched.h
cpumap.c
cpumap.h
cputopo.c
cputopo.h
cs-etm.c
cs-etm.h
data-convert-bt.c
data-convert-bt.h
data-convert.h
data.c
data.h
db-export.c perf callchain: Use 'struct map_symbol' in 'struct callchain_cursor_node' 2019-11-12 08:20:53 -03:00
db-export.h
debug.c perf tool: Provide an option to print perf_event_open args and return value 2019-11-12 08:32:27 -03:00
debug.h perf tool: Provide an option to print perf_event_open args and return value 2019-11-12 08:32:27 -03:00
demangle-java.c
demangle-java.h
demangle-rust.c
demangle-rust.h
dso.c
dso.h
dsos.c
dsos.h
dump-insn.c
dump-insn.h
dwarf-aux.c
dwarf-aux.h
dwarf-regs.c
env.c
env.h
event.c perf tools: Add map_groups to 'struct addr_location' 2019-11-12 08:20:53 -03:00
event.h
events_stats.h
evlist.c
evlist.h
evsel.c perf tool: Provide an option to print perf_event_open args and return value 2019-11-12 08:32:27 -03:00
evsel.h
evsel_config.h
evsel_fprintf.c perf callchain: Use 'struct map_symbol' in 'struct callchain_cursor_node' 2019-11-12 08:20:53 -03:00
evsel_fprintf.h
evswitch.c
evswitch.h
expr.h
expr.y
find-map.c
genelf.c
genelf.h
genelf_debug.c
generate-cmdlist.sh
get_current_dir_name.c
get_current_dir_name.h
group.h
header.c
header.h
help-unknown-cmd.c
help-unknown-cmd.h
hist.c perf tools: Add a 'struct map_groups' pointer to 'struct map_symbol' 2019-11-12 08:20:53 -03:00
hist.h
intel-bts.c
intel-bts.h
intel-pt.c
intel-pt.h
intlist.c
intlist.h
jit.h
jitdump.c
jitdump.h
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c
llvm-utils.h
lzma.c
machine.c perf tools: Add a 'struct map_groups' pointer to 'struct map_symbol' 2019-11-12 08:20:53 -03:00
machine.h
map.c perf maps: Do not use an rbtree to sort by map name 2019-11-18 11:19:51 -03:00
map.h perf maps: Do not use an rbtree to sort by map name 2019-11-18 11:19:51 -03:00
map_groups.h perf maps: Do not use an rbtree to sort by map name 2019-11-18 11:19:51 -03:00
map_symbol.h perf tools: Add a 'struct map_groups' pointer to 'struct map_symbol' 2019-11-12 08:20:53 -03:00
mem-events.c pref tools: Make 'struct addr_map_symbol' contain 'struct map_symbol' 2019-11-12 08:20:53 -03:00
mem-events.h
mem2node.c
mem2node.h
memswap.c
memswap.h
metricgroup.c
metricgroup.h
mmap.c
mmap.h
namespaces.c
namespaces.h
ordered-events.c
ordered-events.h
parse-branch-options.c
parse-branch-options.h
parse-events.c
parse-events.h
parse-events.l
parse-events.y perf parse: Use YYABORT to clear stack after failure, plugging leaks 2019-11-12 08:34:16 -03:00
parse-regs-options.c
parse-regs-options.h
path.c
path.h
perf-hooks-list.h
perf-hooks.c
perf-hooks.h
PERF-VERSION-GEN
perf_event_attr_fprintf.c
perf_regs.c
perf_regs.h
pmu.c
pmu.h
pmu.l
pmu.y
print_binary.c
print_binary.h
probe-event.c
probe-event.h
probe-file.c
probe-file.h
probe-finder.c
probe-finder.h
pstack.c
pstack.h
python-ext-sources
python.c perf tool: Provide an option to print perf_event_open args and return value 2019-11-12 08:32:27 -03:00
rb_resort.h
rblist.c
rblist.h
record.c
record.h
rlimit.c
rlimit.h
rwsem.c
rwsem.h
s390-cpumcf-kernel.h
s390-cpumsf-kernel.h
s390-cpumsf.c
s390-cpumsf.h
s390-sample-raw.c
sample-raw.c
sample-raw.h
session.c
session.h
setns.c
setup.py
smt.c
smt.h
sort.c pref tools: Make 'struct addr_map_symbol' contain 'struct map_symbol' 2019-11-12 08:20:53 -03:00
sort.h
spark.c
spark.h
srccode.c
srccode.h
srcline.c
srcline.h
stat-display.c
stat-shadow.c
stat.c
stat.h
strbuf.c
strbuf.h
strfilter.c
strfilter.h
string.c
string2.h
strlist.c
strlist.h
svghelper.c
svghelper.h
symbol-elf.c perf symbols: Stop using map->groups, we can use kmaps instead 2019-11-12 08:20:53 -03:00
symbol-minimal.c
symbol.c perf maps: Do not use an rbtree to sort by map name 2019-11-18 11:19:51 -03:00
symbol.h perf tools: Add map_groups to 'struct addr_location' 2019-11-12 08:20:53 -03:00
symbol_conf.h
symbol_fprintf.c
symsrc.h
synthetic-events.c
synthetic-events.h
syscalltbl.c
syscalltbl.h
target.c
target.h
term.c
term.h
thread-stack.c
thread-stack.h
thread.c
thread.h
thread_map.c
thread_map.h
time-utils.c
time-utils.h
tool.h
top.c
top.h
trace-event-info.c
trace-event-parse.c
trace-event-read.c
trace-event-scripting.c
trace-event.c
trace-event.h
trigger.h
tsc.c
tsc.h
units.c
units.h
unwind-libdw.c perf tools: Add a 'struct map_groups' pointer to 'struct map_symbol' 2019-11-12 08:20:53 -03:00
unwind-libdw.h
unwind-libunwind-local.c perf tools: Add a 'struct map_groups' pointer to 'struct map_symbol' 2019-11-12 08:20:53 -03:00
unwind-libunwind.c
unwind.h perf unwind: Use 'struct map_symbol' in 'struct unwind_entry' 2019-11-12 08:20:53 -03:00
usage.c
util.c
util.h
values.c
values.h
vdso.c
vdso.h
xyarray.c
zlib.c
zstd.c