Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1376402 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2016-04-12 04:00 +0200 |
| Last post | 2016-04-13 09:10 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
[GIT PULL 00/19] perf/core improvements Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-12 04:00 +0200
[PATCH 15/19] perf evlist: Add (reset,set)_sample_bit methods Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-12 04:00 +0200
[PATCH 12/19] perf evsel: Introduce fprintf_callchain() method out of fprintf_sym() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-12 04:10 +0200
[PATCH 08/19] perf evsel: Allow specifying a file to output in perf_evsel__print_ip Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-12 04:10 +0200
Re: [GIT PULL 00/19] perf/core improvements Ingo Molnar <mingo@kernel.org> - 2016-04-13 09:10 +0200
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-04-12 04:00 +0200 |
| Subject | [GIT PULL 00/19] perf/core improvements |
| Message-ID | <rmVMt-7ps-3@gated-at.bofh.it> |
Hi Ingo,
Please consider pulling, tested with 'perf test', 'make -C tools/perf
build-test' and building on these userspaces, using docker:
# dm
alldeps-fedora-rawhide-minus-python-dev: Ok
alldeps-fedora-20: Ok
alldeps-ubuntu-12.04: Ok
minimal-debian-experimental-x-mips64: Ok
minimal-debian-experimental-x-mips64el: Ok
minimal-debian-experimental-x-mipsel: Ok
minimal-ubuntu-x-arm: Ok
minimal-ubuntu-x-arm64: Ok
minimal-ubuntu-x-ppc64: Ok
minimal-ubuntu-x-ppc64el: Ok
alldeps-debian: Ok
alldeps-mageia: Ok
alldeps-rhel7: Ok
alldeps-centos: Ok
alldeps-opensuse: Ok
alldeps-ubuntu: Ok
#
This is on top of my previous pull request, that is not yet
merged: perf-core-for-mingo-20160408.
Best regards,
- Arnaldo
The following changes since commit 99e87f7bb7268cf644add87130590966fd5d0d17:
perf symbols: Adjust symbol for shared objects (2016-04-08 09:58:15 -0300)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160411
for you to fetch changes up to 00768a2bd3245eace0690fcf2c02776a256b66d7:
perf trace: Print unresolved symbol names as addresses (2016-04-11 22:18:25 -0300)
----------------------------------------------------------------
perf/core improvements:
- Automagically create a 'bpf-output' event, easing the setup of BPF
C "scripts" that produce output via the perf ring buffer. Now it is
just a matter of calling any perf tool, such as 'trace', with a C
source file that references the __bpf_stdout__ output channel and
that channel will be created and connected to the script:
# trace -e nanosleep --event test_bpf_stdout.c usleep 1
0.013 ( 0.013 ms): usleep/2818 nanosleep(rqtp: 0x7ffcead45f40 ) ...
0.013 ( ): __bpf_stdout__:Raise a BPF event!..)
0.015 ( ): perf_bpf_probe:func_begin:(ffffffff81112460))
0.261 ( ): __bpf_stdout__:Raise a BPF event!..)
0.262 ( ): perf_bpf_probe:func_end:(ffffffff81112460 <- ffffffff81003d92))
0.264 ( 0.264 ms): usleep/2818 ... [continued]: nanosleep()) = 0
#
Further work is needed to reduce the number of lines in a perf bpf C source
file, this being the part where we greatly reduce the command line setup (Wang Nan)
- 'perf trace' now supports callchains, with 'trace --call-graph dwarf' using
libunwind, just like 'perf top', to ask the kernel for stack dumps for CFI
processing. This reduces the overhead by asking just for userspace callchains
and also only for the syscall exit tracepoint (raw_syscalls:sys_exit)
(Milian Wolff, Arnaldo Carvalho de Melo)
Try it with, for instance:
# perf trace --call dwarf ping 127.0.0.1
An excerpt of a system wide 'perf trace --call dwarf" session is at:
https://fedorapeople.org/~acme/perf/perf-trace--call-graph-dwarf--all-cpus.txt
You may need to bump the number of mmap pages, using -m/--mmap-pages,
but on a Broadwell machine the defaults allowed system wide tracing to
work without losing that many records, experiment with just some
syscalls, like:
# perf trace --call dwarf -e nanosleep,futex
All the targets available for 'perf record', 'perf top' (--pid, --tid, --cpu,
etc) should work. Also --duration may be interesting to try.
To get filenames from in various syscalls pointer args (open, ettc), add this
to the mix:
# perf probe 'vfs_getname=getname_flags:72 pathname=filename:string'
Making this work is next in line:
# trace --call dwarf --ev sched:sched_switch/call-graph=fp/ usleep 1
I.e. honouring per-tracepoint callchains in 'perf trace' in addition to
in raw_syscalls:sys_exit.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (15):
perf script: Use readdir() instead of deprecated readdir_r()
perf thread_map: Use readdir() instead of deprecated readdir_r()
perf tools: Use readdir() instead of deprecated readdir_r()
perf tools: Use readdir() instead of deprecated readdir_r()
perf dwarf: Guard !x86_64 definitions under #ifdef else clause
perf evsel: Allow passing a left alignment when printing a symbol
perf evsel: Rename print_ip() to fprintf_sym()
perf evsel: Introduce fprintf_callchain() method out of fprintf_sym()
perf trace: Exclude the kernel part of the callchain leading to a syscall
perf evsel: Do not use globals in config()
perf evlist: Add (reset,set)_sample_bit methods
perf evsel: Rename config_callgraph() to config_callchain() and make it public
perf trace: Make "--call-graph" affect just "raw_syscalls:sys_exit"
perf evsel: Allow unresolved symbol names to be printed as addresses
perf trace: Print unresolved symbol names as addresses
Milian Wolff (2):
perf evsel: Allow specifying a file to output in perf_evsel__print_ip
perf trace: Add support for printing call chains on sys_exit events.
Wang Nan (2):
perf bpf: Clone bpf stdout events in multiple bpf scripts
perf bpf: Automatically create bpf-output event __bpf_stdout__
tools/perf/Documentation/perf-trace.txt | 9 ++
tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +-
tools/perf/arch/x86/util/dwarf-regs.c | 8 +-
tools/perf/builtin-kvm.c | 2 +-
tools/perf/builtin-record.c | 10 +-
tools/perf/builtin-script.c | 78 +++++++--------
tools/perf/builtin-top.c | 2 +-
tools/perf/builtin-trace.c | 65 +++++++++++-
tools/perf/tests/bpf.c | 2 +-
tools/perf/tests/code-reading.c | 2 +-
tools/perf/tests/keep-tracking.c | 2 +-
tools/perf/tests/openat-syscall-tp-fields.c | 2 +-
tools/perf/tests/perf-record.c | 2 +-
tools/perf/tests/switch-tracking.c | 2 +-
tools/perf/util/bpf-loader.c | 143 +++++++++++++++++++++++++++
tools/perf/util/bpf-loader.h | 19 ++++
tools/perf/util/event.c | 12 +--
tools/perf/util/evlist.c | 18 ++++
tools/perf/util/evlist.h | 16 ++-
tools/perf/util/evsel.c | 16 +--
tools/perf/util/evsel.h | 14 ++-
tools/perf/util/parse-events.c | 60 +++++------
tools/perf/util/record.c | 5 +-
tools/perf/util/session.c | 95 ++++++++++++------
tools/perf/util/session.h | 8 +-
tools/perf/util/symbol.c | 25 ++++-
tools/perf/util/symbol.h | 6 ++
tools/perf/util/thread_map.c | 8 +-
28 files changed, 487 insertions(+), 146 deletions(-)
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-04-12 04:00 +0200 |
| Subject | [PATCH 15/19] perf evlist: Add (reset,set)_sample_bit methods |
| Message-ID | <rmVMv-7ps-47@gated-at.bofh.it> |
| In reply to | #1376402 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
For fiddling with sample_type fields in all evsels in an evlist.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-dg6yavctt0hzl2tsgfb43qsr@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/evlist.c | 18 ++++++++++++++++++
tools/perf/util/evlist.h | 11 +++++++++++
2 files changed, 29 insertions(+)
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 86a03836a83f..4c9f510ae18d 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1192,6 +1192,24 @@ void perf_evlist__set_maps(struct perf_evlist *evlist, struct cpu_map *cpus,
perf_evlist__propagate_maps(evlist);
}
+void __perf_evlist__set_sample_bit(struct perf_evlist *evlist,
+ enum perf_event_sample_format bit)
+{
+ struct perf_evsel *evsel;
+
+ evlist__for_each(evlist, evsel)
+ __perf_evsel__set_sample_bit(evsel, bit);
+}
+
+void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist,
+ enum perf_event_sample_format bit)
+{
+ struct perf_evsel *evsel;
+
+ evlist__for_each(evlist, evsel)
+ __perf_evsel__reset_sample_bit(evsel, bit);
+}
+
int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel)
{
struct perf_evsel *evsel;
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 8db9228663d6..da46423998e8 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -87,6 +87,17 @@ int perf_evlist__add_dummy(struct perf_evlist *evlist);
int perf_evlist__add_newtp(struct perf_evlist *evlist,
const char *sys, const char *name, void *handler);
+void __perf_evlist__set_sample_bit(struct perf_evlist *evlist,
+ enum perf_event_sample_format bit);
+void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist,
+ enum perf_event_sample_format bit);
+
+#define perf_evlist__set_sample_bit(evlist, bit) \
+ __perf_evlist__set_sample_bit(evlist, PERF_SAMPLE_##bit)
+
+#define perf_evlist__reset_sample_bit(evlist, bit) \
+ __perf_evlist__reset_sample_bit(evlist, PERF_SAMPLE_##bit)
+
int perf_evlist__set_filter(struct perf_evlist *evlist, const char *filter);
int perf_evlist__set_filter_pid(struct perf_evlist *evlist, pid_t pid);
int perf_evlist__set_filter_pids(struct perf_evlist *evlist, size_t npids, pid_t *pids);
--
2.5.5
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-04-12 04:10 +0200 |
| Subject | [PATCH 12/19] perf evsel: Introduce fprintf_callchain() method out of fprintf_sym() |
| Message-ID | <rmVWb-7KC-11@gated-at.bofh.it> |
| In reply to | #1376402 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
In 'perf trace' we're just interested in printing callchains, and we
don't want to use the symbol_conf.use_callchain, so move the callchain
part to a new method.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-kcn3romzivcpxb3u75s9nz33@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 4 ++--
tools/perf/util/evsel.h | 6 ++++++
tools/perf/util/session.c | 29 ++++++++++++++++++++++++-----
3 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index a0d5c680c39e..63a3cc9b717c 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2203,8 +2203,8 @@ signed_print:
event->header.type);
goto out_put;
}
- perf_evsel__fprintf_sym(evsel, sample, &al, 38, print_opts,
- scripting_max_stack, trace->output);
+ perf_evsel__fprintf_callchain(evsel, sample, &al, 38, print_opts,
+ scripting_max_stack, trace->output);
}
out:
ttrace->entry_pending = false;
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 501ea6e565f1..ab3632caba9f 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -381,6 +381,12 @@ struct perf_attr_details {
int perf_evsel__fprintf(struct perf_evsel *evsel,
struct perf_attr_details *details, FILE *fp);
+int perf_evsel__fprintf_callchain(struct perf_evsel *evsel,
+ struct perf_sample *sample,
+ struct addr_location *al, int left_alignment,
+ unsigned int print_opts,
+ unsigned int stack_depth, FILE *fp);
+
bool perf_evsel__fallback(struct perf_evsel *evsel, int err,
char *msg, size_t msgsize);
int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 0669a088ea0d..e384b651a3e8 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1953,10 +1953,10 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
return NULL;
}
-int perf_evsel__fprintf_sym(struct perf_evsel *evsel, struct perf_sample *sample,
- struct addr_location *al, int left_alignment,
- unsigned int print_opts, unsigned int stack_depth,
- FILE *fp)
+int perf_evsel__fprintf_callchain(struct perf_evsel *evsel, struct perf_sample *sample,
+ struct addr_location *al, int left_alignment,
+ unsigned int print_opts, unsigned int stack_depth,
+ FILE *fp)
{
int printed = 0;
struct callchain_cursor_node *node;
@@ -1968,7 +1968,7 @@ int perf_evsel__fprintf_sym(struct perf_evsel *evsel, struct perf_sample *sample
int print_srcline = print_opts & PRINT_IP_OPT_SRCLINE;
char s = print_oneline ? ' ' : '\t';
- if (symbol_conf.use_callchain && sample->callchain) {
+ if (sample->callchain) {
struct addr_location node_al;
if (thread__resolve_callchain(al->thread, evsel,
@@ -2027,7 +2027,26 @@ int perf_evsel__fprintf_sym(struct perf_evsel *evsel, struct perf_sample *sample
next:
callchain_cursor_advance(&callchain_cursor);
}
+ }
+
+ return printed;
+}
+
+int perf_evsel__fprintf_sym(struct perf_evsel *evsel, struct perf_sample *sample,
+ struct addr_location *al, int left_alignment,
+ unsigned int print_opts, unsigned int stack_depth,
+ FILE *fp)
+{
+ int printed = 0;
+ int print_ip = print_opts & PRINT_IP_OPT_IP;
+ int print_sym = print_opts & PRINT_IP_OPT_SYM;
+ int print_dso = print_opts & PRINT_IP_OPT_DSO;
+ int print_symoffset = print_opts & PRINT_IP_OPT_SYMOFFSET;
+ int print_srcline = print_opts & PRINT_IP_OPT_SRCLINE;
+ if (symbol_conf.use_callchain && sample->callchain) {
+ printed += perf_evsel__fprintf_callchain(evsel, sample, al, left_alignment,
+ print_opts, stack_depth, fp);
} else if (!(al->sym && al->sym->ignore)) {
printed += fprintf(fp, "%-*.*s", left_alignment, left_alignment, " ");
--
2.5.5
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-04-12 04:10 +0200 |
| Subject | [PATCH 08/19] perf evsel: Allow specifying a file to output in perf_evsel__print_ip |
| Message-ID | <rmVWb-7KC-9@gated-at.bofh.it> |
| In reply to | #1376402 |
From: Milian Wolff <milian.wolff@kdab.com>
As this function will be used in 'perf trace'.
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/n/tip-8x297v9utnxq77onikevvlse@git.kernel.org
[ Split from a larger patch ]
Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
---
tools/perf/builtin-script.c | 4 ++--
tools/perf/util/session.c | 39 +++++++++++++++++++++------------------
tools/perf/util/session.h | 3 ++-
3 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 8f6ab2ac855a..dbf208f0cdc2 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -580,7 +580,7 @@ static void print_sample_bts(struct perf_sample *sample,
}
}
perf_evsel__print_ip(evsel, sample, al, print_opts,
- scripting_max_stack);
+ scripting_max_stack, stdout);
}
/* print branch_to information */
@@ -790,7 +790,7 @@ static void process_event(struct perf_script *script,
perf_evsel__print_ip(evsel, sample, al,
output[attr->type].print_ip_opts,
- scripting_max_stack);
+ scripting_max_stack, stdout);
}
if (PRINT_FIELD(IREGS))
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index ef370557fb9a..bbac0efbc10c 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1955,7 +1955,8 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
void perf_evsel__print_ip(struct perf_evsel *evsel, struct perf_sample *sample,
struct addr_location *al,
- unsigned int print_opts, unsigned int stack_depth)
+ unsigned int print_opts, unsigned int stack_depth,
+ FILE *fp)
{
struct callchain_cursor_node *node;
int print_ip = print_opts & PRINT_IP_OPT_IP;
@@ -1992,33 +1993,35 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, struct perf_sample *sample,
goto next;
if (print_ip)
- printf("%c%16" PRIx64, s, node->ip);
+ fprintf(fp, "%c%16" PRIx64, s, node->ip);
if (node->map)
addr = node->map->map_ip(node->map, node->ip);
if (print_sym) {
- printf(" ");
+ fprintf(fp, " ");
if (print_symoffset) {
node_al.addr = addr;
node_al.map = node->map;
- symbol__fprintf_symname_offs(node->sym, &node_al, stdout);
+ symbol__fprintf_symname_offs(node->sym,
+ &node_al,
+ fp);
} else
- symbol__fprintf_symname(node->sym, stdout);
+ symbol__fprintf_symname(node->sym, fp);
}
if (print_dso) {
- printf(" (");
- map__fprintf_dsoname(node->map, stdout);
- printf(")");
+ fprintf(fp, " (");
+ map__fprintf_dsoname(node->map, fp);
+ fprintf(fp, ")");
}
if (print_srcline)
map__fprintf_srcline(node->map, addr, "\n ",
- stdout);
+ fp);
if (!print_oneline)
- printf("\n");
+ fprintf(fp, "\n");
stack_depth--;
next:
@@ -2030,25 +2033,25 @@ next:
return;
if (print_ip)
- printf("%16" PRIx64, sample->ip);
+ fprintf(fp, "%16" PRIx64, sample->ip);
if (print_sym) {
- printf(" ");
+ fprintf(fp, " ");
if (print_symoffset)
symbol__fprintf_symname_offs(al->sym, al,
- stdout);
+ fp);
else
- symbol__fprintf_symname(al->sym, stdout);
+ symbol__fprintf_symname(al->sym, fp);
}
if (print_dso) {
- printf(" (");
- map__fprintf_dsoname(al->map, stdout);
- printf(")");
+ fprintf(fp, " (");
+ map__fprintf_dsoname(al->map, fp);
+ fprintf(fp, ")");
}
if (print_srcline)
- map__fprintf_srcline(al->map, al->addr, "\n ", stdout);
+ map__fprintf_srcline(al->map, al->addr, "\n ", fp);
}
}
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index f96fc9e8c52e..0ee3d9dbc099 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -106,7 +106,8 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
void perf_evsel__print_ip(struct perf_evsel *evsel, struct perf_sample *sample,
struct addr_location *al,
- unsigned int print_opts, unsigned int stack_depth);
+ unsigned int print_opts, unsigned int stack_depth,
+ FILE *fp);
int perf_session__cpu_bitmap(struct perf_session *session,
const char *cpu_list, unsigned long *cpu_bitmap);
--
2.5.5
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2016-04-13 09:10 +0200 |
| Message-ID | <rnn63-5Id-23@gated-at.bofh.it> |
| In reply to | #1376402 |
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, tested with 'perf test', 'make -C tools/perf > build-test' and building on these userspaces, using docker: > > # dm > alldeps-fedora-rawhide-minus-python-dev: Ok > alldeps-fedora-20: Ok > alldeps-ubuntu-12.04: Ok > minimal-debian-experimental-x-mips64: Ok > minimal-debian-experimental-x-mips64el: Ok > minimal-debian-experimental-x-mipsel: Ok > minimal-ubuntu-x-arm: Ok > minimal-ubuntu-x-arm64: Ok > minimal-ubuntu-x-ppc64: Ok > minimal-ubuntu-x-ppc64el: Ok > alldeps-debian: Ok > alldeps-mageia: Ok > alldeps-rhel7: Ok > alldeps-centos: Ok > alldeps-opensuse: Ok > alldeps-ubuntu: Ok > # > > This is on top of my previous pull request, that is not yet > merged: perf-core-for-mingo-20160408. > > Best regards, > > - Arnaldo > > The following changes since commit 99e87f7bb7268cf644add87130590966fd5d0d17: > > perf symbols: Adjust symbol for shared objects (2016-04-08 09:58:15 -0300) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160411 > > for you to fetch changes up to 00768a2bd3245eace0690fcf2c02776a256b66d7: > > perf trace: Print unresolved symbol names as addresses (2016-04-11 22:18:25 -0300) > > ---------------------------------------------------------------- > perf/core improvements: > > - Automagically create a 'bpf-output' event, easing the setup of BPF > C "scripts" that produce output via the perf ring buffer. Now it is > just a matter of calling any perf tool, such as 'trace', with a C > source file that references the __bpf_stdout__ output channel and > that channel will be created and connected to the script: > > # trace -e nanosleep --event test_bpf_stdout.c usleep 1 > 0.013 ( 0.013 ms): usleep/2818 nanosleep(rqtp: 0x7ffcead45f40 ) ... > 0.013 ( ): __bpf_stdout__:Raise a BPF event!..) > 0.015 ( ): perf_bpf_probe:func_begin:(ffffffff81112460)) > 0.261 ( ): __bpf_stdout__:Raise a BPF event!..) > 0.262 ( ): perf_bpf_probe:func_end:(ffffffff81112460 <- ffffffff81003d92)) > 0.264 ( 0.264 ms): usleep/2818 ... [continued]: nanosleep()) = 0 > # > > Further work is needed to reduce the number of lines in a perf bpf C source > file, this being the part where we greatly reduce the command line setup (Wang Nan) > > - 'perf trace' now supports callchains, with 'trace --call-graph dwarf' using > libunwind, just like 'perf top', to ask the kernel for stack dumps for CFI > processing. This reduces the overhead by asking just for userspace callchains > and also only for the syscall exit tracepoint (raw_syscalls:sys_exit) > (Milian Wolff, Arnaldo Carvalho de Melo) > > Try it with, for instance: > > # perf trace --call dwarf ping 127.0.0.1 > > An excerpt of a system wide 'perf trace --call dwarf" session is at: > > https://fedorapeople.org/~acme/perf/perf-trace--call-graph-dwarf--all-cpus.txt > > You may need to bump the number of mmap pages, using -m/--mmap-pages, > but on a Broadwell machine the defaults allowed system wide tracing to > work without losing that many records, experiment with just some > syscalls, like: > > # perf trace --call dwarf -e nanosleep,futex > > All the targets available for 'perf record', 'perf top' (--pid, --tid, --cpu, > etc) should work. Also --duration may be interesting to try. > > To get filenames from in various syscalls pointer args (open, ettc), add this > to the mix: > > # perf probe 'vfs_getname=getname_flags:72 pathname=filename:string' > > Making this work is next in line: > > # trace --call dwarf --ev sched:sched_switch/call-graph=fp/ usleep 1 > > I.e. honouring per-tracepoint callchains in 'perf trace' in addition to > in raw_syscalls:sys_exit. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (15): > perf script: Use readdir() instead of deprecated readdir_r() > perf thread_map: Use readdir() instead of deprecated readdir_r() > perf tools: Use readdir() instead of deprecated readdir_r() > perf tools: Use readdir() instead of deprecated readdir_r() > perf dwarf: Guard !x86_64 definitions under #ifdef else clause > perf evsel: Allow passing a left alignment when printing a symbol > perf evsel: Rename print_ip() to fprintf_sym() > perf evsel: Introduce fprintf_callchain() method out of fprintf_sym() > perf trace: Exclude the kernel part of the callchain leading to a syscall > perf evsel: Do not use globals in config() > perf evlist: Add (reset,set)_sample_bit methods > perf evsel: Rename config_callgraph() to config_callchain() and make it public > perf trace: Make "--call-graph" affect just "raw_syscalls:sys_exit" > perf evsel: Allow unresolved symbol names to be printed as addresses > perf trace: Print unresolved symbol names as addresses > > Milian Wolff (2): > perf evsel: Allow specifying a file to output in perf_evsel__print_ip > perf trace: Add support for printing call chains on sys_exit events. > > Wang Nan (2): > perf bpf: Clone bpf stdout events in multiple bpf scripts > perf bpf: Automatically create bpf-output event __bpf_stdout__ > > tools/perf/Documentation/perf-trace.txt | 9 ++ > tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +- > tools/perf/arch/x86/util/dwarf-regs.c | 8 +- > tools/perf/builtin-kvm.c | 2 +- > tools/perf/builtin-record.c | 10 +- > tools/perf/builtin-script.c | 78 +++++++-------- > tools/perf/builtin-top.c | 2 +- > tools/perf/builtin-trace.c | 65 +++++++++++- > tools/perf/tests/bpf.c | 2 +- > tools/perf/tests/code-reading.c | 2 +- > tools/perf/tests/keep-tracking.c | 2 +- > tools/perf/tests/openat-syscall-tp-fields.c | 2 +- > tools/perf/tests/perf-record.c | 2 +- > tools/perf/tests/switch-tracking.c | 2 +- > tools/perf/util/bpf-loader.c | 143 +++++++++++++++++++++++++++ > tools/perf/util/bpf-loader.h | 19 ++++ > tools/perf/util/event.c | 12 +-- > tools/perf/util/evlist.c | 18 ++++ > tools/perf/util/evlist.h | 16 ++- > tools/perf/util/evsel.c | 16 +-- > tools/perf/util/evsel.h | 14 ++- > tools/perf/util/parse-events.c | 60 +++++------ > tools/perf/util/record.c | 5 +- > tools/perf/util/session.c | 95 ++++++++++++------ > tools/perf/util/session.h | 8 +- > tools/perf/util/symbol.c | 25 ++++- > tools/perf/util/symbol.h | 6 ++ > tools/perf/util/thread_map.c | 8 +- > 28 files changed, 487 insertions(+), 146 deletions(-) Pulled, thanks a lot Arnaldo! Ingo
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web