linux-bl808/tools/perf/util
Arnaldo Carvalho de Melo 4b1303d0b0 perf symbols: Accept zero as the kernel base address
Which is the case in S/390, where symbols were not being resolved
because machine__get_kernel_start was only setting machine->kernel_start
when the just successfully loaded kernel symtab had its map->start set
to !0, when it was left at (1ULL << 63) assuming a partitioning of the
address space for user/kernel, which is not the case in S/390 nor in
Sparc.

So just check if map__load() was successfull and set
machine->kernel_start to zero, fixing kernel symbol resolution on S/390.

Test performed by Thomas:

 ----

  I like this patch. I have done a new build and removed all my debug output to start
  from scratch. Without your patch I get this:

  # Samples: 4  of event 'cpu-clock'
  # Event count (approx.): 1000000
  #
  # Children      Self  Command  Shared Object     Symbol
  # ........  ........  .......  ................  ........................
      75.00%     0.00%  true     [unknown]         [k] 0x00000000004bedda
              |
              ---0x4bedda
                 |
                 |--50.00%--0x42693a
                 |          |
                 |           --25.00%--0x2a72e0
                 |                     0x2af0ca
                 |                     0x3d1003fe4c0
                 |
                  --25.00%--0x4272bc
                            0x26fa84

  and with your patch (I just rebuilt the perf tool, nothing else and used the same
  perf.data file as input):

  # Samples: 4  of event 'cpu-clock'
  # Event count (approx.): 1000000
  #
  # Children      Self  Command  Shared Object               Symbol
  # ........  ........  .......  ..........................  ..................................
      75.00%     0.00%  true     [kernel.vmlinux]            [k] pgm_check_handler
              |
              ---pgm_check_handler
                 do_dat_exception
                 handle_mm_fault
                 __handle_mm_fault
                 filemap_map_pages
                 |
                 |--25.00%--rcu_read_lock_held
                 |          rcu_lockdep_current_cpu_online
                 |          0x3d1003ff4c0
                 |
                  --25.00%--lock_release

  Looks good to me....
 ----

Reported-and-Tested-by: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Zvonko Kosic <zvonko.kosic@de.ibm.com>
Link: http://lkml.kernel.org/n/tip-dk0n1uzmbe0tbthrpfqlx6bz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-07-12 11:47:05 -03:00
..
c++
include
intel-pt-decoder perf intel-pt: Do not use TSC packets for calculating CPU cycles to TSC 2017-06-30 11:50:55 -03:00
libunwind
scripting-engines tools: Adopt __noreturn from kernel sources 2017-06-19 15:14:58 -03:00
annotate.c perf annotate: Return arch from symbol__disassemble() and save it in browser 2017-06-19 15:27:09 -03:00
annotate.h perf annotate: Return arch from symbol__disassemble() and save it in browser 2017-06-19 15:27:09 -03:00
auxtrace.c perf auxtrace: Add CPU filter support 2017-06-30 11:50:55 -03:00
auxtrace.h perf auxtrace: Add CPU filter support 2017-06-30 11:50:55 -03:00
block-range.c
block-range.h
bpf-loader.c
bpf-loader.h
bpf-prologue.c
bpf-prologue.h
Build perf memswap: Split the byteswap memory range wrappers from util.[ch] 2017-04-25 15:45:35 -03:00
build-id.c perf symbols: Kill dso__build_id_is_kmod() 2017-06-08 15:39:34 -03:00
build-id.h perf symbols: Kill dso__build_id_is_kmod() 2017-06-08 15:39:34 -03:00
cache.h tools: Adopt __printf from kernel sources 2017-06-19 15:25:26 -03:00
call-path.c
call-path.h
callchain.c perf report: Don't crash on invalid maps in -g srcline mode 2017-05-24 08:41:47 +02:00
callchain.h
cgroup.c
cgroup.h
cloexec.c
cloexec.h
color.c
color.h perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
comm.c perf tools: Remove string.h from util.h 2017-04-24 13:43:32 -03:00
comm.h
compress.h
config.c perf config: Do not die when parsing u64 or int config values 2017-06-27 11:44:58 -03:00
config.h perf config: Do not die when parsing u64 or int config values 2017-06-27 11:44:58 -03:00
counts.c
counts.h
cpumap.c
cpumap.h
cs-etm.h
ctype.c
data-convert-bt.c perf config: Do not die when parsing u64 or int config values 2017-06-27 11:44:58 -03:00
data-convert-bt.h
data-convert.h
data.c
data.h
db-export.c
db-export.h
debug.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
debug.h tools: Adopt __printf from kernel sources 2017-06-19 15:25:26 -03:00
demangle-java.c
demangle-java.h
demangle-rust.c
demangle-rust.h
drv_configs.c
drv_configs.h
dso.c perf tools: Consolidate error path in __open_dso() 2017-06-08 15:39:13 -03:00
dso.h perf tools: Introduce dso__decompress_kmodule_{fd,path} 2017-06-08 15:38:55 -03:00
dump-insn.c
dump-insn.h
dwarf-aux.c
dwarf-aux.h
dwarf-regs.c
env.c
env.h
event.c perf symbols: Accept symbols starting at address 0 2017-05-02 18:23:04 -03:00
event.h perf script: Add synthesized Intel PT power and ptwrite events 2017-06-30 11:40:20 -03:00
evlist.c perf tools: Remove sys/ioctl.h from util.h 2017-04-24 13:43:32 -03:00
evlist.h tools: Adopt __aligned from kernel sources 2017-06-19 15:27:08 -03:00
evsel.c perf evsel: State in the default event name if attr.exclude_kernel is set 2017-07-10 16:19:25 -03:00
evsel.h
evsel_fprintf.c perf script: Add --inline option for debugging 2017-05-24 08:41:48 +02:00
expr.h
expr.y
find-vdso-map.c
genelf.c
genelf.h
genelf_debug.c tools: Adopt __packed from kernel sources 2017-06-19 15:27:07 -03:00
generate-cmdlist.sh
group.h
header.c perf tools: Use __maybe_unused consistently 2017-06-19 15:27:06 -03:00
header.h
help-unknown-cmd.c perf config: Do not die when parsing u64 or int config values 2017-06-27 11:44:58 -03:00
help-unknown-cmd.h
hist.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
hist.h
intel-bts.c perf intel-pt/bts: Remove unused SAMPLE_SIZE defines and bts priv array 2017-06-19 15:27:09 -03:00
intel-bts.h
intel-pt.c perf intel-pt: Synthesize new power and "ptwrite" events 2017-06-30 11:48:28 -03:00
intel-pt.h
intlist.c
intlist.h
jit.h
jitdump.c
jitdump.h
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
llvm-utils.h
lzma.c
machine.c perf symbols: Accept zero as the kernel base address 2017-07-12 11:47:05 -03:00
machine.h
map.c perf symbols: Allow user probes on versioned symbols 2017-05-02 18:23:11 -03:00
map.h perf symbols: Allow user probes on versioned symbols 2017-05-02 18:23:11 -03:00
mem-events.c
mem-events.h
memswap.c perf memswap: Split the byteswap memory range wrappers from util.[ch] 2017-04-25 15:45:35 -03:00
memswap.h perf memswap: Split the byteswap memory range wrappers from util.[ch] 2017-04-25 15:45:35 -03:00
namespaces.c perf tools: Remove string.h from util.h 2017-04-24 13:43:32 -03:00
namespaces.h
ordered-events.c
ordered-events.h
parse-branch-options.c
parse-branch-options.h
parse-events.c perf tools: Remove sys/ioctl.h from util.h 2017-04-24 13:43:32 -03:00
parse-events.h
parse-events.l
parse-events.y
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_regs.c
perf_regs.h
pmu.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
pmu.h tools: Adopt __scanf from kernel sources 2017-06-19 15:27:05 -03:00
pmu.l
pmu.y
print_binary.c
print_binary.h
probe-event.c perf probe: Fix probe definition for inlined functions 2017-06-22 16:08:09 -03:00
probe-event.h tools: Adopt __printf from kernel sources 2017-06-19 15:25:26 -03:00
probe-file.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
probe-file.h
probe-finder.c
probe-finder.h
pstack.c
pstack.h
python-ext-sources
python.c
quote.c
quote.h
rb_resort.h
rblist.c
rblist.h
record.c
sane_ctype.h
session.c perf tools: Fix message because cpu list option is -C not -c 2017-06-21 11:35:53 -03:00
session.h perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
setup.py
sort.c perf tools: Replace error() with pr_err() 2017-06-27 11:22:31 -03:00
sort.h perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
srcline.c perf report: Do not drop last inlined frame 2017-05-24 08:41:48 +02:00
srcline.h
stat-shadow.c perf stat: Add support to measure SMI cost 2017-06-21 11:35:35 -03:00
stat.c perf stat: Add support to measure SMI cost 2017-06-21 11:35:35 -03:00
stat.h perf stat: Add support to measure SMI cost 2017-06-21 11:35:35 -03:00
strbuf.c tools lib string: Adopt prefixcmp() from perf and subcmd 2017-04-26 15:49:21 -03:00
strbuf.h tools: Adopt __printf from kernel sources 2017-06-19 15:25:26 -03:00
strfilter.c
strfilter.h
string.c
string2.h
strlist.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
strlist.h
svghelper.c
svghelper.h
symbol-elf.c perf symbols: Keep DSO->symtab_type after decompress 2017-06-08 15:39:26 -03:00
symbol-minimal.c
symbol.c perf symbols: Kill dso__build_id_is_kmod() 2017-06-08 15:39:34 -03:00
symbol.h perf symbols: Allow user probes on versioned symbols 2017-05-02 18:23:11 -03:00
symbol_fprintf.c
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 perf tools: Remove sys/ioctl.h from util.h 2017-04-24 13:43:32 -03:00
trace-event-info.c
trace-event-parse.c perf event-parse: Use pr_warning() 2017-06-27 11:08:14 -03:00
trace-event-read.c
trace-event-scripting.c
trace-event.c
trace-event.h
trigger.h
tsc.c
tsc.h
units.c perf units: Move parse_tag_value() to units.[ch] 2017-04-26 15:40:31 -03:00
units.h perf units: Move parse_tag_value() to units.[ch] 2017-04-26 15:40:31 -03:00
unwind-libdw.c perf unwind: Report module before querying isactivation in dwfl unwind 2017-06-16 14:37:30 -03:00
unwind-libdw.h perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
unwind-libunwind-local.c perf report: Fix off-by-one for non-activation frames 2017-05-24 08:41:48 +02:00
unwind-libunwind.c perf unwind: Do not fail due to missing unwind support 2017-07-04 11:43:58 -03:00
unwind.h
usage.c perf tools: Kill die() 2017-06-27 11:49:13 -03:00
util-cxx.h
util.c perf tools: Do parameter validation earlier on fetch_kernel_version() 2017-06-20 12:19:16 -03:00
util.h perf tools: Replace error() with pr_err() 2017-06-27 11:22:31 -03:00
values.c
values.h
vdso.c
vdso.h
xyarray.c perf tools: Remove string.h from util.h 2017-04-24 13:43:32 -03:00
xyarray.h
zlib.c