summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-12-11perf: Optimize ring-buffer write by depending on control dependenciesPeter Zijlstra
Remove a full barrier from the ring-buffer write path by relying on a control dependency to order a LOAD -> STORE scenario. Cc: "Paul E. McKenney" <paulmck@us.ibm.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/n/tip-8alv40z6ikk57jzbaobnxrjl@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-12-11Merge tag 'perf-core-for-mingo' of ↵Ingo Molnar
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: * Add an option in 'perf script' to print the source line number, from Adrian Hunter * Add --header/--header-only options to 'script' and 'report', the default is not tho show the header info, but as this has been the default for some time, leave a single line explaining how to obtain that information, from Jiri Olsa. * Fix symoff printing in callchains in 'perf script', from Adrian Hunter. * Assorted mmap_pages handling fixes, from Adrian Hunter. * Fix summary percentage when processing files in 'perf trace', from David Ahern. * Handle old kernels where the "raw_syscalls" tracepoints were called plan "syscalls", in 'perf trace', from David Ahern. * Several man pages typo fixes from Dongsheng Yang. * Add '-v' option to 'perf kvm', from Dongsheng Yang. * Make perf kvm diff support --guestmount, from Dongsheng Yang. * Get rid of several die() calls in libtraceevent, from Namhyung Kim. * Use basename() in a more robust way, to avoid problems related to different system library implementations for that function, from Stephane Eranian. * Remove open coded management of short_name_allocated member, from Adrian Hunter * Several cleanups in the "dso" methods, constifying some parameters and renaming some fields to clarify its purpose. (Arnaldo Carvalho de Melo.) * Add per-feature check flags, fixing libunwind related build problems on some architectures, from Jean Pihet. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-12-10perf unwinding: Use the per-feature check flagsJean Pihet
Use the per-feature check flags for the unwinding feature in order to correctly compile the test-all, libunwind and libunwind-debug-frame feature checks. Tested on x86_64, ARMv7 and ARMv8 with and without LIBUNWIND_DIR set in 'make -C tools/perf' Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Acked-by: Ingo Molnar <mingo@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Will Deacon <will.deacon@arm.com> Cc: linaro-kernel@lists.linaro.org Cc: patches@linaro.org Link: http://lkml.kernel.org/r/1386678244-13535-3-git-send-email-jean.pihet@linaro.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf tools: Add per-feature check flagsJean Pihet
Add CFLAGS and LDFLAGS for each feature to be checked. This allows to pass flags and parameters to the feature checks compilation. Also simplifies the feature check makefile, to come in a subsequent patch. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Acked-by: Ingo Molnar <mingo@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Will Deacon <will.deacon@arm.com> Cc: linaro-kernel@lists.linaro.org Cc: patches@linaro.org Link: http://lkml.kernel.org/r/1386678244-13535-2-git-send-email-jean.pihet@linaro.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf symbols: Fix bug in usage of the basename() functionStephane Eranian
The basename() implementation varies a lot between systems. The Linux man page says: "basename may modify the content of the path, so it may be desirable to pass a copy when calling the function". On some other systems, the returned address may come from an internal buffer which can be reused in subsequent calls, thus the results should also be copied. The dso__set_basename() function was not doing this causing problems on some systems with wrong library names being shown by perf report, such as on Android systems. This patch fixes the problem. The patch is relative to tip.git. In v2, we clean up the comments based on Ingo's feedback. Reported-by: Ben Cheng <bccheng@google.com> Signed-off-by: Stephane Eranian <eranian@google.com> Acked-by: Ingo Molnar <mingo@kernel.org> Cc: Ben Cheng <bccheng@google.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20131205182642.GA14614@quad [ v3: Fixed up wrt allocated flag now being set in dso__set_short_name ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf symbols: Rename filename argumentArnaldo Carvalho de Melo
The 'file' is more commonly associated with a file descriptor of some sort, rename it to 'filename' as this is the more common idiom for a file name argument. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-0ehaawv5xc83w6ag03c5hi10@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf symbols: Constify some DSO methods parametersArnaldo Carvalho de Melo
Those methods are not supposed to change the data structures they manipulate, so make that clearer by using the const qualifier in the function signature and in some variables. Suggested-by: Ingo Molnar <mingo@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-j7oyakex7zy3r82h33rdw25x@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf symbols: Set freed members to NULL in dso destructorArnaldo Carvalho de Melo
To help in debugging use after free bugs. Reported-by: Ingo Molnar <mingo@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-3ckwsob2g1q23s77nuhexrq7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf symbols: Constify dso->long_nameArnaldo Carvalho de Melo
Same reason as for dso->short_name, it may point to a const string, and in most places it is treated as const, i.e. it is just accessed for using its contents as a key or to show it on reports. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-nf7mxf33zt5qw207pbxxryot@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf symbols: Remove open coded management of long_name_allocated memberArnaldo Carvalho de Melo
Instead of expecting callers to set this member accodingly so that later at dso destruction it can, if needed, be correctly free()d, make it a requirement by passing it as a parameter to dso__set_long_name. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-na7t1tqim22vuqkt4zq5n4ri@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf symbols: Set alloc flag close to setting the long_nameArnaldo Carvalho de Melo
This is a preparatory patch to do with dso__set_long_name what was done with the short name variant. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-mb7eqhkyejq1qcf3p22wz2x7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf symbols: Remove open coded management of short_name_allocated memberAdrian Hunter
Instead of expecting callers to set this member accodingly so that later at dso destruction it can, if needed, be correctly free()d, make it a requirement by passing it as a parameter to dso__set_short_name. Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> CC: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Link: http://lkml.kernel.org/r/52A707A2.5020802@intel.com [ Renamed the 'allocated' parameter to clearly indicate to which variable it refers to. ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf machine: Don't open code assign dso->short_nameArnaldo Carvalho de Melo
Use dso__set_short_name instead, as it will release any previously, possibly allocated, short name. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-1v39elw7v6nxczpntpp7ljwr@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf symbols: Rename [sl]name_alloc to match the members they refer toArnaldo Carvalho de Melo
So we now have: dso->short_name dso->short_name_len dso->short_name_allocated Ditto for the 'long variants. To more quickly grasp what they refer to. Suggested-by: Ingo Molnar <mingo@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-nu228f8vlp9w0lr7c0q77dqi@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf script: Add --header/--header-only optionsJiri Olsa
Currently the perf.data header is always displayed for stdio output, which is no always useful. Disabling header information by default and adding following options to control header output: --header - display header information --header-only - display header information only w/o further processing Signed-off-by: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/n/tip-0ehaawv5xc83w6ag03c5hi10@git.kernel.org Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1386583370-1699-3-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-10perf report: Add --header/--header-only optionsJiri Olsa
Currently the perf.data header is always displayed for stdio output, which is no always useful. Disabling header information by default and adding following options to control header output: --header - display header information (old default) --header-only - display header information only w/o further processing, forces stdio output Signed-off-by: Jiri Olsa <jolsa@redhat.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1386583370-1699-2-git-send-email-jolsa@redhat.com [ Added single line explaining talking about the new --header* options, to address David Ahern comment; better man page entry for the new options, from Namhyung Kim ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09tools lib traceevent: Get rid of die() in pevent_filter_clear_trivial()Namhyung Kim
Change the function signature to return error code and not call die() anymore. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Reviewed-by: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386567251-22751-13-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09tools lib traceevent: Get rid of malloc_or_die() in ↵Namhyung Kim
pevent_filter_add_filter_str() Signed-off-by: Namhyung Kim <namhyung@kernel.org> Reviewed-by: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386567251-22751-12-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09tools lib traceevent: Get rid of die() in create_arg_item()Namhyung Kim
Signed-off-by: Namhyung Kim <namhyung@kernel.org> Reviewed-by: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386567251-22751-9-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09tools lib traceevent: Get rid of malloc_or_die() in add_event()Namhyung Kim
Make it return error value since its only caller find_event() now can handle allocation error properly. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Reviewed-by: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386567251-22751-8-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09tools lib traceevent: Get rid of malloc_or_die() in pevent_filter_alloc()Namhyung Kim
It returns NULL when allocation fails so the users should check the return value from now on. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Reviewed-by: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386567251-22751-4-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf kvm: Make perf kvm diff support --guestmount.Dongsheng Yang
In manpage of perf-kvm, --guestmount is supported by diff command, but it does not work well. This patch change the extend the checking in buildid-diff from guestkallsyms or guestmodules to perf_guest. Then this checking can cover the all cases perf kvm is used for. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Link: http://lkml.kernel.org/r/72857ed89642e0633f5e88f7e7abbc9645359e8e.1386368672.git.yangds.fnst@cn.fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf kvm: Move code to generate filename for perf-kvm to function.Dongsheng Yang
The code in builtin-kvm.c to generate filename for perf-kvm is useful to other command such as builtin-diff. This patch move the related code form builtin-kvm.c to util/util.c and wrap them in a function named get_filename_for_perf_kvm. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Link: http://lkml.kernel.org/r/5e09a5c47e8a495e888cbdc65a6fafb2c950f529.1386368672.git.yangds.fnst@cn.fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf annotate: Fix typoDongsheng Yang
A typo in comment of builtin-annotate.c about 'that'. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Link: http://lkml.kernel.org/r/46cb069a4ce21141057a07c0b50baa9968e3228c.1386629050.git.yangds.fnst@cn.fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf archive: Remove duplicated 'runs' in man pageDongsheng Yang
Two 'runs' here breaks the sentence in Description of 'perf archive' command. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Link: http://lkml.kernel.org/r/78a15a9f4f500b6074a1e25917d6e8251f894628.1386629050.git.yangds.fnst@cn.fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf kvm: Fix bug in 'stat report'Dongsheng Yang
When we use perf kvm record-report, there is a bug in report subcommand. Example: # perf kvm stat record -a sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.678 MB perf.data.guest (~29641 samples) ] # perf kvm stat report failed to open perf.data: No such file or directory (try 'perf record' first) Initializing perf session failed This bug was introduced by f5fc14124. + struct perf_data_file file = { + .path = input_name, + .mode = PERF_DATA_MODE_READ, + }; kvm->tool = eops; - kvm->session = perf_session__new(kvm->file_name, O_RDONLY, 0, false, - &kvm->tool); + kvm->session = perf_session__new(&file, false, &kvm->tool); It changed the path from kvm->file_name to input_name, this patch change the path back to 'kvm->file_name', then it works well. Verification: # perf kvm stat record -a sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.807 MB perf.data.guest (~35264 samples) ] # perf kvm stat report Analyze events for all VCPUs: VM-EXIT Samples Samples% Time% Min Time Max Time Avg time EPT_VIOLATION 200 32.79% 1.25% 0us 12064us 62.35us ( +- 96.74% ) EPT_MISCONFIG 134 21.97% 0.21% 0us 35us 15.25us ( +- 4.14% ) EXCEPTION_NMI 96 15.74% 0.02% 0us 11us 1.95us ( +- 9.81% ) APIC_ACCESS 79 12.95% 0.02% 0us 13us 2.94us ( +- 11.20% ) HLT 65 10.66% 98.47% 0us 16706us 15084.86us ( +- 1.89% ) IO_INSTRUCTION 27 4.43% 0.02% 0us 29us 6.42us ( +- 15.53% ) EXTERNAL_INTERRUPT 5 0.82% 0.01% 0us 77us 23.65us ( +- 57.90% ) TPR_BELOW_THRESHOLD 4 0.66% 0.00% 0us 1us 1.22us ( +- 4.36% ) Total Samples:610, Total events handled time:995745.54us. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Link: http://lkml.kernel.org/r/1386632823-17539-1-git-send-email-yangds.fnst@cn.fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf kvm: Introduce option -v for perf kvm command.Dongsheng Yang
As there is no -v option for perf kvm, the all debug message for perf kvm will nerver be printed out to user. Example: # perf kvm --guestmount /tmp/guestmount/ record -a Not enough memory for reading perf file header It is confusing message for newbies such as me. With this patch applied, we can use -v option to get the detail. Example: # perf kvm --guestmount /tmp/guestmount/ record -a -v Can't access file /tmp/guestmount//15069/proc/kallsyms Not enough memory for reading perf file header Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1386609311-23889-1-git-send-email-yangds.fnst@cn.fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf evlist: Fix mmap pages rounding to power of 2Adrian Hunter
'next_pow2()' only works for 'unsigned int' but the argument is 'unsigned long'. Checking for values less than (1 << 31) ensures that 'next_pow2()' is not passed a value out of range but lets anything else go through unvalidated. As a result mmap_pages of zero is used e.g. perf record -v -m2147483649 uname mmap size 0B failed to mmap with 22 (Invalid argument) Fixed: perf record -m2147483649 uname rounding mmap pages size to 17592186044416 bytes (4294967296 pages) Invalid argument for --mmap_pages/-m Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1386595120-22978-4-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf evlist: Fix max mmap_pagesAdrian Hunter
'SIZE_MAX / page_size' is an upper limit for the maximum number of mmap pages, not a lower limit. Change the condition accordingly. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1386595120-22978-3-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf evlist: Remove unnecessary parenthesesAdrian Hunter
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1386595120-22978-2-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf record: Fix display of incorrect mmap pagesAdrian Hunter
'mmap_pages' is 'unsigned int' not 'int' e.g. perf record -m2147483648 uname Permission error mapping pages. Consider increasing /proc/sys/kernel/perf_event_mlock_kb, or try again with a smaller value of -m/--mmap_pages. (current value: -2147483648) Fixed: perf record -m2147483648 uname Permission error mapping pages. Consider increasing /proc/sys/kernel/perf_event_mlock_kb, or try again with a smaller value of -m/--mmap_pages. (current value: 2147483648) Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1386595120-22978-5-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf script: Add an option to print the source line numberAdrian Hunter
Add field 'srcline' that displays the source file name and line number associated with the sample ip. The information displayed is the same as from addr2line. $ perf script -f comm,tid,pid,time,ip,sym,dso,symoff,srcline grep 10701/10701 2497321.421013: ffffffff81043ffa native_write_msr_safe+0xa ([kernel.kallsyms]) /usr/src/debug/kernel-3.9.fc17/linux-3.9.10-100.fc17.x86_64/arch/x86/include/asm/msr.h:95 grep 10701/10701 2497321.421984: ffffffff8165b6b3 _raw_spin_lock+0x13 ([kernel.kallsyms]) /usr/src/debug/kernel-3.9.fc17/linux-3.9.10-100.fc17.x86_64/arch/x86/include/asm/spinlock.h:54 grep 10701/10701 2497321.421990: ffffffff810b64b3 tick_sched_timer+0x53 ([kernel.kallsyms]) /usr/src/debug/kernel-3.9.fc17/linux-3.9.10-100.fc17.x86_64/kernel/time/tick-sched.c:840 grep 10701/10701 2497321.421992: ffffffff8106f63f run_timer_softirq+0x2f ([kernel.kallsyms]) /usr/src/debug/kernel-3.9.fc17/linux-3.9.10-100.fc17.x86_64/kernel/timer.c:1372 Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1386315778-11633-3-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09perf script: Fix symoff printing in callchainsAdrian Hunter
The address being used to calculate the offset was the memory address but the address needed is the address mapped to the dso. i.e. the 'addr' member of 'struct addr_location' Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1386315778-11633-2-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-06tools lib traceevent: Report better error message on bad function argsSteven Rostedt
When Jiri Olsa was writing a function callback for scsi_trace_parse_cdb(), he thought that the traceevent library had a bug in it because he was getting this error: Error: expected ')' but read ',' Error: expected ')' but read ',' Error: expected ')' but read ',' Error: expected ')' but read ',' But in truth, he didn't have the write number of arguments for the function callback, and the error was the library detecting the discrepancy. A better error message would have prevented the confusion: Error: function 'scsi_trace_parse_cdb()' only expects 2 arguments but event scsi_dispatch_cmd_timeout has more Error: function 'scsi_trace_parse_cdb()' only expects 2 arguments but event scsi_dispatch_cmd_start has more Error: function 'scsi_trace_parse_cdb()' only expects 2 arguments but event scsi_dispatch_cmd_error has more Error: function 'scsi_trace_parse_cdb()' only expects 2 arguments but event scsi_dispatch_cmd_done has more Or Error: function 'scsi_trace_parse_cdb()' expects 4 arguments but event scsi_dispatch_cmd_timeout only uses 3 Error: function 'scsi_trace_parse_cdb()' expects 4 arguments but event scsi_dispatch_cmd_start only uses 3 Error: function 'scsi_trace_parse_cdb()' expects 4 arguments but event scsi_dispatch_cmd_error only uses 3 Error: function 'scsi_trace_parse_cdb()' expects 4 arguments but event scsi_dispatch_cmd_done only uses 3 Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/n/tip-a4c34w62vl0diitvxb7bt3er@git.kernel.org Signed-off-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-05perf trace: Fix summary percentage when processing filesDavid Ahern
Getting a divide by 0 when events are processed from a file: perf trace -i perf.data -s ... dnsmasq (1684), 10 events, inf%, 0.000 msec The problem is that the event count is not incremented as events are processed. With this patch: perf trace -i perf.data -s ... dnsmasq (1684), 10 events, 8.9%, 0.000 msec Signed-off-by: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1386211302-31303-4-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-05perf trace: Add support for syscalls vs raw_syscallsDavid Ahern
Older kernels (e.g., RHEL6) do system call tracing via syscalls:sys_{enter,exit} rather than raw_syscalls. Update perf-trace to detect lack of raw_syscalls support and try syscalls. Signed-off-by: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1386211302-31303-2-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-05tools/perf/build: Fix install dependencyJiri Olsa
The traceevents-plugins install targets needs a proper dependency, otherwise it might be executed prematurely and in parallel to an actual build. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Namhyung Kim <namhyung@kernel.org> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/n/tip-rvlbzena4ovzgqiPm6teBofz@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-12-05Merge tag 'perf-core-for-mingo' of ↵Ingo Molnar
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: * Backport libtraceevent plugin support from trace-cmd repository, with plugins for jbd2, hrtimer, kmem, kvm, mac80211, sched_switch, function, xen, scsi, cfg80211. From Jiri Olsa. * Retain bfd reference to lookup source line numbers, greatly optimizing, among other use cases, 'perf report -s srcline', from Adrian Hunter. * Do not disable source line lookup just because of one failure, from Adrian Hunter. * Fix random fd closing with no libelf, from Adrian Hunter. * Do not call perf_event__preprocess_sample() twice in 'perf script', from Adrian Hunter. * Several 'perf kvm' man page corrections, from Dongsheng Yang. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-12-04tools lib traceevent: Update kvm plugin with is_writable_pte helperJiri Olsa
Adding is_writable_pte print helper function, so the kvmmmu:fast_page_fault print format gets resolved properly. The diff of 'perf script' output generated by old and new code: (data was generated by 'perf record -e 'kvm:*,kvmmmu:*' -a') --- script.kvm.old +++ script.kvm.new - qemu-system-x86 3290 [002] 10708.755312: kvmmmu:fast_page_fault: [FAILED TO PARSE] vcpu_id=0 gva=4094486080 error_code=3 sptep=0xffff88019f1e3670 old_spte=336391285 new_spte=336391287 retry=1 + qemu-system-x86 3290 [002] 10708.755312: kvmmmu:fast_page_fault: vcpu 0 gva f40ce640 error_code P|W sptep 0xffff88019f1e3670 old 0x140cec75 new 140cec77 spurious 0 fixed 1 Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-28-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-04tools lib traceevent: Remove malloc_or_die from plugin_function.cJiri Olsa
Removing malloc_or_die calls from plugin_function.c, replacing them and factoring the code with standard realloc and error path. Suggested-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-27-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-04tools lib traceevent: Several cleanups for function pluginJiri Olsa
Several cleanups suggested by Namhyung: * Remove index field from struct func_stack as it's not needed. * Rename get_index into add_and_get_index. * Use '%*X' format string capability instead of the loop Suggested-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-26-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-04tools lib traceevent: Use pevent_print_func_field in hrtimer_start handlerJiri Olsa
The pevent_print_func_field function encompasses all the functionality used in the hrtimer_start handler. Change the handler to use this function. This also unifies the function field output with the hrtimer_expire_entry handler. Suggested-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-25-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-04tools lib traceevent: Use static functions in jbd2 pluginJiri Olsa
There's no need for following functions to be global: process_jbd2_dev_to_name process_jiffies_to_msecs Make them static. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-24-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-04tools lib traceevent: Remove malloc_or_die from event-plugin.cJiri Olsa
Removing malloc_or_die calls from event-plugin.c, replacing them with standard malloc and error path. Suggested-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-23-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-04tools lib traceevent: Add cfg80211 pluginJiri Olsa
Adding cfg80211 plugin. This plugin adds handler for __le16_to_cpup function t properly parse following tracepoint events: cfg80211:cfg80211_tx_mlme_mgmt cfg80211:cfg80211_rx_mlme_mgmt cfg80211:cfg80211_rx_unprot_mlme_mgmt The diff of 'perf script' output generated by old and new code: (data was generated by 'perf record -e 'cfg80211:*' -a') --- script.cfg80211.old +++ script.cfg80211.new - ifconfig 2705 [003] 662.896560: cfg80211:cfg80211_tx_mlme_mgmt: [FAILED TO PARSE] name=wlan0 ifindex=3 frame=ARRAY[c0, 00, 00, 00, 00, 3a, 98, a0, 30, 51, 10, 0b, a9, c6, f4, 74, 00, 3a, 98, a0, 30, 51, 00, 00, 03, 00] + ifconfig 2705 [003] 662.896560: cfg80211:cfg80211_tx_mlme_mgmt: netdev:wlan0(3), ftype:0xc0 - kworker/u16:0 1697 [002] 664.808210: cfg80211:cfg80211_rx_mlme_mgmt: [FAILED TO PARSE] name=wlan0 ifindex=3 frame=ARRAY[b0, 00, da, 00, 10, 0b, a9, c6, f4, 74, d8, 24, bd, a1, 26, 31, d8, 24, bd, a1, 26, 31, 10, b7, 00, 00, 02, 00, 00, 00] + kworker/u16:0 1697 [002] 664.808210: cfg80211:cfg80211_rx_mlme_mgmt: netdev:wlan0(3), ftype:0xb0 Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-22-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-04tools lib traceevent: Add scsi pluginJiri Olsa
Adding scsi plugin. This plugin adds fields resolving functions for following tracepoint events: scsi:scsi_dispatch_cmd_start scsi:scsi_dispatch_cmd_error scsi:scsi_dispatch_cmd_done scsi:scsi_dispatch_cmd_timeout The diff of 'perf script' output generated by old and new code: (data was generated by 'perf record -e 'scsi:scsi_dispatch_cmd*' -a) - swapper 0 [000] 6620.491019: scsi:scsi_dispatch_cmd_done: [FAILED TO PARSE] host_no=0 channel=0 id=0 lun=0 result=0 opcode=53 cmd_len=10 data_sglen=0 prot_sglen=0 prot_op=0 cmnd=5 + swapper 0 [000] 6620.491019: scsi:scsi_dispatch_cmd_done: host_no=0 channel=0 id=0 lun=0 data_sgl=0 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(SYNCHRONIZE_CACHE - raw=35 00 00 00 00 00 00 00 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD) - kworker/0:0 21554 [000] 6620.491126: scsi:scsi_dispatch_cmd_start: [FAILED TO PARSE] host_no=0 channel=0 id=0 lun=0 opcode=42 cmd_len=10 data_sglen=1 prot_sglen=0 prot_op=0 cmnd=* + kworker/0:0 21554 [000] 6620.491126: scsi:scsi_dispatch_cmd_start: host_no=0 channel=0 id=0 lun=0 data_sgl=1 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=570899168 txlen=8 protect=0 raw=2a 00 22 07 3a e0 00 00 08 00) - jbd2/dm-3-8 593 [002] 6621.607992: scsi:scsi_dispatch_cmd_error: [FAILED TO PARSE] host_no=0 channel=0 id=0 lun=0 rtn=4182 opcode=53 cmd_len=10 data_sglen=0 prot_sglen=0 prot_op=0 cmnd=5 + jbd2/dm-3-8 593 [002] 6621.607992: scsi:scsi_dispatch_cmd_error: host_no=0 channel=0 id=0 lun=0 data_sgl=0 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(SYNCHRONIZE_CACHE - raw=35 00 00 00 00 00 00 00 00 00) rtn=4182 NOTE I couldn't generate scsi_dispatch_cmd_timeout tracepoint, but it's similar to the rest, so I believe it's ok. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-21-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-04tools lib traceevent: Add xen pluginJiri Olsa
Adding xen plugin. This plugin adds fields resolving for following tracepoint events: xen:xen_mc_entry xen:xen_mc_extend_args The diff of 'perf script' output generated by old and new code: (data was generated by 'perf record -e 'xen:*' ls') --- script.xen.old +++ script.xen.new - swapper 0 [002] 136.267492: xen:xen_mc_entry: [FAILED TO PARSE] op=3 nargs=2 args=ARRAY[18, 00, 00, 00, 00, 00, 00, 00, 00, e0, d4, 4b, 04, 88, ff, ff, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00] + swapper 0 [002] 136.267492: xen:xen_mc_entry: op 3(stack_switch) args [18, 0, 0, 0, 0, 0] - perf 1970 [008] 136.273319: xen:xen_mc_extend_args: [FAILED TO PARSE] op=1 args=16 res=1 + perf 1970 [008] 136.273319: xen:xen_mc_extend_args: extending op 1(mmu_update) by 16 bytes res ??? NOTE We still do not handle the 'sizeof' and fail to parse following xen tracepoints: xen:xen_mmu_set_pte xen:xen_mmu_set_pte_atomic xen:xen_mmu_set_domain_pte xen:xen_mmu_set_pte_at xen:xen_mmu_set_pmd xen:xen_mmu_set_pud xen:xen_mmu_set_pgd xen:xen_mmu_ptep_modify_prot_start xen:xen_mmu_ptep_modify_prot_commit Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-20-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-04tools lib traceevent: Add function pluginJiri Olsa
Backporting function plugin. Backported from Steven Rostedt's trace-cmd repo (HEAD 0f2c2fb): git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git This plugin adds function and parent function fields resolving for ftrace:function tracepoint event. The diff of 'perf script' output generated by old and new code: (data was generated by 'perf record -e ftrace:function ls') --- script.function.old +++ script.function.new - ls 10781 [001] 32667.291379: ftrace:function: ffffffff811adb80 <-- ffffffff811afc48 - ls 10781 [001] 32667.291379: ftrace:function: ffffffff811b35d0 <-- ffffffff811adb9b - ls 10781 [001] 32667.291380: ftrace:function: ffffffff811b3520 <-- ffffffff811b35e8 - ls 10781 [001] 32667.291380: ftrace:function: ffffffff811b2720 <-- ffffffff811b3549 - ls 10781 [001] 32667.291381: ftrace:function: ffffffff81297e10 <-- ffffffff811b356c - ls 10781 [001] 32667.291381: ftrace:function: ffffffff81298f40 <-- ffffffff81297e2c - ls 10781 [001] 32667.291382: ftrace:function: ffffffff81076160 <-- ffffffff811afbf0 - ls 10781 [001] 32667.291383: ftrace:function: ffffffff811c3eb0 <-- ffffffff811afbfc - ls 10781 [001] 32667.291383: ftrace:function: ffffffff8164e100 <-- ffffffff811c3ed8 - ls 10781 [001] 32667.291384: ftrace:function: ffffffff811a5d10 <-- ffffffff811c3f53 - ls 10781 [001] 32667.291384: ftrace:function: ffffffff811e8e70 <-- ffffffff811a5d58 - ls 10781 [001] 32667.291385: ftrace:function: ffffffff811f38e0 <-- ffffffff811a5d63 - ls 10781 [001] 32667.291385: ftrace:function: ffffffff811a9ff0 <-- ffffffff811a5d6b - ls 10781 [001] 32667.291386: ftrace:function: ffffffff811a9fa0 <-- ffffffff811aa015 - ls 10781 [001] 32667.291387: ftrace:function: ffffffff810851c0 <-- ffffffff811aa053 - ls 10781 [001] 32667.291387: ftrace:function: ffffffff81090e00 <-- ffffffff81085211 + ls 10781 [001] 32667.291379: ftrace:function: would_dump <-- setup_new_exec + ls 10781 [001] 32667.291379: ftrace:function: inode_permission <-- would_dump + ls 10781 [001] 32667.291380: ftrace:function: __inode_permission <-- inode_permission + ls 10781 [001] 32667.291380: ftrace:function: generic_permission <-- __inode_permission + ls 10781 [001] 32667.291381: ftrace:function: security_inode_permission <-- __inode_permission + ls 10781 [001] 32667.291381: ftrace:function: cap_inode_permission <-- security_inode_permission + ls 10781 [001] 32667.291382: ftrace:function: flush_signal_handlers <-- setup_new_exec + ls 10781 [001] 32667.291383: ftrace:function: do_close_on_exec <-- setup_new_exec + ls 10781 [001] 32667.291383: ftrace:function: _raw_spin_lock <-- do_close_on_exec + ls 10781 [001] 32667.291384: ftrace:function: filp_close <-- do_close_on_exec + ls 10781 [001] 32667.291384: ftrace:function: dnotify_flush <-- filp_close + ls 10781 [001] 32667.291385: ftrace:function: locks_remove_posix <-- filp_close + ls 10781 [001] 32667.291385: ftrace:function: fput <-- filp_close + ls 10781 [001] 32667.291386: ftrace:function: file_sb_list_del <-- fput + ls 10781 [001] 32667.291387: ftrace:function: task_work_add <-- fput + ls 10781 [001] 32667.291387: ftrace:function: kick_process <-- task_work_add Removing options support as it's not backported yet. Currently this plugin supports 2 options: 'parent' to display parent function 'indent' to show function call indents Enabling both of them by default. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-19-git-send-email-jolsa@redhat.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-04tools lib traceevent: Add sched_switch pluginJiri Olsa
Backporting sched_switch plugin. Backported from Steven Rostedt's trace-cmd repo (HEAD 0f2c2fb): git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git This plugin adds fields resolving for sched:sched_switch tracepoint event. The diff of 'perf script' output generated by old and new code: (data was generated by 'perf record -e sched:sched_switch -a') --- script.sched_switch.old +++ script.sched_switch.new - perf 577 [002] 30965.311852: sched:sched_switch: prev_comm=perf prev_pid=577 prev_prio=120 prev_state=S ==> next_comm=swapper/2 next_pid=0 next_prio=120 + perf 577 [002] 30965.311852: sched:sched_switch: perf:577 [120] S ==> swapper/2:0 [120] Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-18-git-send-email-jolsa@redhat.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-04tools lib traceevent: Add mac80211 pluginJiri Olsa
Backporting mac80211 plugin. Backported from Steven Rostedt's trace-cmd repo (HEAD 0f2c2fb): git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git This plugin adds changed field resolving for mac80211:drv_bss_info_changed tracepoint event. The diff of 'perf script' output generated by old and new code: (data was generated by 'perf record -e 'mac80211:drv_bss_info_changed' -a') --- script.mac80211.old +++ script.mac80211.new - ifconfig 3711 [000] 1290.446492: mac80211:drv_bss_info_changed: phy0 vif:wlan0(2) changed:0x309f + ifconfig 3711 [000] 1290.446492: mac80211:drv_bss_info_changed: phy0 vif:wlan0(2) + assoc:0 aid:2 cts:0 shortpre:0 shortslot:0 dtimper:1 + bcnint:102 assoc_cap:0x431 basic_rates:0xf enable_beacon:0 + ht_operation_mode:0 Omitting the mac80211:drv_config tracepoint handling because the kernel tracepoint changed its prototype and the plugin handler is no longer working. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1386076182-14484-17-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>