mirror of https://github.com/torvalds/linux.git
The "address" member of "struct probe_trace_point" uses long data type.
If kernel is 64-bit and perf program is 32-bit, size of "address"
variable is 32 bits.
As a result, upper 32 bits of address read from kernel are truncated, an
error occurs during address comparison in kprobe_warn_out_range().
Before:
# perf probe -a schedule
schedule is out of .text, skip it.
Error: Failed to add events.
Solution:
Change data type of "address" variable to u64 and change corresponding
address printing and value assignment.
After:
# perf.new.new probe -a schedule
Added new event:
probe:schedule (on schedule)
You can now use it in all perf tools, such as:
perf record -e probe:schedule -aR sleep 1
# perf probe -l
probe:schedule (on schedule@kernel/sched/core.c)
# perf record -e probe:schedule -aR sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.156 MB perf.data (1366 samples) ]
# perf report --stdio
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 1K of event 'probe:schedule'
# Event count (approx.): 1366
#
# Overhead Command Shared Object Symbol
# ........ ............... ................. ............
#
6.22% migration/0 [kernel.kallsyms] [k] schedule
6.22% migration/1 [kernel.kallsyms] [k] schedule
6.22% migration/2 [kernel.kallsyms] [k] schedule
6.22% migration/3 [kernel.kallsyms] [k] schedule
6.15% migration/10 [kernel.kallsyms] [k] schedule
6.15% migration/11 [kernel.kallsyms] [k] schedule
6.15% migration/12 [kernel.kallsyms] [k] schedule
6.15% migration/13 [kernel.kallsyms] [k] schedule
6.15% migration/14 [kernel.kallsyms] [k] schedule
6.15% migration/15 [kernel.kallsyms] [k] schedule
6.15% migration/4 [kernel.kallsyms] [k] schedule
6.15% migration/5 [kernel.kallsyms] [k] schedule
6.15% migration/6 [kernel.kallsyms] [k] schedule
6.15% migration/7 [kernel.kallsyms] [k] schedule
6.15% migration/8 [kernel.kallsyms] [k] schedule
6.15% migration/9 [kernel.kallsyms] [k] schedule
0.22% rcu_sched [kernel.kallsyms] [k] schedule
...
#
# (Cannot load tips.txt file, please install perf!)
#
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jianlin Lv <jianlin.lv@arm.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Li Huafei <lihuafei1@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Link: http://lore.kernel.org/lkml/20210715063723.11926-1-yangjihong1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
||
|---|---|---|
| .. | ||
| arm-spe-decoder | ||
| bpf_skel | ||
| c++ | ||
| cs-etm-decoder | ||
| include | ||
| intel-pt-decoder | ||
| libunwind | ||
| scripting-engines | ||
| Build | ||
| PERF-VERSION-GEN | ||
| affinity.c | ||
| affinity.h | ||
| annotate.c | ||
| annotate.h | ||
| archinsn.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_counter.c | ||
| bpf_counter.h | ||
| bpf_counter_cgroup.c | ||
| bpf_map.c | ||
| bpf_map.h | ||
| branch.c | ||
| branch.h | ||
| build-id.c | ||
| build-id.h | ||
| cache.h | ||
| cacheline.c | ||
| cacheline.h | ||
| call-path.c | ||
| call-path.h | ||
| callchain.c | ||
| callchain.h | ||
| cap.c | ||
| cap.h | ||
| cgroup.c | ||
| cgroup.h | ||
| clockid.c | ||
| clockid.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-json.c | ||
| data-convert.h | ||
| data.c | ||
| data.h | ||
| db-export.c | ||
| db-export.h | ||
| debug.c | ||
| debug.h | ||
| demangle-java.c | ||
| demangle-java.h | ||
| demangle-ocaml.c | ||
| demangle-ocaml.h | ||
| demangle-rust.c | ||
| demangle-rust.h | ||
| dlfilter.c | ||
| dlfilter.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 | ||
| event.h | ||
| events_stats.h | ||
| evlist-hybrid.c | ||
| evlist-hybrid.h | ||
| evlist.c | ||
| evlist.h | ||
| evsel.c | ||
| evsel.h | ||
| evsel_config.h | ||
| evsel_fprintf.c | ||
| evsel_fprintf.h | ||
| evswitch.c | ||
| evswitch.h | ||
| expr.c | ||
| expr.h | ||
| expr.l | ||
| expr.y | ||
| find-map.c | ||
| fncache.c | ||
| fncache.h | ||
| genelf.c | ||
| genelf.h | ||
| genelf_debug.c | ||
| generate-cmdlist.sh | ||
| get_current_dir_name.c | ||
| get_current_dir_name.h | ||
| hashmap.c | ||
| hashmap.h | ||
| header.c | ||
| header.h | ||
| help-unknown-cmd.c | ||
| help-unknown-cmd.h | ||
| hist.c | ||
| hist.h | ||
| intel-bts.c | ||
| intel-bts.h | ||
| intel-pt.c | ||
| intel-pt.h | ||
| intlist.c | ||
| intlist.h | ||
| iostat.c | ||
| iostat.h | ||
| jit.h | ||
| jitdump.c | ||
| jitdump.h | ||
| kvm-stat.h | ||
| levenshtein.c | ||
| levenshtein.h | ||
| llvm-utils.c | ||
| llvm-utils.h | ||
| lzma.c | ||
| machine.c | ||
| machine.h | ||
| map.c | ||
| map.h | ||
| map_symbol.h | ||
| maps.h | ||
| mem-events.c | ||
| 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-hybrid.c | ||
| parse-events-hybrid.h | ||
| parse-events.c | ||
| parse-events.h | ||
| parse-events.l | ||
| parse-events.y | ||
| parse-regs-options.c | ||
| parse-regs-options.h | ||
| parse-sublevel-options.c | ||
| parse-sublevel-options.h | ||
| path.c | ||
| path.h | ||
| perf-hooks-list.h | ||
| perf-hooks.c | ||
| perf-hooks.h | ||
| perf_api_probe.c | ||
| perf_api_probe.h | ||
| perf_dlfilter.h | ||
| perf_event_attr_fprintf.c | ||
| perf_regs.c | ||
| perf_regs.h | ||
| pfm.c | ||
| pfm.h | ||
| pmu-hybrid.c | ||
| pmu-hybrid.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 | ||
| 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 | ||
| sideband_evlist.c | ||
| smt.c | ||
| smt.h | ||
| sort.c | ||
| 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 | ||
| stream.c | ||
| stream.h | ||
| strfilter.c | ||
| strfilter.h | ||
| string.c | ||
| string2.h | ||
| strlist.c | ||
| strlist.h | ||
| svghelper.c | ||
| svghelper.h | ||
| symbol-elf.c | ||
| symbol-minimal.c | ||
| symbol.c | ||
| symbol.h | ||
| 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 | ||
| topdown.c | ||
| topdown.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 | ||
| unwind-libdw.h | ||
| unwind-libunwind-local.c | ||
| unwind-libunwind.c | ||
| unwind.h | ||
| usage.c | ||
| util.c | ||
| util.h | ||
| values.c | ||
| values.h | ||
| vdso.c | ||
| vdso.h | ||
| zlib.c | ||
| zstd.c | ||