Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1474555 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2016-09-01 18:50 +0200 |
| Last post | 2016-09-05 15:20 +0200 |
| Articles | 7 — 2 participants |
Back to article view | Back to linux.kernel
[GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-01 18:50 +0200
[PATCH 16/19] perf symbols: Fixup symbol sizes before picking best ones Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-01 18:50 +0200
[PATCH 08/19] perf probe: Show trace event definition Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-01 18:50 +0200
[PATCH 12/19] perf test vmlinux: Clarify which -v lines are errors or warning Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-01 18:50 +0200
[PATCH 13/19] perf test vmlinux: Avoid printing headers for empty lists Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-01 19:00 +0200
[PATCH 01/19] perf probe: Remove unused tracing_dir variable Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-01 19:00 +0200
Re: [GIT PULL 00/19] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-09-05 15:20 +0200
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-09-01 18:50 +0200 |
| Subject | [GIT PULL 00/19] perf/core improvements and fixes |
| Message-ID | <scDlD-4lf-5@gated-at.bofh.it> |
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit 36e674a05164cdbb9d4a5b1b0b279fabae6c13bd:
Merge tag 'perf-core-for-mingo-20160823' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-08-24 11:08:10 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160901
for you to fetch changes up to 6243b9dc4c991fe8bdc53a0e029908aef3ddb101:
perf probe: Move dwarf specific functions to dwarf-aux.c (2016-09-01 12:42:26 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
- Support generating cross arch probes, i.e. if you specify a vmlinux
file for different arch than the one in the host machine,
$ perf probe --definition function_name args
will generate the probe definition string needed to append to the
target machine /sys/kernel/debug/tracing/kprobes_events file, using
scripting (Masami Hiramatsu).
- Make 'perf probe' skip the function prologue in uprobes if program
compiled without optimization, using the same strategy as gdb and
systemtap uses, fixing a bug where:
$ perf probe -x ./test 'foo i'
When 'foo(42)' was used on the "./test" executable would produce i=0
instead of the expected i=42 (Ravi Bangoria)
- Demangle symbols for synthesized @plt entries too (Millian Wolff)
Documentation:
- Show default report configuration in 'perf config' example
and docs (Millian Wolff)
Infrastructure:
- Make 'perf test vmlinux' tolerate the symbol aliasing pruning done when
loading kallsyms and vmlinux (Arnaldo Carvalho de Melo)
- Improve output of 'perf test vmlinux' test, to help identify on the verbose
output which lines are warning and which are errors (Arnaldo Carvalho de Melo)
- Prep work to stop having to pass symbol_filter_t to lots of functions,
simplifying symtab loading routines (Arnaldo Carvalho de Melo)
- Honor symbol_conf.allow_aliases when loading kallsyms as well, it was using
it only when loading vmlinux files (Arnaldo Carvalho de Melo)
- Fixup symbol->end before doing alias pruning when loading symbol tables
(Arnaldo Carvalho de Melo)
- Fix error handling of lzma kernel module decompression (Shawn Lin)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (8):
perf annotate: Initialize the priv are in symbol__new()
perf symbols: Rename ->ignore to ->idle
perf probe: Do not use map_load filters for function
perf test vmlinux: Clarify which -v lines are errors or warning
perf test vmlinux: Avoid printing headers for empty lists
perf test vmlinux: Tolerate symbol aliases
perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too
perf symbols: Fixup symbol sizes before picking best ones
Masami Hiramatsu (5):
perf probe: Remove unused tracing_dir variable
perf probe: Show trace event definition
perf probe: Ignore vmlinux buildid if offline kernel is given
perf probe: Support probing on offline cross-arch binary
perf probe: Ignore vmlinux Build-id when offline vmlinux given
Milian Wolff (2):
perf symbols: Demangle symbols for synthesized @plt entries.
perf config: Show default report configuration in example and docs
Ravi Bangoria (3):
perf probe: Add helper function to check if probe with variable
perf uprobe: Skip prologue if program compiled without optimization
perf probe: Move dwarf specific functions to dwarf-aux.c
Shawn Lin (1):
perf tools: Fix error handling of lzma decompression
tools/perf/Documentation/perf-config.txt | 8 +
tools/perf/Documentation/perf-probe.txt | 9 ++
tools/perf/Documentation/perfconfig.example | 9 ++
tools/perf/arch/arm/include/dwarf-regs-table.h | 9 ++
tools/perf/arch/arm64/include/dwarf-regs-table.h | 13 ++
tools/perf/arch/powerpc/include/dwarf-regs-table.h | 27 ++++
tools/perf/arch/s390/include/dwarf-regs-table.h | 8 +
tools/perf/arch/sh/include/dwarf-regs-table.h | 25 +++
tools/perf/arch/sparc/include/dwarf-regs-table.h | 18 +++
tools/perf/arch/x86/include/dwarf-regs-table.h | 14 ++
tools/perf/arch/xtensa/include/dwarf-regs-table.h | 8 +
tools/perf/builtin-annotate.c | 7 +-
tools/perf/builtin-probe.c | 35 +++-
tools/perf/builtin-report.c | 6 +-
tools/perf/builtin-top.c | 8 +-
tools/perf/tests/vmlinux-kallsyms.c | 44 +++--
tools/perf/util/Build | 1 +
tools/perf/util/annotate.c | 7 -
tools/perf/util/annotate.h | 1 -
tools/perf/util/dwarf-aux.c | 179 +++++++++++++++++++++
tools/perf/util/dwarf-aux.h | 8 +
tools/perf/util/dwarf-regs.c | 59 +++++++
tools/perf/util/evsel_fprintf.c | 4 +-
tools/perf/util/include/dwarf-regs.h | 6 +
tools/perf/util/lzma.c | 15 +-
tools/perf/util/probe-event.c | 101 +++++++++---
tools/perf/util/probe-event.h | 3 +
tools/perf/util/probe-file.c | 5 +-
tools/perf/util/probe-finder.c | 60 +++++--
tools/perf/util/probe-finder.h | 1 +
tools/perf/util/symbol-elf.c | 86 ++++++----
tools/perf/util/symbol.c | 30 +++-
tools/perf/util/symbol.h | 5 +-
33 files changed, 698 insertions(+), 121 deletions(-)
create mode 100644 tools/perf/arch/arm/include/dwarf-regs-table.h
create mode 100644 tools/perf/arch/arm64/include/dwarf-regs-table.h
create mode 100644 tools/perf/arch/powerpc/include/dwarf-regs-table.h
create mode 100644 tools/perf/arch/s390/include/dwarf-regs-table.h
create mode 100644 tools/perf/arch/sh/include/dwarf-regs-table.h
create mode 100644 tools/perf/arch/sparc/include/dwarf-regs-table.h
create mode 100644 tools/perf/arch/x86/include/dwarf-regs-table.h
create mode 100644 tools/perf/arch/xtensa/include/dwarf-regs-table.h
create mode 100644 tools/perf/util/dwarf-regs.c
Build stats:
1 alpine:3.4: Ok
2 android-ndk:r12b-arm: Ok
3 archlinux:latest: Ok
4 centos:5: Ok
5 centos:6: Ok
6 centos:7: Ok
7 debian:7: Ok
8 debian:8: Ok
9 fedora:20: Ok
10 fedora:21: Ok
11 fedora:22: Ok
12 fedora:23: Ok
13 fedora:24: Ok
14 fedora:24-x-ARC-uClibc: Ok
15 fedora:rawhide: Ok
16 mageia:5: Ok
17 opensuse:13.2: Ok
18 opensuse:42.1: Ok
19 opensuse:tumbleweed: Ok
20 ubuntu:12.04.5: Ok
21 ubuntu:14.04.4: Ok
22 ubuntu:15.10: Ok
23 ubuntu:16.04: Ok
24 ubuntu:16.04-x-arm: Ok
25 ubuntu:16.04-x-arm64: Ok
26 ubuntu:16.04-x-powerpc64: Ok
27 ubuntu:16.04-x-powerpc64el: Ok
28 ubuntu:16.10: Ok
29 ubuntu:16.10-x-s390: Ok
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-09-01 18:50 +0200 |
| Subject | [PATCH 16/19] perf symbols: Fixup symbol sizes before picking best ones |
| Message-ID | <scDlE-4lf-51@gated-at.bofh.it> |
| In reply to | #1474555 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
When we call symbol__fixup_duplicate() we use algorithms to pick the
"best" symbols for cases where there are various functions/aliases to an
address, and those check zero size symbols, which, before calling
symbol__fixup_end() are _all_ symbols in a just parsed kallsyms file.
So first fixup the end, then fixup the duplicates.
Found while trying to figure out why 'perf test vmlinux' failed, see the
output of 'perf test -v vmlinux' to see cases where the symbols picked
as best for vmlinux don't match the ones picked for kallsyms.
Cc: Anton Blanchard <anton@samba.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 694bf407b061 ("perf symbols: Add some heuristics for choosing the best duplicate symbol")
Link: http://lkml.kernel.org/n/tip-rxqvdgr0mqjdxee0kf8i2ufn@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/symbol-elf.c | 2 +-
tools/perf/util/symbol.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 9ba6e49ead62..295d3147a803 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -1136,8 +1136,8 @@ new_symbol:
* For misannotated, zeroed, ASM function sizes.
*/
if (nr > 0) {
- symbols__fixup_duplicate(&dso->symbols[map->type]);
symbols__fixup_end(&dso->symbols[map->type]);
+ symbols__fixup_duplicate(&dso->symbols[map->type]);
if (kmap) {
/*
* We need to fixup this here too because we create new
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index ef2f913de662..98cd50384c32 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1243,8 +1243,8 @@ int __dso__load_kallsyms(struct dso *dso, const char *filename,
if (kallsyms__delta(map, filename, &delta))
return -1;
- symbols__fixup_duplicate(&dso->symbols[map->type]);
symbols__fixup_end(&dso->symbols[map->type]);
+ symbols__fixup_duplicate(&dso->symbols[map->type]);
if (dso->kernel == DSO_TYPE_GUEST_KERNEL)
dso->symtab_type = DSO_BINARY_TYPE__GUEST_KALLSYMS;
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-09-01 18:50 +0200 |
| Subject | [PATCH 08/19] perf probe: Show trace event definition |
| Message-ID | <scDlE-4lf-59@gated-at.bofh.it> |
| In reply to | #1474555 |
From: Masami Hiramatsu <mhiramat@kernel.org>
Add --definition/-D option for showing the trace-event definition in
stdout. This can be useful in debugging or combined with a shell script.
e.g.
----
# perf probe --definition 'do_sys_open $params'
p:probe/do_sys_open _text+2261728 dfd=%di:s32 filename=%si:u64 flags=%dx:s32 mode=%cx:u16
----
Suggested-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/147214226712.23638.2240534040014013658.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-probe.txt | 7 +++++
tools/perf/builtin-probe.c | 26 ++++++++++++++-----
tools/perf/util/probe-event.c | 46 +++++++++++++++++++++++++++++++++
tools/perf/util/probe-event.h | 1 +
4 files changed, 73 insertions(+), 7 deletions(-)
diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt
index f37d123d5dac..56db4d40d27e 100644
--- a/tools/perf/Documentation/perf-probe.txt
+++ b/tools/perf/Documentation/perf-probe.txt
@@ -21,6 +21,8 @@ or
'perf probe' [options] --vars='PROBEPOINT'
or
'perf probe' [options] --funcs
+or
+'perf probe' [options] --definition='PROBE' [...]
DESCRIPTION
-----------
@@ -96,6 +98,11 @@ OPTIONS
can also list functions in a user space executable / shared library.
This also can accept a FILTER rule argument.
+-D::
+--definition=::
+ Show trace-event definition converted from given probe-event instead
+ of write it into tracing/[k,u]probe_events.
+
--filter=FILTER::
(Only for --vars and --funcs) Set filter. FILTER is a combination of glob
pattern, see FILTER PATTERN for detail.
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index ee5b42173ba3..7a3d8c47ed29 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -326,6 +326,11 @@ static int perf_add_probe_events(struct perf_probe_event *pevs, int npevs)
if (ret < 0)
goto out_cleanup;
+ if (params.command == 'D') { /* it shows definition */
+ ret = show_probe_trace_events(pevs, npevs);
+ goto out_cleanup;
+ }
+
ret = apply_perf_probe_events(pevs, npevs);
if (ret < 0)
goto out_cleanup;
@@ -454,6 +459,14 @@ out:
return ret;
}
+#ifdef HAVE_DWARF_SUPPORT
+#define PROBEDEF_STR \
+ "[EVENT=]FUNC[@SRC][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT [[NAME=]ARG ...]"
+#else
+#define PROBEDEF_STR "[EVENT=]FUNC[+OFF|%return] [[NAME=]ARG ...]"
+#endif
+
+
static int
__cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
{
@@ -479,13 +492,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
opt_set_filter_with_command, DEFAULT_LIST_FILTER),
OPT_CALLBACK('d', "del", NULL, "[GROUP:]EVENT", "delete a probe event.",
opt_set_filter_with_command),
- OPT_CALLBACK('a', "add", NULL,
-#ifdef HAVE_DWARF_SUPPORT
- "[EVENT=]FUNC[@SRC][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT"
- " [[NAME=]ARG ...]",
-#else
- "[EVENT=]FUNC[+OFF|%return] [[NAME=]ARG ...]",
-#endif
+ OPT_CALLBACK('a', "add", NULL, PROBEDEF_STR,
"probe point definition, where\n"
"\t\tGROUP:\tGroup name (optional)\n"
"\t\tEVENT:\tEvent name\n"
@@ -503,6 +510,9 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
"\t\tARG:\tProbe argument (kprobe-tracer argument format.)\n",
#endif
opt_add_probe_event),
+ OPT_CALLBACK('D', "definition", NULL, PROBEDEF_STR,
+ "Show trace event definition of given traceevent for k/uprobe_events.",
+ opt_add_probe_event),
OPT_BOOLEAN('f', "force", &probe_conf.force_add, "forcibly add events"
" with existing name"),
OPT_CALLBACK('L', "line", NULL,
@@ -548,6 +558,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
set_option_flag(options, 'a', "add", PARSE_OPT_EXCLUSIVE);
set_option_flag(options, 'd', "del", PARSE_OPT_EXCLUSIVE);
+ set_option_flag(options, 'D', "definition", PARSE_OPT_EXCLUSIVE);
set_option_flag(options, 'l', "list", PARSE_OPT_EXCLUSIVE);
#ifdef HAVE_DWARF_SUPPORT
set_option_flag(options, 'L', "line", PARSE_OPT_EXCLUSIVE);
@@ -644,6 +655,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
}
break;
case 'a':
+ case 'D':
/* Ensure the last given target is used */
if (params.target && !params.target_used) {
pr_err(" Error: -x/-m must follow the probe definitions.\n");
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 0bed2ee16292..4a49cb8ce7ab 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -3207,6 +3207,52 @@ int convert_perf_probe_events(struct perf_probe_event *pevs, int npevs)
return 0;
}
+static int show_probe_trace_event(struct probe_trace_event *tev)
+{
+ char *buf = synthesize_probe_trace_command(tev);
+
+ if (!buf) {
+ pr_debug("Failed to synthesize probe trace event.\n");
+ return -EINVAL;
+ }
+
+ /* Showing definition always go stdout */
+ printf("%s\n", buf);
+ free(buf);
+
+ return 0;
+}
+
+int show_probe_trace_events(struct perf_probe_event *pevs, int npevs)
+{
+ struct strlist *namelist = strlist__new(NULL, NULL);
+ struct probe_trace_event *tev;
+ struct perf_probe_event *pev;
+ int i, j, ret = 0;
+
+ if (!namelist)
+ return -ENOMEM;
+
+ for (j = 0; j < npevs && !ret; j++) {
+ pev = &pevs[j];
+ for (i = 0; i < pev->ntevs && !ret; i++) {
+ tev = &pev->tevs[i];
+ /* Skip if the symbol is out of .text or blacklisted */
+ if (!tev->point.symbol && !pev->uprobes)
+ continue;
+
+ /* Set new name for tev (and update namelist) */
+ ret = probe_trace_event__set_name(tev, pev,
+ namelist, true);
+ if (!ret)
+ ret = show_probe_trace_event(tev);
+ }
+ }
+ strlist__delete(namelist);
+
+ return ret;
+}
+
int apply_perf_probe_events(struct perf_probe_event *pevs, int npevs)
{
int i, ret = 0;
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h
index f4f45db77c1c..62094082d940 100644
--- a/tools/perf/util/probe-event.h
+++ b/tools/perf/util/probe-event.h
@@ -147,6 +147,7 @@ int line_range__init(struct line_range *lr);
int add_perf_probe_events(struct perf_probe_event *pevs, int npevs);
int convert_perf_probe_events(struct perf_probe_event *pevs, int npevs);
int apply_perf_probe_events(struct perf_probe_event *pevs, int npevs);
+int show_probe_trace_events(struct perf_probe_event *pevs, int npevs);
void cleanup_perf_probe_events(struct perf_probe_event *pevs, int npevs);
int del_perf_probe_events(struct strfilter *filter);
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-09-01 18:50 +0200 |
| Subject | [PATCH 12/19] perf test vmlinux: Clarify which -v lines are errors or warning |
| Message-ID | <scDlE-4lf-61@gated-at.bofh.it> |
| In reply to | #1474555 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
When the 'perf test -v vmlinux' test fails, it is not clear which of the
lines are errors or warnings, clarify that adding ERR/WARN prefixes:
# perf test -F -v 1
1: vmlinux symtab matches kallsyms :
--- start ---
Looking at the vmlinux_path (8 entries long)
Using /lib/modules/4.8.0-rc4+/build/vmlinux for symbols
ERR : 0xffffffffb7001000: diff name v: xen_hypercall_set_trap_table k: hypercall_page
WARN: 0xffffffffb7077970: diff end addr for aesni_gcm_dec v: 0xffffffffb707a2f2 k: 0xffffffffb7077a02
WARN: 0xffffffffb707a300: diff end addr for aesni_gcm_enc v: 0xffffffffb707cc03 k: 0xffffffffb707a392
WARN: 0xffffffffb707f950: diff end addr for aesni_gcm_enc_avx_gen2 v: 0xffffffffb7084ef6 k: 0xffffffffb707f9c3
WARN: 0xffffffffb7084f00: diff end addr for aesni_gcm_dec_avx_gen2 v: 0xffffffffb708a691 k: 0xffffffffb7084f73
WARN: 0xffffffffb708aa10: diff end addr for aesni_gcm_enc_avx_gen4 v: 0xffffffffb708f844 k: 0xffffffffb708aa83
WARN: 0xffffffffb708f850: diff end addr for aesni_gcm_dec_avx_gen4 v: 0xffffffffb709486f k: 0xffffffffb708f8c3
ERR : 0xffffffffb71a6e50: diff name v: perf_pmu_commit_txn.part.98 k: perf_pmu_cancel_txn.part.97
ERR : 0xffffffffb752e480: diff name v: wakeup_expire_count_show.part.5 k: wakeup_active_count_show.part.7
ERR : 0xffffffffb76e8d00: diff name v: phys_switch_id_show.part.11 k: phys_port_name_show.part.12
WARN: Maps only in vmlinux:
ffffffffb7d7d000-ffffffffb7eeaac8 117d000 [kernel].init.text
ffffffffb7eeaac8-ffffffffc03ad000 12eaac8 [kernel].exit.text
WARN: Maps in vmlinux with a different name in kallsyms:
WARN: Maps only in kallsyms:
---- end ----
vmlinux symtab matches kallsyms: FAILED!
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-n5ml8m7y9x8kzvxt09ipku88@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/vmlinux-kallsyms.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index e63abab7d5a1..6bd5bf980de2 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -143,7 +143,7 @@ next_pair:
*/
s64 skew = mem_end - UM(pair->end);
if (llabs(skew) >= page_size)
- pr_debug("%#" PRIx64 ": diff end addr for %s v: %#" PRIx64 " k: %#" PRIx64 "\n",
+ pr_debug("WARN: %#" PRIx64 ": diff end addr for %s v: %#" PRIx64 " k: %#" PRIx64 "\n",
mem_start, sym->name, mem_end,
UM(pair->end));
@@ -161,15 +161,15 @@ next_pair:
if (UM(pair->start) == mem_start)
goto next_pair;
- pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n",
+ pr_debug("ERR : %#" PRIx64 ": diff name v: %s k: %s\n",
mem_start, sym->name, pair->name);
} else {
- pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n",
+ pr_debug("ERR : %#" PRIx64 ": diff name v: %s k: %s\n",
mem_start, sym->name, first_pair->name);
}
}
} else
- pr_debug("%#" PRIx64 ": %s not on kallsyms\n",
+ pr_debug("ERR : %#" PRIx64 ": %s not on kallsyms\n",
mem_start, sym->name);
err = -1;
@@ -178,7 +178,7 @@ next_pair:
if (!verbose)
goto out;
- pr_info("Maps only in vmlinux:\n");
+ pr_info("WARN: Maps only in vmlinux:\n");
for (map = maps__first(maps); map; map = map__next(map)) {
struct map *
@@ -198,7 +198,7 @@ next_pair:
map__fprintf(map, stderr);
}
- pr_info("Maps in vmlinux with a different name in kallsyms:\n");
+ pr_info("WARN: Maps in vmlinux with a different name in kallsyms:\n");
for (map = maps__first(maps); map; map = map__next(map)) {
struct map *pair;
@@ -212,17 +212,17 @@ next_pair:
if (pair->start == mem_start) {
pair->priv = 1;
- pr_info(" %" PRIx64 "-%" PRIx64 " %" PRIx64 " %s in kallsyms as",
+ pr_info("WARN: %" PRIx64 "-%" PRIx64 " %" PRIx64 " %s in kallsyms as",
map->start, map->end, map->pgoff, map->dso->name);
if (mem_end != pair->end)
- pr_info(":\n*%" PRIx64 "-%" PRIx64 " %" PRIx64,
+ pr_info(":\nWARN: *%" PRIx64 "-%" PRIx64 " %" PRIx64,
pair->start, pair->end, pair->pgoff);
pr_info(" %s\n", pair->dso->name);
pair->priv = 1;
}
}
- pr_info("Maps only in kallsyms:\n");
+ pr_info("WARN: Maps only in kallsyms:\n");
maps = &kallsyms.kmaps.maps[type];
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-09-01 19:00 +0200 |
| Subject | [PATCH 13/19] perf test vmlinux: Avoid printing headers for empty lists |
| Message-ID | <scDvj-4op-1@gated-at.bofh.it> |
| In reply to | #1474555 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Before:
# perf test -F -v 1
1: vmlinux symtab matches kallsyms:
--- start ---
<SNIP>
WARN: Maps only in vmlinux:
ffffffffb7d7d000-ffffffffb7eeaac8 117d000 [kernel].init.text
ffffffffb7eeaac8-ffffffffc03ad000 12eaac8 [kernel].exit.text
WARN: Maps in vmlinux with a different name in kallsyms:
WARN: Maps only in kallsyms:
---- end ----
vmlinux symtab matches kallsyms: Ok
#
The two last WARN lines are now suppressed, since there are no such
cases detected.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-9ww8uvzl682ykaw8ht1tozlr@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/vmlinux-kallsyms.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index 6bd5bf980de2..450f69960931 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -28,6 +28,7 @@ int test__vmlinux_matches_kallsyms(int subtest __maybe_unused)
enum map_type type = MAP__FUNCTION;
struct maps *maps = &vmlinux.kmaps.maps[type];
u64 mem_start, mem_end;
+ bool header_printed;
/*
* Step 1:
@@ -178,7 +179,7 @@ next_pair:
if (!verbose)
goto out;
- pr_info("WARN: Maps only in vmlinux:\n");
+ header_printed = false;
for (map = maps__first(maps); map; map = map__next(map)) {
struct map *
@@ -192,13 +193,18 @@ next_pair:
(map->dso->kernel ?
map->dso->short_name :
map->dso->name));
- if (pair)
+ if (pair) {
pair->priv = 1;
- else
+ } else {
+ if (!header_printed) {
+ pr_info("WARN: Maps only in vmlinux:\n");
+ header_printed = true;
+ }
map__fprintf(map, stderr);
+ }
}
- pr_info("WARN: Maps in vmlinux with a different name in kallsyms:\n");
+ header_printed = false;
for (map = maps__first(maps); map; map = map__next(map)) {
struct map *pair;
@@ -211,7 +217,11 @@ next_pair:
continue;
if (pair->start == mem_start) {
- pair->priv = 1;
+ if (!header_printed) {
+ pr_info("WARN: Maps in vmlinux with a different name in kallsyms:\n");
+ header_printed = true;
+ }
+
pr_info("WARN: %" PRIx64 "-%" PRIx64 " %" PRIx64 " %s in kallsyms as",
map->start, map->end, map->pgoff, map->dso->name);
if (mem_end != pair->end)
@@ -222,13 +232,18 @@ next_pair:
}
}
- pr_info("WARN: Maps only in kallsyms:\n");
+ header_printed = false;
maps = &kallsyms.kmaps.maps[type];
for (map = maps__first(maps); map; map = map__next(map)) {
- if (!map->priv)
+ if (!map->priv) {
+ if (!header_printed) {
+ pr_info("WARN: Maps only in kallsyms:\n");
+ header_printed = true;
+ }
map__fprintf(map, stderr);
+ }
}
out:
machine__exit(&kallsyms);
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-09-01 19:00 +0200 |
| Subject | [PATCH 01/19] perf probe: Remove unused tracing_dir variable |
| Message-ID | <scDvj-4op-7@gated-at.bofh.it> |
| In reply to | #1474555 |
From: Masami Hiramatsu <mhiramat@kernel.org>
Remove unused tracing_dir variable from open_probe_events().
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/147201827792.5713.4165387506020511920.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/probe-file.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 697ef66bff91..6f931e442f14 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -73,11 +73,10 @@ static void print_both_open_warning(int kerr, int uerr)
static int open_probe_events(const char *trace_file, bool readwrite)
{
char buf[PATH_MAX];
- const char *tracing_dir = "";
int ret;
- ret = e_snprintf(buf, PATH_MAX, "%s/%s%s",
- tracing_path, tracing_dir, trace_file);
+ ret = e_snprintf(buf, PATH_MAX, "%s/%s",
+ tracing_path, trace_file);
if (ret >= 0) {
pr_debug("Opening %s write=%d\n", buf, readwrite);
if (readwrite && !probe_event_dry_run)
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2016-09-05 15:20 +0200 |
| Message-ID | <se1YC-4eB-5@gated-at.bofh.it> |
| In reply to | #1474555 |
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 36e674a05164cdbb9d4a5b1b0b279fabae6c13bd: > > Merge tag 'perf-core-for-mingo-20160823' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-08-24 11:08:10 +0200) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160901 > > for you to fetch changes up to 6243b9dc4c991fe8bdc53a0e029908aef3ddb101: > > perf probe: Move dwarf specific functions to dwarf-aux.c (2016-09-01 12:42:26 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Support generating cross arch probes, i.e. if you specify a vmlinux > file for different arch than the one in the host machine, > > $ perf probe --definition function_name args > > will generate the probe definition string needed to append to the > target machine /sys/kernel/debug/tracing/kprobes_events file, using > scripting (Masami Hiramatsu). > > - Make 'perf probe' skip the function prologue in uprobes if program > compiled without optimization, using the same strategy as gdb and > systemtap uses, fixing a bug where: > > $ perf probe -x ./test 'foo i' > > When 'foo(42)' was used on the "./test" executable would produce i=0 > instead of the expected i=42 (Ravi Bangoria) > > - Demangle symbols for synthesized @plt entries too (Millian Wolff) > > Documentation: > > - Show default report configuration in 'perf config' example > and docs (Millian Wolff) > > Infrastructure: > > - Make 'perf test vmlinux' tolerate the symbol aliasing pruning done when > loading kallsyms and vmlinux (Arnaldo Carvalho de Melo) > > - Improve output of 'perf test vmlinux' test, to help identify on the verbose > output which lines are warning and which are errors (Arnaldo Carvalho de Melo) > > - Prep work to stop having to pass symbol_filter_t to lots of functions, > simplifying symtab loading routines (Arnaldo Carvalho de Melo) > > - Honor symbol_conf.allow_aliases when loading kallsyms as well, it was using > it only when loading vmlinux files (Arnaldo Carvalho de Melo) > > - Fixup symbol->end before doing alias pruning when loading symbol tables > (Arnaldo Carvalho de Melo) > > - Fix error handling of lzma kernel module decompression (Shawn Lin) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (8): > perf annotate: Initialize the priv are in symbol__new() > perf symbols: Rename ->ignore to ->idle > perf probe: Do not use map_load filters for function > perf test vmlinux: Clarify which -v lines are errors or warning > perf test vmlinux: Avoid printing headers for empty lists > perf test vmlinux: Tolerate symbol aliases > perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too > perf symbols: Fixup symbol sizes before picking best ones > > Masami Hiramatsu (5): > perf probe: Remove unused tracing_dir variable > perf probe: Show trace event definition > perf probe: Ignore vmlinux buildid if offline kernel is given > perf probe: Support probing on offline cross-arch binary > perf probe: Ignore vmlinux Build-id when offline vmlinux given > > Milian Wolff (2): > perf symbols: Demangle symbols for synthesized @plt entries. > perf config: Show default report configuration in example and docs > > Ravi Bangoria (3): > perf probe: Add helper function to check if probe with variable > perf uprobe: Skip prologue if program compiled without optimization > perf probe: Move dwarf specific functions to dwarf-aux.c > > Shawn Lin (1): > perf tools: Fix error handling of lzma decompression > > tools/perf/Documentation/perf-config.txt | 8 + > tools/perf/Documentation/perf-probe.txt | 9 ++ > tools/perf/Documentation/perfconfig.example | 9 ++ > tools/perf/arch/arm/include/dwarf-regs-table.h | 9 ++ > tools/perf/arch/arm64/include/dwarf-regs-table.h | 13 ++ > tools/perf/arch/powerpc/include/dwarf-regs-table.h | 27 ++++ > tools/perf/arch/s390/include/dwarf-regs-table.h | 8 + > tools/perf/arch/sh/include/dwarf-regs-table.h | 25 +++ > tools/perf/arch/sparc/include/dwarf-regs-table.h | 18 +++ > tools/perf/arch/x86/include/dwarf-regs-table.h | 14 ++ > tools/perf/arch/xtensa/include/dwarf-regs-table.h | 8 + > tools/perf/builtin-annotate.c | 7 +- > tools/perf/builtin-probe.c | 35 +++- > tools/perf/builtin-report.c | 6 +- > tools/perf/builtin-top.c | 8 +- > tools/perf/tests/vmlinux-kallsyms.c | 44 +++-- > tools/perf/util/Build | 1 + > tools/perf/util/annotate.c | 7 - > tools/perf/util/annotate.h | 1 - > tools/perf/util/dwarf-aux.c | 179 +++++++++++++++++++++ > tools/perf/util/dwarf-aux.h | 8 + > tools/perf/util/dwarf-regs.c | 59 +++++++ > tools/perf/util/evsel_fprintf.c | 4 +- > tools/perf/util/include/dwarf-regs.h | 6 + > tools/perf/util/lzma.c | 15 +- > tools/perf/util/probe-event.c | 101 +++++++++--- > tools/perf/util/probe-event.h | 3 + > tools/perf/util/probe-file.c | 5 +- > tools/perf/util/probe-finder.c | 60 +++++-- > tools/perf/util/probe-finder.h | 1 + > tools/perf/util/symbol-elf.c | 86 ++++++---- > tools/perf/util/symbol.c | 30 +++- > tools/perf/util/symbol.h | 5 +- > 33 files changed, 698 insertions(+), 121 deletions(-) > create mode 100644 tools/perf/arch/arm/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/arm64/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/powerpc/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/s390/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/sh/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/sparc/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/x86/include/dwarf-regs-table.h > create mode 100644 tools/perf/arch/xtensa/include/dwarf-regs-table.h > create mode 100644 tools/perf/util/dwarf-regs.c > > Build stats: > > 1 alpine:3.4: Ok > 2 android-ndk:r12b-arm: Ok > 3 archlinux:latest: Ok > 4 centos:5: Ok > 5 centos:6: Ok > 6 centos:7: Ok > 7 debian:7: Ok > 8 debian:8: Ok > 9 fedora:20: Ok > 10 fedora:21: Ok > 11 fedora:22: Ok > 12 fedora:23: Ok > 13 fedora:24: Ok > 14 fedora:24-x-ARC-uClibc: Ok > 15 fedora:rawhide: Ok > 16 mageia:5: Ok > 17 opensuse:13.2: Ok > 18 opensuse:42.1: Ok > 19 opensuse:tumbleweed: Ok > 20 ubuntu:12.04.5: Ok > 21 ubuntu:14.04.4: Ok > 22 ubuntu:15.10: Ok > 23 ubuntu:16.04: Ok > 24 ubuntu:16.04-x-arm: Ok > 25 ubuntu:16.04-x-arm64: Ok > 26 ubuntu:16.04-x-powerpc64: Ok > 27 ubuntu:16.04-x-powerpc64el: Ok > 28 ubuntu:16.10: Ok > 29 ubuntu:16.10-x-s390: Ok Pulled, thanks a lot Arnaldo! Ingo
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web