* [GIT PULL 00/19] perf/core improvements and fixes @ 2017-11-03 13:54 Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 01/19] perf script: Add a few missing conversions to fprintf style Arnaldo Carvalho de Melo ` (18 more replies) 0 siblings, 19 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Andrey Vagin, Andy Lutomirski, Changbin Du, Cyrill Gorcunov, David Ahern, Jin Yao, Jiri Olsa, kernel-team, Michael Ellerman, Milian Wolff, Namhyung Kim, Peter Zijlstra, Wang Nan, yuzhoujian, Arnaldo Carvalho de Melo Hi Ingo, A bit of trivia info is now automatically shown in the container builds, the gcc version used to build the tools, that gets changed as the distros update gcc and as I update the container build images :-) Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 0d3d73aac2ff05c78387aa9dcc2c8aa3804405e7: perf/core: Rewrite event timekeeping (2017-10-27 10:31:59 +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-4.15-20171103 for you to fetch changes up to 7285cf3325b4a1dfb336d31eebc27dfbc30fb9aa: perf srcline: Show correct function name for srcline of callchains (2017-11-01 11:44:38 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: - Beautify the 'kcmp' and 'prctl' syscall arguments in 'perf trace' (Arnaldo Carvalho de Melo) - Implement a way to print formatted output to per-event files in 'perf script' to facilitate generate flamegraphs, elliminating the need to write scripts to do that separation (yuzhoujian, Arnaldo Carvalho de Melo) Make 'perf stat --per-thread' update shadow stats to show metrics (Jiri Olsa) - Fix double mapping al->addr in callchain processing for children without self period (Namhyung Kim) - Fix memory leak in addr2inlines() when libbfd is not used (Namhyung Kim) - Show correct function name for srcline of callchains when libbfd is not used (Namhyung Kim) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (11): perf script: Add a few missing conversions to fprintf style perf script: Use pr_debug where appropriate perf script: Use event_format__fprintf() perf evsel: Restore evsel->priv as a tool private area perf script: Allow creating per-event dump files tools include uapi: Grab a copy of linux/prctl.h perf trace beauty prctl: Generate 'option' string table from kernel headers perf script: Print information about per-event-dump files tools include uapi: Grab a copy of linux/kcmp.h perf trace beauty: Implement pid_fd beautifier perf trace beauty kcmp: Beautify arguments Jiri Olsa (5): perf tools: Rename struct perf_data_file to perf_data perf tools: Add struct perf_data_file perf tools: Add perf_data_file__write function perf stat: Move the shadow stats scale computation in perf_stat__update_shadow_stats perf stat: Make --per-thread update shadow stats to show metrics Namhyung Kim (3): perf callchain: Fix double mapping al->addr for children without self period perf srcline: Fix memory leak in addr2inlines() perf srcline: Show correct function name for srcline of callchains tools/include/uapi/linux/kcmp.h | 27 +++++ tools/include/uapi/linux/prctl.h | 200 +++++++++++++++++++++++++++++++ tools/perf/Documentation/perf-script.txt | 4 + tools/perf/Makefile.perf | 22 +++- tools/perf/builtin-annotate.c | 10 +- tools/perf/builtin-buildid-cache.c | 8 +- tools/perf/builtin-buildid-list.c | 16 +-- tools/perf/builtin-c2c.c | 10 +- tools/perf/builtin-diff.c | 18 +-- tools/perf/builtin-evlist.c | 12 +- tools/perf/builtin-inject.c | 36 +++--- tools/perf/builtin-kmem.c | 8 +- tools/perf/builtin-kvm.c | 14 ++- tools/perf/builtin-lock.c | 12 +- tools/perf/builtin-mem.c | 12 +- tools/perf/builtin-record.c | 50 ++++---- tools/perf/builtin-report.c | 14 +-- tools/perf/builtin-sched.c | 24 ++-- tools/perf/builtin-script.c | 169 ++++++++++++++++++++++---- tools/perf/builtin-stat.c | 39 +++--- tools/perf/builtin-timechart.c | 14 ++- tools/perf/builtin-trace.c | 40 ++++++- tools/perf/check-headers.sh | 2 + tools/perf/tests/topology.c | 22 ++-- tools/perf/trace/beauty/Build | 2 + tools/perf/trace/beauty/beauty.h | 18 +++ tools/perf/trace/beauty/kcmp.c | 44 +++++++ tools/perf/trace/beauty/kcmp_type.sh | 10 ++ tools/perf/trace/beauty/prctl.c | 82 +++++++++++++ tools/perf/trace/beauty/prctl_option.sh | 17 +++ tools/perf/util/auxtrace.c | 4 +- tools/perf/util/callchain.c | 5 +- tools/perf/util/data-convert-bt.c | 12 +- tools/perf/util/data.c | 94 ++++++++------- tools/perf/util/data.h | 38 +++--- tools/perf/util/evsel.h | 3 + tools/perf/util/header.c | 20 ++-- tools/perf/util/intel-bts.c | 6 +- tools/perf/util/intel-pt.c | 6 +- tools/perf/util/jit.h | 2 +- tools/perf/util/jitdump.c | 10 +- tools/perf/util/session.c | 44 +++---- tools/perf/util/session.h | 4 +- tools/perf/util/srcline.c | 102 +++++++++------- tools/perf/util/stat-shadow.c | 48 ++++---- tools/perf/util/stat.c | 24 ++-- tools/perf/util/stat.h | 2 +- 47 files changed, 999 insertions(+), 381 deletions(-) create mode 100644 tools/include/uapi/linux/kcmp.h create mode 100644 tools/include/uapi/linux/prctl.h create mode 100644 tools/perf/trace/beauty/kcmp.c create mode 100755 tools/perf/trace/beauty/kcmp_type.sh create mode 100644 tools/perf/trace/beauty/prctl.c create mode 100755 tools/perf/trace/beauty/prctl_option.sh Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf. The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later. Several are cross builds, the ones with -x-ARCH and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # dm 1 alpine:3.4: Ok gcc (Alpine 5.3.0) 5.3.0 2 alpine:3.5: Ok gcc (Alpine 6.2.1) 6.2.1 20160822 3 alpine:3.6: Ok gcc (Alpine 6.3.0) 6.3.0 4 alpine:edge: Ok gcc (Alpine 6.4.0) 6.4.0 5 android-ndk:r12b-arm: Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 6 android-ndk:r15c-arm: Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease) 7 centos:5: Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) 8 centos:6: Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) 9 centos:7: Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16) 10 debian:7: Ok gcc (Debian 4.7.2-5) 4.7.2 11 debian:8: Ok gcc (Debian 4.9.2-10) 4.9.2 12 debian:9: Ok gcc (Debian 6.3.0-18) 6.3.0 20170516 13 debian:experimental: Ok gcc (Debian 7.2.0-11) 7.2.0 14 debian:experimental-x-arm64: Ok aarch64-linux-gnu-gcc (Debian 7.2.0-6) 7.2.0 15 debian:experimental-x-mips: Ok mips-linux-gnu-gcc (Debian 7.2.0-6) 7.2.0 16 debian:experimental-x-mips64: Ok mips64-linux-gnuabi64-gcc (Debian 7.2.0-6) 7.2.0 17 debian:experimental-x-mipsel: Ok mipsel-linux-gnu-gcc (Debian 7.2.0-6) 7.2.0 18 fedora:20: Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7) 19 fedora:21: Ok gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6) 20 fedora:22: Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 21 fedora:23: Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) 22 fedora:24: Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) 23 fedora:24-x-ARC-uClibc: Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 24 fedora:25: Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1) 25 fedora:26: Ok gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2) 26 fedora:rawhide: Ok gcc (GCC) 7.2.1 20170829 (Red Hat 7.2.1-1) 27 mageia:5: Ok gcc (GCC) 4.9.2 28 mageia:6: Ok gcc (Mageia 5.4.0-5.mga6) 5.4.0 29 opensuse:42.1: Ok gcc (SUSE Linux) 4.8.5 30 opensuse:42.2: Ok gcc (SUSE Linux) 4.8.5 31 opensuse:42.3: Ok gcc (SUSE Linux) 4.8.5 32 opensuse:tumbleweed: Ok gcc (SUSE Linux) 7.2.1 20170901 [gcc-7-branch revision 251580] 33 oraclelinux:6: Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) 34 oraclelinux:7: Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16) 35 ubuntu:12.04.5: Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 36 ubuntu:14.04.4: Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 37 ubuntu:14.04.4-x-linaro-arm64: Ok aarch64-linux-gnu-gcc (Linaro GCC 5.4-2017.05) 5.4.1 20170404 38 ubuntu:15.04: Ok gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2 39 ubuntu:15.10: Ok gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010 40 ubuntu:16.04: Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609 41 ubuntu:16.04-x-arm: Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 42 ubuntu:16.04-x-arm64: Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 43 ubuntu:16.04-x-powerpc: Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 44 ubuntu:16.04-x-powerpc64: Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609 45 ubuntu:16.04-x-powerpc64el: Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 46 ubuntu:16.04-x-s390: Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 47 ubuntu:16.10: Ok gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005 48 ubuntu:17.04: Ok gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406 49 ubuntu:17.10: Ok gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0 # # uname -a Linux jouet 4.14.0-rc6+ #1 SMP Tue Oct 31 14:43:51 -03 2017 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Test data source output : Ok 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 10: DSO data read : Ok 11: DSO data cache : Ok 12: DSO data reopen : Ok 13: Roundtrip evsel->name : Ok 14: Parse sched tracepoints fields : Ok 15: syscalls:sys_enter_openat event fields : Ok 16: Setup struct perf_event_attr : Ok 17: Match and link multiple hists : Ok 18: 'import perf' in python : Ok 19: Breakpoint overflow signal handler : Ok 20: Breakpoint overflow sampling : Ok 21: Number of exit events of a simple workload : Ok 22: Software clock events period values : Ok 23: Object code reading : Ok 24: Sample parsing : Ok 25: Use a dummy software event to keep tracking : Ok 26: Parse with no sample_id_all bit set : Ok 27: Filter hist entries : Ok 28: Lookup mmap thread : Ok 29: Share thread mg : Ok 30: Sort output of hist entries : Ok 31: Cumulate child hist entries : Ok 32: Track with sched_switch : Ok 33: Filter fds with revents mask in a fdarray : Ok 34: Add fd to a fdarray, making it autogrow : Ok 35: kmod_path__parse : Ok 36: Thread map : Ok 37: LLVM search and compile : 37.1: Basic BPF llvm compile : Ok 37.2: kbuild searching : Ok 37.3: Compile source for BPF prologue generation : Ok 37.4: Compile source for BPF relocation : Ok 38: Session topology : Ok 39: BPF filter : 39.1: Basic BPF filtering : Ok 39.2: BPF pinning : Ok 39.3: BPF prologue generation : Ok 39.4: BPF relocation checker : Ok 40: Synthesize thread map : Ok 41: Remove thread map : Ok 42: Synthesize cpu map : Ok 43: Synthesize stat config : Ok 44: Synthesize stat : Ok 45: Synthesize stat round : Ok 46: Synthesize attr update : Ok 47: Event times : Ok 48: Read backward ring buffer : Ok 49: Print cpu map : Ok 50: Probe SDT events : Ok 51: is_printable_array : Ok 52: Print bitmap : Ok 53: perf hooks : Ok 54: builtin clang support : Skip (not compiled in) 55: unit_number__scnprintf : Ok 56: x86 rdpmc : Ok 57: Convert perf time to TSC : Ok 58: DWARF unwind : Ok 59: x86 instruction decoder - new instructions : Ok 60: Use vfs_getname probe to get syscall args filenames : Ok 61: probe libc's inet_pton & backtrace it with ping : Ok 62: Check open filename arg using perf trace + vfs_getname: Ok 63: Add vfs_getname probe to get syscall args filenames : Ok # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_clean_all_O: make clean all make_no_libnuma_O: make NO_LIBNUMA=1 make_no_demangle_O: make NO_DEMANGLE=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_gtk2_O: make NO_GTK2=1 make_static_O: make LDFLAGS=-static make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_pure_O: make make_no_libaudit_O: make NO_LIBAUDIT=1 make_debug_O: make DEBUG=1 make_no_newt_O: make NO_NEWT=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_slang_O: make NO_SLANG=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libbionic_O: make NO_LIBBIONIC=1 make_doc_O: make doc make_tags_O: make tags make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libelf_O: make NO_LIBELF=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_help_O: make help make_no_libbpf_O: make NO_LIBBPF=1 make_perf_o_O: make perf.o make_no_libunwind_O: make NO_LIBUNWIND=1 make_install_O: make install make_util_map_o_O: make util/map.o make_install_bin_O: make install-bin make_no_backtrace_O: make NO_BACKTRACE=1 make_no_libperl_O: make NO_LIBPERL=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH 01/19] perf script: Add a few missing conversions to fprintf style 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 02/19] perf script: Use pr_debug where appropriate Arnaldo Carvalho de Melo ` (17 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> In a1a587073ccd ("perf script: Use fprintf like printing uniformly") there were a few cases that were missed, fix it. Reported-by: yuzhoujian <yuzhoujian@didichuxing.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-sq9hvfk5mkjdqzlpyiq7jkos@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-script.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index a3add2cd7856..db4ff1510dc5 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1447,7 +1447,7 @@ static void process_event(struct perf_script *script, perf_sample__fprintf_start(sample, thread, evsel, fp); if (PRINT_FIELD(PERIOD)) - printf("%10" PRIu64 " ", sample->period); + fprintf(fp, "%10" PRIu64 " ", sample->period); if (PRINT_FIELD(EVNAME)) { const char *evname = perf_evsel__name(evsel); @@ -1455,8 +1455,7 @@ static void process_event(struct perf_script *script, if (!script->name_width) script->name_width = perf_evlist__max_name_len(script->session->evlist); - printf("%*s: ", script->name_width, - evname ? evname : "[unknown]"); + fprintf(fp, "%*s: ", script->name_width, evname ?: "[unknown]"); } if (print_flags) @@ -1513,8 +1512,8 @@ static void process_event(struct perf_script *script, perf_sample__fprintf_insn(sample, attr, thread, machine, fp); if (PRINT_FIELD(PHYS_ADDR)) - printf("%16" PRIx64, sample->phys_addr); - printf("\n"); + fprintf(fp, "%16" PRIx64, sample->phys_addr); + fprintf(fp, "\n"); } static struct scripting_ops *scripting_ops; -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 02/19] perf script: Use pr_debug where appropriate 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 01/19] perf script: Add a few missing conversions to fprintf style Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 03/19] perf script: Use event_format__fprintf() Arnaldo Carvalho de Melo ` (16 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, David Ahern, Jiri Olsa, Michael Ellerman, Namhyung Kim, Wang Nan, yuzhoujian From: Arnaldo Carvalho de Melo <acme@redhat.com> We have facilities for reporting unexpected, unlikely errors, use them. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Cc: yuzhoujian <yuzhoujian@didichuxing.com> Link: http://lkml.kernel.org/n/tip-c7j22xfjf1j773g7ufp607q0@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-script.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index db4ff1510dc5..af0267072d43 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -769,27 +769,26 @@ static int grab_bb(u8 *buffer, u64 start, u64 end, * but the exit is not. Let the caller patch it up. */ if (kernel != machine__kernel_ip(machine, end)) { - printf("\tblock %" PRIx64 "-%" PRIx64 " transfers between kernel and user\n", - start, end); + pr_debug("\tblock %" PRIx64 "-%" PRIx64 " transfers between kernel and user\n", start, end); return -ENXIO; } memset(&al, 0, sizeof(al)); if (end - start > MAXBB - MAXINSN) { if (last) - printf("\tbrstack does not reach to final jump (%" PRIx64 "-%" PRIx64 ")\n", start, end); + pr_debug("\tbrstack does not reach to final jump (%" PRIx64 "-%" PRIx64 ")\n", start, end); else - printf("\tblock %" PRIx64 "-%" PRIx64 " (%" PRIu64 ") too long to dump\n", start, end, end - start); + pr_debug("\tblock %" PRIx64 "-%" PRIx64 " (%" PRIu64 ") too long to dump\n", start, end, end - start); return 0; } thread__find_addr_map(thread, *cpumode, MAP__FUNCTION, start, &al); if (!al.map || !al.map->dso) { - printf("\tcannot resolve %" PRIx64 "-%" PRIx64 "\n", start, end); + pr_debug("\tcannot resolve %" PRIx64 "-%" PRIx64 "\n", start, end); return 0; } if (al.map->dso->data.status == DSO_DATA_STATUS_ERROR) { - printf("\tcannot resolve %" PRIx64 "-%" PRIx64 "\n", start, end); + pr_debug("\tcannot resolve %" PRIx64 "-%" PRIx64 "\n", start, end); return 0; } @@ -802,7 +801,7 @@ static int grab_bb(u8 *buffer, u64 start, u64 end, *is64bit = al.map->dso->is_64_bit; if (len <= 0) - printf("\tcannot fetch code for block at %" PRIx64 "-%" PRIx64 "\n", + pr_debug("\tcannot fetch code for block at %" PRIx64 "-%" PRIx64 "\n", start, end); return len; } -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 03/19] perf script: Use event_format__fprintf() 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 01/19] perf script: Add a few missing conversions to fprintf style Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 02/19] perf script: Use pr_debug where appropriate Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 04/19] perf evsel: Restore evsel->priv as a tool private area Arnaldo Carvalho de Melo ` (15 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan, yuzhoujian From: Arnaldo Carvalho de Melo <acme@redhat.com> Another case where we a1a587073ccd ("perf script: Use fprintf like printing uniformly") forgot to redirect output to the FILE descriptor, fix this too. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Cc: yuzhoujian <yuzhoujian@didichuxing.com> Link: http://lkml.kernel.org/n/tip-jmwx4pgfezw98ezfoj9t957s@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-script.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index af0267072d43..b27f21638207 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1465,9 +1465,10 @@ static void process_event(struct perf_script *script, return; } - if (PRINT_FIELD(TRACE)) - event_format__print(evsel->tp_format, sample->cpu, - sample->raw_data, sample->raw_size); + if (PRINT_FIELD(TRACE)) { + event_format__fprintf(evsel->tp_format, sample->cpu, + sample->raw_data, sample->raw_size, fp); + } if (attr->type == PERF_TYPE_SYNTH && PRINT_FIELD(SYNTH)) perf_sample__fprintf_synth(sample, evsel, fp); -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 04/19] perf evsel: Restore evsel->priv as a tool private area 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (2 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 03/19] perf script: Use event_format__fprintf() Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 05/19] perf script: Allow creating per-event dump files Arnaldo Carvalho de Melo ` (14 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan, yuzhoujian From: Arnaldo Carvalho de Melo <acme@redhat.com> When we started using it for stats and did it not just in builtin-stat.c, but also for builtin-script.c, then it stopped being a tool private area, so introduce a new pointer for these stats and leave ->priv to its original purpose. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Cc: yuzhoujian <yuzhoujian@didichuxing.com> Fixes: cfc8874a4859 ("perf script: Process cpu/threads maps") Link: http://lkml.kernel.org/n/tip-jtpzx3rjqo78snmmsdzwb2eb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-stat.c | 4 ++-- tools/perf/util/evsel.h | 3 +++ tools/perf/util/stat.c | 16 ++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index dd525417880a..988bdfa5d832 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -845,7 +845,7 @@ static void print_noise(struct perf_evsel *evsel, double avg) if (run_count == 1) return; - ps = evsel->priv; + ps = evsel->stats; print_noise_pct(stddev_stats(&ps->res_stats[0]), avg); } @@ -1432,7 +1432,7 @@ static void counter_aggr_cb(struct perf_evsel *counter, void *data, bool first __maybe_unused) { struct caggr_data *cd = data; - struct perf_stat_evsel *ps = counter->priv; + struct perf_stat_evsel *ps = counter->stats; cd->avg += avg_stats(&ps->res_stats[0]); cd->avg_enabled += avg_stats(&ps->res_stats[1]); diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index db658785d828..64782b19089d 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -68,6 +68,8 @@ struct perf_evsel_config_term { } val; }; +struct perf_stat_evsel; + /** struct perf_evsel - event selector * * @evlist - evlist this evsel is in, if it is in one. @@ -101,6 +103,7 @@ struct perf_evsel { const char *unit; struct event_format *tp_format; off_t id_offset; + struct perf_stat_evsel *stats; void *priv; u64 db_id; struct cgroup_sel *cgrp; diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 35e9848734d6..933de91831fa 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -69,7 +69,7 @@ double rel_stddev_stats(double stddev, double avg) bool __perf_evsel_stat__is(struct perf_evsel *evsel, enum perf_stat_evsel_id id) { - struct perf_stat_evsel *ps = evsel->priv; + struct perf_stat_evsel *ps = evsel->stats; return ps->id == id; } @@ -93,7 +93,7 @@ static const char *id_str[PERF_STAT_EVSEL_ID__MAX] = { void perf_stat_evsel_id_init(struct perf_evsel *evsel) { - struct perf_stat_evsel *ps = evsel->priv; + struct perf_stat_evsel *ps = evsel->stats; int i; /* ps->id is 0 hence PERF_STAT_EVSEL_ID__NONE by default */ @@ -109,7 +109,7 @@ void perf_stat_evsel_id_init(struct perf_evsel *evsel) static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) { int i; - struct perf_stat_evsel *ps = evsel->priv; + struct perf_stat_evsel *ps = evsel->stats; for (i = 0; i < 3; i++) init_stats(&ps->res_stats[i]); @@ -119,8 +119,8 @@ static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel) { - evsel->priv = zalloc(sizeof(struct perf_stat_evsel)); - if (evsel->priv == NULL) + evsel->stats = zalloc(sizeof(struct perf_stat_evsel)); + if (evsel->stats == NULL) return -ENOMEM; perf_evsel__reset_stat_priv(evsel); return 0; @@ -128,11 +128,11 @@ static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel) static void perf_evsel__free_stat_priv(struct perf_evsel *evsel) { - struct perf_stat_evsel *ps = evsel->priv; + struct perf_stat_evsel *ps = evsel->stats; if (ps) free(ps->group_data); - zfree(&evsel->priv); + zfree(&evsel->stats); } static int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel, @@ -318,7 +318,7 @@ int perf_stat_process_counter(struct perf_stat_config *config, struct perf_evsel *counter) { struct perf_counts_values *aggr = &counter->counts->aggr; - struct perf_stat_evsel *ps = counter->priv; + struct perf_stat_evsel *ps = counter->stats; u64 *count = counter->counts->aggr.values; u64 val; int i, ret; -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 05/19] perf script: Allow creating per-event dump files 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (3 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 04/19] perf evsel: Restore evsel->priv as a tool private area Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 06/19] tools include uapi: Grab a copy of linux/prctl.h Arnaldo Carvalho de Melo ` (13 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> Introduce a new option to dump trace output to files named by the monitored events and update perf-script documentation accordingly. Shown below is output of perf script command with the newly introduced option. $ perf record -e cycles -e cs -ag -- sleep 1 $ perf script --per-event-dump $ ls perf.data.cycles.dump perf.data.cs.dump Without per-event-dump support, drawing flamegraphs for different events would require post processing to separate events. You can monitor only one event at a time if you want to get flamegraphs for different events. Using this option, you can get the trace output files named by the monitored events, and could draw flamegraphs according to the event's name. Based-on-a-patch-by: yuzhoujian <yuzhoujian@didichuxing.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/r/1508921599-10832-3-git-send-email-yuzhoujian@didichuxing.com Link: http://lkml.kernel.org/n/tip-8ngzsjdhgiovkupl3r5yy570@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Documentation/perf-script.txt | 4 +++ tools/perf/builtin-script.c | 59 +++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt index 25e677344728..2811fcf684cb 100644 --- a/tools/perf/Documentation/perf-script.txt +++ b/tools/perf/Documentation/perf-script.txt @@ -325,6 +325,10 @@ include::itrace.txt[] Set the maximum number of program blocks to print with brstackasm for each sample. +--per-event-dump:: + Create per event files with a "perf.data.EVENT.dump" name instead of + printing to stdout, useful, for instance, for generating flamegraphs. + --inline:: If a callgraph address belongs to an inlined function, the inline stack will be printed. Each entry has function name and file/line. Enabled by diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index b27f21638207..fb5e49b3bc44 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1392,6 +1392,7 @@ struct perf_script { bool show_switch_events; bool show_namespace_events; bool allocated; + bool per_event_dump; struct cpu_map *cpus; struct thread_map *threads; int name_width; @@ -1438,7 +1439,7 @@ static void process_event(struct perf_script *script, struct thread *thread = al->thread; struct perf_event_attr *attr = &evsel->attr; unsigned int type = output_type(attr->type); - FILE *fp = stdout; + FILE *fp = evsel->priv; if (output[type].fields == 0) return; @@ -1887,6 +1888,52 @@ static void sig_handler(int sig __maybe_unused) session_done = 1; } +static void perf_script__fclose_per_event_dump(struct perf_script *script) +{ + struct perf_evlist *evlist = script->session->evlist; + struct perf_evsel *evsel; + + evlist__for_each_entry(evlist, evsel) { + if (!evsel->priv) + break; + fclose(evsel->priv); + evsel->priv = NULL; + } +} + +static int perf_script__fopen_per_event_dump(struct perf_script *script) +{ + struct perf_evsel *evsel; + + evlist__for_each_entry(script->session->evlist, evsel) { + char filename[PATH_MAX]; + snprintf(filename, sizeof(filename), "%s.%s.dump", + script->session->file->path, perf_evsel__name(evsel)); + evsel->priv = fopen(filename, "w"); + if (evsel->priv == NULL) + goto out_err_fclose; + } + + return 0; + +out_err_fclose: + perf_script__fclose_per_event_dump(script); + return -1; +} + +static int perf_script__setup_per_event_dump(struct perf_script *script) +{ + struct perf_evsel *evsel; + + if (script->per_event_dump) + return perf_script__fopen_per_event_dump(script); + + evlist__for_each_entry(script->session->evlist, evsel) + evsel->priv = stdout; + + return 0; +} + static int __cmd_script(struct perf_script *script) { int ret; @@ -1908,8 +1955,16 @@ static int __cmd_script(struct perf_script *script) if (script->show_namespace_events) script->tool.namespaces = process_namespaces_event; + if (perf_script__setup_per_event_dump(script)) { + pr_err("Couldn't create the per event dump files\n"); + return -1; + } + ret = perf_session__process_events(script->session); + if (script->per_event_dump) + perf_script__fclose_per_event_dump(script); + if (debug_mode) pr_err("Misordered timestamps: %" PRIu64 "\n", nr_unordered); @@ -2827,6 +2882,8 @@ int cmd_script(int argc, const char **argv) "Show context switch events (if recorded)"), OPT_BOOLEAN('\0', "show-namespace-events", &script.show_namespace_events, "Show namespace events (if recorded)"), + OPT_BOOLEAN('\0', "per-event-dump", &script.per_event_dump, + "Dump trace output to files named by the monitored events"), OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"), OPT_INTEGER(0, "max-blocks", &max_blocks, "Maximum number of code blocks to dump with brstackinsn"), -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 06/19] tools include uapi: Grab a copy of linux/prctl.h 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (4 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 05/19] perf script: Allow creating per-event dump files Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 07/19] perf trace beauty prctl: Generate 'option' string table from kernel headers Arnaldo Carvalho de Melo ` (12 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Andy Lutomirski, Adrian Hunter, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> We will use it to generate tables for beautifying prctl's 'option' arg and some of the others eventually. Cc: Andy Lutomirski <luto@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-cg8mpmz4hk9nfih685emnbk9@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/include/uapi/linux/prctl.h | 200 +++++++++++++++++++++++++++++++++++++++ tools/perf/check-headers.sh | 1 + 2 files changed, 201 insertions(+) create mode 100644 tools/include/uapi/linux/prctl.h diff --git a/tools/include/uapi/linux/prctl.h b/tools/include/uapi/linux/prctl.h new file mode 100644 index 000000000000..a8d0759a9e40 --- /dev/null +++ b/tools/include/uapi/linux/prctl.h @@ -0,0 +1,200 @@ +#ifndef _LINUX_PRCTL_H +#define _LINUX_PRCTL_H + +#include <linux/types.h> + +/* Values to pass as first argument to prctl() */ + +#define PR_SET_PDEATHSIG 1 /* Second arg is a signal */ +#define PR_GET_PDEATHSIG 2 /* Second arg is a ptr to return the signal */ + +/* Get/set current->mm->dumpable */ +#define PR_GET_DUMPABLE 3 +#define PR_SET_DUMPABLE 4 + +/* Get/set unaligned access control bits (if meaningful) */ +#define PR_GET_UNALIGN 5 +#define PR_SET_UNALIGN 6 +# define PR_UNALIGN_NOPRINT 1 /* silently fix up unaligned user accesses */ +# define PR_UNALIGN_SIGBUS 2 /* generate SIGBUS on unaligned user access */ + +/* Get/set whether or not to drop capabilities on setuid() away from + * uid 0 (as per security/commoncap.c) */ +#define PR_GET_KEEPCAPS 7 +#define PR_SET_KEEPCAPS 8 + +/* Get/set floating-point emulation control bits (if meaningful) */ +#define PR_GET_FPEMU 9 +#define PR_SET_FPEMU 10 +# define PR_FPEMU_NOPRINT 1 /* silently emulate fp operations accesses */ +# define PR_FPEMU_SIGFPE 2 /* don't emulate fp operations, send SIGFPE instead */ + +/* Get/set floating-point exception mode (if meaningful) */ +#define PR_GET_FPEXC 11 +#define PR_SET_FPEXC 12 +# define PR_FP_EXC_SW_ENABLE 0x80 /* Use FPEXC for FP exception enables */ +# define PR_FP_EXC_DIV 0x010000 /* floating point divide by zero */ +# define PR_FP_EXC_OVF 0x020000 /* floating point overflow */ +# define PR_FP_EXC_UND 0x040000 /* floating point underflow */ +# define PR_FP_EXC_RES 0x080000 /* floating point inexact result */ +# define PR_FP_EXC_INV 0x100000 /* floating point invalid operation */ +# define PR_FP_EXC_DISABLED 0 /* FP exceptions disabled */ +# define PR_FP_EXC_NONRECOV 1 /* async non-recoverable exc. mode */ +# define PR_FP_EXC_ASYNC 2 /* async recoverable exception mode */ +# define PR_FP_EXC_PRECISE 3 /* precise exception mode */ + +/* Get/set whether we use statistical process timing or accurate timestamp + * based process timing */ +#define PR_GET_TIMING 13 +#define PR_SET_TIMING 14 +# define PR_TIMING_STATISTICAL 0 /* Normal, traditional, + statistical process timing */ +# define PR_TIMING_TIMESTAMP 1 /* Accurate timestamp based + process timing */ + +#define PR_SET_NAME 15 /* Set process name */ +#define PR_GET_NAME 16 /* Get process name */ + +/* Get/set process endian */ +#define PR_GET_ENDIAN 19 +#define PR_SET_ENDIAN 20 +# define PR_ENDIAN_BIG 0 +# define PR_ENDIAN_LITTLE 1 /* True little endian mode */ +# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ + +/* Get/set process seccomp mode */ +#define PR_GET_SECCOMP 21 +#define PR_SET_SECCOMP 22 + +/* Get/set the capability bounding set (as per security/commoncap.c) */ +#define PR_CAPBSET_READ 23 +#define PR_CAPBSET_DROP 24 + +/* Get/set the process' ability to use the timestamp counter instruction */ +#define PR_GET_TSC 25 +#define PR_SET_TSC 26 +# define PR_TSC_ENABLE 1 /* allow the use of the timestamp counter */ +# define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */ + +/* Get/set securebits (as per security/commoncap.c) */ +#define PR_GET_SECUREBITS 27 +#define PR_SET_SECUREBITS 28 + +/* + * Get/set the timerslack as used by poll/select/nanosleep + * A value of 0 means "use default" + */ +#define PR_SET_TIMERSLACK 29 +#define PR_GET_TIMERSLACK 30 + +#define PR_TASK_PERF_EVENTS_DISABLE 31 +#define PR_TASK_PERF_EVENTS_ENABLE 32 + +/* + * Set early/late kill mode for hwpoison memory corruption. + * This influences when the process gets killed on a memory corruption. + */ +#define PR_MCE_KILL 33 +# define PR_MCE_KILL_CLEAR 0 +# define PR_MCE_KILL_SET 1 + +# define PR_MCE_KILL_LATE 0 +# define PR_MCE_KILL_EARLY 1 +# define PR_MCE_KILL_DEFAULT 2 + +#define PR_MCE_KILL_GET 34 + +/* + * Tune up process memory map specifics. + */ +#define PR_SET_MM 35 +# define PR_SET_MM_START_CODE 1 +# define PR_SET_MM_END_CODE 2 +# define PR_SET_MM_START_DATA 3 +# define PR_SET_MM_END_DATA 4 +# define PR_SET_MM_START_STACK 5 +# define PR_SET_MM_START_BRK 6 +# define PR_SET_MM_BRK 7 +# define PR_SET_MM_ARG_START 8 +# define PR_SET_MM_ARG_END 9 +# define PR_SET_MM_ENV_START 10 +# define PR_SET_MM_ENV_END 11 +# define PR_SET_MM_AUXV 12 +# define PR_SET_MM_EXE_FILE 13 +# define PR_SET_MM_MAP 14 +# define PR_SET_MM_MAP_SIZE 15 + +/* + * This structure provides new memory descriptor + * map which mostly modifies /proc/pid/stat[m] + * output for a task. This mostly done in a + * sake of checkpoint/restore functionality. + */ +struct prctl_mm_map { + __u64 start_code; /* code section bounds */ + __u64 end_code; + __u64 start_data; /* data section bounds */ + __u64 end_data; + __u64 start_brk; /* heap for brk() syscall */ + __u64 brk; + __u64 start_stack; /* stack starts at */ + __u64 arg_start; /* command line arguments bounds */ + __u64 arg_end; + __u64 env_start; /* environment variables bounds */ + __u64 env_end; + __u64 *auxv; /* auxiliary vector */ + __u32 auxv_size; /* vector size */ + __u32 exe_fd; /* /proc/$pid/exe link file */ +}; + +/* + * Set specific pid that is allowed to ptrace the current task. + * A value of 0 mean "no process". + */ +#define PR_SET_PTRACER 0x59616d61 +# define PR_SET_PTRACER_ANY ((unsigned long)-1) + +#define PR_SET_CHILD_SUBREAPER 36 +#define PR_GET_CHILD_SUBREAPER 37 + +/* + * If no_new_privs is set, then operations that grant new privileges (i.e. + * execve) will either fail or not grant them. This affects suid/sgid, + * file capabilities, and LSMs. + * + * Operations that merely manipulate or drop existing privileges (setresuid, + * capset, etc.) will still work. Drop those privileges if you want them gone. + * + * Changing LSM security domain is considered a new privilege. So, for example, + * asking selinux for a specific new context (e.g. with runcon) will result + * in execve returning -EPERM. + * + * See Documentation/prctl/no_new_privs.txt for more details. + */ +#define PR_SET_NO_NEW_PRIVS 38 +#define PR_GET_NO_NEW_PRIVS 39 + +#define PR_GET_TID_ADDRESS 40 + +#define PR_SET_THP_DISABLE 41 +#define PR_GET_THP_DISABLE 42 + +/* + * Tell the kernel to start/stop helping userspace manage bounds tables. + */ +#define PR_MPX_ENABLE_MANAGEMENT 43 +#define PR_MPX_DISABLE_MANAGEMENT 44 + +#define PR_SET_FP_MODE 45 +#define PR_GET_FP_MODE 46 +# define PR_FP_MODE_FR (1 << 0) /* 64b FP registers */ +# define PR_FP_MODE_FRE (1 << 1) /* 32b compatibility */ + +/* Control the ambient capability set */ +#define PR_CAP_AMBIENT 47 +# define PR_CAP_AMBIENT_IS_SET 1 +# define PR_CAP_AMBIENT_RAISE 2 +# define PR_CAP_AMBIENT_LOWER 3 +# define PR_CAP_AMBIENT_CLEAR_ALL 4 + +#endif /* _LINUX_PRCTL_H */ diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index 322629423b49..8d8b37198666 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh @@ -6,6 +6,7 @@ include/uapi/drm/i915_drm.h include/uapi/linux/fcntl.h include/uapi/linux/kvm.h include/uapi/linux/perf_event.h +include/uapi/linux/prctl.h include/uapi/linux/sched.h include/uapi/linux/stat.h include/uapi/linux/vhost.h -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 07/19] perf trace beauty prctl: Generate 'option' string table from kernel headers 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (5 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 06/19] tools include uapi: Grab a copy of linux/prctl.h Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 08/19] perf script: Print information about per-event-dump files Arnaldo Carvalho de Melo ` (11 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andy Lutomirski, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> This is one more case where the way that syscall parameter values are defined in kernel headers are easy to parse using a shell script that will then generate the string table that gets used by the prctl 'option' argument beautifier. This way as soon as the header syncronization mechanism in perf's build system detects a change in a copy of a kernel ABI header and that file is syncronized, we get 'perf trace' updated automagically. Further work needed for the PR_SET_ values, as well for using eBPF to copy the non-integer arguments to/from the kernel. E.g.: System wide prctl tracing: # perf trace -e prctl 1668.028 ( 0.025 ms): TaskSchedulerR/10649 prctl(option: SET_NAME, arg2: 0x2b61d5db15d0) = 0 3365.663 ( 0.018 ms): chrome/10650 prctl(option: SET_SECCOMP, arg2: 2, arg4: 8 ) = -1 EFAULT Bad address 3366.585 ( 0.010 ms): chrome/10650 prctl(option: SET_NO_NEW_PRIVS, arg2: 1 ) = 0 3367.173 ( 0.009 ms): TaskSchedulerR/10652 prctl(option: SET_NAME, arg2: 0x2b61d2aaa300) = 0 3367.222 ( 0.003 ms): TaskSchedulerR/10653 prctl(option: SET_NAME, arg2: 0x2b61d2aaa1e0) = 0 3367.244 ( 0.002 ms): TaskSchedulerR/10654 prctl(option: SET_NAME, arg2: 0x2b61d2aaa0c0) = 0 3367.265 ( 0.002 ms): TaskSchedulerR/10655 prctl(option: SET_NAME, arg2: 0x2b61d2ac7f90) = 0 3367.281 ( 0.002 ms): Chrome_ChildIO/10656 prctl(option: SET_NAME, arg2: 0x7efbe406bb11) = 0 3367.220 ( 0.004 ms): TaskSchedulerS/10651 prctl(option: SET_NAME, arg2: 0x2b61d2ac1be0) = 0 3370.906 ( 0.010 ms): GpuMemoryThrea/10657 prctl(option: SET_NAME, arg2: 0x7efbe386ab11) = 0 3370.983 ( 0.003 ms): File/10658 prctl(option: SET_NAME, arg2: 0x7efbe3069b11 ) = 0 3384.272 ( 0.020 ms): Compositor/10659 prctl(option: SET_NAME, arg2: 0x7efbe2868b11 ) = 0 3612.091 ( 0.012 ms): DOM Worker/11489 prctl(option: SET_NAME, arg2: 0x7f49ab97ebf2 ) = 0 <SNIP> 4512.437 ( 0.004 ms): (sa1)/11490 prctl(option: SET_NAME, arg2: 0x7ffca15af844 ) = 0 4512.468 ( 0.002 ms): (sa1)/11490 prctl(option: SET_MM, arg2: ARG_START, arg3: 0x7f5cb7c81000) = 0 4512.472 ( 0.001 ms): (sa1)/11490 prctl(option: SET_MM, arg2: ARG_END, arg3: 0x7f5cb7c81006) = 0 4514.667 ( 0.002 ms): (sa1)/11490 prctl(option: GET_SECUREBITS ) = 0 Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-q0s2uw579o5ei6xlh2zjirgz@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Makefile.perf | 13 +++++- tools/perf/builtin-trace.c | 5 +- tools/perf/trace/beauty/Build | 1 + tools/perf/trace/beauty/beauty.h | 9 ++++ tools/perf/trace/beauty/prctl.c | 82 +++++++++++++++++++++++++++++++++ tools/perf/trace/beauty/prctl_option.sh | 17 +++++++ 6 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 tools/perf/trace/beauty/prctl.c create mode 100755 tools/perf/trace/beauty/prctl_option.sh diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 5f7408118a2d..c872ca607b39 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -448,6 +448,13 @@ madvise_behavior_tbl := $(srctree)/tools/perf/trace/beauty/madvise_behavior.sh $(madvise_behavior_array): $(madvise_hdr_dir)/mman-common.h $(madvise_behavior_tbl) $(Q)$(SHELL) '$(madvise_behavior_tbl)' $(madvise_hdr_dir) > $@ +prctl_option_array := $(beauty_outdir)/prctl_option_array.c +prctl_hdr_dir := $(srctree)/tools/include/uapi/linux/ +prctl_option_tbl := $(srctree)/tools/perf/trace/beauty/prctl_option.sh + +$(prctl_option_array): $(prctl_hdr_dir)/prctl.h $(prctl_option_tbl) + $(Q)$(SHELL) '$(prctl_option_tbl)' $(prctl_hdr_dir) > $@ + all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS) $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST) @@ -549,7 +556,8 @@ prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioc $(kvm_ioctl_array) \ $(vhost_virtio_ioctl_array) \ $(madvise_behavior_array) \ - $(perf_ioctl_array) + $(perf_ioctl_array) \ + $(prctl_option_array) $(OUTPUT)%.o: %.c prepare FORCE $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@ @@ -829,7 +837,8 @@ clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clea $(OUTPUT)$(sndrv_pcm_ioctl_array) \ $(OUTPUT)$(kvm_ioctl_array) \ $(OUTPUT)$(vhost_virtio_ioctl_array) \ - $(OUTPUT)$(perf_ioctl_array) + $(OUTPUT)$(perf_ioctl_array) \ + $(OUTPUT)$(prctl_option_array) $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean # diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 8b23982dd9f2..78855916f4b0 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -578,7 +578,6 @@ static struct syscall_fmt { } syscall_fmts[] = { { .name = "access", .arg = { [1] = { .scnprintf = SCA_ACCMODE, /* mode */ }, }, }, - { .name = "arch_prctl", .alias = "prctl", }, { .name = "bpf", .arg = { [0] = STRARRAY(cmd, bpf_cmd), }, }, { .name = "brk", .hexret = true, @@ -703,6 +702,10 @@ static struct syscall_fmt { [3] = { .scnprintf = SCA_INT, /* pkey */ }, }, }, { .name = "poll", .timeout = true, }, { .name = "ppoll", .timeout = true, }, + { .name = "prctl", .alias = "arch_prctl", + .arg = { [0] = { .scnprintf = SCA_PRCTL_OPTION, /* option */ }, + [1] = { .scnprintf = SCA_PRCTL_ARG2, /* arg2 */ }, + [2] = { .scnprintf = SCA_PRCTL_ARG3, /* arg3 */ }, }, }, { .name = "pread", .alias = "pread64", }, { .name = "preadv", .alias = "pread", }, { .name = "prlimit64", diff --git a/tools/perf/trace/beauty/Build b/tools/perf/trace/beauty/Build index 175d633c6b49..2f68b76ec39b 100644 --- a/tools/perf/trace/beauty/Build +++ b/tools/perf/trace/beauty/Build @@ -4,4 +4,5 @@ ifeq ($(SRCARCH),$(filter $(SRCARCH),x86)) libperf-y += ioctl.o endif libperf-y += pkey_alloc.o +libperf-y += prctl.o libperf-y += statx.o diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h index 4b58581a6053..b29f94ef5d6a 100644 --- a/tools/perf/trace/beauty/beauty.h +++ b/tools/perf/trace/beauty/beauty.h @@ -84,6 +84,15 @@ size_t syscall_arg__scnprintf_pkey_alloc_access_rights(char *bf, size_t size, st size_t syscall_arg__scnprintf_open_flags(char *bf, size_t size, struct syscall_arg *arg); #define SCA_OPEN_FLAGS syscall_arg__scnprintf_open_flags +size_t syscall_arg__scnprintf_prctl_option(char *bf, size_t size, struct syscall_arg *arg); +#define SCA_PRCTL_OPTION syscall_arg__scnprintf_prctl_option + +size_t syscall_arg__scnprintf_prctl_arg2(char *bf, size_t size, struct syscall_arg *arg); +#define SCA_PRCTL_ARG2 syscall_arg__scnprintf_prctl_arg2 + +size_t syscall_arg__scnprintf_prctl_arg3(char *bf, size_t size, struct syscall_arg *arg); +#define SCA_PRCTL_ARG3 syscall_arg__scnprintf_prctl_arg3 + size_t syscall_arg__scnprintf_statx_flags(char *bf, size_t size, struct syscall_arg *arg); #define SCA_STATX_FLAGS syscall_arg__scnprintf_statx_flags diff --git a/tools/perf/trace/beauty/prctl.c b/tools/perf/trace/beauty/prctl.c new file mode 100644 index 000000000000..246130dad6c4 --- /dev/null +++ b/tools/perf/trace/beauty/prctl.c @@ -0,0 +1,82 @@ +/* + * trace/beauty/prctl.c + * + * Copyright (C) 2017, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> + * + * Released under the GPL v2. (and only v2, not any later version) + */ + +#include "trace/beauty/beauty.h" +#include <linux/kernel.h> +#include <uapi/linux/prctl.h> + +#include "trace/beauty/generated/prctl_option_array.c" + +static size_t prctl__scnprintf_option(int option, char *bf, size_t size) +{ + static DEFINE_STRARRAY(prctl_options); + return strarray__scnprintf(&strarray__prctl_options, bf, size, "%d", option); +} + +static size_t prctl__scnprintf_set_mm(int option, char *bf, size_t size) +{ + static DEFINE_STRARRAY(prctl_set_mm_options); + return strarray__scnprintf(&strarray__prctl_set_mm_options, bf, size, "%d", option); +} + +size_t syscall_arg__scnprintf_prctl_arg2(char *bf, size_t size, struct syscall_arg *arg) +{ + int option = syscall_arg__val(arg, 0); + + if (option == PR_SET_MM) + return prctl__scnprintf_set_mm(arg->val, bf, size); + /* + * We still don't grab the contents of pointers on entry or exit, + * so just print them as hex numbers + */ + if (option == PR_SET_NAME) + return syscall_arg__scnprintf_hex(bf, size, arg); + + return syscall_arg__scnprintf_long(bf, size, arg); +} + +size_t syscall_arg__scnprintf_prctl_arg3(char *bf, size_t size, struct syscall_arg *arg) +{ + int option = syscall_arg__val(arg, 0); + + if (option == PR_SET_MM) + return syscall_arg__scnprintf_hex(bf, size, arg); + + return syscall_arg__scnprintf_long(bf, size, arg); +} + +size_t syscall_arg__scnprintf_prctl_option(char *bf, size_t size, struct syscall_arg *arg) +{ + unsigned long option = arg->val; + enum { + SPO_ARG2 = (1 << 1), + SPO_ARG3 = (1 << 2), + SPO_ARG4 = (1 << 3), + SPO_ARG5 = (1 << 4), + SPO_ARG6 = (1 << 5), + }; + const u8 all_but2 = SPO_ARG3 | SPO_ARG4 | SPO_ARG5 | SPO_ARG6; + const u8 all = SPO_ARG2 | all_but2; + const u8 masks[] = { + [PR_GET_DUMPABLE] = all, + [PR_SET_DUMPABLE] = all_but2, + [PR_SET_NAME] = all_but2, + [PR_GET_CHILD_SUBREAPER] = all_but2, + [PR_SET_CHILD_SUBREAPER] = all_but2, + [PR_GET_SECUREBITS] = all, + [PR_SET_SECUREBITS] = all_but2, + [PR_SET_MM] = SPO_ARG4 | SPO_ARG5 | SPO_ARG6, + [PR_GET_PDEATHSIG] = all, + [PR_SET_PDEATHSIG] = all_but2, + }; + + if (option < ARRAY_SIZE(masks)) + arg->mask |= masks[option]; + + return prctl__scnprintf_option(option, bf, size); +} diff --git a/tools/perf/trace/beauty/prctl_option.sh b/tools/perf/trace/beauty/prctl_option.sh new file mode 100755 index 000000000000..0be4138fbe71 --- /dev/null +++ b/tools/perf/trace/beauty/prctl_option.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +header_dir=$1 + +printf "static const char *prctl_options[] = {\n" +regex='^#define[[:space:]]+PR_([GS]ET\w+)[[:space:]]*([[:xdigit:]]+).*' +egrep $regex ${header_dir}/prctl.h | grep -v PR_SET_PTRACER | \ + sed -r "s/$regex/\2 \1/g" | \ + sort -n | xargs printf "\t[%s] = \"%s\",\n" +printf "};\n" + +printf "static const char *prctl_set_mm_options[] = {\n" +regex='^#[[:space:]]+define[[:space:]]+PR_SET_MM_(\w+)[[:space:]]*([[:digit:]]+).*' +egrep $regex ${header_dir}/prctl.h | \ + sed -r "s/$regex/\2 \1/g" | \ + sort -n | xargs printf "\t[%s] = \"%s\",\n" +printf "};\n" -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 08/19] perf script: Print information about per-event-dump files 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (6 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 07/19] perf trace beauty prctl: Generate 'option' string table from kernel headers Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 09/19] perf tools: Rename struct perf_data_file to perf_data Arnaldo Carvalho de Melo ` (10 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, Namhyung Kim, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> For a file generated by "perf sched record sleep 50": # perf script --per-event-dump [ perf script: Wrote 23.121 MB perf.data.sched:sched_switch.dump (206015 samples) ] [ perf script: Wrote 0.000 MB perf.data.sched:sched_stat_wait.dump (0 samples) ] [ perf script: Wrote 0.000 MB perf.data.sched:sched_stat_sleep.dump (0 samples) ] [ perf script: Wrote 0.000 MB perf.data.sched:sched_stat_iowait.dump (0 samples) ] [ perf script: Wrote 17.680 MB perf.data.sched:sched_stat_runtime.dump (129342 samples) ] [ perf script: Wrote 0.000 MB perf.data.sched:sched_process_fork.dump (24 samples) ] [ perf script: Wrote 11.328 MB perf.data.sched:sched_wakeup.dump (106770 samples) ] [ perf script: Wrote 0.000 MB perf.data.sched:sched_wakeup_new.dump (24 samples) ] [ perf script: Wrote 2.477 MB perf.data.sched:sched_migrate_task.dump (20434 samples) ] # Similar to what is generated by 'perf record'. Based-on-a-patch-by: yuzhoujian <yuzhoujian@didichuxing.com> Suggested-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/r/1508921599-10832-3-git-send-email-yuzhoujian@didichuxing.com Link: http://lkml.kernel.org/n/tip-xuketkkjuk2c0qz546ypd1u7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-script.c | 77 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 8 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index fb5e49b3bc44..4d198f73b29a 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -210,6 +210,51 @@ static struct { }, }; +struct perf_evsel_script { + char *filename; + FILE *fp; + u64 samples; +}; + +static struct perf_evsel_script *perf_evsel_script__new(struct perf_evsel *evsel, + struct perf_data_file *file) +{ + struct perf_evsel_script *es = malloc(sizeof(*es)); + + if (es != NULL) { + if (asprintf(&es->filename, "%s.%s.dump", file->path, perf_evsel__name(evsel)) < 0) + goto out_free; + es->fp = fopen(es->filename, "w"); + if (es->fp == NULL) + goto out_free_filename; + es->samples = 0; + } + + return es; +out_free_filename: + zfree(&es->filename); +out_free: + free(es); + return NULL; +} + +static void perf_evsel_script__delete(struct perf_evsel_script *es) +{ + zfree(&es->filename); + fclose(es->fp); + es->fp = NULL; + free(es); +} + +static int perf_evsel_script__fprintf(struct perf_evsel_script *es, FILE *fp) +{ + struct stat st; + + fstat(fileno(es->fp), &st); + return fprintf(fp, "[ perf script: Wrote %.3f MB %s (%" PRIu64 " samples) ]\n", + st.st_size / 1024.0 / 1024.0, es->filename, es->samples); +} + static inline int output_type(unsigned int type) { switch (type) { @@ -1439,11 +1484,14 @@ static void process_event(struct perf_script *script, struct thread *thread = al->thread; struct perf_event_attr *attr = &evsel->attr; unsigned int type = output_type(attr->type); - FILE *fp = evsel->priv; + struct perf_evsel_script *es = evsel->priv; + FILE *fp = es->fp; if (output[type].fields == 0) return; + ++es->samples; + perf_sample__fprintf_start(sample, thread, evsel, fp); if (PRINT_FIELD(PERIOD)) @@ -1896,7 +1944,7 @@ static void perf_script__fclose_per_event_dump(struct perf_script *script) evlist__for_each_entry(evlist, evsel) { if (!evsel->priv) break; - fclose(evsel->priv); + perf_evsel_script__delete(evsel->priv); evsel->priv = NULL; } } @@ -1906,10 +1954,7 @@ static int perf_script__fopen_per_event_dump(struct perf_script *script) struct perf_evsel *evsel; evlist__for_each_entry(script->session->evlist, evsel) { - char filename[PATH_MAX]; - snprintf(filename, sizeof(filename), "%s.%s.dump", - script->session->file->path, perf_evsel__name(evsel)); - evsel->priv = fopen(filename, "w"); + evsel->priv = perf_evsel_script__new(evsel, script->session->file); if (evsel->priv == NULL) goto out_err_fclose; } @@ -1924,16 +1969,32 @@ static int perf_script__fopen_per_event_dump(struct perf_script *script) static int perf_script__setup_per_event_dump(struct perf_script *script) { struct perf_evsel *evsel; + static struct perf_evsel_script es_stdout; if (script->per_event_dump) return perf_script__fopen_per_event_dump(script); + es_stdout.fp = stdout; + evlist__for_each_entry(script->session->evlist, evsel) - evsel->priv = stdout; + evsel->priv = &es_stdout; return 0; } +static void perf_script__exit_per_event_dump_stats(struct perf_script *script) +{ + struct perf_evsel *evsel; + + evlist__for_each_entry(script->session->evlist, evsel) { + struct perf_evsel_script *es = evsel->priv; + + perf_evsel_script__fprintf(es, stdout); + perf_evsel_script__delete(es); + evsel->priv = NULL; + } +} + static int __cmd_script(struct perf_script *script) { int ret; @@ -1963,7 +2024,7 @@ static int __cmd_script(struct perf_script *script) ret = perf_session__process_events(script->session); if (script->per_event_dump) - perf_script__fclose_per_event_dump(script); + perf_script__exit_per_event_dump_stats(script); if (debug_mode) pr_err("Misordered timestamps: %" PRIu64 "\n", nr_unordered); -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 09/19] perf tools: Rename struct perf_data_file to perf_data 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (7 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 08/19] perf script: Print information about per-event-dump files Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 10/19] perf tools: Add struct perf_data_file Arnaldo Carvalho de Melo ` (9 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Jiri Olsa, Andi Kleen, Changbin Du, David Ahern, Jin Yao, Namhyung Kim, Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@kernel.org> Rename struct perf_data_file to perf_data, because we will add the possibility to have multiple files under perf.data, so the 'perf_data' name fits better. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: Changbin Du <changbin.du@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-39wn4d77phel3dgkzo3lyan0@git.kernel.org [ Fixup recent changes in 'perf script --per-event-dump' ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-annotate.c | 10 ++--- tools/perf/builtin-buildid-cache.c | 8 ++-- tools/perf/builtin-buildid-list.c | 8 ++-- tools/perf/builtin-c2c.c | 10 ++--- tools/perf/builtin-diff.c | 18 ++++---- tools/perf/builtin-evlist.c | 4 +- tools/perf/builtin-inject.c | 26 +++++------ tools/perf/builtin-kmem.c | 8 ++-- tools/perf/builtin-kvm.c | 6 +-- tools/perf/builtin-lock.c | 4 +- tools/perf/builtin-mem.c | 4 +- tools/perf/builtin-record.c | 50 ++++++++++----------- tools/perf/builtin-report.c | 14 +++--- tools/perf/builtin-sched.c | 8 ++-- tools/perf/builtin-script.c | 20 ++++----- tools/perf/builtin-stat.c | 32 ++++++------- tools/perf/builtin-timechart.c | 6 +-- tools/perf/builtin-trace.c | 4 +- tools/perf/tests/topology.c | 10 ++--- tools/perf/util/auxtrace.c | 4 +- tools/perf/util/data-convert-bt.c | 6 +-- tools/perf/util/data.c | 92 +++++++++++++++++++------------------- tools/perf/util/data.h | 32 ++++++------- tools/perf/util/header.c | 20 ++++----- tools/perf/util/intel-bts.c | 6 +-- tools/perf/util/intel-pt.c | 6 +-- tools/perf/util/jit.h | 2 +- tools/perf/util/jitdump.c | 10 ++--- tools/perf/util/session.c | 44 +++++++++--------- tools/perf/util/session.h | 4 +- 30 files changed, 238 insertions(+), 238 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index c38373195c4a..2d06be81a109 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -356,7 +356,7 @@ static int __cmd_annotate(struct perf_annotate *ann) } if (total_nr_samples == 0) { - ui__error("The %s file has no samples!\n", session->file->path); + ui__error("The %s file has no samples!\n", session->data->path); goto out; } @@ -400,7 +400,7 @@ int cmd_annotate(int argc, const char **argv) .ordering_requires_timestamps = true, }, }; - struct perf_data_file file = { + struct perf_data data = { .mode = PERF_DATA_MODE_READ, }; struct option options[] = { @@ -410,7 +410,7 @@ int cmd_annotate(int argc, const char **argv) "only consider symbols in these dsos"), OPT_STRING('s', "symbol", &annotate.sym_hist_filter, "symbol", "symbol to annotate"), - OPT_BOOLEAN('f', "force", &file.force, "don't complain, do it"), + OPT_BOOLEAN('f', "force", &data.force, "don't complain, do it"), OPT_INCR('v', "verbose", &verbose, "be more verbose (show symbol address, etc)"), OPT_BOOLEAN('q', "quiet", &quiet, "do now show any message"), @@ -482,9 +482,9 @@ int cmd_annotate(int argc, const char **argv) if (quiet) perf_quiet_option(); - file.path = input_name; + data.path = input_name; - annotate.session = perf_session__new(&file, false, &annotate.tool); + annotate.session = perf_session__new(&data, false, &annotate.tool); if (annotate.session == NULL) return -1; diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c index e3eb6240ced0..9fceae47a02e 100644 --- a/tools/perf/builtin-buildid-cache.c +++ b/tools/perf/builtin-buildid-cache.c @@ -311,7 +311,7 @@ int cmd_buildid_cache(int argc, const char **argv) *kcore_filename = NULL; char sbuf[STRERR_BUFSIZE]; - struct perf_data_file file = { + struct perf_data data = { .mode = PERF_DATA_MODE_READ, }; struct perf_session *session = NULL; @@ -352,10 +352,10 @@ int cmd_buildid_cache(int argc, const char **argv) nsi = nsinfo__new(ns_id); if (missing_filename) { - file.path = missing_filename; - file.force = force; + data.path = missing_filename; + data.force = force; - session = perf_session__new(&file, false, NULL); + session = perf_session__new(&data, false, NULL); if (session == NULL) return -1; } diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c index fdaca16e0c74..72bdc0eba990 100644 --- a/tools/perf/builtin-buildid-list.c +++ b/tools/perf/builtin-buildid-list.c @@ -50,7 +50,7 @@ static bool dso__skip_buildid(struct dso *dso, int with_hits) static int perf_session__list_build_ids(bool force, bool with_hits) { struct perf_session *session; - struct perf_data_file file = { + struct perf_data data = { .path = input_name, .mode = PERF_DATA_MODE_READ, .force = force, @@ -63,7 +63,7 @@ static int perf_session__list_build_ids(bool force, bool with_hits) if (filename__fprintf_build_id(input_name, stdout) > 0) goto out; - session = perf_session__new(&file, false, &build_id__mark_dso_hit_ops); + session = perf_session__new(&data, false, &build_id__mark_dso_hit_ops); if (session == NULL) return -1; @@ -71,7 +71,7 @@ static int perf_session__list_build_ids(bool force, bool with_hits) * We take all buildids when the file contains AUX area tracing data * because we do not decode the trace because it would take too long. */ - if (!perf_data_file__is_pipe(&file) && + if (!perf_data__is_pipe(&data) && perf_header__has_feat(&session->header, HEADER_AUXTRACE)) with_hits = false; @@ -79,7 +79,7 @@ static int perf_session__list_build_ids(bool force, bool with_hits) * in pipe-mode, the only way to get the buildids is to parse * the record stream. Buildids are stored as RECORD_HEADER_BUILD_ID */ - if (with_hits || perf_data_file__is_pipe(&file)) + if (with_hits || perf_data__is_pipe(&data)) perf_session__process_events(session); perf_session__fprintf_dsos_buildid(session, stdout, dso__skip_buildid, with_hits); diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index bb1ee22bd221..87a52d09da29 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2523,7 +2523,7 @@ static int perf_c2c__report(int argc, const char **argv) { struct perf_session *session; struct ui_progress prog; - struct perf_data_file file = { + struct perf_data data = { .mode = PERF_DATA_MODE_READ, }; char callchain_default_opt[] = CALLCHAIN_DEFAULT_OPT; @@ -2572,8 +2572,8 @@ static int perf_c2c__report(int argc, const char **argv) if (!input_name || !strlen(input_name)) input_name = "perf.data"; - file.path = input_name; - file.force = symbol_conf.force; + data.path = input_name; + data.force = symbol_conf.force; err = setup_display(display); if (err) @@ -2591,7 +2591,7 @@ static int perf_c2c__report(int argc, const char **argv) goto out; } - session = perf_session__new(&file, 0, &c2c.tool); + session = perf_session__new(&data, 0, &c2c.tool); if (session == NULL) { pr_debug("No memory for session\n"); goto out; @@ -2611,7 +2611,7 @@ static int perf_c2c__report(int argc, const char **argv) goto out_session; /* No pipe support at the moment. */ - if (perf_data_file__is_pipe(session->file)) { + if (perf_data__is_pipe(session->data)) { pr_debug("No pipe support at the moment.\n"); goto out_session; } diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index 0cd4cf6a344b..5292e3d13cec 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c @@ -47,7 +47,7 @@ struct diff_hpp_fmt { struct data__file { struct perf_session *session; - struct perf_data_file file; + struct perf_data data; int idx; struct hists *hists; struct diff_hpp_fmt fmt[PERF_HPP_DIFF__MAX_INDEX]; @@ -707,7 +707,7 @@ static void data__fprintf(void) data__for_each_file(i, d) fprintf(stdout, "# [%d] %s %s\n", - d->idx, d->file.path, + d->idx, d->data.path, !d->idx ? "(Baseline)" : ""); fprintf(stdout, "#\n"); @@ -776,16 +776,16 @@ static int __cmd_diff(void) int ret = -EINVAL, i; data__for_each_file(i, d) { - d->session = perf_session__new(&d->file, false, &tool); + d->session = perf_session__new(&d->data, false, &tool); if (!d->session) { - pr_err("Failed to open %s\n", d->file.path); + pr_err("Failed to open %s\n", d->data.path); ret = -1; goto out_delete; } ret = perf_session__process_events(d->session); if (ret) { - pr_err("Failed to process %s\n", d->file.path); + pr_err("Failed to process %s\n", d->data.path); goto out_delete; } @@ -1286,11 +1286,11 @@ static int data_init(int argc, const char **argv) return -ENOMEM; data__for_each_file(i, d) { - struct perf_data_file *file = &d->file; + struct perf_data *data = &d->data; - file->path = use_default ? defaults[i] : argv[i]; - file->mode = PERF_DATA_MODE_READ, - file->force = force, + data->path = use_default ? defaults[i] : argv[i]; + data->mode = PERF_DATA_MODE_READ, + data->force = force, d->idx = i; } diff --git a/tools/perf/builtin-evlist.c b/tools/perf/builtin-evlist.c index 6d210e40d611..cd79c26e16a4 100644 --- a/tools/perf/builtin-evlist.c +++ b/tools/perf/builtin-evlist.c @@ -21,14 +21,14 @@ static int __cmd_evlist(const char *file_name, struct perf_attr_details *details { struct perf_session *session; struct perf_evsel *pos; - struct perf_data_file file = { + struct perf_data data = { .path = file_name, .mode = PERF_DATA_MODE_READ, .force = details->force, }; bool has_tracepoint = false; - session = perf_session__new(&file, 0, NULL); + session = perf_session__new(&data, 0, NULL); if (session == NULL) return -1; diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 2b8032908fb2..ac7486f6c46f 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -35,7 +35,7 @@ struct perf_inject { bool strip; bool jit_mode; const char *input_name; - struct perf_data_file output; + struct perf_data output; u64 bytes_written; u64 aux_id; struct list_head samples; @@ -52,7 +52,7 @@ static int output_bytes(struct perf_inject *inject, void *buf, size_t sz) { ssize_t size; - size = perf_data_file__write(&inject->output, buf, sz); + size = perf_data__write(&inject->output, buf, sz); if (size < 0) return -errno; @@ -154,11 +154,11 @@ static s64 perf_event__repipe_auxtrace(struct perf_tool *tool, return ret; } - if (perf_data_file__is_pipe(session->file) || !session->one_mmap) { + if (perf_data__is_pipe(session->data) || !session->one_mmap) { ret = output_bytes(inject, event, event->header.size); if (ret < 0) return ret; - ret = copy_bytes(inject, perf_data_file__fd(session->file), + ret = copy_bytes(inject, perf_data__fd(session->data), event->auxtrace.size); } else { ret = output_bytes(inject, event, @@ -637,8 +637,8 @@ static int __cmd_inject(struct perf_inject *inject) { int ret = -EINVAL; struct perf_session *session = inject->session; - struct perf_data_file *file_out = &inject->output; - int fd = perf_data_file__fd(file_out); + struct perf_data *data_out = &inject->output; + int fd = perf_data__fd(data_out); u64 output_data_offset; signal(SIGINT, sig_handler); @@ -693,14 +693,14 @@ static int __cmd_inject(struct perf_inject *inject) if (!inject->itrace_synth_opts.set) auxtrace_index__free(&session->auxtrace_index); - if (!file_out->is_pipe) + if (!data_out->is_pipe) lseek(fd, output_data_offset, SEEK_SET); ret = perf_session__process_events(session); if (ret) return ret; - if (!file_out->is_pipe) { + if (!data_out->is_pipe) { if (inject->build_ids) perf_header__set_feat(&session->header, HEADER_BUILD_ID); @@ -779,7 +779,7 @@ int cmd_inject(int argc, const char **argv) .mode = PERF_DATA_MODE_WRITE, }, }; - struct perf_data_file file = { + struct perf_data data = { .mode = PERF_DATA_MODE_READ, }; int ret; @@ -801,7 +801,7 @@ int cmd_inject(int argc, const char **argv) "be more verbose (show build ids, etc)"), OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, "file", "kallsyms pathname"), - OPT_BOOLEAN('f', "force", &file.force, "don't complain, do it"), + OPT_BOOLEAN('f', "force", &data.force, "don't complain, do it"), OPT_CALLBACK_OPTARG(0, "itrace", &inject.itrace_synth_opts, NULL, "opts", "Instruction Tracing options", itrace_parse_synth_opts), @@ -829,15 +829,15 @@ int cmd_inject(int argc, const char **argv) return -1; } - if (perf_data_file__open(&inject.output)) { + if (perf_data__open(&inject.output)) { perror("failed to create output file"); return -1; } inject.tool.ordered_events = inject.sched_stat; - file.path = inject.input_name; - inject.session = perf_session__new(&file, true, &inject.tool); + data.path = inject.input_name; + inject.session = perf_session__new(&data, true, &inject.tool); if (inject.session == NULL) return -1; diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index d8f25ef8157b..d45740a3e5f1 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -1893,7 +1893,7 @@ int cmd_kmem(int argc, const char **argv) { const char * const default_slab_sort = "frag,hit,bytes"; const char * const default_page_sort = "bytes,hit"; - struct perf_data_file file = { + struct perf_data data = { .mode = PERF_DATA_MODE_READ, }; const struct option kmem_options[] = { @@ -1909,7 +1909,7 @@ int cmd_kmem(int argc, const char **argv) "page, order, migtype, gfp", parse_sort_opt), OPT_CALLBACK('l', "line", NULL, "num", "show n lines", parse_line_opt), OPT_BOOLEAN(0, "raw-ip", &raw_ip, "show raw ip instead of symbol"), - OPT_BOOLEAN('f', "force", &file.force, "don't complain, do it"), + OPT_BOOLEAN('f', "force", &data.force, "don't complain, do it"), OPT_CALLBACK_NOOPT(0, "slab", NULL, NULL, "Analyze slab allocator", parse_slab_opt), OPT_CALLBACK_NOOPT(0, "page", NULL, NULL, "Analyze page allocator", @@ -1949,9 +1949,9 @@ int cmd_kmem(int argc, const char **argv) return __cmd_record(argc, argv); } - file.path = input_name; + data.path = input_name; - kmem_session = session = perf_session__new(&file, false, &perf_kmem); + kmem_session = session = perf_session__new(&data, false, &perf_kmem); if (session == NULL) return -1; diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index 721f4f91291a..4301fc34f23c 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c @@ -1067,7 +1067,7 @@ static int read_events(struct perf_kvm_stat *kvm) .namespaces = perf_event__process_namespaces, .ordered_events = true, }; - struct perf_data_file file = { + struct perf_data file = { .path = kvm->file_name, .mode = PERF_DATA_MODE_READ, .force = kvm->force, @@ -1358,7 +1358,7 @@ static int kvm_events_live(struct perf_kvm_stat *kvm, "perf kvm stat live [<options>]", NULL }; - struct perf_data_file file = { + struct perf_data data = { .mode = PERF_DATA_MODE_WRITE, }; @@ -1432,7 +1432,7 @@ static int kvm_events_live(struct perf_kvm_stat *kvm, /* * perf session */ - kvm->session = perf_session__new(&file, false, &kvm->tool); + kvm->session = perf_session__new(&data, false, &kvm->tool); if (kvm->session == NULL) { err = -1; goto out; diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index ff98652484a7..2e281f7b0fca 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -864,13 +864,13 @@ static int __cmd_report(bool display_info) .namespaces = perf_event__process_namespaces, .ordered_events = true, }; - struct perf_data_file file = { + struct perf_data data = { .path = input_name, .mode = PERF_DATA_MODE_READ, .force = force, }; - session = perf_session__new(&file, false, &eops); + session = perf_session__new(&data, false, &eops); if (!session) { pr_err("Initializing perf session failed\n"); return -1; diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 6940490bc3f9..5a4a6f8e614d 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c @@ -236,13 +236,13 @@ static int process_sample_event(struct perf_tool *tool, static int report_raw_events(struct perf_mem *mem) { - struct perf_data_file file = { + struct perf_data data = { .path = input_name, .mode = PERF_DATA_MODE_READ, .force = mem->force, }; int ret; - struct perf_session *session = perf_session__new(&file, false, + struct perf_session *session = perf_session__new(&data, false, &mem->tool); if (session == NULL) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index a6cbf1640269..0ab7dd0e4f2b 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -66,7 +66,7 @@ struct record { struct perf_tool tool; struct record_opts opts; u64 bytes_written; - struct perf_data_file file; + struct perf_data data; struct auxtrace_record *itr; struct perf_evlist *evlist; struct perf_session *session; @@ -107,7 +107,7 @@ static bool switch_output_time(struct record *rec) static int record__write(struct record *rec, void *bf, size_t size) { - if (perf_data_file__write(rec->session->file, bf, size) < 0) { + if (perf_data__write(rec->session->data, bf, size) < 0) { pr_err("failed to write perf data, error: %m\n"); return -1; } @@ -173,13 +173,13 @@ static int record__process_auxtrace(struct perf_tool *tool, size_t len1, void *data2, size_t len2) { struct record *rec = container_of(tool, struct record, tool); - struct perf_data_file *file = &rec->file; + struct perf_data *data = &rec->data; size_t padding; u8 pad[8] = {0}; - if (!perf_data_file__is_pipe(file)) { + if (!perf_data__is_pipe(data)) { off_t file_offset; - int fd = perf_data_file__fd(file); + int fd = perf_data__fd(data); int err; file_offset = lseek(fd, 0, SEEK_CUR); @@ -398,10 +398,10 @@ static int process_sample_event(struct perf_tool *tool, static int process_buildids(struct record *rec) { - struct perf_data_file *file = &rec->file; + struct perf_data *data = &rec->data; struct perf_session *session = rec->session; - if (file->size == 0) + if (data->size == 0) return 0; /* @@ -544,14 +544,14 @@ static void record__init_features(struct record *rec) static void record__finish_output(struct record *rec) { - struct perf_data_file *file = &rec->file; - int fd = perf_data_file__fd(file); + struct perf_data *data = &rec->data; + int fd = perf_data__fd(data); - if (file->is_pipe) + if (data->is_pipe) return; rec->session->header.data_size += rec->bytes_written; - file->size = lseek(perf_data_file__fd(file), 0, SEEK_CUR); + data->size = lseek(perf_data__fd(data), 0, SEEK_CUR); if (!rec->no_buildid) { process_buildids(rec); @@ -590,7 +590,7 @@ static int record__synthesize(struct record *rec, bool tail); static int record__switch_output(struct record *rec, bool at_exit) { - struct perf_data_file *file = &rec->file; + struct perf_data *data = &rec->data; int fd, err; /* Same Size: "2015122520103046"*/ @@ -608,7 +608,7 @@ record__switch_output(struct record *rec, bool at_exit) return -EINVAL; } - fd = perf_data_file__switch(file, timestamp, + fd = perf_data__switch(data, timestamp, rec->session->header.data_offset, at_exit); if (fd >= 0 && !at_exit) { @@ -618,7 +618,7 @@ record__switch_output(struct record *rec, bool at_exit) if (!quiet) fprintf(stderr, "[ perf record: Dump %s.%s ]\n", - file->path, timestamp); + data->path, timestamp); /* Output tracking events */ if (!at_exit) { @@ -693,16 +693,16 @@ static int record__synthesize(struct record *rec, bool tail) { struct perf_session *session = rec->session; struct machine *machine = &session->machines.host; - struct perf_data_file *file = &rec->file; + struct perf_data *data = &rec->data; struct record_opts *opts = &rec->opts; struct perf_tool *tool = &rec->tool; - int fd = perf_data_file__fd(file); + int fd = perf_data__fd(data); int err = 0; if (rec->opts.tail_synthesize != tail) return 0; - if (file->is_pipe) { + if (data->is_pipe) { err = perf_event__synthesize_features( tool, session, rec->evlist, process_synthesized_event); if (err < 0) { @@ -781,7 +781,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) struct machine *machine; struct perf_tool *tool = &rec->tool; struct record_opts *opts = &rec->opts; - struct perf_data_file *file = &rec->file; + struct perf_data *data = &rec->data; struct perf_session *session; bool disabled = false, draining = false; int fd; @@ -807,20 +807,20 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) signal(SIGUSR2, SIG_IGN); } - session = perf_session__new(file, false, tool); + session = perf_session__new(data, false, tool); if (session == NULL) { pr_err("Perf session creation failed.\n"); return -1; } - fd = perf_data_file__fd(file); + fd = perf_data__fd(data); rec->session = session; record__init_features(rec); if (forks) { err = perf_evlist__prepare_workload(rec->evlist, &opts->target, - argv, file->is_pipe, + argv, data->is_pipe, workload_exec_failed_signal); if (err < 0) { pr_err("Couldn't run the workload!\n"); @@ -856,7 +856,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) if (!rec->evlist->nr_groups) perf_header__clear_feat(&session->header, HEADER_GROUP_DESC); - if (file->is_pipe) { + if (data->is_pipe) { err = perf_header__write_pipe(fd); if (err < 0) goto out_child; @@ -1117,8 +1117,8 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) samples[0] = '\0'; fprintf(stderr, "[ perf record: Captured and wrote %.3f MB %s%s%s ]\n", - perf_data_file__size(file) / 1024.0 / 1024.0, - file->path, postfix, samples); + perf_data__size(data) / 1024.0 / 1024.0, + data->path, postfix, samples); } out_delete_session: @@ -1482,7 +1482,7 @@ static struct option __record_options[] = { OPT_STRING('C', "cpu", &record.opts.target.cpu_list, "cpu", "list of cpus to monitor"), OPT_U64('c', "count", &record.opts.user_interval, "event period to sample"), - OPT_STRING('o', "output", &record.file.path, "file", + OPT_STRING('o', "output", &record.data.path, "file", "output file name"), OPT_BOOLEAN_SET('i', "no-inherit", &record.opts.no_inherit, &record.opts.no_inherit_set, diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index f9dff652dcbd..0dc323772b5e 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -257,7 +257,7 @@ static int report__setup_sample_type(struct report *rep) { struct perf_session *session = rep->session; u64 sample_type = perf_evlist__combined_sample_type(session->evlist); - bool is_pipe = perf_data_file__is_pipe(session->file); + bool is_pipe = perf_data__is_pipe(session->data); if (session->itrace_synth_opts->callchain || (!is_pipe && @@ -568,7 +568,7 @@ static int __cmd_report(struct report *rep) int ret; struct perf_session *session = rep->session; struct perf_evsel *pos; - struct perf_data_file *file = session->file; + struct perf_data *data = session->data; signal(SIGINT, sig_handler); @@ -637,7 +637,7 @@ static int __cmd_report(struct report *rep) rep->nr_entries += evsel__hists(pos)->nr_entries; if (rep->nr_entries == 0) { - ui__error("The %s file has no samples!\n", file->path); + ui__error("The %s file has no samples!\n", data->path); return 0; } @@ -879,7 +879,7 @@ int cmd_report(int argc, const char **argv) "Show inline function"), OPT_END() }; - struct perf_data_file file = { + struct perf_data data = { .mode = PERF_DATA_MODE_READ, }; int ret = hists__init(); @@ -940,11 +940,11 @@ int cmd_report(int argc, const char **argv) input_name = "perf.data"; } - file.path = input_name; - file.force = symbol_conf.force; + data.path = input_name; + data.force = symbol_conf.force; repeat: - session = perf_session__new(&file, false, &report.tool); + session = perf_session__new(&data, false, &report.tool); if (session == NULL) return -1; diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index b7e8812ee80c..cb5410511f69 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -1700,14 +1700,14 @@ static int perf_sched__read_events(struct perf_sched *sched) { "sched:sched_migrate_task", process_sched_migrate_task_event, }, }; struct perf_session *session; - struct perf_data_file file = { + struct perf_data data = { .path = input_name, .mode = PERF_DATA_MODE_READ, .force = sched->force, }; int rc = -1; - session = perf_session__new(&file, false, &sched->tool); + session = perf_session__new(&data, false, &sched->tool); if (session == NULL) { pr_debug("No Memory for session\n"); return -1; @@ -2902,7 +2902,7 @@ static int perf_sched__timehist(struct perf_sched *sched) const struct perf_evsel_str_handler migrate_handlers[] = { { "sched:sched_migrate_task", timehist_migrate_task_event, }, }; - struct perf_data_file file = { + struct perf_data data = { .path = input_name, .mode = PERF_DATA_MODE_READ, .force = sched->force, @@ -2930,7 +2930,7 @@ static int perf_sched__timehist(struct perf_sched *sched) symbol_conf.use_callchain = sched->show_callchain; - session = perf_session__new(&file, false, &sched->tool); + session = perf_session__new(&data, false, &sched->tool); if (session == NULL) return -ENOMEM; diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 4d198f73b29a..8f8fa952b506 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -217,12 +217,12 @@ struct perf_evsel_script { }; static struct perf_evsel_script *perf_evsel_script__new(struct perf_evsel *evsel, - struct perf_data_file *file) + struct perf_data *data) { struct perf_evsel_script *es = malloc(sizeof(*es)); if (es != NULL) { - if (asprintf(&es->filename, "%s.%s.dump", file->path, perf_evsel__name(evsel)) < 0) + if (asprintf(&es->filename, "%s.%s.dump", data->path, perf_evsel__name(evsel)) < 0) goto out_free; es->fp = fopen(es->filename, "w"); if (es->fp == NULL) @@ -1954,7 +1954,7 @@ static int perf_script__fopen_per_event_dump(struct perf_script *script) struct perf_evsel *evsel; evlist__for_each_entry(script->session->evlist, evsel) { - evsel->priv = perf_evsel_script__new(evsel, script->session->file); + evsel->priv = perf_evsel_script__new(evsel, script->session->data); if (evsel->priv == NULL) goto out_err_fclose; } @@ -2590,14 +2590,14 @@ int find_scripts(char **scripts_array, char **scripts_path_array) char scripts_path[MAXPATHLEN], lang_path[MAXPATHLEN]; DIR *scripts_dir, *lang_dir; struct perf_session *session; - struct perf_data_file file = { + struct perf_data data = { .path = input_name, .mode = PERF_DATA_MODE_READ, }; char *temp; int i = 0; - session = perf_session__new(&file, false, NULL); + session = perf_session__new(&data, false, NULL); if (!session) return -1; @@ -2875,7 +2875,7 @@ int cmd_script(int argc, const char **argv) .ordering_requires_timestamps = true, }, }; - struct perf_data_file file = { + struct perf_data data = { .mode = PERF_DATA_MODE_READ, }; const struct option options[] = { @@ -2982,8 +2982,8 @@ int cmd_script(int argc, const char **argv) argc = parse_options_subcommand(argc, argv, options, script_subcommands, script_usage, PARSE_OPT_STOP_AT_NON_OPTION); - file.path = input_name; - file.force = symbol_conf.force; + data.path = input_name; + data.force = symbol_conf.force; if (argc > 1 && !strncmp(argv[0], "rec", strlen("rec"))) { rec_script_path = get_script_path(argv[1], RECORD_SUFFIX); @@ -3150,7 +3150,7 @@ int cmd_script(int argc, const char **argv) if (!script_name) setup_pager(); - session = perf_session__new(&file, false, &script.tool); + session = perf_session__new(&data, false, &script.tool); if (session == NULL) return -1; @@ -3206,7 +3206,7 @@ int cmd_script(int argc, const char **argv) goto out_delete; } - input = open(file.path, O_RDONLY); /* input_name */ + input = open(data.path, O_RDONLY); /* input_name */ if (input < 0) { err = -errno; perror("failed to open file"); diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 988bdfa5d832..85af6d291c06 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -175,7 +175,7 @@ static int print_free_counters_hint; struct perf_stat { bool record; - struct perf_data_file file; + struct perf_data data; struct perf_session *session; u64 bytes_written; struct perf_tool tool; @@ -253,7 +253,7 @@ static int create_perf_stat_counter(struct perf_evsel *evsel) * by attr->sample_type != 0, and we can't run it on * stat sessions. */ - if (!(STAT_RECORD && perf_stat.file.is_pipe)) + if (!(STAT_RECORD && perf_stat.data.is_pipe)) attr->sample_type = PERF_SAMPLE_IDENTIFIER; /* @@ -295,7 +295,7 @@ static int process_synthesized_event(struct perf_tool *tool __maybe_unused, struct perf_sample *sample __maybe_unused, struct machine *machine __maybe_unused) { - if (perf_data_file__write(&perf_stat.file, event, event->header.size) < 0) { + if (perf_data__write(&perf_stat.data, event, event->header.size) < 0) { pr_err("failed to write perf data, error: %m\n"); return -1; } @@ -628,7 +628,7 @@ static int __run_perf_stat(int argc, const char **argv) size_t l; int status = 0; const bool forks = (argc > 0); - bool is_pipe = STAT_RECORD ? perf_stat.file.is_pipe : false; + bool is_pipe = STAT_RECORD ? perf_stat.data.is_pipe : false; struct perf_evsel_config_term *err_term; if (interval) { @@ -719,10 +719,10 @@ static int __run_perf_stat(int argc, const char **argv) } if (STAT_RECORD) { - int err, fd = perf_data_file__fd(&perf_stat.file); + int err, fd = perf_data__fd(&perf_stat.data); if (is_pipe) { - err = perf_header__write_pipe(perf_data_file__fd(&perf_stat.file)); + err = perf_header__write_pipe(perf_data__fd(&perf_stat.data)); } else { err = perf_session__write_header(perf_stat.session, evsel_list, fd, false); @@ -1696,7 +1696,7 @@ static void print_counters(struct timespec *ts, int argc, const char **argv) char buf[64], *prefix = NULL; /* Do not print anything if we record to the pipe. */ - if (STAT_RECORD && perf_stat.file.is_pipe) + if (STAT_RECORD && perf_stat.data.is_pipe) return; if (interval) @@ -2406,20 +2406,20 @@ static void init_features(struct perf_session *session) static int __cmd_record(int argc, const char **argv) { struct perf_session *session; - struct perf_data_file *file = &perf_stat.file; + struct perf_data *data = &perf_stat.data; argc = parse_options(argc, argv, stat_options, stat_record_usage, PARSE_OPT_STOP_AT_NON_OPTION); if (output_name) - file->path = output_name; + data->path = output_name; if (run_count != 1 || forever) { pr_err("Cannot use -r option with perf stat record.\n"); return -1; } - session = perf_session__new(file, false, NULL); + session = perf_session__new(data, false, NULL); if (session == NULL) { pr_err("Perf session creation failed.\n"); return -1; @@ -2477,7 +2477,7 @@ int process_stat_config_event(struct perf_tool *tool, if (st->aggr_mode != AGGR_UNSET) stat_config.aggr_mode = st->aggr_mode; - if (perf_stat.file.is_pipe) + if (perf_stat.data.is_pipe) perf_stat_init_aggr_mode(); else perf_stat_init_aggr_mode_file(st); @@ -2585,10 +2585,10 @@ static int __cmd_report(int argc, const char **argv) input_name = "perf.data"; } - perf_stat.file.path = input_name; - perf_stat.file.mode = PERF_DATA_MODE_READ; + perf_stat.data.path = input_name; + perf_stat.data.mode = PERF_DATA_MODE_READ; - session = perf_session__new(&perf_stat.file, false, &perf_stat.tool); + session = perf_session__new(&perf_stat.data, false, &perf_stat.tool); if (session == NULL) return -1; @@ -2859,7 +2859,7 @@ int cmd_stat(int argc, const char **argv) * records, but the need to suppress the kptr_restrict messages in older * tools remain -acme */ - int fd = perf_data_file__fd(&perf_stat.file); + int fd = perf_data__fd(&perf_stat.data); int err = perf_event__synthesize_kernel_mmap((void *)&perf_stat, process_synthesized_event, &perf_stat.session->machines.host); @@ -2873,7 +2873,7 @@ int cmd_stat(int argc, const char **argv) pr_err("failed to write stat round event\n"); } - if (!perf_stat.file.is_pipe) { + if (!perf_stat.data.is_pipe) { perf_stat.session->header.data_size += perf_stat.bytes_written; perf_session__write_header(perf_stat.session, evsel_list, fd, true); } diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 01de01ca14f2..0f79ea5e2f0f 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c @@ -1601,13 +1601,13 @@ static int __cmd_timechart(struct timechart *tchart, const char *output_name) { "syscalls:sys_exit_pselect6", process_exit_poll }, { "syscalls:sys_exit_select", process_exit_poll }, }; - struct perf_data_file file = { + struct perf_data data = { .path = input_name, .mode = PERF_DATA_MODE_READ, .force = tchart->force, }; - struct perf_session *session = perf_session__new(&file, false, + struct perf_session *session = perf_session__new(&data, false, &tchart->tool); int ret = -EINVAL; @@ -1617,7 +1617,7 @@ static int __cmd_timechart(struct timechart *tchart, const char *output_name) symbol__init(&session->header.env); (void)perf_header__process_sections(&session->header, - perf_data_file__fd(session->file), + perf_data__fd(session->data), tchart, process_header); diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 78855916f4b0..7def6947ad61 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2532,7 +2532,7 @@ static int trace__replay(struct trace *trace) const struct perf_evsel_str_handler handlers[] = { { "probe:vfs_getname", trace__vfs_getname, }, }; - struct perf_data_file file = { + struct perf_data data = { .path = input_name, .mode = PERF_DATA_MODE_READ, .force = trace->force, @@ -2558,7 +2558,7 @@ static int trace__replay(struct trace *trace) /* add tid to output */ trace->multiple_threads = true; - session = perf_session__new(&file, false, &trace->tool); + session = perf_session__new(&data, false, &trace->tool); if (session == NULL) return -1; diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c index 19b0561fd6f6..7536782e8495 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -29,12 +29,12 @@ static int get_temp(char *path) static int session_write_header(char *path) { struct perf_session *session; - struct perf_data_file file = { + struct perf_data data = { .path = path, .mode = PERF_DATA_MODE_WRITE, }; - session = perf_session__new(&file, false, NULL); + session = perf_session__new(&data, false, NULL); TEST_ASSERT_VAL("can't get session", session); session->evlist = perf_evlist__new_default(); @@ -46,7 +46,7 @@ static int session_write_header(char *path) session->header.data_size += DATA_SIZE; TEST_ASSERT_VAL("failed to write header", - !perf_session__write_header(session, session->evlist, file.fd, true)); + !perf_session__write_header(session, session->evlist, data.fd, true)); perf_session__delete(session); @@ -56,13 +56,13 @@ static int session_write_header(char *path) static int check_cpu_topology(char *path, struct cpu_map *map) { struct perf_session *session; - struct perf_data_file file = { + struct perf_data data = { .path = path, .mode = PERF_DATA_MODE_READ, }; int i; - session = perf_session__new(&file, false, NULL); + session = perf_session__new(&data, false, NULL); TEST_ASSERT_VAL("can't get session", session); for (i = 0; i < session->header.env.nr_cpus_avail; i++) { diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 5547457566a7..a33491416400 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -208,7 +208,7 @@ static int auxtrace_queues__grow(struct auxtrace_queues *queues, static void *auxtrace_copy_data(u64 size, struct perf_session *session) { - int fd = perf_data_file__fd(session->file); + int fd = perf_data__fd(session->data); void *p; ssize_t ret; @@ -305,7 +305,7 @@ static int auxtrace_queues__add_event_buffer(struct auxtrace_queues *queues, if (session->one_mmap) { buffer->data = buffer->data_offset - session->one_mmap_offset + session->one_mmap_addr; - } else if (perf_data_file__is_pipe(session->file)) { + } else if (perf_data__is_pipe(session->data)) { buffer->data = auxtrace_copy_data(buffer->size, session); if (!buffer->data) return -ENOMEM; diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index 2346cecb8ea2..9fdae383a58c 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c @@ -1577,7 +1577,7 @@ int bt_convert__perf2ctf(const char *input, const char *path, struct perf_data_convert_opts *opts) { struct perf_session *session; - struct perf_data_file file = { + struct perf_data data = { .path = input, .mode = PERF_DATA_MODE_READ, .force = opts->force, @@ -1619,7 +1619,7 @@ int bt_convert__perf2ctf(const char *input, const char *path, err = -1; /* perf.data session */ - session = perf_session__new(&file, 0, &c.tool); + session = perf_session__new(&data, 0, &c.tool); if (!session) goto free_writer; @@ -1650,7 +1650,7 @@ int bt_convert__perf2ctf(const char *input, const char *path, fprintf(stderr, "[ perf data convert: Converted '%s' into CTF data '%s' ]\n", - file.path, path); + data.path, path); fprintf(stderr, "[ perf data convert: Converted and wrote %.3f MB (%" PRIu64 " samples", diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index 1123b30e3033..a6eea3df4c10 100644 --- a/tools/perf/util/data.c +++ b/tools/perf/util/data.c @@ -21,56 +21,56 @@ #endif #endif -static bool check_pipe(struct perf_data_file *file) +static bool check_pipe(struct perf_data *data) { struct stat st; bool is_pipe = false; - int fd = perf_data_file__is_read(file) ? + int fd = perf_data__is_read(data) ? STDIN_FILENO : STDOUT_FILENO; - if (!file->path) { + if (!data->path) { if (!fstat(fd, &st) && S_ISFIFO(st.st_mode)) is_pipe = true; } else { - if (!strcmp(file->path, "-")) + if (!strcmp(data->path, "-")) is_pipe = true; } if (is_pipe) - file->fd = fd; + data->fd = fd; - return file->is_pipe = is_pipe; + return data->is_pipe = is_pipe; } -static int check_backup(struct perf_data_file *file) +static int check_backup(struct perf_data *data) { struct stat st; - if (!stat(file->path, &st) && st.st_size) { + if (!stat(data->path, &st) && st.st_size) { /* TODO check errors properly */ char oldname[PATH_MAX]; snprintf(oldname, sizeof(oldname), "%s.old", - file->path); + data->path); unlink(oldname); - rename(file->path, oldname); + rename(data->path, oldname); } return 0; } -static int open_file_read(struct perf_data_file *file) +static int open_file_read(struct perf_data *data) { struct stat st; int fd; char sbuf[STRERR_BUFSIZE]; - fd = open(file->path, O_RDONLY); + fd = open(data->path, O_RDONLY); if (fd < 0) { int err = errno; - pr_err("failed to open %s: %s", file->path, + pr_err("failed to open %s: %s", data->path, str_error_r(err, sbuf, sizeof(sbuf))); - if (err == ENOENT && !strcmp(file->path, "perf.data")) + if (err == ENOENT && !strcmp(data->path, "perf.data")) pr_err(" (try 'perf record' first)"); pr_err("\n"); return -err; @@ -79,19 +79,19 @@ static int open_file_read(struct perf_data_file *file) if (fstat(fd, &st) < 0) goto out_close; - if (!file->force && st.st_uid && (st.st_uid != geteuid())) { + if (!data->force && st.st_uid && (st.st_uid != geteuid())) { pr_err("File %s not owned by current user or root (use -f to override)\n", - file->path); + data->path); goto out_close; } if (!st.st_size) { - pr_info("zero-sized file (%s), nothing to do!\n", - file->path); + pr_info("zero-sized data (%s), nothing to do!\n", + data->path); goto out_close; } - file->size = st.st_size; + data->size = st.st_size; return fd; out_close: @@ -99,93 +99,93 @@ static int open_file_read(struct perf_data_file *file) return -1; } -static int open_file_write(struct perf_data_file *file) +static int open_file_write(struct perf_data *data) { int fd; char sbuf[STRERR_BUFSIZE]; - if (check_backup(file)) + if (check_backup(data)) return -1; - fd = open(file->path, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, + fd = open(data->path, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, S_IRUSR|S_IWUSR); if (fd < 0) - pr_err("failed to open %s : %s\n", file->path, + pr_err("failed to open %s : %s\n", data->path, str_error_r(errno, sbuf, sizeof(sbuf))); return fd; } -static int open_file(struct perf_data_file *file) +static int open_file(struct perf_data *data) { int fd; - fd = perf_data_file__is_read(file) ? - open_file_read(file) : open_file_write(file); + fd = perf_data__is_read(data) ? + open_file_read(data) : open_file_write(data); - file->fd = fd; + data->fd = fd; return fd < 0 ? -1 : 0; } -int perf_data_file__open(struct perf_data_file *file) +int perf_data__open(struct perf_data *data) { - if (check_pipe(file)) + if (check_pipe(data)) return 0; - if (!file->path) - file->path = "perf.data"; + if (!data->path) + data->path = "perf.data"; - return open_file(file); + return open_file(data); } -void perf_data_file__close(struct perf_data_file *file) +void perf_data__close(struct perf_data *data) { - close(file->fd); + close(data->fd); } -ssize_t perf_data_file__write(struct perf_data_file *file, +ssize_t perf_data__write(struct perf_data *data, void *buf, size_t size) { - return writen(file->fd, buf, size); + return writen(data->fd, buf, size); } -int perf_data_file__switch(struct perf_data_file *file, +int perf_data__switch(struct perf_data *data, const char *postfix, size_t pos, bool at_exit) { char *new_filepath; int ret; - if (check_pipe(file)) + if (check_pipe(data)) return -EINVAL; - if (perf_data_file__is_read(file)) + if (perf_data__is_read(data)) return -EINVAL; - if (asprintf(&new_filepath, "%s.%s", file->path, postfix) < 0) + if (asprintf(&new_filepath, "%s.%s", data->path, postfix) < 0) return -ENOMEM; /* * Only fire a warning, don't return error, continue fill * original file. */ - if (rename(file->path, new_filepath)) - pr_warning("Failed to rename %s to %s\n", file->path, new_filepath); + if (rename(data->path, new_filepath)) + pr_warning("Failed to rename %s to %s\n", data->path, new_filepath); if (!at_exit) { - close(file->fd); - ret = perf_data_file__open(file); + close(data->fd); + ret = perf_data__open(data); if (ret < 0) goto out; - if (lseek(file->fd, pos, SEEK_SET) == (off_t)-1) { + if (lseek(data->fd, pos, SEEK_SET) == (off_t)-1) { ret = -errno; pr_debug("Failed to lseek to %zu: %s", pos, strerror(errno)); goto out; } } - ret = file->fd; + ret = data->fd; out: free(new_filepath); return ret; diff --git a/tools/perf/util/data.h b/tools/perf/util/data.h index ae510ce16cb1..a1f9d70426b1 100644 --- a/tools/perf/util/data.h +++ b/tools/perf/util/data.h @@ -8,7 +8,7 @@ enum perf_data_mode { PERF_DATA_MODE_READ, }; -struct perf_data_file { +struct perf_data { const char *path; int fd; bool is_pipe; @@ -17,43 +17,43 @@ struct perf_data_file { enum perf_data_mode mode; }; -static inline bool perf_data_file__is_read(struct perf_data_file *file) +static inline bool perf_data__is_read(struct perf_data *data) { - return file->mode == PERF_DATA_MODE_READ; + return data->mode == PERF_DATA_MODE_READ; } -static inline bool perf_data_file__is_write(struct perf_data_file *file) +static inline bool perf_data__is_write(struct perf_data *data) { - return file->mode == PERF_DATA_MODE_WRITE; + return data->mode == PERF_DATA_MODE_WRITE; } -static inline int perf_data_file__is_pipe(struct perf_data_file *file) +static inline int perf_data__is_pipe(struct perf_data *data) { - return file->is_pipe; + return data->is_pipe; } -static inline int perf_data_file__fd(struct perf_data_file *file) +static inline int perf_data__fd(struct perf_data *data) { - return file->fd; + return data->fd; } -static inline unsigned long perf_data_file__size(struct perf_data_file *file) +static inline unsigned long perf_data__size(struct perf_data *data) { - return file->size; + return data->size; } -int perf_data_file__open(struct perf_data_file *file); -void perf_data_file__close(struct perf_data_file *file); -ssize_t perf_data_file__write(struct perf_data_file *file, +int perf_data__open(struct perf_data *data); +void perf_data__close(struct perf_data *data); +ssize_t perf_data__write(struct perf_data *data, void *buf, size_t size); /* * If at_exit is set, only rename current perf.data to - * perf.data.<postfix>, continue write on original file. + * perf.data.<postfix>, continue write on original data. * Set at_exit when flushing the last output. * * Return value is fd of new output. */ -int perf_data_file__switch(struct perf_data_file *file, +int perf_data__switch(struct perf_data *data, const char *postfix, size_t pos, bool at_exit); #endif /* __PERF_DATA_H */ diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 605bbd5404fb..d7be552b21c8 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -1762,7 +1762,7 @@ process_event_desc(struct feat_fd *ff, void *data __maybe_unused) session = container_of(ff->ph, struct perf_session, header); - if (session->file->is_pipe) { + if (session->data->is_pipe) { /* Save events for reading later by print_event_desc, * since they can't be read again in pipe mode. */ ff->events = events; @@ -1771,7 +1771,7 @@ process_event_desc(struct feat_fd *ff, void *data __maybe_unused) for (evsel = events; evsel->attr.size; evsel++) perf_evlist__set_event_name(session->evlist, evsel); - if (!session->file->is_pipe) + if (!session->data->is_pipe) free_event_desc(events); return 0; @@ -2248,7 +2248,7 @@ int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full) { struct header_print_data hd; struct perf_header *header = &session->header; - int fd = perf_data_file__fd(session->file); + int fd = perf_data__fd(session->data); struct stat st; int ret, bit; @@ -2264,7 +2264,7 @@ int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full) perf_header__process_sections(header, fd, &hd, perf_file_section__fprintf_info); - if (session->file->is_pipe) + if (session->data->is_pipe) return 0; fprintf(fp, "# missing features: "); @@ -2757,7 +2757,7 @@ static int perf_header__read_pipe(struct perf_session *session) struct perf_pipe_file_header f_header; if (perf_file_header__read_pipe(&f_header, header, - perf_data_file__fd(session->file), + perf_data__fd(session->data), session->repipe) < 0) { pr_debug("incompatible file format\n"); return -EINVAL; @@ -2860,13 +2860,13 @@ static int perf_evlist__prepare_tracepoint_events(struct perf_evlist *evlist, int perf_session__read_header(struct perf_session *session) { - struct perf_data_file *file = session->file; + struct perf_data *data = session->data; struct perf_header *header = &session->header; struct perf_file_header f_header; struct perf_file_attr f_attr; u64 f_id; int nr_attrs, nr_ids, i, j; - int fd = perf_data_file__fd(file); + int fd = perf_data__fd(data); session->evlist = perf_evlist__new(); if (session->evlist == NULL) @@ -2874,7 +2874,7 @@ int perf_session__read_header(struct perf_session *session) session->evlist->env = &header->env; session->machines.host.env = &header->env; - if (perf_data_file__is_pipe(file)) + if (perf_data__is_pipe(data)) return perf_header__read_pipe(session); if (perf_file_header__read(&f_header, header, fd) < 0) @@ -2889,7 +2889,7 @@ int perf_session__read_header(struct perf_session *session) if (f_header.data.size == 0) { pr_warning("WARNING: The %s file's data size field is 0 which is unexpected.\n" "Was the 'perf record' command properly terminated?\n", - file->path); + data->path); } nr_attrs = f_header.attrs.size / f_header.attr_size; @@ -3397,7 +3397,7 @@ int perf_event__process_tracing_data(struct perf_tool *tool __maybe_unused, struct perf_session *session) { ssize_t size_read, padding, size = event->tracing_data.size; - int fd = perf_data_file__fd(session->file); + int fd = perf_data__fd(session->data); off_t offset = lseek(fd, 0, SEEK_CUR); char buf[BUFSIZ]; diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c index 218ee2bac9a5..5325e65f9711 100644 --- a/tools/perf/util/intel-bts.c +++ b/tools/perf/util/intel-bts.c @@ -500,7 +500,7 @@ static int intel_bts_process_queue(struct intel_bts_queue *btsq, u64 *timestamp) } if (!buffer->data) { - int fd = perf_data_file__fd(btsq->bts->session->file); + int fd = perf_data__fd(btsq->bts->session->data); buffer->data = auxtrace_buffer__get_data(buffer, fd); if (!buffer->data) { @@ -664,10 +664,10 @@ static int intel_bts_process_auxtrace_event(struct perf_session *session, if (!bts->data_queued) { struct auxtrace_buffer *buffer; off_t data_offset; - int fd = perf_data_file__fd(session->file); + int fd = perf_data__fd(session->data); int err; - if (perf_data_file__is_pipe(session->file)) { + if (perf_data__is_pipe(session->data)) { data_offset = 0; } else { data_offset = lseek(fd, 0, SEEK_CUR); diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index b58f9fd1e2ee..23f9ba676df0 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -271,7 +271,7 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data) ptq->buffer = buffer; if (!buffer->data) { - int fd = perf_data_file__fd(ptq->pt->session->file); + int fd = perf_data__fd(ptq->pt->session->data); buffer->data = auxtrace_buffer__get_data(buffer, fd); if (!buffer->data) @@ -2084,10 +2084,10 @@ static int intel_pt_process_auxtrace_event(struct perf_session *session, if (!pt->data_queued) { struct auxtrace_buffer *buffer; off_t data_offset; - int fd = perf_data_file__fd(session->file); + int fd = perf_data__fd(session->data); int err; - if (perf_data_file__is_pipe(session->file)) { + if (perf_data__is_pipe(session->data)) { data_offset = 0; } else { data_offset = lseek(fd, 0, SEEK_CUR); diff --git a/tools/perf/util/jit.h b/tools/perf/util/jit.h index 3f42ee4d2a0b..961e7a8a0e17 100644 --- a/tools/perf/util/jit.h +++ b/tools/perf/util/jit.h @@ -3,7 +3,7 @@ #include <data.h> -int jit_process(struct perf_session *session, struct perf_data_file *output, +int jit_process(struct perf_session *session, struct perf_data *output, struct machine *machine, char *filename, pid_t pid, u64 *nbytes); int jit_inject_record(const char *filename); diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c index 9084930e1757..e7645098a323 100644 --- a/tools/perf/util/jitdump.c +++ b/tools/perf/util/jitdump.c @@ -29,7 +29,7 @@ #include "sane_ctype.h" struct jit_buf_desc { - struct perf_data_file *output; + struct perf_data *output; struct perf_session *session; struct machine *machine; union jr_entry *entry; @@ -60,8 +60,8 @@ struct debug_line_info { struct jit_tool { struct perf_tool tool; - struct perf_data_file output; - struct perf_data_file input; + struct perf_data output; + struct perf_data input; u64 bytes_written; }; @@ -356,7 +356,7 @@ jit_inject_event(struct jit_buf_desc *jd, union perf_event *event) { ssize_t size; - size = perf_data_file__write(jd->output, event, event->header.size); + size = perf_data__write(jd->output, event, event->header.size); if (size < 0) return -1; @@ -751,7 +751,7 @@ jit_detect(char *mmap_name, pid_t pid) int jit_process(struct perf_session *session, - struct perf_data_file *output, + struct perf_data *output, struct machine *machine, char *filename, pid_t pid, diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index b3fd62f7e4c9..c09b748ab599 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -32,14 +32,14 @@ static int perf_session__deliver_event(struct perf_session *session, static int perf_session__open(struct perf_session *session) { - struct perf_data_file *file = session->file; + struct perf_data *data = session->data; if (perf_session__read_header(session) < 0) { pr_err("incompatible file format (rerun with -v to learn more)\n"); return -1; } - if (perf_data_file__is_pipe(file)) + if (perf_data__is_pipe(data)) return 0; if (perf_header__has_feat(&session->header, HEADER_STAT)) @@ -120,7 +120,7 @@ static int ordered_events__deliver_event(struct ordered_events *oe, session->tool, event->file_offset); } -struct perf_session *perf_session__new(struct perf_data_file *file, +struct perf_session *perf_session__new(struct perf_data *data, bool repipe, struct perf_tool *tool) { struct perf_session *session = zalloc(sizeof(*session)); @@ -134,13 +134,13 @@ struct perf_session *perf_session__new(struct perf_data_file *file, machines__init(&session->machines); ordered_events__init(&session->ordered_events, ordered_events__deliver_event); - if (file) { - if (perf_data_file__open(file)) + if (data) { + if (perf_data__open(data)) goto out_delete; - session->file = file; + session->data = data; - if (perf_data_file__is_read(file)) { + if (perf_data__is_read(data)) { if (perf_session__open(session) < 0) goto out_close; @@ -148,7 +148,7 @@ struct perf_session *perf_session__new(struct perf_data_file *file, * set session attributes that are present in perf.data * but not in pipe-mode. */ - if (!file->is_pipe) { + if (!data->is_pipe) { perf_session__set_id_hdr_size(session); perf_session__set_comm_exec(session); } @@ -157,7 +157,7 @@ struct perf_session *perf_session__new(struct perf_data_file *file, session->machines.host.env = &perf_env; } - if (!file || perf_data_file__is_write(file)) { + if (!data || perf_data__is_write(data)) { /* * In O_RDONLY mode this will be performed when reading the * kernel MMAP event, in perf_event__process_mmap(). @@ -170,7 +170,7 @@ struct perf_session *perf_session__new(struct perf_data_file *file, * In pipe-mode, evlist is empty until PERF_RECORD_HEADER_ATTR is * processed, so perf_evlist__sample_id_all is not meaningful here. */ - if ((!file || !file->is_pipe) && tool && tool->ordering_requires_timestamps && + if ((!data || !data->is_pipe) && tool && tool->ordering_requires_timestamps && tool->ordered_events && !perf_evlist__sample_id_all(session->evlist)) { dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n"); tool->ordered_events = false; @@ -179,7 +179,7 @@ struct perf_session *perf_session__new(struct perf_data_file *file, return session; out_close: - perf_data_file__close(file); + perf_data__close(data); out_delete: perf_session__delete(session); out: @@ -201,8 +201,8 @@ void perf_session__delete(struct perf_session *session) perf_session__delete_threads(session); perf_env__exit(&session->header.env); machines__exit(&session->machines); - if (session->file) - perf_data_file__close(session->file); + if (session->data) + perf_data__close(session->data); free(session); } @@ -290,8 +290,8 @@ static s64 process_event_auxtrace_stub(struct perf_tool *tool __maybe_unused, __maybe_unused) { dump_printf(": unhandled!\n"); - if (perf_data_file__is_pipe(session->file)) - skipn(perf_data_file__fd(session->file), event->auxtrace.size); + if (perf_data__is_pipe(session->data)) + skipn(perf_data__fd(session->data), event->auxtrace.size); return event->auxtrace.size; } @@ -1349,7 +1349,7 @@ static s64 perf_session__process_user_event(struct perf_session *session, { struct ordered_events *oe = &session->ordered_events; struct perf_tool *tool = session->tool; - int fd = perf_data_file__fd(session->file); + int fd = perf_data__fd(session->data); int err; dump_event(session->evlist, event, file_offset, NULL); @@ -1449,10 +1449,10 @@ int perf_session__peek_event(struct perf_session *session, off_t file_offset, goto out_parse_sample; } - if (perf_data_file__is_pipe(session->file)) + if (perf_data__is_pipe(session->data)) return -1; - fd = perf_data_file__fd(session->file); + fd = perf_data__fd(session->data); hdr_sz = sizeof(struct perf_event_header); if (buf_sz < hdr_sz) @@ -1687,7 +1687,7 @@ static int __perf_session__process_pipe_events(struct perf_session *session) { struct ordered_events *oe = &session->ordered_events; struct perf_tool *tool = session->tool; - int fd = perf_data_file__fd(session->file); + int fd = perf_data__fd(session->data); union perf_event *event; uint32_t size, cur_size = 0; void *buf = NULL; @@ -1828,7 +1828,7 @@ static int __perf_session__process_events(struct perf_session *session, { struct ordered_events *oe = &session->ordered_events; struct perf_tool *tool = session->tool; - int fd = perf_data_file__fd(session->file); + int fd = perf_data__fd(session->data); u64 head, page_offset, file_offset, file_pos, size; int err, mmap_prot, mmap_flags, map_idx = 0; size_t mmap_size; @@ -1945,13 +1945,13 @@ static int __perf_session__process_events(struct perf_session *session, int perf_session__process_events(struct perf_session *session) { - u64 size = perf_data_file__size(session->file); + u64 size = perf_data__size(session->data); int err; if (perf_session__register_idle_thread(session) < 0) return -ENOMEM; - if (!perf_data_file__is_pipe(session->file)) + if (!perf_data__is_pipe(session->data)) err = __perf_session__process_events(session, session->header.data_offset, session->header.data_size, size); diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index 47b5e7dbcb18..cc1c5ea53c39 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h @@ -32,13 +32,13 @@ struct perf_session { void *one_mmap_addr; u64 one_mmap_offset; struct ordered_events ordered_events; - struct perf_data_file *file; + struct perf_data *data; struct perf_tool *tool; }; struct perf_tool; -struct perf_session *perf_session__new(struct perf_data_file *file, +struct perf_session *perf_session__new(struct perf_data *data, bool repipe, struct perf_tool *tool); void perf_session__delete(struct perf_session *session); -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 10/19] perf tools: Add struct perf_data_file 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (8 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 09/19] perf tools: Rename struct perf_data_file to perf_data Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 11/19] perf tools: Add perf_data_file__write function Arnaldo Carvalho de Melo ` (8 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Jiri Olsa, Andi Kleen, Changbin Du, David Ahern, Jin Yao, Namhyung Kim, Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@kernel.org> Add struct perf_data_file to represent a single file within a perf_data struct. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: Changbin Du <changbin.du@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-c3f9p4xzykr845ktqcek6p4t@git.kernel.org [ Fixup recent changes in 'perf script --per-event-dump' ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-annotate.c | 4 ++-- tools/perf/builtin-buildid-cache.c | 4 ++-- tools/perf/builtin-buildid-list.c | 8 ++++--- tools/perf/builtin-c2c.c | 4 ++-- tools/perf/builtin-diff.c | 12 +++++----- tools/perf/builtin-evlist.c | 8 ++++--- tools/perf/builtin-inject.c | 12 ++++++---- tools/perf/builtin-kmem.c | 2 +- tools/perf/builtin-kvm.c | 8 ++++--- tools/perf/builtin-lock.c | 8 ++++--- tools/perf/builtin-mem.c | 8 ++++--- tools/perf/builtin-record.c | 6 ++--- tools/perf/builtin-report.c | 6 ++--- tools/perf/builtin-sched.c | 16 ++++++++----- tools/perf/builtin-script.c | 14 ++++++----- tools/perf/builtin-stat.c | 6 ++--- tools/perf/builtin-timechart.c | 8 ++++--- tools/perf/builtin-trace.c | 8 ++++--- tools/perf/tests/topology.c | 14 +++++++---- tools/perf/util/data-convert-bt.c | 8 +++---- tools/perf/util/data.c | 48 +++++++++++++++++++------------------- tools/perf/util/data.h | 10 +++++--- tools/perf/util/header.c | 2 +- 23 files changed, 127 insertions(+), 97 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 2d06be81a109..2d5c87578f83 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -356,7 +356,7 @@ static int __cmd_annotate(struct perf_annotate *ann) } if (total_nr_samples == 0) { - ui__error("The %s file has no samples!\n", session->data->path); + ui__error("The %s file has no samples!\n", session->data->file.path); goto out; } @@ -482,7 +482,7 @@ int cmd_annotate(int argc, const char **argv) if (quiet) perf_quiet_option(); - data.path = input_name; + data.file.path = input_name; annotate.session = perf_session__new(&data, false, &annotate.tool); if (annotate.session == NULL) diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c index 9fceae47a02e..cb2453b29365 100644 --- a/tools/perf/builtin-buildid-cache.c +++ b/tools/perf/builtin-buildid-cache.c @@ -352,8 +352,8 @@ int cmd_buildid_cache(int argc, const char **argv) nsi = nsinfo__new(ns_id); if (missing_filename) { - data.path = missing_filename; - data.force = force; + data.file.path = missing_filename; + data.force = force; session = perf_session__new(&data, false, NULL); if (session == NULL) diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c index 72bdc0eba990..00099a830b0d 100644 --- a/tools/perf/builtin-buildid-list.c +++ b/tools/perf/builtin-buildid-list.c @@ -51,9 +51,11 @@ static int perf_session__list_build_ids(bool force, bool with_hits) { struct perf_session *session; struct perf_data data = { - .path = input_name, - .mode = PERF_DATA_MODE_READ, - .force = force, + .file = { + .path = input_name, + }, + .mode = PERF_DATA_MODE_READ, + .force = force, }; symbol__elf_init(); diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 87a52d09da29..9590fdcc6484 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2572,8 +2572,8 @@ static int perf_c2c__report(int argc, const char **argv) if (!input_name || !strlen(input_name)) input_name = "perf.data"; - data.path = input_name; - data.force = symbol_conf.force; + data.file.path = input_name; + data.force = symbol_conf.force; err = setup_display(display); if (err) diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index 5292e3d13cec..67570e6417e5 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c @@ -707,7 +707,7 @@ static void data__fprintf(void) data__for_each_file(i, d) fprintf(stdout, "# [%d] %s %s\n", - d->idx, d->data.path, + d->idx, d->data.file.path, !d->idx ? "(Baseline)" : ""); fprintf(stdout, "#\n"); @@ -778,14 +778,14 @@ static int __cmd_diff(void) data__for_each_file(i, d) { d->session = perf_session__new(&d->data, false, &tool); if (!d->session) { - pr_err("Failed to open %s\n", d->data.path); + pr_err("Failed to open %s\n", d->data.file.path); ret = -1; goto out_delete; } ret = perf_session__process_events(d->session); if (ret) { - pr_err("Failed to process %s\n", d->data.path); + pr_err("Failed to process %s\n", d->data.file.path); goto out_delete; } @@ -1288,9 +1288,9 @@ static int data_init(int argc, const char **argv) data__for_each_file(i, d) { struct perf_data *data = &d->data; - data->path = use_default ? defaults[i] : argv[i]; - data->mode = PERF_DATA_MODE_READ, - data->force = force, + data->file.path = use_default ? defaults[i] : argv[i]; + data->mode = PERF_DATA_MODE_READ, + data->force = force, d->idx = i; } diff --git a/tools/perf/builtin-evlist.c b/tools/perf/builtin-evlist.c index cd79c26e16a4..93b85dc857b6 100644 --- a/tools/perf/builtin-evlist.c +++ b/tools/perf/builtin-evlist.c @@ -22,9 +22,11 @@ static int __cmd_evlist(const char *file_name, struct perf_attr_details *details struct perf_session *session; struct perf_evsel *pos; struct perf_data data = { - .path = file_name, - .mode = PERF_DATA_MODE_READ, - .force = details->force, + .file = { + .path = file_name, + }, + .mode = PERF_DATA_MODE_READ, + .force = details->force, }; bool has_tracepoint = false; diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index ac7486f6c46f..91e65093d3c2 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -145,7 +145,7 @@ static s64 perf_event__repipe_auxtrace(struct perf_tool *tool, if (!inject->output.is_pipe) { off_t offset; - offset = lseek(inject->output.fd, 0, SEEK_CUR); + offset = lseek(inject->output.file.fd, 0, SEEK_CUR); if (offset == -1) return -errno; ret = auxtrace_index__auxtrace_event(&session->auxtrace_index, @@ -775,8 +775,10 @@ int cmd_inject(int argc, const char **argv) .input_name = "-", .samples = LIST_HEAD_INIT(inject.samples), .output = { - .path = "-", - .mode = PERF_DATA_MODE_WRITE, + .file = { + .path = "-", + }, + .mode = PERF_DATA_MODE_WRITE, }, }; struct perf_data data = { @@ -789,7 +791,7 @@ int cmd_inject(int argc, const char **argv) "Inject build-ids into the output stream"), OPT_STRING('i', "input", &inject.input_name, "file", "input file name"), - OPT_STRING('o', "output", &inject.output.path, "file", + OPT_STRING('o', "output", &inject.output.file.path, "file", "output file name"), OPT_BOOLEAN('s', "sched-stat", &inject.sched_stat, "Merge sched-stat and sched-switch for getting events " @@ -836,7 +838,7 @@ int cmd_inject(int argc, const char **argv) inject.tool.ordered_events = inject.sched_stat; - data.path = inject.input_name; + data.file.path = inject.input_name; inject.session = perf_session__new(&data, true, &inject.tool); if (inject.session == NULL) return -1; diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index d45740a3e5f1..abcab75cc5b9 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -1949,7 +1949,7 @@ int cmd_kmem(int argc, const char **argv) return __cmd_record(argc, argv); } - data.path = input_name; + data.file.path = input_name; kmem_session = session = perf_session__new(&data, false, &perf_kmem); if (session == NULL) diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index 4301fc34f23c..0af4c092b471 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c @@ -1068,9 +1068,11 @@ static int read_events(struct perf_kvm_stat *kvm) .ordered_events = true, }; struct perf_data file = { - .path = kvm->file_name, - .mode = PERF_DATA_MODE_READ, - .force = kvm->force, + .file = { + .path = kvm->file_name, + }, + .mode = PERF_DATA_MODE_READ, + .force = kvm->force, }; kvm->tool = eops; diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 2e281f7b0fca..81af29400b64 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -865,9 +865,11 @@ static int __cmd_report(bool display_info) .ordered_events = true, }; struct perf_data data = { - .path = input_name, - .mode = PERF_DATA_MODE_READ, - .force = force, + .file = { + .path = input_name, + }, + .mode = PERF_DATA_MODE_READ, + .force = force, }; session = perf_session__new(&data, false, &eops); diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 5a4a6f8e614d..f09fd1a1b813 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c @@ -237,9 +237,11 @@ static int process_sample_event(struct perf_tool *tool, static int report_raw_events(struct perf_mem *mem) { struct perf_data data = { - .path = input_name, - .mode = PERF_DATA_MODE_READ, - .force = mem->force, + .file = { + .path = input_name, + }, + .mode = PERF_DATA_MODE_READ, + .force = mem->force, }; int ret; struct perf_session *session = perf_session__new(&data, false, diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 0ab7dd0e4f2b..f4d9fc54b382 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -618,7 +618,7 @@ record__switch_output(struct record *rec, bool at_exit) if (!quiet) fprintf(stderr, "[ perf record: Dump %s.%s ]\n", - data->path, timestamp); + data->file.path, timestamp); /* Output tracking events */ if (!at_exit) { @@ -1118,7 +1118,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) fprintf(stderr, "[ perf record: Captured and wrote %.3f MB %s%s%s ]\n", perf_data__size(data) / 1024.0 / 1024.0, - data->path, postfix, samples); + data->file.path, postfix, samples); } out_delete_session: @@ -1482,7 +1482,7 @@ static struct option __record_options[] = { OPT_STRING('C', "cpu", &record.opts.target.cpu_list, "cpu", "list of cpus to monitor"), OPT_U64('c', "count", &record.opts.user_interval, "event period to sample"), - OPT_STRING('o', "output", &record.data.path, "file", + OPT_STRING('o', "output", &record.data.file.path, "file", "output file name"), OPT_BOOLEAN_SET('i', "no-inherit", &record.opts.no_inherit, &record.opts.no_inherit_set, diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 0dc323772b5e..3c2d9d4932f3 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -637,7 +637,7 @@ static int __cmd_report(struct report *rep) rep->nr_entries += evsel__hists(pos)->nr_entries; if (rep->nr_entries == 0) { - ui__error("The %s file has no samples!\n", data->path); + ui__error("The %s file has no samples!\n", data->file.path); return 0; } @@ -940,8 +940,8 @@ int cmd_report(int argc, const char **argv) input_name = "perf.data"; } - data.path = input_name; - data.force = symbol_conf.force; + data.file.path = input_name; + data.force = symbol_conf.force; repeat: session = perf_session__new(&data, false, &report.tool); diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index cb5410511f69..47e54348b5ed 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -1701,9 +1701,11 @@ static int perf_sched__read_events(struct perf_sched *sched) }; struct perf_session *session; struct perf_data data = { - .path = input_name, - .mode = PERF_DATA_MODE_READ, - .force = sched->force, + .file = { + .path = input_name, + }, + .mode = PERF_DATA_MODE_READ, + .force = sched->force, }; int rc = -1; @@ -2903,9 +2905,11 @@ static int perf_sched__timehist(struct perf_sched *sched) { "sched:sched_migrate_task", timehist_migrate_task_event, }, }; struct perf_data data = { - .path = input_name, - .mode = PERF_DATA_MODE_READ, - .force = sched->force, + .file = { + .path = input_name, + }, + .mode = PERF_DATA_MODE_READ, + .force = sched->force, }; struct perf_session *session; diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 8f8fa952b506..89975e30c0ba 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -222,7 +222,7 @@ static struct perf_evsel_script *perf_evsel_script__new(struct perf_evsel *evsel struct perf_evsel_script *es = malloc(sizeof(*es)); if (es != NULL) { - if (asprintf(&es->filename, "%s.%s.dump", data->path, perf_evsel__name(evsel)) < 0) + if (asprintf(&es->filename, "%s.%s.dump", data->file.path, perf_evsel__name(evsel)) < 0) goto out_free; es->fp = fopen(es->filename, "w"); if (es->fp == NULL) @@ -2591,8 +2591,10 @@ int find_scripts(char **scripts_array, char **scripts_path_array) DIR *scripts_dir, *lang_dir; struct perf_session *session; struct perf_data data = { - .path = input_name, - .mode = PERF_DATA_MODE_READ, + .file = { + .path = input_name, + }, + .mode = PERF_DATA_MODE_READ, }; char *temp; int i = 0; @@ -2982,8 +2984,8 @@ int cmd_script(int argc, const char **argv) argc = parse_options_subcommand(argc, argv, options, script_subcommands, script_usage, PARSE_OPT_STOP_AT_NON_OPTION); - data.path = input_name; - data.force = symbol_conf.force; + data.file.path = input_name; + data.force = symbol_conf.force; if (argc > 1 && !strncmp(argv[0], "rec", strlen("rec"))) { rec_script_path = get_script_path(argv[1], RECORD_SUFFIX); @@ -3206,7 +3208,7 @@ int cmd_script(int argc, const char **argv) goto out_delete; } - input = open(data.path, O_RDONLY); /* input_name */ + input = open(data.file.path, O_RDONLY); /* input_name */ if (input < 0) { err = -errno; perror("failed to open file"); diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 85af6d291c06..fa5896270022 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -2412,7 +2412,7 @@ static int __cmd_record(int argc, const char **argv) PARSE_OPT_STOP_AT_NON_OPTION); if (output_name) - data->path = output_name; + data->file.path = output_name; if (run_count != 1 || forever) { pr_err("Cannot use -r option with perf stat record.\n"); @@ -2585,8 +2585,8 @@ static int __cmd_report(int argc, const char **argv) input_name = "perf.data"; } - perf_stat.data.path = input_name; - perf_stat.data.mode = PERF_DATA_MODE_READ; + perf_stat.data.file.path = input_name; + perf_stat.data.mode = PERF_DATA_MODE_READ; session = perf_session__new(&perf_stat.data, false, &perf_stat.tool); if (session == NULL) diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 0f79ea5e2f0f..813698a9b8c7 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c @@ -1602,9 +1602,11 @@ static int __cmd_timechart(struct timechart *tchart, const char *output_name) { "syscalls:sys_exit_select", process_exit_poll }, }; struct perf_data data = { - .path = input_name, - .mode = PERF_DATA_MODE_READ, - .force = tchart->force, + .file = { + .path = input_name, + }, + .mode = PERF_DATA_MODE_READ, + .force = tchart->force, }; struct perf_session *session = perf_session__new(&data, false, diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 7def6947ad61..c373f9a3e4a9 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2533,9 +2533,11 @@ static int trace__replay(struct trace *trace) { "probe:vfs_getname", trace__vfs_getname, }, }; struct perf_data data = { - .path = input_name, - .mode = PERF_DATA_MODE_READ, - .force = trace->force, + .file = { + .path = input_name, + }, + .mode = PERF_DATA_MODE_READ, + .force = trace->force, }; struct perf_session *session; struct perf_evsel *evsel; diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c index 7536782e8495..9bbfed51f1d6 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -30,8 +30,10 @@ static int session_write_header(char *path) { struct perf_session *session; struct perf_data data = { - .path = path, - .mode = PERF_DATA_MODE_WRITE, + .file = { + .path = path, + }, + .mode = PERF_DATA_MODE_WRITE, }; session = perf_session__new(&data, false, NULL); @@ -46,7 +48,7 @@ static int session_write_header(char *path) session->header.data_size += DATA_SIZE; TEST_ASSERT_VAL("failed to write header", - !perf_session__write_header(session, session->evlist, data.fd, true)); + !perf_session__write_header(session, session->evlist, data.file.fd, true)); perf_session__delete(session); @@ -57,8 +59,10 @@ static int check_cpu_topology(char *path, struct cpu_map *map) { struct perf_session *session; struct perf_data data = { - .path = path, - .mode = PERF_DATA_MODE_READ, + .file = { + .path = path, + }, + .mode = PERF_DATA_MODE_READ, }; int i; diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index 9fdae383a58c..5744c12641a5 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c @@ -1578,9 +1578,9 @@ int bt_convert__perf2ctf(const char *input, const char *path, { struct perf_session *session; struct perf_data data = { - .path = input, - .mode = PERF_DATA_MODE_READ, - .force = opts->force, + .file.path = input, + .mode = PERF_DATA_MODE_READ, + .force = opts->force, }; struct convert c = { .tool = { @@ -1650,7 +1650,7 @@ int bt_convert__perf2ctf(const char *input, const char *path, fprintf(stderr, "[ perf data convert: Converted '%s' into CTF data '%s' ]\n", - data.path, path); + data.file.path, path); fprintf(stderr, "[ perf data convert: Converted and wrote %.3f MB (%" PRIu64 " samples", diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index a6eea3df4c10..07ef56a4123c 100644 --- a/tools/perf/util/data.c +++ b/tools/perf/util/data.c @@ -28,16 +28,16 @@ static bool check_pipe(struct perf_data *data) int fd = perf_data__is_read(data) ? STDIN_FILENO : STDOUT_FILENO; - if (!data->path) { + if (!data->file.path) { if (!fstat(fd, &st) && S_ISFIFO(st.st_mode)) is_pipe = true; } else { - if (!strcmp(data->path, "-")) + if (!strcmp(data->file.path, "-")) is_pipe = true; } if (is_pipe) - data->fd = fd; + data->file.fd = fd; return data->is_pipe = is_pipe; } @@ -46,13 +46,13 @@ static int check_backup(struct perf_data *data) { struct stat st; - if (!stat(data->path, &st) && st.st_size) { + if (!stat(data->file.path, &st) && st.st_size) { /* TODO check errors properly */ char oldname[PATH_MAX]; snprintf(oldname, sizeof(oldname), "%s.old", - data->path); + data->file.path); unlink(oldname); - rename(data->path, oldname); + rename(data->file.path, oldname); } return 0; @@ -64,13 +64,13 @@ static int open_file_read(struct perf_data *data) int fd; char sbuf[STRERR_BUFSIZE]; - fd = open(data->path, O_RDONLY); + fd = open(data->file.path, O_RDONLY); if (fd < 0) { int err = errno; - pr_err("failed to open %s: %s", data->path, + pr_err("failed to open %s: %s", data->file.path, str_error_r(err, sbuf, sizeof(sbuf))); - if (err == ENOENT && !strcmp(data->path, "perf.data")) + if (err == ENOENT && !strcmp(data->file.path, "perf.data")) pr_err(" (try 'perf record' first)"); pr_err("\n"); return -err; @@ -81,13 +81,13 @@ static int open_file_read(struct perf_data *data) if (!data->force && st.st_uid && (st.st_uid != geteuid())) { pr_err("File %s not owned by current user or root (use -f to override)\n", - data->path); + data->file.path); goto out_close; } if (!st.st_size) { pr_info("zero-sized data (%s), nothing to do!\n", - data->path); + data->file.path); goto out_close; } @@ -107,11 +107,11 @@ static int open_file_write(struct perf_data *data) if (check_backup(data)) return -1; - fd = open(data->path, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, + fd = open(data->file.path, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, S_IRUSR|S_IWUSR); if (fd < 0) - pr_err("failed to open %s : %s\n", data->path, + pr_err("failed to open %s : %s\n", data->file.path, str_error_r(errno, sbuf, sizeof(sbuf))); return fd; @@ -124,7 +124,7 @@ static int open_file(struct perf_data *data) fd = perf_data__is_read(data) ? open_file_read(data) : open_file_write(data); - data->fd = fd; + data->file.fd = fd; return fd < 0 ? -1 : 0; } @@ -133,21 +133,21 @@ int perf_data__open(struct perf_data *data) if (check_pipe(data)) return 0; - if (!data->path) - data->path = "perf.data"; + if (!data->file.path) + data->file.path = "perf.data"; return open_file(data); } void perf_data__close(struct perf_data *data) { - close(data->fd); + close(data->file.fd); } ssize_t perf_data__write(struct perf_data *data, void *buf, size_t size) { - return writen(data->fd, buf, size); + return writen(data->file.fd, buf, size); } int perf_data__switch(struct perf_data *data, @@ -162,30 +162,30 @@ int perf_data__switch(struct perf_data *data, if (perf_data__is_read(data)) return -EINVAL; - if (asprintf(&new_filepath, "%s.%s", data->path, postfix) < 0) + if (asprintf(&new_filepath, "%s.%s", data->file.path, postfix) < 0) return -ENOMEM; /* * Only fire a warning, don't return error, continue fill * original file. */ - if (rename(data->path, new_filepath)) - pr_warning("Failed to rename %s to %s\n", data->path, new_filepath); + if (rename(data->file.path, new_filepath)) + pr_warning("Failed to rename %s to %s\n", data->file.path, new_filepath); if (!at_exit) { - close(data->fd); + close(data->file.fd); ret = perf_data__open(data); if (ret < 0) goto out; - if (lseek(data->fd, pos, SEEK_SET) == (off_t)-1) { + if (lseek(data->file.fd, pos, SEEK_SET) == (off_t)-1) { ret = -errno; pr_debug("Failed to lseek to %zu: %s", pos, strerror(errno)); goto out; } } - ret = data->fd; + ret = data->file.fd; out: free(new_filepath); return ret; diff --git a/tools/perf/util/data.h b/tools/perf/util/data.h index a1f9d70426b1..1797bed3aa4b 100644 --- a/tools/perf/util/data.h +++ b/tools/perf/util/data.h @@ -8,9 +8,13 @@ enum perf_data_mode { PERF_DATA_MODE_READ, }; +struct perf_data_file { + const char *path; + int fd; +}; + struct perf_data { - const char *path; - int fd; + struct perf_data_file file; bool is_pipe; bool force; unsigned long size; @@ -34,7 +38,7 @@ static inline int perf_data__is_pipe(struct perf_data *data) static inline int perf_data__fd(struct perf_data *data) { - return data->fd; + return data->file.fd; } static inline unsigned long perf_data__size(struct perf_data *data) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index d7be552b21c8..6e59dcca9df2 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2889,7 +2889,7 @@ int perf_session__read_header(struct perf_session *session) if (f_header.data.size == 0) { pr_warning("WARNING: The %s file's data size field is 0 which is unexpected.\n" "Was the 'perf record' command properly terminated?\n", - data->path); + data->file.path); } nr_attrs = f_header.attrs.size / f_header.attr_size; -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 11/19] perf tools: Add perf_data_file__write function 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (9 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 10/19] perf tools: Add struct perf_data_file Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 12/19] perf stat: Move the shadow stats scale computation in perf_stat__update_shadow_stats Arnaldo Carvalho de Melo ` (7 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Jiri Olsa, Andi Kleen, Changbin Du, David Ahern, Jin Yao, Namhyung Kim, Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@kernel.org> Adding perf_data_file__write function to provide single file write operation. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: Changbin Du <changbin.du@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-c3f9p4xzykr845ktqcek6p4t@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/data.c | 8 +++++++- tools/perf/util/data.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index 07ef56a4123c..f80a23d031d6 100644 --- a/tools/perf/util/data.c +++ b/tools/perf/util/data.c @@ -144,10 +144,16 @@ void perf_data__close(struct perf_data *data) close(data->file.fd); } +ssize_t perf_data_file__write(struct perf_data_file *file, + void *buf, size_t size) +{ + return writen(file->fd, buf, size); +} + ssize_t perf_data__write(struct perf_data *data, void *buf, size_t size) { - return writen(data->file.fd, buf, size); + return perf_data_file__write(&data->file, buf, size); } int perf_data__switch(struct perf_data *data, diff --git a/tools/perf/util/data.h b/tools/perf/util/data.h index 1797bed3aa4b..000c43bbb7ac 100644 --- a/tools/perf/util/data.h +++ b/tools/perf/util/data.h @@ -50,6 +50,8 @@ int perf_data__open(struct perf_data *data); void perf_data__close(struct perf_data *data); ssize_t perf_data__write(struct perf_data *data, void *buf, size_t size); +ssize_t perf_data_file__write(struct perf_data_file *file, + void *buf, size_t size); /* * If at_exit is set, only rename current perf.data to * perf.data.<postfix>, continue write on original data. -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 12/19] perf stat: Move the shadow stats scale computation in perf_stat__update_shadow_stats 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (10 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 11/19] perf tools: Add perf_data_file__write function Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 13/19] perf stat: Make --per-thread update shadow stats to show metrics Arnaldo Carvalho de Melo ` (6 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Jiri Olsa, Andi Kleen, Changbin Du, David Ahern, Jin Yao, Namhyung Kim, Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@kernel.org> Move the shadow stats scale computation to the perf_stat__update_shadow_stats() function, so it's centralized and we don't forget to do it. It also saves few lines of code. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: Changbin Du <changbin.du@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-htg7mmyxv6pcrf57qyo6msid@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-stat.c | 3 +-- tools/perf/util/stat-shadow.c | 48 ++++++++++++++++++++++--------------------- tools/perf/util/stat.c | 6 ++---- tools/perf/util/stat.h | 2 +- 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index fa5896270022..59af5a8419e2 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1267,8 +1267,7 @@ static void aggr_update_shadow(void) continue; val += perf_counts(counter->counts, cpu, 0)->val; } - val = val * counter->scale; - perf_stat__update_shadow_stats(counter, &val, + perf_stat__update_shadow_stats(counter, val, first_shadow_cpu(counter, id)); } } diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index a2c12d1ef32a..51ad03a799ec 100644 --- a/tools/perf/util/stat-shadow.c +++ b/tools/perf/util/stat-shadow.c @@ -178,58 +178,60 @@ void perf_stat__reset_shadow_stats(void) * more semantic information such as miss/hit ratios, * instruction rates, etc: */ -void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count, +void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 count, int cpu) { int ctx = evsel_context(counter); + count *= counter->scale; + if (perf_evsel__match(counter, SOFTWARE, SW_TASK_CLOCK) || perf_evsel__match(counter, SOFTWARE, SW_CPU_CLOCK)) - update_stats(&runtime_nsecs_stats[cpu], count[0]); + update_stats(&runtime_nsecs_stats[cpu], count); else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES)) - update_stats(&runtime_cycles_stats[ctx][cpu], count[0]); + update_stats(&runtime_cycles_stats[ctx][cpu], count); else if (perf_stat_evsel__is(counter, CYCLES_IN_TX)) - update_stats(&runtime_cycles_in_tx_stats[ctx][cpu], count[0]); + update_stats(&runtime_cycles_in_tx_stats[ctx][cpu], count); else if (perf_stat_evsel__is(counter, TRANSACTION_START)) - update_stats(&runtime_transaction_stats[ctx][cpu], count[0]); + update_stats(&runtime_transaction_stats[ctx][cpu], count); else if (perf_stat_evsel__is(counter, ELISION_START)) - update_stats(&runtime_elision_stats[ctx][cpu], count[0]); + update_stats(&runtime_elision_stats[ctx][cpu], count); else if (perf_stat_evsel__is(counter, TOPDOWN_TOTAL_SLOTS)) - update_stats(&runtime_topdown_total_slots[ctx][cpu], count[0]); + update_stats(&runtime_topdown_total_slots[ctx][cpu], count); else if (perf_stat_evsel__is(counter, TOPDOWN_SLOTS_ISSUED)) - update_stats(&runtime_topdown_slots_issued[ctx][cpu], count[0]); + update_stats(&runtime_topdown_slots_issued[ctx][cpu], count); else if (perf_stat_evsel__is(counter, TOPDOWN_SLOTS_RETIRED)) - update_stats(&runtime_topdown_slots_retired[ctx][cpu], count[0]); + update_stats(&runtime_topdown_slots_retired[ctx][cpu], count); else if (perf_stat_evsel__is(counter, TOPDOWN_FETCH_BUBBLES)) - update_stats(&runtime_topdown_fetch_bubbles[ctx][cpu],count[0]); + update_stats(&runtime_topdown_fetch_bubbles[ctx][cpu], count); else if (perf_stat_evsel__is(counter, TOPDOWN_RECOVERY_BUBBLES)) - update_stats(&runtime_topdown_recovery_bubbles[ctx][cpu], count[0]); + update_stats(&runtime_topdown_recovery_bubbles[ctx][cpu], count); else if (perf_evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_FRONTEND)) - update_stats(&runtime_stalled_cycles_front_stats[ctx][cpu], count[0]); + update_stats(&runtime_stalled_cycles_front_stats[ctx][cpu], count); else if (perf_evsel__match(counter, HARDWARE, HW_STALLED_CYCLES_BACKEND)) - update_stats(&runtime_stalled_cycles_back_stats[ctx][cpu], count[0]); + update_stats(&runtime_stalled_cycles_back_stats[ctx][cpu], count); else if (perf_evsel__match(counter, HARDWARE, HW_BRANCH_INSTRUCTIONS)) - update_stats(&runtime_branches_stats[ctx][cpu], count[0]); + update_stats(&runtime_branches_stats[ctx][cpu], count); else if (perf_evsel__match(counter, HARDWARE, HW_CACHE_REFERENCES)) - update_stats(&runtime_cacherefs_stats[ctx][cpu], count[0]); + update_stats(&runtime_cacherefs_stats[ctx][cpu], count); else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_L1D)) - update_stats(&runtime_l1_dcache_stats[ctx][cpu], count[0]); + update_stats(&runtime_l1_dcache_stats[ctx][cpu], count); else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_L1I)) - update_stats(&runtime_ll_cache_stats[ctx][cpu], count[0]); + update_stats(&runtime_ll_cache_stats[ctx][cpu], count); else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_LL)) - update_stats(&runtime_ll_cache_stats[ctx][cpu], count[0]); + update_stats(&runtime_ll_cache_stats[ctx][cpu], count); else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_DTLB)) - update_stats(&runtime_dtlb_cache_stats[ctx][cpu], count[0]); + update_stats(&runtime_dtlb_cache_stats[ctx][cpu], count); else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_ITLB)) - update_stats(&runtime_itlb_cache_stats[ctx][cpu], count[0]); + update_stats(&runtime_itlb_cache_stats[ctx][cpu], count); else if (perf_stat_evsel__is(counter, SMI_NUM)) - update_stats(&runtime_smi_num_stats[ctx][cpu], count[0]); + update_stats(&runtime_smi_num_stats[ctx][cpu], count); else if (perf_stat_evsel__is(counter, APERF)) - update_stats(&runtime_aperf_stats[ctx][cpu], count[0]); + update_stats(&runtime_aperf_stats[ctx][cpu], count); if (counter->collect_stat) { struct saved_value *v = saved_value_lookup(counter, cpu, true); - update_stats(&v->stats, count[0]); + update_stats(&v->stats, count); } } diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 933de91831fa..ef00c91e2553 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -277,7 +277,7 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel perf_evsel__compute_deltas(evsel, cpu, thread, count); perf_counts_values__scale(count, config->scale, NULL); if (config->aggr_mode == AGGR_NONE) - perf_stat__update_shadow_stats(evsel, count->values, cpu); + perf_stat__update_shadow_stats(evsel, count->val, cpu); break; case AGGR_GLOBAL: aggr->val += count->val; @@ -320,7 +320,6 @@ int perf_stat_process_counter(struct perf_stat_config *config, struct perf_counts_values *aggr = &counter->counts->aggr; struct perf_stat_evsel *ps = counter->stats; u64 *count = counter->counts->aggr.values; - u64 val; int i, ret; aggr->val = aggr->ena = aggr->run = 0; @@ -360,8 +359,7 @@ int perf_stat_process_counter(struct perf_stat_config *config, /* * Save the full runtime - to allow normalization during printout: */ - val = counter->scale * *count; - perf_stat__update_shadow_stats(counter, &val, 0); + perf_stat__update_shadow_stats(counter, *count, 0); return 0; } diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 47915df346fb..490b78aa7230 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h @@ -82,7 +82,7 @@ typedef void (*new_line_t )(void *ctx); void perf_stat__init_shadow_stats(void); void perf_stat__reset_shadow_stats(void); -void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count, +void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 count, int cpu); struct perf_stat_output_ctx { void *ctx; -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 13/19] perf stat: Make --per-thread update shadow stats to show metrics 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (11 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 12/19] perf stat: Move the shadow stats scale computation in perf_stat__update_shadow_stats Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 14/19] perf callchain: Fix double mapping al->addr for children without self period Arnaldo Carvalho de Melo ` (5 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Jiri Olsa, Andi Kleen, Changbin Du, David Ahern, Namhyung Kim, Peter Zijlstra, Wang Nan, Arnaldo Carvalho de Melo From: Jiri Olsa <jolsa@kernel.org> We should support this because it would allow easily to collect metrics for different threads in applications. Original patch from posted by Jin Yao in here [1]. 1. Current output, for example: root@skl:/tmp# perf stat --per-thread -p 21623 ^C Performance counter stats for process id '21623': vmstat-21623 0.517479 task-clock (msec) # 0.000 CPUs utilized vmstat-21623 1 context-switches vmstat-21623 0 cpu-migrations vmstat-21623 0 page-faults vmstat-21623 461,306 cycles vmstat-21623 630,724 instructions vmstat-21623 136,265 branches vmstat-21623 2,520 branch-misses 1.444020756 seconds time elapsed root@skl:/tmp# perf stat --per-thread --metrics ipc -p 21623 ^C Performance counter stats for process id '21623': vmstat-21623 631,185 inst_retired.any vmstat-21623 605,893 cpu_clk_unhalted.thread 1.415679293 seconds time elapsed 2. With this patch, the result would be: root@skl:/tmp# perf stat --per-thread -p 21623 ^C Performance counter stats for process id '21623': vmstat-21623 0.533759 task-clock (msec) # 0.000 CPUs utilized vmstat-21623 1 context-switches # 0.002 M/sec vmstat-21623 0 cpu-migrations # 0.000 K/sec vmstat-21623 0 page-faults # 0.000 K/sec vmstat-21623 473,896 cycles # 0.888 GHz vmstat-21623 631,072 instructions # 1.33 insn per cycle vmstat-21623 136,307 branches # 255.372 M/sec vmstat-21623 2,524 branch-misses # 1.85% of all branches 1.544862861 seconds time elapsed root@skl:/tmp# perf stat --per-thread --metrics ipc -p 21623 ^C Performance counter stats for process id '21623': vmstat-21623 1,259,104 inst_retired.any # 1.2 IPC vmstat-21623 1,056,756 cpu_clk_unhalted.thread 2.040954502 seconds time elapsed [1] https://marc.info/?l=linux-kernel&m=150777054620511&w=2 Originally-from: Jin Yao <yao.jin@linux.intel.com> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: Changbin Du <changbin.du@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-tr8ntktxmy4qc5769ajg5u6c@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/stat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index ef00c91e2553..203f5d8d11d1 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -278,6 +278,8 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel perf_counts_values__scale(count, config->scale, NULL); if (config->aggr_mode == AGGR_NONE) perf_stat__update_shadow_stats(evsel, count->val, cpu); + if (config->aggr_mode == AGGR_THREAD) + perf_stat__update_shadow_stats(evsel, count->val, 0); break; case AGGR_GLOBAL: aggr->val += count->val; -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 14/19] perf callchain: Fix double mapping al->addr for children without self period 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (12 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 13/19] perf stat: Make --per-thread update shadow stats to show metrics Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 15/19] tools include uapi: Grab a copy of linux/kcmp.h Arnaldo Carvalho de Melo ` (4 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Namhyung Kim, Jin Yao, Jiri Olsa, kernel-team, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung@kernel.org> Milian Wolff found a problem he described in [1] and that for him would get fixed: "Note how most of the large offset values are now gone. Most notably, we get proper srcline resolution for the random.h and complex headers." Then Namhyung found the root cause: "I looked into it and found a bug handling cumulative (children) entries. For children entries that have no self period, the al->addr (so he->ip) ends up having an doubly-mapped address. It seems to be there from the beginning but only affects entries that have no srclines - finding srcline itself is done using a different address but it will show the invalid address if no srcline was found. I think we should fix the commit c7405d85d7a3 ("perf tools: Update cpumode for each cumulative entry")." [1] https://lkml.kernel.org/r/20171018185350.14893-7-milian.wolff@kdab.com Reported-by: Milian Wolff <milian.wolff@kdab.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Tested-by: Milian Wolff <milian.wolff@kdab.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: kernel-team@lge.com Fixes: c7405d85d7a3 ("perf tools: Update cpumode for each cumulative entry") Link: https://lkml.kernel.org/r/20171020051533.GA2746@sejong Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/callchain.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index 3a3916934a92..837012147c7b 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c @@ -1091,10 +1091,7 @@ int fill_callchain_info(struct addr_location *al, struct callchain_cursor_node * al->map = node->map; al->sym = node->sym; al->srcline = node->srcline; - if (node->map) - al->addr = node->map->map_ip(node->map, node->ip); - else - al->addr = node->ip; + al->addr = node->ip; if (al->sym == NULL) { if (hide_unresolved) -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 15/19] tools include uapi: Grab a copy of linux/kcmp.h 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (13 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 14/19] perf callchain: Fix double mapping al->addr for children without self period Arnaldo Carvalho de Melo @ 2017-11-03 13:54 ` Arnaldo Carvalho de Melo 2017-11-03 13:55 ` [PATCH 16/19] perf trace beauty: Implement pid_fd beautifier Arnaldo Carvalho de Melo ` (3 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andrey Vagin, Cyrill Gorcunov, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> We will use it to generate tables for beautifying kcmp's 'type' arg. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andrey Vagin <avagin@openvz.org> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-r35zr79invmpinfe1zu57cas@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/include/uapi/linux/kcmp.h | 27 +++++++++++++++++++++++++++ tools/perf/check-headers.sh | 1 + 2 files changed, 28 insertions(+) create mode 100644 tools/include/uapi/linux/kcmp.h diff --git a/tools/include/uapi/linux/kcmp.h b/tools/include/uapi/linux/kcmp.h new file mode 100644 index 000000000000..481e103da78e --- /dev/null +++ b/tools/include/uapi/linux/kcmp.h @@ -0,0 +1,27 @@ +#ifndef _UAPI_LINUX_KCMP_H +#define _UAPI_LINUX_KCMP_H + +#include <linux/types.h> + +/* Comparison type */ +enum kcmp_type { + KCMP_FILE, + KCMP_VM, + KCMP_FILES, + KCMP_FS, + KCMP_SIGHAND, + KCMP_IO, + KCMP_SYSVSEM, + KCMP_EPOLL_TFD, + + KCMP_TYPES, +}; + +/* Slot for KCMP_EPOLL_TFD */ +struct kcmp_epoll_slot { + __u32 efd; /* epoll file descriptor */ + __u32 tfd; /* target file number */ + __u32 toff; /* target offset within same numbered sequence */ +}; + +#endif /* _UAPI_LINUX_KCMP_H */ diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh index 8d8b37198666..a3a041b0d35e 100755 --- a/tools/perf/check-headers.sh +++ b/tools/perf/check-headers.sh @@ -4,6 +4,7 @@ HEADERS=' include/uapi/drm/drm.h include/uapi/drm/i915_drm.h include/uapi/linux/fcntl.h +include/uapi/linux/kcmp.h include/uapi/linux/kvm.h include/uapi/linux/perf_event.h include/uapi/linux/prctl.h -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 16/19] perf trace beauty: Implement pid_fd beautifier 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (14 preceding siblings ...) 2017-11-03 13:54 ` [PATCH 15/19] tools include uapi: Grab a copy of linux/kcmp.h Arnaldo Carvalho de Melo @ 2017-11-03 13:55 ` Arnaldo Carvalho de Melo 2017-11-03 13:55 ` [PATCH 17/19] perf trace beauty kcmp: Beautify arguments Arnaldo Carvalho de Melo ` (2 subsequent siblings) 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:55 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andrey Vagin, Cyrill Gorcunov, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> One that given a pid and a fd, will try to get the path for that fd. Will be used in the upcoming kcmp's KCMP_FILE beautifier. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andrey Vagin <avagin@openvz.org> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-7ketygp2dvs9h13wuakfncws@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-trace.c | 17 +++++++++++++++++ tools/perf/trace/beauty/beauty.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index c373f9a3e4a9..0c1461416ef1 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -988,6 +988,23 @@ size_t syscall_arg__scnprintf_fd(char *bf, size_t size, struct syscall_arg *arg) return printed; } +size_t pid__scnprintf_fd(struct trace *trace, pid_t pid, int fd, char *bf, size_t size) +{ + size_t printed = scnprintf(bf, size, "%d", fd); + struct thread *thread = machine__find_thread(trace->host, pid, pid); + + if (thread) { + const char *path = thread__fd_path(thread, fd, trace); + + if (path) + printed += scnprintf(bf + printed, size - printed, "<%s>", path); + + thread__put(thread); + } + + return printed; +} + static size_t syscall_arg__scnprintf_close_fd(char *bf, size_t size, struct syscall_arg *arg) { diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h index b29f94ef5d6a..365bb6fecc1c 100644 --- a/tools/perf/trace/beauty/beauty.h +++ b/tools/perf/trace/beauty/beauty.h @@ -3,6 +3,7 @@ #include <linux/kernel.h> #include <linux/types.h> +#include <sys/types.h> struct strarray { int offset; @@ -26,6 +27,8 @@ size_t strarray__scnprintf(struct strarray *sa, char *bf, size_t size, const cha struct trace; struct thread; +size_t pid__scnprintf_fd(struct trace *trace, pid_t pid, int fd, char *bf, size_t size); + /** * @val: value of syscall argument being formatted * @args: All the args, use syscall_args__val(arg, nth) to access one -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 17/19] perf trace beauty kcmp: Beautify arguments 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (15 preceding siblings ...) 2017-11-03 13:55 ` [PATCH 16/19] perf trace beauty: Implement pid_fd beautifier Arnaldo Carvalho de Melo @ 2017-11-03 13:55 ` Arnaldo Carvalho de Melo 2017-11-03 13:55 ` [PATCH 18/19] perf srcline: Fix memory leak in addr2inlines() Arnaldo Carvalho de Melo 2017-11-03 13:55 ` [PATCH 19/19] perf srcline: Show correct function name for srcline of callchains Arnaldo Carvalho de Melo 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:55 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andrey Vagin, Cyrill Gorcunov, David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan From: Arnaldo Carvalho de Melo <acme@redhat.com> For some unknown reason there is no entry in tracefs's syscalls for kcmp, i.e. no tracefs/events/syscalls/sys_{enter,exit}_kcmp, so we need to provide a data dictionary for the fields. To beautify the 'type' argument we automatically generate a strarray from tools/include/uapi/kcmp.h, the idx1 and idx2 args, nowadays used only if type == KCMP_FILE, are masked for all the other types and a lookup is made for the thread and fd to show the path, if possible, getting it from the probe:vfs_getname if in place or from procfs, races allowing. A system wide strace like tracing session, with callchains shows just one user so far in this fedora 25 machine: # perf trace --max-stack 5 -e kcmp <SNIP> 1502914.400 ( 0.001 ms): systemd/1 kcmp(pid1: 1 (systemd), pid2: 1 (systemd), type: FILE, idx1: 271<socket:[4723475]>, idx2: 25<socket:[4788686]>) = -1 ENOSYS Function not implemented syscall (/usr/lib64/libc-2.25.so) same_fd (/usr/lib/systemd/libsystemd-shared-233.so) service_add_fd_store (/usr/lib/systemd/systemd) service_notify_message.lto_priv.127 (/usr/lib/systemd/systemd) 1502914.407 ( 0.001 ms): systemd/1 kcmp(pid1: 1 (systemd), pid2: 1 (systemd), type: FILE, idx1: 270<socket:[4726396]>, idx2: 25<socket:[4788686]>) = -1 ENOSYS Function not implemented syscall (/usr/lib64/libc-2.25.so) same_fd (/usr/lib/systemd/libsystemd-shared-233.so) service_add_fd_store (/usr/lib/systemd/systemd) service_notify_message.lto_priv.127 (/usr/lib/systemd/systemd) <SNIP> The backtraces seem to agree this is really kcmp(), but this system doesn't have the sys_kcmp(), bummer: # uname -a Linux jouet 4.14.0-rc3+ #1 SMP Fri Oct 13 12:21:12 -03 2017 x86_64 x86_64 x86_64 GNU/Linux # grep kcmp /proc/kallsyms ffffffffb60b8890 W sys_kcmp $ grep CONFIG_CHECKPOINT_RESTORE ../build/v4.14.0-rc3+/.config # CONFIG_CHECKPOINT_RESTORE is not set $ So systemd uses it, good fedora kernel config has it: $ grep CONFIG_CHECKPOINT_RESTORE /boot/config-4.13.4-200.fc26.x86_64 CONFIG_CHECKPOINT_RESTORE=y [acme@jouet linux]$ /me goes to rebuild a kernel... Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andrey Vagin <avagin@openvz.org> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-gz5fca968viw8m7hryjqvrln@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Makefile.perf | 9 ++++++++ tools/perf/builtin-trace.c | 6 +++++ tools/perf/trace/beauty/Build | 1 + tools/perf/trace/beauty/beauty.h | 6 +++++ tools/perf/trace/beauty/kcmp.c | 44 ++++++++++++++++++++++++++++++++++++ tools/perf/trace/beauty/kcmp_type.sh | 10 ++++++++ 6 files changed, 76 insertions(+) create mode 100644 tools/perf/trace/beauty/kcmp.c create mode 100755 tools/perf/trace/beauty/kcmp_type.sh diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index c872ca607b39..68cf1360a3f3 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -420,6 +420,13 @@ sndrv_pcm_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/sndrv_pcm_ioctl.sh $(sndrv_pcm_ioctl_array): $(sndrv_pcm_hdr_dir)/asound.h $(sndrv_pcm_ioctl_tbl) $(Q)$(SHELL) '$(sndrv_pcm_ioctl_tbl)' $(sndrv_pcm_hdr_dir) > $@ +kcmp_type_array := $(beauty_outdir)/kcmp_type_array.c +kcmp_hdr_dir := $(srctree)/tools/include/uapi/linux/ +kcmp_type_tbl := $(srctree)/tools/perf/trace/beauty/kcmp_type.sh + +$(kcmp_type_array): $(kcmp_hdr_dir)/kcmp.h $(kcmp_type_tbl) + $(Q)$(SHELL) '$(kcmp_type_tbl)' $(kcmp_hdr_dir) > $@ + kvm_ioctl_array := $(beauty_ioctl_outdir)/kvm_ioctl_array.c kvm_hdr_dir := $(srctree)/tools/include/uapi/linux kvm_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/kvm_ioctl.sh @@ -553,6 +560,7 @@ prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioc $(pkey_alloc_access_rights_array) \ $(sndrv_pcm_ioctl_array) \ $(sndrv_ctl_ioctl_array) \ + $(kcmp_type_array) \ $(kvm_ioctl_array) \ $(vhost_virtio_ioctl_array) \ $(madvise_behavior_array) \ @@ -836,6 +844,7 @@ clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clea $(OUTPUT)$(sndrv_ctl_ioctl_array) \ $(OUTPUT)$(sndrv_pcm_ioctl_array) \ $(OUTPUT)$(kvm_ioctl_array) \ + $(OUTPUT)$(kcmp_type_array) \ $(OUTPUT)$(vhost_virtio_ioctl_array) \ $(OUTPUT)$(perf_ioctl_array) \ $(OUTPUT)$(prctl_option_array) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 0c1461416ef1..505b871fdc82 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -633,6 +633,12 @@ static struct syscall_fmt { #else [2] = { .scnprintf = SCA_HEX, /* arg */ }, }, }, #endif + { .name = "kcmp", .nr_args = 5, + .arg = { [0] = { .name = "pid1", .scnprintf = SCA_PID, }, + [1] = { .name = "pid2", .scnprintf = SCA_PID, }, + [2] = { .name = "type", .scnprintf = SCA_KCMP_TYPE, }, + [3] = { .name = "idx1", .scnprintf = SCA_KCMP_IDX, }, + [4] = { .name = "idx2", .scnprintf = SCA_KCMP_IDX, }, }, }, { .name = "keyctl", .arg = { [0] = STRARRAY(option, keyctl_options), }, }, { .name = "kill", diff --git a/tools/perf/trace/beauty/Build b/tools/perf/trace/beauty/Build index 2f68b76ec39b..066bbf0f4a74 100644 --- a/tools/perf/trace/beauty/Build +++ b/tools/perf/trace/beauty/Build @@ -3,6 +3,7 @@ libperf-y += fcntl.o ifeq ($(SRCARCH),$(filter $(SRCARCH),x86)) libperf-y += ioctl.o endif +libperf-y += kcmp.o libperf-y += pkey_alloc.o libperf-y += prctl.o libperf-y += statx.o diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h index 365bb6fecc1c..3f067bdab84f 100644 --- a/tools/perf/trace/beauty/beauty.h +++ b/tools/perf/trace/beauty/beauty.h @@ -81,6 +81,12 @@ size_t syscall_arg__scnprintf_fcntl_arg(char *bf, size_t size, struct syscall_ar size_t syscall_arg__scnprintf_ioctl_cmd(char *bf, size_t size, struct syscall_arg *arg); #define SCA_IOCTL_CMD syscall_arg__scnprintf_ioctl_cmd +size_t syscall_arg__scnprintf_kcmp_type(char *bf, size_t size, struct syscall_arg *arg); +#define SCA_KCMP_TYPE syscall_arg__scnprintf_kcmp_type + +size_t syscall_arg__scnprintf_kcmp_idx(char *bf, size_t size, struct syscall_arg *arg); +#define SCA_KCMP_IDX syscall_arg__scnprintf_kcmp_idx + size_t syscall_arg__scnprintf_pkey_alloc_access_rights(char *bf, size_t size, struct syscall_arg *arg); #define SCA_PKEY_ALLOC_ACCESS_RIGHTS syscall_arg__scnprintf_pkey_alloc_access_rights diff --git a/tools/perf/trace/beauty/kcmp.c b/tools/perf/trace/beauty/kcmp.c new file mode 100644 index 000000000000..f62040eb9d5c --- /dev/null +++ b/tools/perf/trace/beauty/kcmp.c @@ -0,0 +1,44 @@ +/* + * trace/beauty/kcmp.c + * + * Copyright (C) 2017, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> + * + * Released under the GPL v2. (and only v2, not any later version) + */ + +#include "trace/beauty/beauty.h" +#include <linux/kernel.h> +#include <sys/types.h> +#include <machine.h> +#include <uapi/linux/kcmp.h> + +#include "trace/beauty/generated/kcmp_type_array.c" + +size_t syscall_arg__scnprintf_kcmp_idx(char *bf, size_t size, struct syscall_arg *arg) +{ + unsigned long fd = arg->val; + int type = syscall_arg__val(arg, 2); + pid_t pid; + + if (type != KCMP_FILE) + return syscall_arg__scnprintf_long(bf, size, arg); + + pid = syscall_arg__val(arg, arg->idx == 3 ? 0 : 1); /* idx1 -> pid1, idx2 -> pid2 */ + return pid__scnprintf_fd(arg->trace, pid, fd, bf, size); +} + +static size_t kcmp__scnprintf_type(int type, char *bf, size_t size) +{ + static DEFINE_STRARRAY(kcmp_types); + return strarray__scnprintf(&strarray__kcmp_types, bf, size, "%d", type); +} + +size_t syscall_arg__scnprintf_kcmp_type(char *bf, size_t size, struct syscall_arg *arg) +{ + unsigned long type = arg->val; + + if (type != KCMP_FILE) + arg->mask |= (1 << 3) | (1 << 4); /* Ignore idx1 and idx2 */ + + return kcmp__scnprintf_type(type, bf, size); +} diff --git a/tools/perf/trace/beauty/kcmp_type.sh b/tools/perf/trace/beauty/kcmp_type.sh new file mode 100755 index 000000000000..40d063b8c082 --- /dev/null +++ b/tools/perf/trace/beauty/kcmp_type.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +header_dir=$1 + +printf "static const char *kcmp_types[] = {\n" +regex='^[[:space:]]+(KCMP_(\w+)),' +egrep $regex ${header_dir}/kcmp.h | grep -v KCMP_TYPES, | \ + sed -r "s/$regex/\1 \2/g" | \ + xargs printf "\t[%s]\t= \"%s\",\n" +printf "};\n" -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 18/19] perf srcline: Fix memory leak in addr2inlines() 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (16 preceding siblings ...) 2017-11-03 13:55 ` [PATCH 17/19] perf trace beauty kcmp: Beautify arguments Arnaldo Carvalho de Melo @ 2017-11-03 13:55 ` Arnaldo Carvalho de Melo 2017-11-03 13:55 ` [PATCH 19/19] perf srcline: Show correct function name for srcline of callchains Arnaldo Carvalho de Melo 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:55 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Namhyung Kim, Jin Yao, Milian Wolff, Peter Zijlstra, kernel-team, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung@kernel.org> When libbfd is not used, addr2inlines() executes `addr2line -i` and process output line by line. But it resets filename to NULL in the loop so getline() allocates additional memory everytime instead of realloc. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Milian Wolff <milian.wolff@kdab.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: kernel-team@lge.com Link: http://lkml.kernel.org/r/20171031020654.31163-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/srcline.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c index c143c3bc1ef8..51dc49c65476 100644 --- a/tools/perf/util/srcline.c +++ b/tools/perf/util/srcline.c @@ -456,20 +456,17 @@ static struct inline_node *addr2inlines(const char *dso_name, u64 addr, while (getline(&filename, &len, fp) != -1) { char *srcline; - if (filename_split(filename, &line_nr) != 1) { - free(filename); + if (filename_split(filename, &line_nr) != 1) goto out; - } srcline = srcline_from_fileline(filename, line_nr); if (inline_list__append(sym, srcline, node) != 0) goto out; - - filename = NULL; } out: pclose(fp); + free(filename); return node; } -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 19/19] perf srcline: Show correct function name for srcline of callchains 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo ` (17 preceding siblings ...) 2017-11-03 13:55 ` [PATCH 18/19] perf srcline: Fix memory leak in addr2inlines() Arnaldo Carvalho de Melo @ 2017-11-03 13:55 ` Arnaldo Carvalho de Melo 18 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-11-03 13:55 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Namhyung Kim, Jin Yao, Peter Zijlstra, kernel-team, Arnaldo Carvalho de Melo From: Namhyung Kim <namhyung@kernel.org> When libbfd is not used, it doesn't show proper function name and reuse the original symbol of the sample. That's because it passes the original sym to inline_list__append(). As `addr2line -f` returns function names as well, use that to create an inline_sym and pass it to inline_list__append(). For example, following data shows that inlined entries of main have same name (main). Before: $ perf report -g srcline -q | head 45.22% inlining libm-2.26.so [.] __hypot_finite | ---__hypot_finite ??:0 | |--44.15%--hypot ??:0 | main complex:589 | main complex:597 | main complex:654 | main complex:664 | main inlining.cpp:14 After: $ perf report -g srcline -q | head 45.22% inlining libm-2.26.so [.] __hypot_finite | ---__hypot_finite | |--44.15%--hypot | std::__complex_abs complex:589 (inlined) | std::abs<double> complex:597 (inlined) | std::_Norm_helper<true>::_S_do_it<double> complex:654 (inlined) | std::norm<double> complex:664 (inlined) | main inlining.cpp:14 Signed-off-by: Namhyung Kim <namhyung@kernel.org> Reviewed-by: Jiri Olsa <jolsa@kernel.org> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: kernel-team@lge.com Link: http://lkml.kernel.org/r/20171031020654.31163-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/srcline.c | 95 +++++++++++++++++++++++++++-------------------- 1 file changed, 55 insertions(+), 40 deletions(-) diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c index 51dc49c65476..ad1b46f1f2cf 100644 --- a/tools/perf/util/srcline.c +++ b/tools/perf/util/srcline.c @@ -10,7 +10,7 @@ #include "util/debug.h" #include "util/callchain.h" #include "srcline.h" - +#include "string2.h" #include "symbol.h" bool srcline_full_filename; @@ -77,6 +77,41 @@ static char *srcline_from_fileline(const char *file, unsigned int line) return srcline; } +static struct symbol *new_inline_sym(struct dso *dso, + struct symbol *base_sym, + const char *funcname) +{ + struct symbol *inline_sym; + char *demangled = NULL; + + if (dso) { + demangled = dso__demangle_sym(dso, 0, funcname); + if (demangled) + funcname = demangled; + } + + if (base_sym && strcmp(funcname, base_sym->name) == 0) { + /* reuse the real, existing symbol */ + inline_sym = base_sym; + /* ensure that we don't alias an inlined symbol, which could + * lead to double frees in inline_node__delete + */ + assert(!base_sym->inlined); + } else { + /* create a fake symbol for the inline frame */ + inline_sym = symbol__new(base_sym ? base_sym->start : 0, + base_sym ? base_sym->end : 0, + base_sym ? base_sym->binding : 0, + funcname); + if (inline_sym) + inline_sym->inlined = 1; + } + + free(demangled); + + return inline_sym; +} + #ifdef HAVE_LIBBFD_SUPPORT /* @@ -219,41 +254,6 @@ static void addr2line_cleanup(struct a2l_data *a2l) #define MAX_INLINE_NEST 1024 -static struct symbol *new_inline_sym(struct dso *dso, - struct symbol *base_sym, - const char *funcname) -{ - struct symbol *inline_sym; - char *demangled = NULL; - - if (dso) { - demangled = dso__demangle_sym(dso, 0, funcname); - if (demangled) - funcname = demangled; - } - - if (base_sym && strcmp(funcname, base_sym->name) == 0) { - /* reuse the real, existing symbol */ - inline_sym = base_sym; - /* ensure that we don't alias an inlined symbol, which could - * lead to double frees in inline_node__delete - */ - assert(!base_sym->inlined); - } else { - /* create a fake symbol for the inline frame */ - inline_sym = symbol__new(base_sym ? base_sym->start : 0, - base_sym ? base_sym->end : 0, - base_sym ? base_sym->binding : 0, - funcname); - if (inline_sym) - inline_sym->inlined = 1; - } - - free(demangled); - - return inline_sym; -} - static int inline_list__append_dso_a2l(struct dso *dso, struct inline_node *node, struct symbol *sym) @@ -432,10 +432,11 @@ static struct inline_node *addr2inlines(const char *dso_name, u64 addr, char cmd[PATH_MAX]; struct inline_node *node; char *filename = NULL; - size_t len; + char *funcname = NULL; + size_t filelen, funclen; unsigned int line_nr = 0; - scnprintf(cmd, sizeof(cmd), "addr2line -e %s -i %016"PRIx64, + scnprintf(cmd, sizeof(cmd), "addr2line -e %s -i -f %016"PRIx64, dso_name, addr); fp = popen(cmd, "r"); @@ -453,20 +454,34 @@ static struct inline_node *addr2inlines(const char *dso_name, u64 addr, INIT_LIST_HEAD(&node->val); node->addr = addr; - while (getline(&filename, &len, fp) != -1) { + /* addr2line -f generates two lines for each inlined functions */ + while (getline(&funcname, &funclen, fp) != -1) { char *srcline; + struct symbol *inline_sym; + + rtrim(funcname); + + if (getline(&filename, &filelen, fp) == -1) + goto out; if (filename_split(filename, &line_nr) != 1) goto out; srcline = srcline_from_fileline(filename, line_nr); - if (inline_list__append(sym, srcline, node) != 0) + inline_sym = new_inline_sym(dso, sym, funcname); + + if (inline_list__append(inline_sym, srcline, node) != 0) { + free(srcline); + if (inline_sym && inline_sym->inlined) + symbol__delete(inline_sym); goto out; + } } out: pclose(fp); free(filename); + free(funcname); return node; } -- 2.13.6 ^ permalink raw reply related [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2017-08-14 16:27 Arnaldo Carvalho de Melo 2017-08-14 17:39 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-08-14 16:27 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, linux-perf-users, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Anton Blanchard, David Ahern, Hendrik Brueckner, Jiri Olsa, linuxppc-dev, Matt Fleming, Michael Ellerman, Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao, Paul Clarke, Peter Zijlstra, Sukadev Bhattiprolu, Thomas-Mich Richter, Wang Nan, Yao Jin, Zvonko Kosic, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 82119cbe8e1e32cc2a941393e59816e731681310: Merge tag 'perf-core-for-mingo-4.14-20170801' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-08-10 17:07:02 +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-4.14-20170814 for you to fetch changes up to 8fc375d7d36c72b4c2d55f5c24be022a939295d4: perf test shell: Add uprobes + backtrace ping test (2017-08-11 16:18:49 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: Infrastructure: - Do not consider empty files as valid srclines (Milian Wolff) - Fix wrong size in perf_record_mmap for last kernel module, which resulted in erroneous symbol resolution in at least s390x (Thomas Richter) - Add missing newline to expr parser error messages (Andi Kleen) - Fix saved values rbtree lookup in 'perf stat' (Andi Kleen) - Add support for shell based tests in 'perf test', add a few that run 'perf probe', 'perf trace', using kprobes, uprobes to check the output of those tools and the effects on the system, checking, for instance, DWARF backtraces from uprobes (Arnaldo Carvalho de Melo) Arch specific: - Add ppc64le to audit uname list in the python scripting support (Naveen N. Rao) - Update POWER9 vendor events tables (Sukadev Bhattiprolu) - Fix module symbol adjustment for s390x (Thomas Richter) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (2): perf stat: Fix saved values rbtree lookup perf tools: Add missing newline to expr parser error messages Arnaldo Carvalho de Melo (10): perf test: Make 'list' subcommand match main 'perf test' numbering/matching perf test: Add 'struct test *' to the test functions perf test: Add infrastructure to run shell based tests perf test: Make 'list' use same filtering code as main 'perf test' perf test shell: Add 'probe_vfs_getname' shell test perf test shell: Install shell tests perf test shell: Move vfs_getname probe function to lib perf test shell: Add test using probe:vfs_getname and verifying results perf test shell: Add test using vfs_getname + 'perf trace' perf test shell: Add uprobes + backtrace ping test Milian Wolff (2): perf util: Take elf_name as const string in dso__demangle_sym perf srcline: Do not consider empty files as valid srclines Naveen N. Rao (1): perf scripting python: Add ppc64le to audit uname list Sukadev Bhattiprolu (2): perf vendor events powerpc: remove suffix in mapfile perf vendor events powerpc: Update POWER9 events Thomas Richter (2): perf record: Fix wrong size in perf_record_mmap for last kernel module perf report: Fix module symbol adjustment for s390x tools/perf/Makefile.perf | 6 +- tools/perf/arch/s390/util/sym-handling.c | 7 + tools/perf/arch/x86/include/arch-tests.h | 11 +- tools/perf/arch/x86/tests/insn-x86.c | 2 +- tools/perf/arch/x86/tests/intel-cqm.c | 2 +- tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +- tools/perf/arch/x86/tests/rdpmc.c | 2 +- tools/perf/pmu-events/arch/powerpc/mapfile.csv | 20 +- .../perf/pmu-events/arch/powerpc/power9/cache.json | 191 +- .../arch/powerpc/power9/floating-point.json | 42 +- .../pmu-events/arch/powerpc/power9/frontend.json | 517 ++-- .../pmu-events/arch/powerpc/power9/marked.json | 905 +++---- .../pmu-events/arch/powerpc/power9/memory.json | 178 +- .../perf/pmu-events/arch/powerpc/power9/other.json | 2768 ++++++++++++++++---- .../pmu-events/arch/powerpc/power9/pipeline.json | 779 +++--- tools/perf/pmu-events/arch/powerpc/power9/pmc.json | 167 +- .../arch/powerpc/power9/translation.json | 314 +-- .../python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 1 + tools/perf/tests/attr.c | 2 +- tools/perf/tests/backward-ring-buffer.c | 2 +- tools/perf/tests/bitmap.c | 2 +- tools/perf/tests/bp_signal.c | 2 +- tools/perf/tests/bp_signal_overflow.c | 2 +- tools/perf/tests/bpf.c | 4 +- tools/perf/tests/builtin-test.c | 184 +- tools/perf/tests/clang.c | 4 +- tools/perf/tests/code-reading.c | 2 +- tools/perf/tests/cpumap.c | 4 +- tools/perf/tests/dso-data.c | 6 +- tools/perf/tests/dwarf-unwind.c | 2 +- tools/perf/tests/event-times.c | 2 +- tools/perf/tests/event_update.c | 2 +- tools/perf/tests/evsel-roundtrip-name.c | 2 +- tools/perf/tests/evsel-tp-sched.c | 2 +- tools/perf/tests/expr.c | 2 +- tools/perf/tests/fdarray.c | 4 +- tools/perf/tests/hists_cumulate.c | 2 +- tools/perf/tests/hists_filter.c | 2 +- tools/perf/tests/hists_link.c | 2 +- tools/perf/tests/hists_output.c | 2 +- tools/perf/tests/is_printable_array.c | 2 +- tools/perf/tests/keep-tracking.c | 2 +- tools/perf/tests/kmod-path.c | 2 +- tools/perf/tests/llvm.c | 2 +- tools/perf/tests/mmap-basic.c | 2 +- tools/perf/tests/mmap-thread-lookup.c | 2 +- tools/perf/tests/openat-syscall-all-cpus.c | 2 +- tools/perf/tests/openat-syscall-tp-fields.c | 2 +- tools/perf/tests/openat-syscall.c | 2 +- tools/perf/tests/parse-events.c | 2 +- tools/perf/tests/parse-no-sample-id-all.c | 2 +- tools/perf/tests/perf-hooks.c | 2 +- tools/perf/tests/perf-record.c | 2 +- tools/perf/tests/pmu.c | 2 +- tools/perf/tests/python-use.c | 2 +- tools/perf/tests/sample-parsing.c | 2 +- tools/perf/tests/sdt.c | 4 +- tools/perf/tests/shell/lib/probe_vfs_getname.sh | 28 + tools/perf/tests/shell/probe_vfs_getname.sh | 10 + .../tests/shell/record+script_probe_vfs_getname.sh | 37 + .../perf/tests/shell/trace+probe_libc_inet_pton.sh | 40 + tools/perf/tests/shell/trace+probe_vfs_getname.sh | 31 + tools/perf/tests/stat.c | 6 +- tools/perf/tests/sw-clock.c | 2 +- tools/perf/tests/switch-tracking.c | 2 +- tools/perf/tests/task-exit.c | 2 +- tools/perf/tests/tests.h | 113 +- tools/perf/tests/thread-map.c | 6 +- tools/perf/tests/thread-mg-share.c | 2 +- tools/perf/tests/topology.c | 2 +- tools/perf/tests/unit_number__scnprintf.c | 2 +- tools/perf/tests/vmlinux-kallsyms.c | 2 +- tools/perf/util/expr.y | 2 +- tools/perf/util/machine.c | 4 +- tools/perf/util/srcline.c | 6 + tools/perf/util/stat-shadow.c | 6 +- tools/perf/util/symbol-elf.c | 12 +- tools/perf/util/symbol-minimal.c | 2 +- tools/perf/util/symbol.c | 21 +- tools/perf/util/symbol.h | 7 +- 80 files changed, 4054 insertions(+), 2479 deletions(-) create mode 100644 tools/perf/tests/shell/lib/probe_vfs_getname.sh create mode 100755 tools/perf/tests/shell/probe_vfs_getname.sh create mode 100755 tools/perf/tests/shell/record+script_probe_vfs_getname.sh create mode 100755 tools/perf/tests/shell/trace+probe_libc_inet_pton.sh create mode 100755 tools/perf/tests/shell/trace+probe_vfs_getname.sh Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support, objtool where it is supported and samples/bpf/, ditto. Where clang is available, it is also used to build perf with/without libelf. Several are cross builds, the ones with -x-ARCH, and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. The 'perf test' also runs shell scripts exercising the tools, checking if they affect the system in certain ways, like setting up kprobes and uprobes, request callchains for well known programs and check that they are the expected ones, see if 'perf trace' beautifies system call arguments correctly, etc. Additionally, a new set of tests, script based, runs the tools in a live system, setting probes in place that then gets used by 'perf trace', with its output compared against expected results. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # dm 1 alpine:3.4: Ok 2 alpine:3.5: Ok 3 alpine:3.6: Ok 4 alpine:edge: Ok 5 android-ndk:r12b-arm: Ok 6 archlinux:latest: Ok 7 centos:5: Ok 8 centos:6: Ok 9 centos:7: Ok 10 debian:7: Ok 11 debian:8: Ok 12 debian:9: Ok 13 debian:experimental: Ok 14 debian:experimental-x-arm64: Ok 15 debian:experimental-x-mips: Ok 16 debian:experimental-x-mips64: Ok 17 debian:experimental-x-mipsel: Ok 18 fedora:20: Ok 19 fedora:21: Ok 20 fedora:22: Ok 21 fedora:23: Ok 22 fedora:24: Ok 23 fedora:24-x-ARC-uClibc: Ok 24 fedora:25: Ok 25 fedora:26: Ok 26 fedora:rawhide: Ok 27 mageia:5: Ok 28 opensuse:13.2: Ok 29 opensuse:42.1: Ok 30 opensuse:42.2: Ok 31 opensuse:tumbleweed: Ok 32 oraclelinux:6: Ok 33 oraclelinux:7: Ok 34 ubuntu:12.04.5: Ok 35 ubuntu:14.04.4: Ok 36 ubuntu:14.04.4-x-linaro-arm64: Ok 37 ubuntu:15.10: Ok 38 ubuntu:16.04: Ok 39 ubuntu:16.04-x-arm: Ok 40 ubuntu:16.04-x-arm64: Ok 41 ubuntu:16.04-x-powerpc: Ok 42 ubuntu:16.04-x-powerpc64: Ok 43 ubuntu:16.04-x-powerpc64el: Ok 44 ubuntu:16.04-x-s390: Ok 45 ubuntu:16.10: Ok 46 ubuntu:17.04: Ok 47 ubuntu:17.10: Ok # # uname -a Linux jouet 4.13.0-rc4+ #2 SMP Fri Aug 11 12:39:09 -03 2017 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Parse event definition strings : Ok 6: Simple expression parser : Ok 7: PERF_RECORD_* events & perf_sample fields : Ok 8: Parse perf pmu format : Ok 9: DSO data read : Ok 10: DSO data cache : Ok 11: DSO data reopen : Ok 12: Roundtrip evsel->name : Ok 13: Parse sched tracepoints fields : Ok 14: syscalls:sys_enter_openat event fields : Ok 15: Setup struct perf_event_attr : Ok 16: Match and link multiple hists : Ok 17: 'import perf' in python : Ok 18: Breakpoint overflow signal handler : Ok 19: Breakpoint overflow sampling : Ok 20: Number of exit events of a simple workload : Ok 21: Software clock events period values : Ok 22: Object code reading : Ok 23: Sample parsing : Ok 24: Use a dummy software event to keep tracking : Ok 25: Parse with no sample_id_all bit set : Ok 26: Filter hist entries : Ok 27: Lookup mmap thread : Ok 28: Share thread mg : Ok 29: Sort output of hist entries : Ok 30: Cumulate child hist entries : Ok 31: Track with sched_switch : Ok 32: Filter fds with revents mask in a fdarray : Ok 33: Add fd to a fdarray, making it autogrow : Ok 34: kmod_path__parse : Ok 35: Thread map : Ok 36: LLVM search and compile : 36.1: Basic BPF llvm compile : Ok 36.2: kbuild searching : Ok 36.3: Compile source for BPF prologue generation : Ok 36.4: Compile source for BPF relocation : Ok 37: Session topology : Ok 38: BPF filter : 38.1: Basic BPF filtering : Ok 38.2: BPF pinning : Ok 38.3: BPF prologue generation : Ok 38.4: BPF relocation checker : Ok 39: Synthesize thread map : Ok 40: Remove thread map : Ok 41: Synthesize cpu map : Ok 42: Synthesize stat config : Ok 43: Synthesize stat : Ok 44: Synthesize stat round : Ok 45: Synthesize attr update : Ok 46: Event times : Ok 47: Read backward ring buffer : Ok 48: Print cpu map : Ok 49: Probe SDT events : Ok 50: is_printable_array : Ok 51: Print bitmap : Ok 52: perf hooks : Ok 53: builtin clang support : Skip (not compiled in) 54: unit_number__scnprintf : Ok 55: x86 rdpmc : Ok 56: Convert perf time to TSC : Ok 57: DWARF unwind : Ok 58: x86 instruction decoder - new instructions : Ok 59: Intel cqm nmi context read : Skip 60: Use vfs_getname probe to get syscall args filenames : Ok 61: probe libc's inet_pton & backtrace it with ping : Ok 62: Check open filename arg using perf trace + vfs_getname: Ok 63: Add vfs_getname probe to get syscall args filenames : Ok # # The static build test works on Fedora 25, is failing on Fedora 26, # this issue is being investigated. $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_slang_O: make NO_SLANG=1 make_install_prefix_O: make install prefix=/tmp/krava make_install_bin_O: make install-bin make_debug_O: make DEBUG=1 make_clean_all_O: make clean all make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_auxtrace_O: make NO_AUXTRACE=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_help_O: make help make_no_demangle_O: make NO_DEMANGLE=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_no_libunwind_O: make NO_LIBUNWIND=1 make_install_O: make install make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_no_newt_O: make NO_NEWT=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_perf_o_O: make perf.o make_no_gtk2_O: make NO_GTK2=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_libbpf_O: make NO_LIBBPF=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_tags_O: make tags make_util_map_o_O: make util/map.o make_pure_O: make make_no_libperl_O: make NO_LIBPERL=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_libelf_O: make NO_LIBELF=1 make_doc_O: make doc OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2017-08-14 16:27 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo @ 2017-08-14 17:39 ` Ingo Molnar 2017-08-14 17:52 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 53+ messages in thread From: Ingo Molnar @ 2017-08-14 17:39 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Anton Blanchard, David Ahern, Hendrik Brueckner, Jiri Olsa, linuxppc-dev, Matt Fleming, Michael Ellerman, Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao, Paul Clarke, Peter Zijlstra, Sukadev Bhattiprolu, Thomas-Mich Richter, Wang Nan, Yao Jin, Zvonko Kosic, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end of this message, as usual. > > > The following changes since commit 82119cbe8e1e32cc2a941393e59816e731681310: > > Merge tag 'perf-core-for-mingo-4.14-20170801' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-08-10 17:07:02 +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-4.14-20170814 > > for you to fetch changes up to 8fc375d7d36c72b4c2d55f5c24be022a939295d4: > > perf test shell: Add uprobes + backtrace ping test (2017-08-11 16:18:49 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > Infrastructure: > > - Do not consider empty files as valid srclines (Milian Wolff) > > - Fix wrong size in perf_record_mmap for last kernel module, > which resulted in erroneous symbol resolution in at least s390x (Thomas Richter) > > - Add missing newline to expr parser error messages (Andi Kleen) > > - Fix saved values rbtree lookup in 'perf stat' (Andi Kleen) > > - Add support for shell based tests in 'perf test', add a few that > run 'perf probe', 'perf trace', using kprobes, uprobes to check > the output of those tools and the effects on the system, checking, > for instance, DWARF backtraces from uprobes (Arnaldo Carvalho de Melo) > > Arch specific: > > - Add ppc64le to audit uname list in the python scripting support (Naveen N. Rao) > > - Update POWER9 vendor events tables (Sukadev Bhattiprolu) > > - Fix module symbol adjustment for s390x (Thomas Richter) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (2): > perf stat: Fix saved values rbtree lookup > perf tools: Add missing newline to expr parser error messages > > Arnaldo Carvalho de Melo (10): > perf test: Make 'list' subcommand match main 'perf test' numbering/matching > perf test: Add 'struct test *' to the test functions > perf test: Add infrastructure to run shell based tests > perf test: Make 'list' use same filtering code as main 'perf test' > perf test shell: Add 'probe_vfs_getname' shell test > perf test shell: Install shell tests > perf test shell: Move vfs_getname probe function to lib > perf test shell: Add test using probe:vfs_getname and verifying results > perf test shell: Add test using vfs_getname + 'perf trace' > perf test shell: Add uprobes + backtrace ping test > > Milian Wolff (2): > perf util: Take elf_name as const string in dso__demangle_sym > perf srcline: Do not consider empty files as valid srclines > > Naveen N. Rao (1): > perf scripting python: Add ppc64le to audit uname list > > Sukadev Bhattiprolu (2): > perf vendor events powerpc: remove suffix in mapfile > perf vendor events powerpc: Update POWER9 events > > Thomas Richter (2): > perf record: Fix wrong size in perf_record_mmap for last kernel module > perf report: Fix module symbol adjustment for s390x > > tools/perf/Makefile.perf | 6 +- > tools/perf/arch/s390/util/sym-handling.c | 7 + > tools/perf/arch/x86/include/arch-tests.h | 11 +- > tools/perf/arch/x86/tests/insn-x86.c | 2 +- > tools/perf/arch/x86/tests/intel-cqm.c | 2 +- > tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +- > tools/perf/arch/x86/tests/rdpmc.c | 2 +- > tools/perf/pmu-events/arch/powerpc/mapfile.csv | 20 +- > .../perf/pmu-events/arch/powerpc/power9/cache.json | 191 +- > .../arch/powerpc/power9/floating-point.json | 42 +- > .../pmu-events/arch/powerpc/power9/frontend.json | 517 ++-- > .../pmu-events/arch/powerpc/power9/marked.json | 905 +++---- > .../pmu-events/arch/powerpc/power9/memory.json | 178 +- > .../perf/pmu-events/arch/powerpc/power9/other.json | 2768 ++++++++++++++++---- > .../pmu-events/arch/powerpc/power9/pipeline.json | 779 +++--- > tools/perf/pmu-events/arch/powerpc/power9/pmc.json | 167 +- > .../arch/powerpc/power9/translation.json | 314 +-- > .../python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 1 + > tools/perf/tests/attr.c | 2 +- > tools/perf/tests/backward-ring-buffer.c | 2 +- > tools/perf/tests/bitmap.c | 2 +- > tools/perf/tests/bp_signal.c | 2 +- > tools/perf/tests/bp_signal_overflow.c | 2 +- > tools/perf/tests/bpf.c | 4 +- > tools/perf/tests/builtin-test.c | 184 +- > tools/perf/tests/clang.c | 4 +- > tools/perf/tests/code-reading.c | 2 +- > tools/perf/tests/cpumap.c | 4 +- > tools/perf/tests/dso-data.c | 6 +- > tools/perf/tests/dwarf-unwind.c | 2 +- > tools/perf/tests/event-times.c | 2 +- > tools/perf/tests/event_update.c | 2 +- > tools/perf/tests/evsel-roundtrip-name.c | 2 +- > tools/perf/tests/evsel-tp-sched.c | 2 +- > tools/perf/tests/expr.c | 2 +- > tools/perf/tests/fdarray.c | 4 +- > tools/perf/tests/hists_cumulate.c | 2 +- > tools/perf/tests/hists_filter.c | 2 +- > tools/perf/tests/hists_link.c | 2 +- > tools/perf/tests/hists_output.c | 2 +- > tools/perf/tests/is_printable_array.c | 2 +- > tools/perf/tests/keep-tracking.c | 2 +- > tools/perf/tests/kmod-path.c | 2 +- > tools/perf/tests/llvm.c | 2 +- > tools/perf/tests/mmap-basic.c | 2 +- > tools/perf/tests/mmap-thread-lookup.c | 2 +- > tools/perf/tests/openat-syscall-all-cpus.c | 2 +- > tools/perf/tests/openat-syscall-tp-fields.c | 2 +- > tools/perf/tests/openat-syscall.c | 2 +- > tools/perf/tests/parse-events.c | 2 +- > tools/perf/tests/parse-no-sample-id-all.c | 2 +- > tools/perf/tests/perf-hooks.c | 2 +- > tools/perf/tests/perf-record.c | 2 +- > tools/perf/tests/pmu.c | 2 +- > tools/perf/tests/python-use.c | 2 +- > tools/perf/tests/sample-parsing.c | 2 +- > tools/perf/tests/sdt.c | 4 +- > tools/perf/tests/shell/lib/probe_vfs_getname.sh | 28 + > tools/perf/tests/shell/probe_vfs_getname.sh | 10 + > .../tests/shell/record+script_probe_vfs_getname.sh | 37 + > .../perf/tests/shell/trace+probe_libc_inet_pton.sh | 40 + > tools/perf/tests/shell/trace+probe_vfs_getname.sh | 31 + > tools/perf/tests/stat.c | 6 +- > tools/perf/tests/sw-clock.c | 2 +- > tools/perf/tests/switch-tracking.c | 2 +- > tools/perf/tests/task-exit.c | 2 +- > tools/perf/tests/tests.h | 113 +- > tools/perf/tests/thread-map.c | 6 +- > tools/perf/tests/thread-mg-share.c | 2 +- > tools/perf/tests/topology.c | 2 +- > tools/perf/tests/unit_number__scnprintf.c | 2 +- > tools/perf/tests/vmlinux-kallsyms.c | 2 +- > tools/perf/util/expr.y | 2 +- > tools/perf/util/machine.c | 4 +- > tools/perf/util/srcline.c | 6 + > tools/perf/util/stat-shadow.c | 6 +- > tools/perf/util/symbol-elf.c | 12 +- > tools/perf/util/symbol-minimal.c | 2 +- > tools/perf/util/symbol.c | 21 +- > tools/perf/util/symbol.h | 7 +- > 80 files changed, 4054 insertions(+), 2479 deletions(-) > create mode 100644 tools/perf/tests/shell/lib/probe_vfs_getname.sh > create mode 100755 tools/perf/tests/shell/probe_vfs_getname.sh > create mode 100755 tools/perf/tests/shell/record+script_probe_vfs_getname.sh > create mode 100755 tools/perf/tests/shell/trace+probe_libc_inet_pton.sh > create mode 100755 tools/perf/tests/shell/trace+probe_vfs_getname.sh Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2017-08-14 17:39 ` Ingo Molnar @ 2017-08-14 17:52 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-08-14 17:52 UTC (permalink / raw) To: Ingo Molnar Cc: Kim Phillips, linux-kernel, linux-perf-users, Adrian Hunter, Andi Kleen, Anton Blanchard, David Ahern, Hendrik Brueckner, Jiri Olsa, linuxppc-dev, Matt Fleming, Michael Ellerman, Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao, Paul Clarke, Peter Zijlstra, Sukadev Bhattiprolu, Thomas-Mich Richter, Wang Nan, Yao Jin, Zvonko Kosic, acme Em Mon, Aug 14, 2017 at 07:39:48PM +0200, Ingo Molnar escreveu: > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > Infrastructure: > > - Add support for shell based tests in 'perf test', add a few that > > run 'perf probe', 'perf trace', using kprobes, uprobes to check > > the output of those tools and the effects on the system, checking, > > for instance, DWARF backtraces from uprobes (Arnaldo Carvalho de Melo) <SNIP> > > create mode 100644 tools/perf/tests/shell/lib/probe_vfs_getname.sh > > create mode 100755 tools/perf/tests/shell/probe_vfs_getname.sh > > create mode 100755 tools/perf/tests/shell/record+script_probe_vfs_getname.sh > > create mode 100755 tools/perf/tests/shell/trace+probe_libc_inet_pton.sh > > create mode 100755 tools/perf/tests/shell/trace+probe_vfs_getname.sh > > Pulled, thanks a lot Arnaldo! Thanks! I'm working with Kim Phillips to fix some issues he noticed while testing on his ARM systems where 'perf probe' is not available, my perf/core branch has several fixes to handle this that will be in my next pull request. - Arnaldo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2017-03-14 18:50 Arnaldo Carvalho de Melo 2017-03-15 18:29 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2017-03-14 18:50 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Shishkin, Alexei Starovoitov, Ananth N Mavinakayanahalli, Andi Kleen, Aravinda Prasad, Brendan Gregg, Changbin Du, Daniel Borkmann, Eric Biederman, Feng Tang, Hari Bathini, Jiri Olsa, kernel-team, linuxppc-dev, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Sargun Dhillon, Steven Rostedt, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 84e5b549214f2160c12318aac549de85f600c79a: Merge tag 'perf-core-for-mingo-4.11-20170306' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-07 08:14:14 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170314 for you to fetch changes up to 5f6bee34707973ea7879a7857fd63ddccc92fff3: kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL (2017-03-14 15:17:40 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: New features: - Add PERF_RECORD_NAMESPACES so that the kernel can record information required to associate samples to namespaces, helping in container problem characterization. Now the 'perf record has a --namespace' option to ask for such info, and when present, it can be used, initially, via a new sort order, 'cgroup_id', allowing histogram entry bucketization by a (device, inode) based cgroup identifier (Hari Bathini) - Add --next option to 'perf sched timehist', showing what is the next thread to run (Brendan Gregg) Fixes: - Fix segfault with basic block 'cycles' sort dimension (Changbin Du) - Add c2c to command-list.txt, making it appear in the 'perf help' output (Changbin Du) - Fix zeroing of 'abs_path' variable in the perf hists browser switch file code (Changbin Du) - Hide tips messages when -q/--quiet is given to 'perf report' (Namhyung Kim) Infrastructure: - Use ref_reloc_sym + offset to setup kretprobes (Naveen Rao) - Ignore generated files pmu-events/{jevents,pmu-events.c} for git (Changbin Du) Documentation: - Document +field style argument support for --field option (Changbin Du) - Clarify 'perf c2c --stats' help message (Namhyung Kim) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Brendan Gregg (1): perf sched timehist: Add --next option Changbin Du (5): perf tools: Missing c2c command in command-list perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git perf sort: Fix segfault with basic block 'cycles' sort dimension perf report: Document +field style argument support for --field option perf hists browser: Fix typo in function switch_data_file Hari Bathini (5): perf: Add PERF_RECORD_NAMESPACES to include namespaces related info perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info perf record: Synthesize namespace events for current processes perf script: Add script print support for namespace events perf tools: Add 'cgroup_id' sort order keyword Namhyung Kim (3): perf report: Hide tip message when -q option is given perf c2c: Clarify help message of --stats option perf c2c: Fix display bug when using pipe Naveen N. Rao (5): perf probe: Factor out the ftrace README scanning perf kretprobes: Offset from reloc_sym if kernel supports it perf powerpc: Choose local entry point with kretprobes doc: trace/kprobes: add information about NOKPROBE_SYMBOL kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL Documentation/trace/kprobetrace.txt | 5 +- include/linux/perf_event.h | 2 + include/uapi/linux/perf_event.h | 32 +++++- kernel/events/core.c | 139 ++++++++++++++++++++++++++ kernel/fork.c | 2 + kernel/kprobes.c | 5 +- kernel/nsproxy.c | 3 + tools/include/uapi/linux/perf_event.h | 32 +++++- tools/perf/.gitignore | 2 + tools/perf/Documentation/perf-record.txt | 3 + tools/perf/Documentation/perf-report.txt | 7 +- tools/perf/Documentation/perf-sched.txt | 4 + tools/perf/Documentation/perf-script.txt | 3 + tools/perf/arch/powerpc/util/sym-handling.c | 14 ++- tools/perf/builtin-annotate.c | 1 + tools/perf/builtin-c2c.c | 4 +- tools/perf/builtin-diff.c | 1 + tools/perf/builtin-inject.c | 13 +++ tools/perf/builtin-kmem.c | 1 + tools/perf/builtin-kvm.c | 2 + tools/perf/builtin-lock.c | 1 + tools/perf/builtin-mem.c | 1 + tools/perf/builtin-record.c | 35 ++++++- tools/perf/builtin-report.c | 4 +- tools/perf/builtin-sched.c | 26 ++++- tools/perf/builtin-script.c | 41 ++++++++ tools/perf/builtin-trace.c | 3 +- tools/perf/command-list.txt | 1 + tools/perf/perf.h | 1 + tools/perf/ui/browsers/hists.c | 2 +- tools/perf/util/Build | 1 + tools/perf/util/data-convert-bt.c | 1 + tools/perf/util/event.c | 150 ++++++++++++++++++++++++++-- tools/perf/util/event.h | 19 ++++ tools/perf/util/evsel.c | 3 + tools/perf/util/hist.c | 7 ++ tools/perf/util/hist.h | 1 + tools/perf/util/machine.c | 34 +++++++ tools/perf/util/machine.h | 3 + tools/perf/util/namespaces.c | 36 +++++++ tools/perf/util/namespaces.h | 26 +++++ tools/perf/util/probe-event.c | 12 +-- tools/perf/util/probe-file.c | 77 ++++++++------ tools/perf/util/probe-file.h | 1 + tools/perf/util/session.c | 7 ++ tools/perf/util/sort.c | 46 +++++++++ tools/perf/util/sort.h | 7 ++ tools/perf/util/thread.c | 44 +++++++- tools/perf/util/thread.h | 6 ++ tools/perf/util/tool.h | 2 + 50 files changed, 799 insertions(+), 74 deletions(-) create mode 100644 tools/perf/util/namespaces.c create mode 100644 tools/perf/util/namespaces.h Test results: The first ones are container (docker) based builds of tools/perf with and without libelf support, objtool where it is supported and samples/bpf/, ditto. Where clang is available, it is also used to build perf with/without libelf. Several are cross builds, the ones with -x-ARCH, and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}. The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests. Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place. # dm 1 alpine:3.4: Ok 2 alpine:3.5: Ok 3 alpine:edge: Ok 4 android-ndk:r12b-arm: Ok 5 archlinux:latest: Ok 6 centos:5: Ok 7 centos:6: Ok 8 centos:7: Ok 9 debian:7: Ok 10 debian:8: Ok 11 debian:experimental: Ok 12 debian:experimental-x-arm64: Ok 13 debian:experimental-x-mips: Ok 14 debian:experimental-x-mips64: Ok 15 debian:experimental-x-mipsel: Ok 16 fedora:20: Ok 17 fedora:21: Ok 18 fedora:22: Ok 19 fedora:23: Ok 20 fedora:24: Ok 21 fedora:24-x-ARC-uClibc: Ok 22 fedora:25: Ok 23 fedora:rawhide: Ok 24 mageia:5: Ok 25 opensuse:13.2: Ok 26 opensuse:42.1: Ok 27 opensuse:tumbleweed: Ok 28 ubuntu:12.04.5: Ok 29 ubuntu:14.04.4: Ok 30 ubuntu:14.04.4-x-linaro-arm64: Ok 31 ubuntu:15.10: Ok 32 ubuntu:16.04: Ok 33 ubuntu:16.04-x-arm: Ok 34 ubuntu:16.04-x-arm64: Ok 35 ubuntu:16.04-x-powerpc: Ok 36 ubuntu:16.04-x-powerpc64: Ok 37 ubuntu:16.04-x-s390: Ok 38 ubuntu:16.10: Ok 39 ubuntu:17.04: Ok # # uname -a Linux zoo 4.9.13-100.fc24.x86_64 #1 SMP Mon Feb 27 16:57:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Parse event definition strings : Ok 6: PERF_RECORD_* events & perf_sample fields : Ok 7: Parse perf pmu format : Ok 8: DSO data read : Ok 9: DSO data cache : Ok 10: DSO data reopen : Ok 11: Roundtrip evsel->name : Ok 12: Parse sched tracepoints fields : Ok 13: syscalls:sys_enter_openat event fields : Ok 14: Setup struct perf_event_attr : Ok 15: Match and link multiple hists : Ok 16: 'import perf' in python : Ok 17: Breakpoint overflow signal handler : Ok 18: Breakpoint overflow sampling : Ok 19: Number of exit events of a simple workload : Ok 20: Software clock events period values : Ok 21: Object code reading : Ok 22: Sample parsing : Ok 23: Use a dummy software event to keep tracking: Ok 24: Parse with no sample_id_all bit set : Ok 25: Filter hist entries : Ok 26: Lookup mmap thread : Ok 27: Share thread mg : Ok 28: Sort output of hist entries : Ok 29: Cumulate child hist entries : Ok 30: Track with sched_switch : Ok 31: Filter fds with revents mask in a fdarray : Ok 32: Add fd to a fdarray, making it autogrow : Ok 33: kmod_path__parse : Ok 34: Thread map : Ok 35: LLVM search and compile : 35.1: Basic BPF llvm compile : Ok 35.2: kbuild searching : Ok 35.3: Compile source for BPF prologue generation: Ok 35.4: Compile source for BPF relocation : Ok 36: Session topology : Ok 37: BPF filter : 37.1: Basic BPF filtering : Ok 37.2: BPF pinning : Ok 37.3: BPF prologue generation : Ok 37.4: BPF relocation checker : Ok 38: Synthesize thread map : Ok 39: Remove thread map : Ok 40: Synthesize cpu map : Ok 41: Synthesize stat config : Ok 42: Synthesize stat : Ok 43: Synthesize stat round : Ok 44: Synthesize attr update : Ok 45: Event times : Ok 46: Read backward ring buffer : Ok 47: Print cpu map : Ok 48: Probe SDT events : Ok 49: is_printable_array : Ok 50: Print bitmap : Ok 51: perf hooks : Ok 52: builtin clang support : Skip (not compiled in) 53: unit_number__scnprintf : Ok 54: x86 rdpmc : Ok 55: Convert perf time to TSC : Ok 56: DWARF unwind : Ok 57: x86 instruction decoder - new instructions : Ok 58: Intel cqm nmi context read : Skip # $ make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_debug_O: make DEBUG=1 make_no_libelf_O: make NO_LIBELF=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_pure_O: make make_no_libbpf_O: make NO_LIBBPF=1 make_tags_O: make tags make_with_babeltrace_O: make LIBBABELTRACE=1 make_with_clangllvm_O: make LIBCLANGLLVM=1 make_no_auxtrace_O: make NO_AUXTRACE=1 make_perf_o_O: make perf.o make_no_demangle_O: make NO_DEMANGLE=1 make_clean_all_O: make clean all make_no_slang_O: make NO_SLANG=1 make_doc_O: make doc make_no_newt_O: make NO_NEWT=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_install_bin_O: make install-bin make_no_gtk2_O: make NO_GTK2=1 make_no_backtrace_O: make NO_BACKTRACE=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_util_map_o_O: make util/map.o make_no_libperl_O: make NO_LIBPERL=1 make_static_O: make LDFLAGS=-static make_no_libunwind_O: make NO_LIBUNWIND=1 make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 make_help_O: make help make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 OK $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2017-03-14 18:50 Arnaldo Carvalho de Melo @ 2017-03-15 18:29 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2017-03-15 18:29 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Alexander Shishkin, Alexei Starovoitov, Ananth N Mavinakayanahalli, Andi Kleen, Aravinda Prasad, Brendan Gregg, Changbin Du, Daniel Borkmann, Eric Biederman, Feng Tang, Hari Bathini, Jiri Olsa, kernel-team, linuxppc-dev, Masami Hiramatsu, Michael Ellerman, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Sargun Dhillon, Steven Rostedt, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 84e5b549214f2160c12318aac549de85f600c79a: > > Merge tag 'perf-core-for-mingo-4.11-20170306' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-03-07 08:14:14 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.12-20170314 > > for you to fetch changes up to 5f6bee34707973ea7879a7857fd63ddccc92fff3: > > kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL (2017-03-14 15:17:40 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > New features: > > - Add PERF_RECORD_NAMESPACES so that the kernel can record information > required to associate samples to namespaces, helping in container > problem characterization. > > Now the 'perf record has a --namespace' option to ask for such info, > and when present, it can be used, initially, via a new sort order, > 'cgroup_id', allowing histogram entry bucketization by a (device, inode) > based cgroup identifier (Hari Bathini) > > - Add --next option to 'perf sched timehist', showing what is the next > thread to run (Brendan Gregg) > > Fixes: > > - Fix segfault with basic block 'cycles' sort dimension (Changbin Du) > > - Add c2c to command-list.txt, making it appear in the 'perf help' > output (Changbin Du) > > - Fix zeroing of 'abs_path' variable in the perf hists browser switch > file code (Changbin Du) > > - Hide tips messages when -q/--quiet is given to 'perf report' (Namhyung Kim) > > Infrastructure: > > - Use ref_reloc_sym + offset to setup kretprobes (Naveen Rao) > > - Ignore generated files pmu-events/{jevents,pmu-events.c} for git (Changbin Du) > > Documentation: > > - Document +field style argument support for --field option (Changbin Du) > > - Clarify 'perf c2c --stats' help message (Namhyung Kim) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Brendan Gregg (1): > perf sched timehist: Add --next option > > Changbin Du (5): > perf tools: Missing c2c command in command-list > perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git > perf sort: Fix segfault with basic block 'cycles' sort dimension > perf report: Document +field style argument support for --field option > perf hists browser: Fix typo in function switch_data_file > > Hari Bathini (5): > perf: Add PERF_RECORD_NAMESPACES to include namespaces related info > perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info > perf record: Synthesize namespace events for current processes > perf script: Add script print support for namespace events > perf tools: Add 'cgroup_id' sort order keyword > > Namhyung Kim (3): > perf report: Hide tip message when -q option is given > perf c2c: Clarify help message of --stats option > perf c2c: Fix display bug when using pipe > > Naveen N. Rao (5): > perf probe: Factor out the ftrace README scanning > perf kretprobes: Offset from reloc_sym if kernel supports it > perf powerpc: Choose local entry point with kretprobes > doc: trace/kprobes: add information about NOKPROBE_SYMBOL > kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL > > Documentation/trace/kprobetrace.txt | 5 +- > include/linux/perf_event.h | 2 + > include/uapi/linux/perf_event.h | 32 +++++- > kernel/events/core.c | 139 ++++++++++++++++++++++++++ > kernel/fork.c | 2 + > kernel/kprobes.c | 5 +- > kernel/nsproxy.c | 3 + > tools/include/uapi/linux/perf_event.h | 32 +++++- > tools/perf/.gitignore | 2 + > tools/perf/Documentation/perf-record.txt | 3 + > tools/perf/Documentation/perf-report.txt | 7 +- > tools/perf/Documentation/perf-sched.txt | 4 + > tools/perf/Documentation/perf-script.txt | 3 + > tools/perf/arch/powerpc/util/sym-handling.c | 14 ++- > tools/perf/builtin-annotate.c | 1 + > tools/perf/builtin-c2c.c | 4 +- > tools/perf/builtin-diff.c | 1 + > tools/perf/builtin-inject.c | 13 +++ > tools/perf/builtin-kmem.c | 1 + > tools/perf/builtin-kvm.c | 2 + > tools/perf/builtin-lock.c | 1 + > tools/perf/builtin-mem.c | 1 + > tools/perf/builtin-record.c | 35 ++++++- > tools/perf/builtin-report.c | 4 +- > tools/perf/builtin-sched.c | 26 ++++- > tools/perf/builtin-script.c | 41 ++++++++ > tools/perf/builtin-trace.c | 3 +- > tools/perf/command-list.txt | 1 + > tools/perf/perf.h | 1 + > tools/perf/ui/browsers/hists.c | 2 +- > tools/perf/util/Build | 1 + > tools/perf/util/data-convert-bt.c | 1 + > tools/perf/util/event.c | 150 ++++++++++++++++++++++++++-- > tools/perf/util/event.h | 19 ++++ > tools/perf/util/evsel.c | 3 + > tools/perf/util/hist.c | 7 ++ > tools/perf/util/hist.h | 1 + > tools/perf/util/machine.c | 34 +++++++ > tools/perf/util/machine.h | 3 + > tools/perf/util/namespaces.c | 36 +++++++ > tools/perf/util/namespaces.h | 26 +++++ > tools/perf/util/probe-event.c | 12 +-- > tools/perf/util/probe-file.c | 77 ++++++++------ > tools/perf/util/probe-file.h | 1 + > tools/perf/util/session.c | 7 ++ > tools/perf/util/sort.c | 46 +++++++++ > tools/perf/util/sort.h | 7 ++ > tools/perf/util/thread.c | 44 +++++++- > tools/perf/util/thread.h | 6 ++ > tools/perf/util/tool.h | 2 + > 50 files changed, 799 insertions(+), 74 deletions(-) > create mode 100644 tools/perf/util/namespaces.c > create mode 100644 tools/perf/util/namespaces.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-12-01 18:02 Arnaldo Carvalho de Melo 2016-12-02 9:10 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-12-01 18:02 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Chris Ryder, David Ahern, He Kuang, Jiri Olsa, Joe Stringer, Kim Phillips, Mark Rutland, Namhyung Kim, Pawel Moll, Peter Zijlstra, Wang Nan, Will Deacon, Zefan Li, pi3orama, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo Test results at the end of this message, as usual. The following changes since commit 2471cece40d61b0035360338569d338f9dea6099: Merge tag 'perf-core-for-mingo-20161125' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-11-25 18:12:41 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20161201 for you to fetch changes up to 0fcb1da4aba6e6c7b32de5e0948b740b31ad822d: perf annotate: AArch64 support (2016-12-01 13:03:19 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: New features: - Support AArch64 in the 'annotate' code, native/local and cross-arch/remote (Kim Phillips) - Allow considering just events in a given time interval, via the '--time start.s.ms,end.s.ms' command line, added to 'perf kmem', 'perf report', 'perf sched timehist' and 'perf script' (David Ahern) - Add option to stop printing a callchain at one of a given group of symbol names (David Ahern) - Handle cpu migration events in 'perf sched timehist' (David Ahern) - Track memory freed in 'perf kmem stat' (David Ahern) Infrastructure: - Initial support (and perf test entry) for tooling hooks, starting with 'record_start' and 'record_end', that will have as its initial user the eBPF infrastructure, where perf_ prefixed functions will be JITed and run when such hooks are called (Wang Nan) - Remove redundant "test" and similar strings from 'perf test' descriptions (Arnaldo Carvalho de Melo) - libbpf assorted improvements (Wang Nan) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (3): perf ui helpline: Provide a printf variant perf annotate: Show invalid jump offset in error message perf test: Remove "test" and similar strings from test descriptions David Ahern (10): perf sched timehist: Handle cpu migration events perf trace: Update tid/pid filtering option to leverage symbol_conf perf kmem stat: Track memory freed perf script: Add option to stop printing callchain perf tools: Add time-based utility functions perf tools: Move parse_nsec_time to time-utils.c perf script: Add option to specify time window of interest perf sched timehist: Add option to specify time window of interest perf kmem: Add option to specify time window of interest perf report: Add option to specify time window of interest Kim Phillips (2): perf annotate: Use arch->objdump.comment_char in dec__parse() perf annotate: AArch64 support Wang Nan (4): tools lib bpf: Add missing BPF functions tools lib bpf: Add private field for bpf_object tools lib bpf: Retrive bpf_map through offset of bpf_map_def perf tools: Introduce perf hooks tools/lib/bpf/bpf.c | 56 ++++++++++ tools/lib/bpf/bpf.h | 7 ++ tools/lib/bpf/libbpf.c | 35 ++++++ tools/lib/bpf/libbpf.h | 13 +++ tools/perf/Documentation/perf-kmem.txt | 7 ++ tools/perf/Documentation/perf-report.txt | 7 ++ tools/perf/Documentation/perf-sched.txt | 12 +++ tools/perf/Documentation/perf-script.txt | 10 ++ tools/perf/arch/arm64/annotate/instructions.c | 62 +++++++++++ tools/perf/arch/x86/tests/arch-tests.c | 10 +- tools/perf/builtin-kmem.c | 36 ++++++- tools/perf/builtin-record.c | 11 ++ tools/perf/builtin-report.c | 14 ++- tools/perf/builtin-sched.c | 148 ++++++++++++++++++++++++-- tools/perf/builtin-script.c | 17 ++- tools/perf/builtin-trace.c | 49 ++------- tools/perf/tests/Build | 1 + tools/perf/tests/bpf.c | 6 +- tools/perf/tests/builtin-test.c | 96 +++++++++-------- tools/perf/tests/llvm.c | 8 +- tools/perf/tests/perf-hooks.c | 44 ++++++++ tools/perf/tests/tests.h | 1 + tools/perf/ui/browsers/annotate.c | 6 +- tools/perf/ui/helpline.c | 10 ++ tools/perf/ui/helpline.h | 1 + tools/perf/util/Build | 3 + tools/perf/util/annotate.c | 7 +- tools/perf/util/evsel_fprintf.c | 8 ++ tools/perf/util/perf-hooks-list.h | 3 + tools/perf/util/perf-hooks.c | 84 +++++++++++++++ tools/perf/util/perf-hooks.h | 37 +++++++ tools/perf/util/symbol.c | 8 ++ tools/perf/util/symbol.h | 6 +- tools/perf/util/time-utils.c | 119 +++++++++++++++++++++ tools/perf/util/time-utils.h | 14 +++ tools/perf/util/util.c | 33 ------ tools/perf/util/util.h | 2 - 37 files changed, 842 insertions(+), 149 deletions(-) create mode 100644 tools/perf/arch/arm64/annotate/instructions.c create mode 100644 tools/perf/tests/perf-hooks.c create mode 100644 tools/perf/util/perf-hooks-list.h create mode 100644 tools/perf/util/perf-hooks.c create mode 100644 tools/perf/util/perf-hooks.h create mode 100644 tools/perf/util/time-utils.c create mode 100644 tools/perf/util/time-utils.h # uname -a Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux # perf test 1: vmlinux symtab matches kallsyms : Ok 2: Detect openat syscall event : Ok 3: Detect openat syscall event on all cpus : Ok 4: Read samples using the mmap interface : Ok 5: Parse event definition strings : Ok 6: PERF_RECORD_* events & perf_sample fields : Ok 7: Parse perf pmu format : Ok 8: DSO data read : Ok 9: DSO data cache : Ok 10: DSO data reopen : Ok 11: Roundtrip evsel->name : Ok 12: Parse sched tracepoints fields : Ok 13: syscalls:sys_enter_openat event fields : Ok 14: Setup struct perf_event_attr : Ok 15: Match and link multiple hists : Ok 16: 'import perf' in python : Ok 17: Breakpoint overflow signal handler : Ok 18: Breakpoint overflow sampling : Ok 19: Number of exit events of a simple workload : Ok 20: Software clock events period values : Ok 21: Object code reading : Ok 22: Sample parsing : Ok 23: Use a dummy software event to keep tracking: Ok 24: Parse with no sample_id_all bit set : Ok 25: Filter hist entries : Ok 26: Lookup mmap thread : Ok 27: Share thread mg : Ok 28: Sort output of hist entries : Ok 29: Cumulate child hist entries : Ok 30: Track with sched_switch : Ok 31: Filter fds with revents mask in a fdarray : Ok 32: Add fd to a fdarray, making it autogrow : Ok 33: kmod_path__parse : Ok 34: Thread map : Ok 35: LLVM search and compile : 35.1: Basic BPF llvm compile : Ok 35.2: kbuild searching : Ok 35.3: Compile source for BPF prologue generation: Ok 35.4: Compile source for BPF relocation : Ok 36: Session topology : Ok 37: BPF filter : 37.1: Basic BPF filtering : Ok 37.2: BPF prologue generation : Ok 37.3: BPF relocation checker : Ok 38: Synthesize thread map : Ok 39: Synthesize cpu map : Ok 40: Synthesize stat config : Ok 41: Synthesize stat : Ok 42: Synthesize stat round : Ok 43: Synthesize attr update : Ok 44: Event times : Ok 45: Read backward ring buffer : Ok 46: Print cpu map : Ok 47: Probe SDT events : Ok 48: is_printable_array : Ok 49: Print bitmap : Ok 50: perf hooks : Ok 51: x86 rdpmc : Ok 52: Convert perf time to TSC : Ok 53: DWARF unwind : Ok 54: x86 instruction decoder - new instructions : Ok 55: Intel cqm nmi context read : Skip # # uname -a Linux zoo 4.7.3-200.fc24.x86_64 #1 SMP Wed Sep 7 17:31:21 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux # dm 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 debian:experimental: Ok 10 fedora:20: Ok 11 fedora:21: Ok 12 fedora:22: Ok 13 fedora:23: Ok 14 fedora:24: Ok 15 fedora:24-x-ARC-uClibc: Ok 16 fedora:rawhide: Ok 17 mageia:5: Ok 18 opensuse:13.2: Ok 19 opensuse:42.1: Ok 20 opensuse:tumbleweed: Ok 21 ubuntu:12.04.5: Ok 22 ubuntu:14.04: Ok 23 ubuntu:14.04.4: Ok 24 ubuntu:15.10: Ok 25 ubuntu:16.04: Ok 26 ubuntu:16.04-x-arm: Ok 27 ubuntu:16.04-x-arm64: Ok 28 ubuntu:16.04-x-powerpc: Ok 29 ubuntu:16.04-x-powerpc64: Ok 30 ubuntu:16.04-x-powerpc64el: Ok 31 ubuntu:16.04-x-s390: Ok 32 ubuntu:16.10: Ok # $ grep PRETTY_NAME /etc/os-release PRETTY_NAME="Fedora 25 (Workstation Edition)" $ $ perf stat make -C tools/perf build-test make: Entering directory '/home/acme/git/linux/tools/perf' - tarpkg: ./tests/perf-targz-src-pkg . make_no_slang_O: make NO_SLANG=1 make_util_map_o_O: make util/map.o make_static_O: make LDFLAGS=-static make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 make_perf_o_O: make perf.o make_no_libunwind_O: make NO_LIBUNWIND=1 make_no_libelf_O: make NO_LIBELF=1 make_util_pmu_bison_o_O: make util/pmu-bison.o make_no_backtrace_O: make NO_BACKTRACE=1 make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 make_no_demangle_O: make NO_DEMANGLE=1 make_no_libperl_O: make NO_LIBPERL=1 make_tags_O: make tags make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 make_install_prefix_slash_O: make install prefix=/tmp/krava/ make_no_auxtrace_O: make NO_AUXTRACE=1 make_no_libnuma_O: make NO_LIBNUMA=1 make_install_bin_O: make install-bin make_no_newt_O: make NO_NEWT=1 make_pure_O: make make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 make_clean_all_O: make clean all make_no_gtk2_O: make NO_GTK2=1 make_no_libbionic_O: make NO_LIBBIONIC=1 make_install_prefix_O: make install prefix=/tmp/krava make_no_libbpf_O: make NO_LIBBPF=1 make_no_libaudit_O: make NO_LIBAUDIT=1 make_with_babeltrace_O: make LIBBABELTRACE=1 make_no_libpython_O: make NO_LIBPYTHON=1 make_help_O: make help make_doc_O: make doc make_debug_O: make DEBUG=1 make_install_O: make install OK make: Leaving directory '/home/acme/git/linux/tools/perf' $ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-12-01 18:02 Arnaldo Carvalho de Melo @ 2016-12-02 9:10 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-12-02 9:10 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Chris Ryder, David Ahern, He Kuang, Jiri Olsa, Joe Stringer, Kim Phillips, Mark Rutland, Namhyung Kim, Pawel Moll, Peter Zijlstra, Wang Nan, Will Deacon, Zefan Li, pi3orama, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > Test results at the end of this message, as usual. > > The following changes since commit 2471cece40d61b0035360338569d338f9dea6099: > > Merge tag 'perf-core-for-mingo-20161125' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-11-25 18:12:41 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20161201 > > for you to fetch changes up to 0fcb1da4aba6e6c7b32de5e0948b740b31ad822d: > > perf annotate: AArch64 support (2016-12-01 13:03:19 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > New features: > > - Support AArch64 in the 'annotate' code, native/local and > cross-arch/remote (Kim Phillips) > > - Allow considering just events in a given time interval, via the > '--time start.s.ms,end.s.ms' command line, added to 'perf kmem', > 'perf report', 'perf sched timehist' and 'perf script' (David Ahern) > > - Add option to stop printing a callchain at one of a given group of > symbol names (David Ahern) > > - Handle cpu migration events in 'perf sched timehist' (David Ahern) > > - Track memory freed in 'perf kmem stat' (David Ahern) > > Infrastructure: > > - Initial support (and perf test entry) for tooling hooks, starting with > 'record_start' and 'record_end', that will have as its initial user the > eBPF infrastructure, where perf_ prefixed functions will be JITed and > run when such hooks are called (Wang Nan) > > - Remove redundant "test" and similar strings from 'perf test' descriptions > (Arnaldo Carvalho de Melo) > > - libbpf assorted improvements (Wang Nan) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (3): > perf ui helpline: Provide a printf variant > perf annotate: Show invalid jump offset in error message > perf test: Remove "test" and similar strings from test descriptions > > David Ahern (10): > perf sched timehist: Handle cpu migration events > perf trace: Update tid/pid filtering option to leverage symbol_conf > perf kmem stat: Track memory freed > perf script: Add option to stop printing callchain > perf tools: Add time-based utility functions > perf tools: Move parse_nsec_time to time-utils.c > perf script: Add option to specify time window of interest > perf sched timehist: Add option to specify time window of interest > perf kmem: Add option to specify time window of interest > perf report: Add option to specify time window of interest > > Kim Phillips (2): > perf annotate: Use arch->objdump.comment_char in dec__parse() > perf annotate: AArch64 support > > Wang Nan (4): > tools lib bpf: Add missing BPF functions > tools lib bpf: Add private field for bpf_object > tools lib bpf: Retrive bpf_map through offset of bpf_map_def > perf tools: Introduce perf hooks > > tools/lib/bpf/bpf.c | 56 ++++++++++ > tools/lib/bpf/bpf.h | 7 ++ > tools/lib/bpf/libbpf.c | 35 ++++++ > tools/lib/bpf/libbpf.h | 13 +++ > tools/perf/Documentation/perf-kmem.txt | 7 ++ > tools/perf/Documentation/perf-report.txt | 7 ++ > tools/perf/Documentation/perf-sched.txt | 12 +++ > tools/perf/Documentation/perf-script.txt | 10 ++ > tools/perf/arch/arm64/annotate/instructions.c | 62 +++++++++++ > tools/perf/arch/x86/tests/arch-tests.c | 10 +- > tools/perf/builtin-kmem.c | 36 ++++++- > tools/perf/builtin-record.c | 11 ++ > tools/perf/builtin-report.c | 14 ++- > tools/perf/builtin-sched.c | 148 ++++++++++++++++++++++++-- > tools/perf/builtin-script.c | 17 ++- > tools/perf/builtin-trace.c | 49 ++------- > tools/perf/tests/Build | 1 + > tools/perf/tests/bpf.c | 6 +- > tools/perf/tests/builtin-test.c | 96 +++++++++-------- > tools/perf/tests/llvm.c | 8 +- > tools/perf/tests/perf-hooks.c | 44 ++++++++ > tools/perf/tests/tests.h | 1 + > tools/perf/ui/browsers/annotate.c | 6 +- > tools/perf/ui/helpline.c | 10 ++ > tools/perf/ui/helpline.h | 1 + > tools/perf/util/Build | 3 + > tools/perf/util/annotate.c | 7 +- > tools/perf/util/evsel_fprintf.c | 8 ++ > tools/perf/util/perf-hooks-list.h | 3 + > tools/perf/util/perf-hooks.c | 84 +++++++++++++++ > tools/perf/util/perf-hooks.h | 37 +++++++ > tools/perf/util/symbol.c | 8 ++ > tools/perf/util/symbol.h | 6 +- > tools/perf/util/time-utils.c | 119 +++++++++++++++++++++ > tools/perf/util/time-utils.h | 14 +++ > tools/perf/util/util.c | 33 ------ > tools/perf/util/util.h | 2 - > 37 files changed, 842 insertions(+), 149 deletions(-) > create mode 100644 tools/perf/arch/arm64/annotate/instructions.c > create mode 100644 tools/perf/tests/perf-hooks.c > create mode 100644 tools/perf/util/perf-hooks-list.h > create mode 100644 tools/perf/util/perf-hooks.c > create mode 100644 tools/perf/util/perf-hooks.h > create mode 100644 tools/perf/util/time-utils.c > create mode 100644 tools/perf/util/time-utils.h > > # uname -a > Linux jouet 4.8.8-300.fc25.x86_64 #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux > # perf test > 1: vmlinux symtab matches kallsyms : Ok > 2: Detect openat syscall event : Ok > 3: Detect openat syscall event on all cpus : Ok > 4: Read samples using the mmap interface : Ok > 5: Parse event definition strings : Ok > 6: PERF_RECORD_* events & perf_sample fields : Ok > 7: Parse perf pmu format : Ok > 8: DSO data read : Ok > 9: DSO data cache : Ok > 10: DSO data reopen : Ok > 11: Roundtrip evsel->name : Ok > 12: Parse sched tracepoints fields : Ok > 13: syscalls:sys_enter_openat event fields : Ok > 14: Setup struct perf_event_attr : Ok > 15: Match and link multiple hists : Ok > 16: 'import perf' in python : Ok > 17: Breakpoint overflow signal handler : Ok > 18: Breakpoint overflow sampling : Ok > 19: Number of exit events of a simple workload : Ok > 20: Software clock events period values : Ok > 21: Object code reading : Ok > 22: Sample parsing : Ok > 23: Use a dummy software event to keep tracking: Ok > 24: Parse with no sample_id_all bit set : Ok > 25: Filter hist entries : Ok > 26: Lookup mmap thread : Ok > 27: Share thread mg : Ok > 28: Sort output of hist entries : Ok > 29: Cumulate child hist entries : Ok > 30: Track with sched_switch : Ok > 31: Filter fds with revents mask in a fdarray : Ok > 32: Add fd to a fdarray, making it autogrow : Ok > 33: kmod_path__parse : Ok > 34: Thread map : Ok > 35: LLVM search and compile : > 35.1: Basic BPF llvm compile : Ok > 35.2: kbuild searching : Ok > 35.3: Compile source for BPF prologue generation: Ok > 35.4: Compile source for BPF relocation : Ok > 36: Session topology : Ok > 37: BPF filter : > 37.1: Basic BPF filtering : Ok > 37.2: BPF prologue generation : Ok > 37.3: BPF relocation checker : Ok > 38: Synthesize thread map : Ok > 39: Synthesize cpu map : Ok > 40: Synthesize stat config : Ok > 41: Synthesize stat : Ok > 42: Synthesize stat round : Ok > 43: Synthesize attr update : Ok > 44: Event times : Ok > 45: Read backward ring buffer : Ok > 46: Print cpu map : Ok > 47: Probe SDT events : Ok > 48: is_printable_array : Ok > 49: Print bitmap : Ok > 50: perf hooks : Ok > 51: x86 rdpmc : Ok > 52: Convert perf time to TSC : Ok > 53: DWARF unwind : Ok > 54: x86 instruction decoder - new instructions : Ok > 55: Intel cqm nmi context read : Skip > # > # uname -a > Linux zoo 4.7.3-200.fc24.x86_64 #1 SMP Wed Sep 7 17:31:21 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux > # dm > 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 debian:experimental: Ok > 10 fedora:20: Ok > 11 fedora:21: Ok > 12 fedora:22: Ok > 13 fedora:23: Ok > 14 fedora:24: Ok > 15 fedora:24-x-ARC-uClibc: Ok > 16 fedora:rawhide: Ok > 17 mageia:5: Ok > 18 opensuse:13.2: Ok > 19 opensuse:42.1: Ok > 20 opensuse:tumbleweed: Ok > 21 ubuntu:12.04.5: Ok > 22 ubuntu:14.04: Ok > 23 ubuntu:14.04.4: Ok > 24 ubuntu:15.10: Ok > 25 ubuntu:16.04: Ok > 26 ubuntu:16.04-x-arm: Ok > 27 ubuntu:16.04-x-arm64: Ok > 28 ubuntu:16.04-x-powerpc: Ok > 29 ubuntu:16.04-x-powerpc64: Ok > 30 ubuntu:16.04-x-powerpc64el: Ok > 31 ubuntu:16.04-x-s390: Ok > 32 ubuntu:16.10: Ok > # > $ grep PRETTY_NAME /etc/os-release > PRETTY_NAME="Fedora 25 (Workstation Edition)" > $ > $ perf stat make -C tools/perf build-test > make: Entering directory '/home/acme/git/linux/tools/perf' > - tarpkg: ./tests/perf-targz-src-pkg . > make_no_slang_O: make NO_SLANG=1 > make_util_map_o_O: make util/map.o > make_static_O: make LDFLAGS=-static > make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1 > make_perf_o_O: make perf.o > make_no_libunwind_O: make NO_LIBUNWIND=1 > make_no_libelf_O: make NO_LIBELF=1 > make_util_pmu_bison_o_O: make util/pmu-bison.o > make_no_backtrace_O: make NO_BACKTRACE=1 > make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 > make_no_demangle_O: make NO_DEMANGLE=1 > make_no_libperl_O: make NO_LIBPERL=1 > make_tags_O: make tags > make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1 > make_install_prefix_slash_O: make install prefix=/tmp/krava/ > make_no_auxtrace_O: make NO_AUXTRACE=1 > make_no_libnuma_O: make NO_LIBNUMA=1 > make_install_bin_O: make install-bin > make_no_newt_O: make NO_NEWT=1 > make_pure_O: make > make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1 > make_clean_all_O: make clean all > make_no_gtk2_O: make NO_GTK2=1 > make_no_libbionic_O: make NO_LIBBIONIC=1 > make_install_prefix_O: make install prefix=/tmp/krava > make_no_libbpf_O: make NO_LIBBPF=1 > make_no_libaudit_O: make NO_LIBAUDIT=1 > make_with_babeltrace_O: make LIBBABELTRACE=1 > make_no_libpython_O: make NO_LIBPYTHON=1 > make_help_O: make help > make_doc_O: make doc > make_debug_O: make DEBUG=1 > make_install_O: make install > OK > make: Leaving directory '/home/acme/git/linux/tools/perf' > $ > Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-09-01 16:45 Arnaldo Carvalho de Melo 2016-09-05 13:16 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-09-01 16:45 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Anton Blanchard, David Ahern, Hemant Kumar, Jiri Olsa, Masami Hiramatsu, Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria, Shawn Lin, Wang Nan, Yauheni Kaliuta, Arnaldo Carvalho de Melo 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 ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-09-01 16:45 Arnaldo Carvalho de Melo @ 2016-09-05 13:16 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-09-05 13:16 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Anton Blanchard, David Ahern, Hemant Kumar, Jiri Olsa, Masami Hiramatsu, Michael Petlan, Milian Wolff, Namhyung Kim, Naveen N . Rao, Peter Zijlstra, Ravi Bangoria, Shawn Lin, Wang Nan, Yauheni Kaliuta, Arnaldo Carvalho de Melo * 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 ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-07-14 2:20 Arnaldo Carvalho de Melo 2016-07-14 6:58 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-07-14 2:20 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexei Starovoitov, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, Hemant Kumar, Jiri Olsa, Josh Poimboeuf, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, pi3orama, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, I've added building objtool to most of the containers in my build test setup: [root@jouet ~]# perf stat dm alpine:3.4: Ok centos:5: Ok centos:6: Ok centos:7: Ok debian:7: Ok debian:8: Ok debian:experimental: Ok fedora:21: Ok fedora:22: Ok fedora:23: Ok fedora:24: Ok fedora:rawhide: Ok mageia:5: Ok opensuse:13.2: Ok opensuse:42.1: Ok ubuntu:12.04.5: Ok ubuntu:14.04.4: Ok ubuntu:15.10: Ok ubuntu:16.04: Ok Performance counter stats for 'dm': 2601.121782 task-clock (msec) # 0.002 CPUs utilized 86,368 context-switches # 0.033 M/sec 5,740 cpu-migrations # 0.002 M/sec 53,962 page-faults # 0.021 M/sec 7,217,605,183 cycles # 2.775 GHz 6,534,540,119 instructions # 0.91 insn per cycle 1,408,715,184 branches # 541.580 M/sec 18,523,459 branch-misses # 1.31% of all branches 1541.746171526 seconds time elapsed [root@jouet ~]# - Arnaldo The following changes since commit 7b39cafb7aa68ef8e32a9f51fbe737d96084ca74: tools: Work around BITS_PER_LONG related build failure in objtool (2016-07-13 09:37:43 +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-20160713 for you to fetch changes up to 8e5dc848356ecf6ea8d27d641c4d7ad8d42fe92b: perf test: Add a test case for SDT event (2016-07-13 23:09:10 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Finish merging initial SDT (Statically Defined Traces) support, see cset comments for details about how it all works (Masami Hiramatsu) - Support attaching eBPF programs to tracepoints (Wang Nan) Infrastructure: - Fix up BITS_PER_LONG setting (Arnaldo Carvalho de Melo) - Add fallback from ELF_C_READ_MMAP to ELF_C_READ in objtool, fixing the build in libelf implementations lacking that elf_begin() cmd, such as Alpine Linux's (Arnaldo Carvalho de Melo) - Avoid checking code drift on busybox's diff in objtool (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (3): tools: Fix up BITS_PER_LONG setting objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ objtool: Avoid checking code drift on busybox's diff Masami Hiramatsu (11): perf probe: Fix to show correct error message for $vars and $params perf probe: Accept %sdt and %cached event name perf probe: Make --list show only available cached events perf probe-cache: Add for_each_probe_cache_entry() wrapper perf probe: Allow wildcard for cached events perf probe: Search SDT/cached event from all probe caches perf list: Show SDT and pre-cached events perf probe: Support @BUILDID or @FILE suffix for SDT events perf probe: Support a special SDT probe format perf build: Add sdt feature detection perf test: Add a test case for SDT event Wang Nan (5): tools lib bpf: New API to adjust type of a BPF program tools lib bpf: Report error when kernel doesn't support program type perf event parser: Add const qualifier to evt_name and sys_name perf bpf: Rename bpf__foreach_tev() to bpf__foreach_event() perf bpf: Support BPF program attach to tracepoints tools/build/Makefile.feature | 3 +- tools/build/feature/Makefile | 6 +- tools/build/feature/test-all.c | 5 + tools/build/feature/test-sdt.c | 7 + tools/include/asm-generic/bitsperlong.h | 24 ++- tools/lib/bpf/libbpf.c | 80 +++++++-- tools/lib/bpf/libbpf.h | 10 ++ tools/objtool/Makefile | 5 +- tools/objtool/elf.c | 7 + tools/perf/Documentation/perf-probe.txt | 11 +- tools/perf/Makefile.perf | 3 + tools/perf/builtin-list.c | 6 +- tools/perf/builtin-probe.c | 2 +- tools/perf/config/Makefile | 10 ++ tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/make | 3 +- tools/perf/tests/sdt.c | 115 ++++++++++++ tools/perf/tests/tests.h | 1 + tools/perf/util/bpf-loader.c | 73 +++++++- tools/perf/util/bpf-loader.h | 12 +- tools/perf/util/build-id.c | 76 +++++++- tools/perf/util/build-id.h | 3 +- tools/perf/util/parse-events.c | 110 ++++++++++-- tools/perf/util/parse-events.h | 4 +- tools/perf/util/probe-event.c | 309 +++++++++++++++++++++++++++----- tools/perf/util/probe-event.h | 1 + tools/perf/util/probe-file.c | 57 ++++-- tools/perf/util/probe-file.h | 14 ++ 29 files changed, 850 insertions(+), 112 deletions(-) create mode 100644 tools/build/feature/test-sdt.c create mode 100644 tools/perf/tests/sdt.c ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-07-14 2:20 Arnaldo Carvalho de Melo @ 2016-07-14 6:58 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-07-14 6:58 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, Hemant Kumar, Jiri Olsa, Josh Poimboeuf, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, pi3orama, Wang Nan, Zefan Li, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > I've added building objtool to most of the containers in my build test setup: > > [root@jouet ~]# perf stat dm > alpine:3.4: Ok > centos:5: Ok > centos:6: Ok > centos:7: Ok > debian:7: Ok > debian:8: Ok > debian:experimental: Ok > fedora:21: Ok > fedora:22: Ok > fedora:23: Ok > fedora:24: Ok > fedora:rawhide: Ok > mageia:5: Ok > opensuse:13.2: Ok > opensuse:42.1: Ok > ubuntu:12.04.5: Ok > ubuntu:14.04.4: Ok > ubuntu:15.10: Ok > ubuntu:16.04: Ok > > Performance counter stats for 'dm': > > 2601.121782 task-clock (msec) # 0.002 CPUs utilized > 86,368 context-switches # 0.033 M/sec > 5,740 cpu-migrations # 0.002 M/sec > 53,962 page-faults # 0.021 M/sec > 7,217,605,183 cycles # 2.775 GHz > 6,534,540,119 instructions # 0.91 insn per cycle > 1,408,715,184 branches # 541.580 M/sec > 18,523,459 branch-misses # 1.31% of all branches > > 1541.746171526 seconds time elapsed > > [root@jouet ~]# > > - Arnaldo > > The following changes since commit 7b39cafb7aa68ef8e32a9f51fbe737d96084ca74: > > tools: Work around BITS_PER_LONG related build failure in objtool (2016-07-13 09:37:43 +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-20160713 > > for you to fetch changes up to 8e5dc848356ecf6ea8d27d641c4d7ad8d42fe92b: > > perf test: Add a test case for SDT event (2016-07-13 23:09:10 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Finish merging initial SDT (Statically Defined Traces) support, see > cset comments for details about how it all works (Masami Hiramatsu) > > - Support attaching eBPF programs to tracepoints (Wang Nan) > > Infrastructure: > > - Fix up BITS_PER_LONG setting (Arnaldo Carvalho de Melo) > > - Add fallback from ELF_C_READ_MMAP to ELF_C_READ in objtool, fixing > the build in libelf implementations lacking that elf_begin() cmd, > such as Alpine Linux's (Arnaldo Carvalho de Melo) > > - Avoid checking code drift on busybox's diff in objtool (Arnaldo Carvalho de Melo) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (3): > tools: Fix up BITS_PER_LONG setting > objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ > objtool: Avoid checking code drift on busybox's diff > > Masami Hiramatsu (11): > perf probe: Fix to show correct error message for $vars and $params > perf probe: Accept %sdt and %cached event name > perf probe: Make --list show only available cached events > perf probe-cache: Add for_each_probe_cache_entry() wrapper > perf probe: Allow wildcard for cached events > perf probe: Search SDT/cached event from all probe caches > perf list: Show SDT and pre-cached events > perf probe: Support @BUILDID or @FILE suffix for SDT events > perf probe: Support a special SDT probe format > perf build: Add sdt feature detection > perf test: Add a test case for SDT event > > Wang Nan (5): > tools lib bpf: New API to adjust type of a BPF program > tools lib bpf: Report error when kernel doesn't support program type > perf event parser: Add const qualifier to evt_name and sys_name > perf bpf: Rename bpf__foreach_tev() to bpf__foreach_event() > perf bpf: Support BPF program attach to tracepoints > > tools/build/Makefile.feature | 3 +- > tools/build/feature/Makefile | 6 +- > tools/build/feature/test-all.c | 5 + > tools/build/feature/test-sdt.c | 7 + > tools/include/asm-generic/bitsperlong.h | 24 ++- > tools/lib/bpf/libbpf.c | 80 +++++++-- > tools/lib/bpf/libbpf.h | 10 ++ > tools/objtool/Makefile | 5 +- > tools/objtool/elf.c | 7 + > tools/perf/Documentation/perf-probe.txt | 11 +- > tools/perf/Makefile.perf | 3 + > tools/perf/builtin-list.c | 6 +- > tools/perf/builtin-probe.c | 2 +- > tools/perf/config/Makefile | 10 ++ > tools/perf/tests/Build | 1 + > tools/perf/tests/builtin-test.c | 4 + > tools/perf/tests/make | 3 +- > tools/perf/tests/sdt.c | 115 ++++++++++++ > tools/perf/tests/tests.h | 1 + > tools/perf/util/bpf-loader.c | 73 +++++++- > tools/perf/util/bpf-loader.h | 12 +- > tools/perf/util/build-id.c | 76 +++++++- > tools/perf/util/build-id.h | 3 +- > tools/perf/util/parse-events.c | 110 ++++++++++-- > tools/perf/util/parse-events.h | 4 +- > tools/perf/util/probe-event.c | 309 +++++++++++++++++++++++++++----- > tools/perf/util/probe-event.h | 1 + > tools/perf/util/probe-file.c | 57 ++++-- > tools/perf/util/probe-file.h | 14 ++ > 29 files changed, 850 insertions(+), 112 deletions(-) > create mode 100644 tools/build/feature/test-sdt.c > create mode 100644 tools/perf/tests/sdt.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-06-15 18:13 Arnaldo Carvalho de Melo 2016-06-16 6:29 ` Jiri Olsa 2016-06-16 8:29 ` Ingo Molnar 0 siblings, 2 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-06-15 18:13 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Alexander Shishkin, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, He Kuang, Hemant Kumar, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 2c95afc1e83d93fac3be6923465e1753c2c53b0a: perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86 (2016-06-14 11:16:59 +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-20160615 for you to fetch changes up to 2fd457a34525ea3bc609e377b46af759af8a7934: perf probe: Add --cache option to cache the probe definitions (2016-06-15 14:34:42 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Add --ldlat option to 'perf mem' to specify load latency for loads event (e.g. cpu/mem-loads/ ) (Jiri Olsa) Build fixes: - Fix libunwind related compile error for static cross build (He Kuang) Infrastructure: - UI refactorings to support headers with multiple lines, non-evsel hists browsers, toggle showing callchains, etc (Jiri Olsa) - More prep work for caching probe definitions, paving the way for supporting SDT (Statically Defined Traces) userspace probes (Masami Hiramatsu) - Handle NULL at perf_config_set__delete() (Taeung Song) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- He Kuang (1): perf unwind: Fix compile error for static cross build Jiri Olsa (10): perf mem: Add --ldlat option perf tools: Fix Data Object sort entry width index perf tui: Separate hierarchy and standard headers output perf stdio: Separate headers output perf stdio: Separate hierarchy headers output perf stdio: Separate standard headers output perf stdio: Do not pass hists in hist_entry__fprintf perf stdio: Add use_callchain parameter to hists__fprintf perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback Masami Hiramatsu (7): perf tools: Fix rm_rf() to handle non-regular files correctly perf probe: Fix to add NULL check for strndup perf buildid: Rename and export build_id_cache__cachedir() perf probe: Add perf_probe_event__copy() perf probe: Uncomment and export synthesize_perf_probe_point() perf probe: Introduce perf_cache interfaces perf probe: Add --cache option to cache the probe definitions Taeung Song (1): perf config: Handle NULL at perf_config_set__delete() tools/perf/Documentation/perf-mem.txt | 3 + tools/perf/Documentation/perf-probe.txt | 4 + tools/perf/builtin-diff.c | 7 +- tools/perf/builtin-mem.c | 1 + tools/perf/builtin-probe.c | 1 + tools/perf/builtin-report.c | 3 +- tools/perf/builtin-top.c | 2 +- tools/perf/config/Makefile | 3 + tools/perf/ui/browsers/hists.c | 39 ++-- tools/perf/ui/gtk/hists.c | 2 +- tools/perf/ui/hist.c | 11 +- tools/perf/ui/stdio/hist.c | 133 +++++++------ tools/perf/util/build-id.c | 12 +- tools/perf/util/build-id.h | 2 + tools/perf/util/config.c | 3 + tools/perf/util/hist.c | 2 +- tools/perf/util/hist.h | 7 +- tools/perf/util/mem-events.c | 17 +- tools/perf/util/mem-events.h | 1 + tools/perf/util/probe-event.c | 128 ++++++++++-- tools/perf/util/probe-event.h | 5 + tools/perf/util/probe-file.c | 331 ++++++++++++++++++++++++++++++++ tools/perf/util/probe-file.h | 20 ++ tools/perf/util/sort.c | 14 +- tools/perf/util/util.c | 13 +- 25 files changed, 640 insertions(+), 124 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-06-15 18:13 Arnaldo Carvalho de Melo @ 2016-06-16 6:29 ` Jiri Olsa 2016-06-16 19:54 ` Arnaldo Carvalho de Melo 2016-06-16 8:29 ` Ingo Molnar 1 sibling, 1 reply; 53+ messages in thread From: Jiri Olsa @ 2016-06-16 6:29 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Ingo Molnar, linux-kernel, Alexander Shishkin, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, He Kuang, Hemant Kumar, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo On Wed, Jun 15, 2016 at 03:13:09PM -0300, Arnaldo Carvalho de Melo wrote: SNIP > ---------------------------------------------------------------- > He Kuang (1): > perf unwind: Fix compile error for static cross build > > Jiri Olsa (10): > perf mem: Add --ldlat option > perf tools: Fix Data Object sort entry width index > perf tui: Separate hierarchy and standard headers output > perf stdio: Separate headers output > perf stdio: Separate hierarchy headers output > perf stdio: Separate standard headers output > perf stdio: Do not pass hists in hist_entry__fprintf > perf stdio: Add use_callchain parameter to hists__fprintf > perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback > perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback hi, any reason for skipping this one?: perf tools: Rename __hists__add_entry to hists__add_entry thanks, jirka ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-06-16 6:29 ` Jiri Olsa @ 2016-06-16 19:54 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-06-16 19:54 UTC (permalink / raw) To: Jiri Olsa Cc: Ingo Molnar, linux-kernel, Alexander Shishkin, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, He Kuang, Hemant Kumar, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo Em Thu, Jun 16, 2016 at 08:29:47AM +0200, Jiri Olsa escreveu: > On Wed, Jun 15, 2016 at 03:13:09PM -0300, Arnaldo Carvalho de Melo wrote: > > SNIP > > > ---------------------------------------------------------------- > > He Kuang (1): > > perf unwind: Fix compile error for static cross build > > > > Jiri Olsa (10): > > perf mem: Add --ldlat option > > perf tools: Fix Data Object sort entry width index > > perf tui: Separate hierarchy and standard headers output > > perf stdio: Separate headers output > > perf stdio: Separate hierarchy headers output > > perf stdio: Separate standard headers output > > perf stdio: Do not pass hists in hist_entry__fprintf > > perf stdio: Add use_callchain parameter to hists__fprintf > > perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback > > perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback > hi, > any reason for skipping this one?: > perf tools: Rename __hists__add_entry to hists__add_entry nope, will apply. - Arnaldo ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-06-15 18:13 Arnaldo Carvalho de Melo 2016-06-16 6:29 ` Jiri Olsa @ 2016-06-16 8:29 ` Ingo Molnar 1 sibling, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-06-16 8:29 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Alexander Shishkin, Ananth N Mavinakayanahalli, Brendan Gregg, David Ahern, He Kuang, Hemant Kumar, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 2c95afc1e83d93fac3be6923465e1753c2c53b0a: > > perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86 (2016-06-14 11:16:59 +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-20160615 > > for you to fetch changes up to 2fd457a34525ea3bc609e377b46af759af8a7934: > > perf probe: Add --cache option to cache the probe definitions (2016-06-15 14:34:42 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Add --ldlat option to 'perf mem' to specify load latency for loads > event (e.g. cpu/mem-loads/ ) (Jiri Olsa) > > Build fixes: > > - Fix libunwind related compile error for static cross build (He Kuang) > > Infrastructure: > > - UI refactorings to support headers with multiple lines, non-evsel > hists browsers, toggle showing callchains, etc (Jiri Olsa) > > - More prep work for caching probe definitions, paving the way > for supporting SDT (Statically Defined Traces) userspace probes (Masami Hiramatsu) > > - Handle NULL at perf_config_set__delete() (Taeung Song) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > He Kuang (1): > perf unwind: Fix compile error for static cross build > > Jiri Olsa (10): > perf mem: Add --ldlat option > perf tools: Fix Data Object sort entry width index > perf tui: Separate hierarchy and standard headers output > perf stdio: Separate headers output > perf stdio: Separate hierarchy headers output > perf stdio: Separate standard headers output > perf stdio: Do not pass hists in hist_entry__fprintf > perf stdio: Add use_callchain parameter to hists__fprintf > perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback > perf hists: Replace perf_evsel arg perf_hpp_fmt's width callback > > Masami Hiramatsu (7): > perf tools: Fix rm_rf() to handle non-regular files correctly > perf probe: Fix to add NULL check for strndup > perf buildid: Rename and export build_id_cache__cachedir() > perf probe: Add perf_probe_event__copy() > perf probe: Uncomment and export synthesize_perf_probe_point() > perf probe: Introduce perf_cache interfaces > perf probe: Add --cache option to cache the probe definitions > > Taeung Song (1): > perf config: Handle NULL at perf_config_set__delete() > > tools/perf/Documentation/perf-mem.txt | 3 + > tools/perf/Documentation/perf-probe.txt | 4 + > tools/perf/builtin-diff.c | 7 +- > tools/perf/builtin-mem.c | 1 + > tools/perf/builtin-probe.c | 1 + > tools/perf/builtin-report.c | 3 +- > tools/perf/builtin-top.c | 2 +- > tools/perf/config/Makefile | 3 + > tools/perf/ui/browsers/hists.c | 39 ++-- > tools/perf/ui/gtk/hists.c | 2 +- > tools/perf/ui/hist.c | 11 +- > tools/perf/ui/stdio/hist.c | 133 +++++++------ > tools/perf/util/build-id.c | 12 +- > tools/perf/util/build-id.h | 2 + > tools/perf/util/config.c | 3 + > tools/perf/util/hist.c | 2 +- > tools/perf/util/hist.h | 7 +- > tools/perf/util/mem-events.c | 17 +- > tools/perf/util/mem-events.h | 1 + > tools/perf/util/probe-event.c | 128 ++++++++++-- > tools/perf/util/probe-event.h | 5 + > tools/perf/util/probe-file.c | 331 ++++++++++++++++++++++++++++++++ > tools/perf/util/probe-file.h | 20 ++ > tools/perf/util/sort.c | 14 +- > tools/perf/util/util.c | 13 +- > 25 files changed, 640 insertions(+), 124 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-04-07 20:58 Arnaldo Carvalho de Melo 2016-04-08 13:15 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-04-07 20:58 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Andi Kleen, Andreas Hollmann, Cody P Schafer, David Ahern, Dima Kogan, Frederic Weisbecker, He Kuang, Jiri Olsa, Josh Poimboeuf, Kirill Smelkov, Li Zefan, Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra, pi3orama, Steven Rostedt, Taeung Song, Vinson Lee, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, build tested on: # perf stat -e cycles dm 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 Performance counter stats for 'dm': 3,095,685,547 cycles 454.805537820 seconds time elapsed # 'perf test' passes on fedora23 x86_64, Thanks, - Arnaldo The following changes since commit dad38ca64a252144b4ccdfe9730a3fe2b7c61957: Merge tag 'perf-core-for-mingo-20160401' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-04-06 08:46:23 +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-20160407 for you to fetch changes up to 98c3d844cd0bc56d33800114e6b6adcd0a5ec381: perf symbols: Adjust symbol for shared objects (2016-04-07 17:17:01 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Beautify more syscall arguments in 'perf trace', using the type column in tracepoint /format fields to attach, for instance, a pid_t resolver to the thread COMM, also attach a mode_t beautifier in the same fashion (Arnaldo Carvalho de Melo) - Build the syscall table id <-> name resolver using the same .tbl file used in the kernel to generate headers, to avoid the delay in getting new syscalls supported in the audit-libs external dependency, done so far only for x86_64 (Arnaldo Carvalho de Melo) - Improve the documentation of event specifications (Andi Kleen) - Process update events in 'perf script', fixing up this use case: # perf stat -a -I 1000 -e cycles record | perf script -s script.py - Shared object symbol adjustment fixes, fixing symbol resolution in Android (Wang Nan) Infrastructure: - Add dedicated unwind addr_space member into thread struct, to allow tools to use thread->priv, noticed while working on having callchains in 'perf trace' (Jiri Olsa) Build fixes: - Fix the build in Ubuntu 12.04 (Arnaldo Carvalho de Melo, Vinson Lee) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (1): perf list: Document event specifications better Arnaldo Carvalho de Melo (11): perf probe: Check if dwarf_getlocations() is available perf script perl: Do error checking on new backtrace routine perf trace: Beautify sched_setscheduler 'policy' argument perf trace: Beautify wait4/waitid 'options' argument perf trace: Infrastructure to show COMM strings for syscalls returning PIDs perf trace: Beautify set_tid_address, getpid, getppid return values perf trace: Beautify pid_t arguments perf trace: Beautify mode_t arguments perf trace: Move syscall table id <-> name routines to separate class perf tools: Allow generating per-arch syscall table arrays perf tools: Build syscall table .c header from kernel's syscall_64.tbl Jiri Olsa (4): perf tools: Remove superfluous ARCH Makefile includes perf tools: Introduce trim function perf tools: Add dedicated unwind addr_space member into thread struct perf script: Process event update events Vinson Lee (1): perf config: Fix build with older toolchain. Wang Nan (2): perf symbols: Record text offset in dso to calculate objdump address perf symbols: Adjust symbol for shared objects tools/build/Makefile.feature | 2 + tools/build/feature/Makefile | 4 + tools/build/feature/test-all.c | 5 + tools/build/feature/test-dwarf_getlocations.c | 12 + tools/perf/Documentation/perf-list.txt | 107 +++++- tools/perf/Makefile.perf | 13 +- tools/perf/arch/x86/Makefile | 23 ++ tools/perf/arch/x86/entry/syscalls/syscall_64.tbl | 374 +++++++++++++++++++++ tools/perf/arch/x86/entry/syscalls/syscalltbl.sh | 39 +++ tools/perf/builtin-script.c | 1 + tools/perf/builtin-trace.c | 156 +++++---- tools/perf/config/Makefile | 11 +- tools/perf/trace/beauty/mode_t.c | 68 ++++ tools/perf/trace/beauty/pid.c | 18 + tools/perf/trace/beauty/sched_policy.c | 44 +++ tools/perf/trace/beauty/waitid_options.c | 26 ++ tools/perf/ui/browsers/hists.c | 3 +- tools/perf/ui/stdio/hist.c | 3 +- tools/perf/util/Build | 5 + tools/perf/util/config.c | 6 +- tools/perf/util/dwarf-aux.c | 9 + tools/perf/util/map.c | 14 + .../perf/util/scripting-engines/trace-event-perl.c | 30 +- tools/perf/util/symbol-elf.c | 13 +- tools/perf/util/syscalltbl.c | 134 ++++++++ tools/perf/util/syscalltbl.h | 20 ++ tools/perf/util/thread.h | 6 + tools/perf/util/unwind-libunwind.c | 25 +- tools/perf/util/util.h | 5 + 29 files changed, 1060 insertions(+), 116 deletions(-) create mode 100644 tools/build/feature/test-dwarf_getlocations.c create mode 100644 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl create mode 100755 tools/perf/arch/x86/entry/syscalls/syscalltbl.sh create mode 100644 tools/perf/trace/beauty/mode_t.c create mode 100644 tools/perf/trace/beauty/pid.c create mode 100644 tools/perf/trace/beauty/sched_policy.c create mode 100644 tools/perf/trace/beauty/waitid_options.c create mode 100644 tools/perf/util/syscalltbl.c create mode 100644 tools/perf/util/syscalltbl.h ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-04-07 20:58 Arnaldo Carvalho de Melo @ 2016-04-08 13:15 ` Arnaldo Carvalho de Melo 2016-04-13 6:58 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-04-08 13:15 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Andi Kleen, Andreas Hollmann, Cody P Schafer, David Ahern, Dima Kogan, Frederic Weisbecker, He Kuang, Jiri Olsa, Josh Poimboeuf, Kirill Smelkov, Li Zefan, Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra, pi3orama, Steven Rostedt, Taeung Song, Vinson Lee, Wang Nan, Arnaldo Carvalho de Melo Em Thu, Apr 07, 2016 at 05:58:21PM -0300, Arnaldo Carvalho de Melo escreveu: > Hi Ingo, > > Please consider pulling, build tested on: Ingo, if you haven't pulled this one, please pull instead perf-core-for-mingo-20160408, which has the same tag text and contents + a Tested-by tag from Milian for the unwind thread one and a bisection fix one liner for the syscall_tbl generation from Wang, Thanks, - Arnaldo > # perf stat -e cycles dm > 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 > > Performance counter stats for 'dm': > > 3,095,685,547 cycles > > 454.805537820 seconds time elapsed > > # > > 'perf test' passes on fedora23 x86_64, > > Thanks, > > - Arnaldo > > The following changes since commit dad38ca64a252144b4ccdfe9730a3fe2b7c61957: > > Merge tag 'perf-core-for-mingo-20160401' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-04-06 08:46:23 +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-20160407 > > for you to fetch changes up to 98c3d844cd0bc56d33800114e6b6adcd0a5ec381: > > perf symbols: Adjust symbol for shared objects (2016-04-07 17:17:01 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Beautify more syscall arguments in 'perf trace', using the type column in > tracepoint /format fields to attach, for instance, a pid_t resolver to the > thread COMM, also attach a mode_t beautifier in the same fashion > (Arnaldo Carvalho de Melo) > > - Build the syscall table id <-> name resolver using the same .tbl file > used in the kernel to generate headers, to avoid the delay in getting > new syscalls supported in the audit-libs external dependency, done so > far only for x86_64 (Arnaldo Carvalho de Melo) > > - Improve the documentation of event specifications (Andi Kleen) > > - Process update events in 'perf script', fixing up this use case: > > # perf stat -a -I 1000 -e cycles record | perf script -s script.py > > - Shared object symbol adjustment fixes, fixing symbol resolution in > Android (Wang Nan) > > Infrastructure: > > - Add dedicated unwind addr_space member into thread struct, to allow > tools to use thread->priv, noticed while working on having callchains > in 'perf trace' (Jiri Olsa) > > Build fixes: > > - Fix the build in Ubuntu 12.04 (Arnaldo Carvalho de Melo, Vinson Lee) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (1): > perf list: Document event specifications better > > Arnaldo Carvalho de Melo (11): > perf probe: Check if dwarf_getlocations() is available > perf script perl: Do error checking on new backtrace routine > perf trace: Beautify sched_setscheduler 'policy' argument > perf trace: Beautify wait4/waitid 'options' argument > perf trace: Infrastructure to show COMM strings for syscalls returning PIDs > perf trace: Beautify set_tid_address, getpid, getppid return values > perf trace: Beautify pid_t arguments > perf trace: Beautify mode_t arguments > perf trace: Move syscall table id <-> name routines to separate class > perf tools: Allow generating per-arch syscall table arrays > perf tools: Build syscall table .c header from kernel's syscall_64.tbl > > Jiri Olsa (4): > perf tools: Remove superfluous ARCH Makefile includes > perf tools: Introduce trim function > perf tools: Add dedicated unwind addr_space member into thread struct > perf script: Process event update events > > Vinson Lee (1): > perf config: Fix build with older toolchain. > > Wang Nan (2): > perf symbols: Record text offset in dso to calculate objdump address > perf symbols: Adjust symbol for shared objects > > tools/build/Makefile.feature | 2 + > tools/build/feature/Makefile | 4 + > tools/build/feature/test-all.c | 5 + > tools/build/feature/test-dwarf_getlocations.c | 12 + > tools/perf/Documentation/perf-list.txt | 107 +++++- > tools/perf/Makefile.perf | 13 +- > tools/perf/arch/x86/Makefile | 23 ++ > tools/perf/arch/x86/entry/syscalls/syscall_64.tbl | 374 +++++++++++++++++++++ > tools/perf/arch/x86/entry/syscalls/syscalltbl.sh | 39 +++ > tools/perf/builtin-script.c | 1 + > tools/perf/builtin-trace.c | 156 +++++---- > tools/perf/config/Makefile | 11 +- > tools/perf/trace/beauty/mode_t.c | 68 ++++ > tools/perf/trace/beauty/pid.c | 18 + > tools/perf/trace/beauty/sched_policy.c | 44 +++ > tools/perf/trace/beauty/waitid_options.c | 26 ++ > tools/perf/ui/browsers/hists.c | 3 +- > tools/perf/ui/stdio/hist.c | 3 +- > tools/perf/util/Build | 5 + > tools/perf/util/config.c | 6 +- > tools/perf/util/dwarf-aux.c | 9 + > tools/perf/util/map.c | 14 + > .../perf/util/scripting-engines/trace-event-perl.c | 30 +- > tools/perf/util/symbol-elf.c | 13 +- > tools/perf/util/syscalltbl.c | 134 ++++++++ > tools/perf/util/syscalltbl.h | 20 ++ > tools/perf/util/thread.h | 6 + > tools/perf/util/unwind-libunwind.c | 25 +- > tools/perf/util/util.h | 5 + > 29 files changed, 1060 insertions(+), 116 deletions(-) > create mode 100644 tools/build/feature/test-dwarf_getlocations.c > create mode 100644 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl > create mode 100755 tools/perf/arch/x86/entry/syscalls/syscalltbl.sh > create mode 100644 tools/perf/trace/beauty/mode_t.c > create mode 100644 tools/perf/trace/beauty/pid.c > create mode 100644 tools/perf/trace/beauty/sched_policy.c > create mode 100644 tools/perf/trace/beauty/waitid_options.c > create mode 100644 tools/perf/util/syscalltbl.c > create mode 100644 tools/perf/util/syscalltbl.h ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-04-08 13:15 ` Arnaldo Carvalho de Melo @ 2016-04-13 6:58 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-04-13 6:58 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Alexei Starovoitov, Andi Kleen, Andreas Hollmann, Cody P Schafer, David Ahern, Dima Kogan, Frederic Weisbecker, He Kuang, Jiri Olsa, Josh Poimboeuf, Kirill Smelkov, Li Zefan, Masami Hiramatsu, Milian Wolff, Namhyung Kim, Peter Zijlstra, pi3orama, Steven Rostedt, Taeung Song, Vinson Lee, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Em Thu, Apr 07, 2016 at 05:58:21PM -0300, Arnaldo Carvalho de Melo escreveu: > > Hi Ingo, > > > > Please consider pulling, build tested on: > > Ingo, if you haven't pulled this one, please pull instead > perf-core-for-mingo-20160408, which has the same tag text and contents + > a Tested-by tag from Milian for the unwind thread one and a bisection > fix one liner for the syscall_tbl generation from Wang, Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-03-10 21:04 Arnaldo Carvalho de Melo 2016-03-11 8:43 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-03-10 21:04 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Borislav Petkov, Chris Phlipot, Colin Ian King, David Ahern, Davidlohr Bueso, He Kuang, H . Peter Anvin, Jiri Olsa, Mel Gorman, Namhyung Kim, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Thomas Gleixner, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 3a99e6db539e53cc9c79282e80f8362b0cb96ac8: perf bench mem: Prepare the x86-64 build for upstream memcpy_mcsafe() changes (2016-03-09 10:40:01 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160310 for you to fetch changes up to 206cab651d07563d766c7f4cb73f858c5df3dec5: perf stat: Add --metric-only support for -A (2016-03-10 16:50:47 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Implement 'perf stat --metric-only' (Andi Kleen) - Fix perf script python database export crash (Chris Phlipot) Infrastructure: - perf top/report --hierarchy assorted fixes for problems introduced in this perf/core cycle (Namhyung Kim) - Support '~' operation in libtraceevent (Steven Rosted) Build fixes: - Fix bulding of jitdump on opensuse on ubuntu systems when the DWARF devel files are not installed (Arnaldo Carvalho de Melo) - Do not try building jitdump on unsupported arches (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Andi Kleen (3): perf stat: Document CSV format in manpage perf stat: Implement --metric-only mode perf stat: Add --metric-only support for -A Arnaldo Carvalho de Melo (1): perf jitdump: DWARF is also needed Chris Phlipot (1): perf tools: Fix perf script python database export crash Jiri Olsa (3): perf tools: Pass perf_hpp_list all the way through setup_sort_list perf tools: Omit unnecessary cast in perf_pmu__parse_scale perf jitdump: Build only on supported archs Namhyung Kim (10): perf tools: Fix hist_entry__filter() for hierarchy perf tools: Add more sort entry check functions perf tools: Fix command line filters in hierarchy mode perf tools: Remove hist_entry->fmt field perf hists browser: Cleanup hist_browser__fprintf_hierarchy_entry() perf tools: Remove nr_sort_keys field perf tools: Recalc total periods using top-level entries in hierarchy perf tools: Add sort__has_comm variable perf hists browser: Allow thread filtering for comm sort key perf hists browser: Check sort keys before hot key actions Steven Rostedt (1): tools lib traceevent: Add '~' operation within arg_num_eval() tools/lib/traceevent/event-parse.c | 6 + tools/perf/Documentation/perf-stat.txt | 27 ++++ tools/perf/arch/arm/Makefile | 1 + tools/perf/arch/arm64/Makefile | 1 + tools/perf/arch/powerpc/Makefile | 1 + tools/perf/arch/x86/Makefile | 1 + tools/perf/builtin-inject.c | 12 +- tools/perf/builtin-stat.c | 244 +++++++++++++++++++++++++++++++-- tools/perf/config/Makefile | 7 + tools/perf/ui/browsers/hists.c | 73 ++++++---- tools/perf/ui/hist.c | 3 - tools/perf/util/Build | 3 + tools/perf/util/evsel.h | 6 +- tools/perf/util/hist.c | 144 +++++++++++++++++-- tools/perf/util/hist.h | 6 +- tools/perf/util/pmu.c | 4 +- tools/perf/util/sort.c | 147 +++++++++----------- tools/perf/util/sort.h | 2 +- 18 files changed, 542 insertions(+), 146 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-03-10 21:04 Arnaldo Carvalho de Melo @ 2016-03-11 8:43 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-03-11 8:43 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen, Borislav Petkov, Chris Phlipot, Colin Ian King, David Ahern, Davidlohr Bueso, He Kuang, H . Peter Anvin, Jiri Olsa, Mel Gorman, Namhyung Kim, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Thomas Gleixner, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 3a99e6db539e53cc9c79282e80f8362b0cb96ac8: > > perf bench mem: Prepare the x86-64 build for upstream memcpy_mcsafe() changes (2016-03-09 10:40:01 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160310 > > for you to fetch changes up to 206cab651d07563d766c7f4cb73f858c5df3dec5: > > perf stat: Add --metric-only support for -A (2016-03-10 16:50:47 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Implement 'perf stat --metric-only' (Andi Kleen) > > - Fix perf script python database export crash (Chris Phlipot) > > Infrastructure: > > - perf top/report --hierarchy assorted fixes for problems introduced in this > perf/core cycle (Namhyung Kim) > > - Support '~' operation in libtraceevent (Steven Rosted) > > Build fixes: > > - Fix bulding of jitdump on opensuse on ubuntu systems when the DWARF > devel files are not installed (Arnaldo Carvalho de Melo) > > - Do not try building jitdump on unsupported arches (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Andi Kleen (3): > perf stat: Document CSV format in manpage > perf stat: Implement --metric-only mode > perf stat: Add --metric-only support for -A > > Arnaldo Carvalho de Melo (1): > perf jitdump: DWARF is also needed > > Chris Phlipot (1): > perf tools: Fix perf script python database export crash > > Jiri Olsa (3): > perf tools: Pass perf_hpp_list all the way through setup_sort_list > perf tools: Omit unnecessary cast in perf_pmu__parse_scale > perf jitdump: Build only on supported archs > > Namhyung Kim (10): > perf tools: Fix hist_entry__filter() for hierarchy > perf tools: Add more sort entry check functions > perf tools: Fix command line filters in hierarchy mode > perf tools: Remove hist_entry->fmt field > perf hists browser: Cleanup hist_browser__fprintf_hierarchy_entry() > perf tools: Remove nr_sort_keys field > perf tools: Recalc total periods using top-level entries in hierarchy > perf tools: Add sort__has_comm variable > perf hists browser: Allow thread filtering for comm sort key > perf hists browser: Check sort keys before hot key actions > > Steven Rostedt (1): > tools lib traceevent: Add '~' operation within arg_num_eval() > > tools/lib/traceevent/event-parse.c | 6 + > tools/perf/Documentation/perf-stat.txt | 27 ++++ > tools/perf/arch/arm/Makefile | 1 + > tools/perf/arch/arm64/Makefile | 1 + > tools/perf/arch/powerpc/Makefile | 1 + > tools/perf/arch/x86/Makefile | 1 + > tools/perf/builtin-inject.c | 12 +- > tools/perf/builtin-stat.c | 244 +++++++++++++++++++++++++++++++-- > tools/perf/config/Makefile | 7 + > tools/perf/ui/browsers/hists.c | 73 ++++++---- > tools/perf/ui/hist.c | 3 - > tools/perf/util/Build | 3 + > tools/perf/util/evsel.h | 6 +- > tools/perf/util/hist.c | 144 +++++++++++++++++-- > tools/perf/util/hist.h | 6 +- > tools/perf/util/pmu.c | 4 +- > tools/perf/util/sort.c | 147 +++++++++----------- > tools/perf/util/sort.h | 2 +- > 18 files changed, 542 insertions(+), 146 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-02-26 23:18 Arnaldo Carvalho de Melo 2016-02-27 9:36 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-26 23:18 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexei Starovoitov, Andi Kleen, David Ahern, Jiri Olsa, Kan Liang, Li Zefan, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, pi3orama, Stephane Eranian, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 06466212a69c0511c5dcff7363c207ffc8913731: Merge tag 'perf-core-for-mingo-20160224' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-25 08:20:56 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160226 for you to fetch changes up to 1d6c9407d45dd622b277ca9f725da3cc9e95b5de: perf trace: Print content of bpf-output event (2016-02-26 19:57:07 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Show extra line telling no entries below --percent-limit are at that --hierarchy level (Namhyung Kim) - 'perf report/top --hierarchy' assorted alignment fixes (Namhyung Kim) - Handle empty print fmts in 'perf script -s' i.e. when running python or perl scripts (Taeung Song) - Improve support for bpf-output events in 'perf trace' (Wang Nan) - Fix parsing of pmu events with empty list of modifiers, this cures a perf/core-only regression where '-e intel_pt//' got broken (Arnaldo Carvalho de Melo) Infrastructure: - Improve missing OpenJDK devel files error message in jvmti Makefile (Stephane Eranian) - Remove duplicated code and needless script_spec__findnew() (Taeung Song) - Bring perf_default_config to the very beginning at main(), removing the need for each subcommand to do this (Wang Nan) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (2): perf tools: Use asprintf() for simple string formatting/allocation perf tools: Fix parsing of pmu events with empty list of modifiers Namhyung Kim (10): perf hists: Add more helper functions for the hierarchy mode perf report: Show message for percent limit on stdio perf hists browser: Cleanup hist_browser__update_percent_limit() perf hists browser: Show message for percent limit perf report: Show message for percent limit on gtk perf hists: Fix comparing of dynamic entries perf report: Fix indentation of dynamic entries in hierarchy perf report: Left align dynamic entries in hierarchy perf hists: Fix dynamic entry display in hierarchy perf report: Update column width of dynamic entries Stephane Eranian (1): perf jvmti: improve error message in Makefile Taeung Song (2): perf script: Exception handling when the print fmt is empty perf script: Remove duplicated code and needless script_spec__findnew() Wang Nan (4): perf config: Bring perf_default_config to the very beginning at main() perf tools: Only set filter for tracepoints events perf trace: Call bpf__apply_obj_config in 'perf trace' perf trace: Print content of bpf-output event tools/perf/builtin-diff.c | 2 - tools/perf/builtin-help.c | 2 +- tools/perf/builtin-kmem.c | 4 +- tools/perf/builtin-report.c | 2 +- tools/perf/builtin-script.c | 21 +--- tools/perf/builtin-top.c | 4 +- tools/perf/builtin-trace.c | 46 +++++++- tools/perf/jvmti/Makefile | 17 ++- tools/perf/perf.c | 16 ++- tools/perf/tests/llvm.c | 8 -- tools/perf/ui/browsers/hists.c | 128 +++++++++++++++++++-- tools/perf/ui/gtk/hists.c | 11 ++ tools/perf/ui/hist.c | 22 ++++ tools/perf/ui/stdio/hist.c | 49 ++++++-- tools/perf/util/color.c | 5 +- tools/perf/util/data-convert-bt.c | 2 +- tools/perf/util/evlist.c | 3 + tools/perf/util/help-unknown-cmd.c | 5 +- tools/perf/util/hist.c | 48 +++++++- tools/perf/util/hist.h | 4 + tools/perf/util/parse-events.y | 6 +- .../perf/util/scripting-engines/trace-event-perl.c | 3 + .../util/scripting-engines/trace-event-python.c | 3 + tools/perf/util/sort.c | 30 ++++- tools/perf/util/sort.h | 1 + 25 files changed, 363 insertions(+), 79 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-02-26 23:18 Arnaldo Carvalho de Melo @ 2016-02-27 9:36 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-02-27 9:36 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexei Starovoitov, Andi Kleen, David Ahern, Jiri Olsa, Kan Liang, Li Zefan, Masami Hiramatsu, Namhyung Kim, Peter Zijlstra, pi3orama, Stephane Eranian, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 06466212a69c0511c5dcff7363c207ffc8913731: > > Merge tag 'perf-core-for-mingo-20160224' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-25 08:20:56 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160226 > > for you to fetch changes up to 1d6c9407d45dd622b277ca9f725da3cc9e95b5de: > > perf trace: Print content of bpf-output event (2016-02-26 19:57:07 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Show extra line telling no entries below --percent-limit are > at that --hierarchy level (Namhyung Kim) > > - 'perf report/top --hierarchy' assorted alignment fixes (Namhyung Kim) > > - Handle empty print fmts in 'perf script -s' i.e. when running > python or perl scripts (Taeung Song) > > - Improve support for bpf-output events in 'perf trace' (Wang Nan) > > - Fix parsing of pmu events with empty list of modifiers, this > cures a perf/core-only regression where '-e intel_pt//' got > broken (Arnaldo Carvalho de Melo) > > Infrastructure: > > - Improve missing OpenJDK devel files error message in jvmti > Makefile (Stephane Eranian) > > - Remove duplicated code and needless script_spec__findnew() (Taeung Song) > > - Bring perf_default_config to the very beginning at main(), removing > the need for each subcommand to do this (Wang Nan) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (2): > perf tools: Use asprintf() for simple string formatting/allocation > perf tools: Fix parsing of pmu events with empty list of modifiers > > Namhyung Kim (10): > perf hists: Add more helper functions for the hierarchy mode > perf report: Show message for percent limit on stdio > perf hists browser: Cleanup hist_browser__update_percent_limit() > perf hists browser: Show message for percent limit > perf report: Show message for percent limit on gtk > perf hists: Fix comparing of dynamic entries > perf report: Fix indentation of dynamic entries in hierarchy > perf report: Left align dynamic entries in hierarchy > perf hists: Fix dynamic entry display in hierarchy > perf report: Update column width of dynamic entries > > Stephane Eranian (1): > perf jvmti: improve error message in Makefile > > Taeung Song (2): > perf script: Exception handling when the print fmt is empty > perf script: Remove duplicated code and needless script_spec__findnew() > > Wang Nan (4): > perf config: Bring perf_default_config to the very beginning at main() > perf tools: Only set filter for tracepoints events > perf trace: Call bpf__apply_obj_config in 'perf trace' > perf trace: Print content of bpf-output event > > tools/perf/builtin-diff.c | 2 - > tools/perf/builtin-help.c | 2 +- > tools/perf/builtin-kmem.c | 4 +- > tools/perf/builtin-report.c | 2 +- > tools/perf/builtin-script.c | 21 +--- > tools/perf/builtin-top.c | 4 +- > tools/perf/builtin-trace.c | 46 +++++++- > tools/perf/jvmti/Makefile | 17 ++- > tools/perf/perf.c | 16 ++- > tools/perf/tests/llvm.c | 8 -- > tools/perf/ui/browsers/hists.c | 128 +++++++++++++++++++-- > tools/perf/ui/gtk/hists.c | 11 ++ > tools/perf/ui/hist.c | 22 ++++ > tools/perf/ui/stdio/hist.c | 49 ++++++-- > tools/perf/util/color.c | 5 +- > tools/perf/util/data-convert-bt.c | 2 +- > tools/perf/util/evlist.c | 3 + > tools/perf/util/help-unknown-cmd.c | 5 +- > tools/perf/util/hist.c | 48 +++++++- > tools/perf/util/hist.h | 4 + > tools/perf/util/parse-events.y | 6 +- > .../perf/util/scripting-engines/trace-event-perl.c | 3 + > .../util/scripting-engines/trace-event-python.c | 3 + > tools/perf/util/sort.c | 30 ++++- > tools/perf/util/sort.h | 1 + > 25 files changed, 363 insertions(+), 79 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2016-02-05 16:25 Arnaldo Carvalho de Melo 2016-02-09 9:40 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-02-05 16:25 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Carl Love, David Ahern, Jiri Olsa, John McCutchan, Marcin Ślusarz, Namhyung Kim, Pawel Moll, Peter Zijlstra, Sonny Rao, Stephane Eranian, Sukadev Bhattiprolu, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit d3aaf09f889b31f3b424bf9603b163ec1204c361: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-04 08:58:01 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo for you to fetch changes up to 598b7c6919c7bbcc1243009721a01bc12275ff3e: perf jit: add source line info support (2016-02-05 12:33:09 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible fixes: - Handle spaces in file names obtained from /proc/pid/maps (Marcin Ślusarz) New features: - Improved support for java, using the JVMTI agent library to do jitdumps that then will be inserted in synthesized PERF_RECORD_MMAP2 events via 'perf inject' pointed to synthesized ELF files stored in ~/.debug and keyed with build-ids, to allow symbol resolution and even annotation with source line info, see the changeset comments to see how to use it (Stephane Eranian) Documentation: - Document mmore variables in the 'perf config' man page (Taeung Song) Infrastructure: - Improve a bit the 'make -C tools/perf build-test' output (Arnaldo Carvalho de Melo) - Do 'build-test' in parallell, using 'make -j' (Arnaldo Carvalho de Melo) - Fix handling of 'clean' in multi-target make invokations for parallell builds (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (4): perf build tests: Elide "-f Makefile" from make invokation perf build tests: Move the feature related vars to the front of the make cmdline perf build tests: Do parallell builds with 'build-test' perf inject: Make sure mmap records are ordered when injecting build_ids Jiri Olsa (1): perf tools: Fix parallel build including 'clean' target Marcin Ślusarz (1): perf tools: handle spaces in file names obtained from /proc/pid/maps Stephane Eranian (5): perf symbols: add Java demangling support perf build: Add libcrypto feature detection perf inject: Add jitdump mmap injection support perf tools: add JVMTI agent library perf jit: add source line info support Taeung Song (8): perf config: Document 'ui.show-headers' variable in man page perf config: Document variables for 'call-graph' section in man page perf config: Document variables for 'report' section in man page perf config: Document 'top.children' variable in man page perf config: Document 'man.viewer' variable in man page perf config: Document 'pager.<subcommand>' variables in man page perf config: Document 'kmem.default' variable in man page perf config: Document 'record.build-id' variable in man page tools/build/Makefile.feature | 2 + tools/build/feature/Makefile | 4 + tools/build/feature/test-all.c | 5 + tools/build/feature/test-libcrypto.c | 17 + tools/perf/Documentation/perf-config.txt | 143 +++++++ tools/perf/Documentation/perf-inject.txt | 7 + tools/perf/Makefile | 16 +- tools/perf/Makefile.perf | 3 + tools/perf/builtin-inject.c | 107 ++++- tools/perf/config/Makefile | 11 + tools/perf/jvmti/Makefile | 76 ++++ tools/perf/jvmti/jvmti_agent.c | 465 +++++++++++++++++++++ tools/perf/jvmti/jvmti_agent.h | 36 ++ tools/perf/jvmti/libjvmti.c | 304 ++++++++++++++ tools/perf/tests/make | 11 +- tools/perf/util/Build | 6 + tools/perf/util/demangle-java.c | 199 +++++++++ tools/perf/util/demangle-java.h | 10 + tools/perf/util/event.c | 2 +- tools/perf/util/genelf.c | 449 +++++++++++++++++++++ tools/perf/util/genelf.h | 67 +++ tools/perf/util/genelf_debug.c | 610 ++++++++++++++++++++++++++++ tools/perf/util/jit.h | 15 + tools/perf/util/jitdump.c | 672 +++++++++++++++++++++++++++++++ tools/perf/util/jitdump.h | 124 ++++++ tools/perf/util/symbol-elf.c | 3 + 26 files changed, 3357 insertions(+), 7 deletions(-) create mode 100644 tools/build/feature/test-libcrypto.c create mode 100644 tools/perf/jvmti/Makefile create mode 100644 tools/perf/jvmti/jvmti_agent.c create mode 100644 tools/perf/jvmti/jvmti_agent.h create mode 100644 tools/perf/jvmti/libjvmti.c create mode 100644 tools/perf/util/demangle-java.c create mode 100644 tools/perf/util/demangle-java.h create mode 100644 tools/perf/util/genelf.c create mode 100644 tools/perf/util/genelf.h create mode 100644 tools/perf/util/genelf_debug.c create mode 100644 tools/perf/util/jit.h create mode 100644 tools/perf/util/jitdump.c create mode 100644 tools/perf/util/jitdump.h ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2016-02-05 16:25 Arnaldo Carvalho de Melo @ 2016-02-09 9:40 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2016-02-09 9:40 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Andi Kleen, Carl Love, David Ahern, Jiri Olsa, John McCutchan, Marcin Ślusarz, Namhyung Kim, Pawel Moll, Peter Zijlstra, Sonny Rao, Stephane Eranian, Sukadev Bhattiprolu, Taeung Song, Wang Nan, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit d3aaf09f889b31f3b424bf9603b163ec1204c361: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-04 08:58:01 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo > > for you to fetch changes up to 598b7c6919c7bbcc1243009721a01bc12275ff3e: > > perf jit: add source line info support (2016-02-05 12:33:09 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible fixes: > > - Handle spaces in file names obtained from /proc/pid/maps (Marcin Ślusarz) > > New features: > > - Improved support for java, using the JVMTI agent library to do jitdumps > that then will be inserted in synthesized PERF_RECORD_MMAP2 events via > 'perf inject' pointed to synthesized ELF files stored in ~/.debug and > keyed with build-ids, to allow symbol resolution and even annotation with > source line info, see the changeset comments to see how to use it (Stephane Eranian) > > Documentation: > > - Document mmore variables in the 'perf config' man page (Taeung Song) > > Infrastructure: > > - Improve a bit the 'make -C tools/perf build-test' output (Arnaldo Carvalho de Melo) > > - Do 'build-test' in parallell, using 'make -j' (Arnaldo Carvalho de Melo) > > - Fix handling of 'clean' in multi-target make invokations for parallell builds (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (4): > perf build tests: Elide "-f Makefile" from make invokation > perf build tests: Move the feature related vars to the front of the make cmdline > perf build tests: Do parallell builds with 'build-test' > perf inject: Make sure mmap records are ordered when injecting build_ids > > Jiri Olsa (1): > perf tools: Fix parallel build including 'clean' target > > Marcin Ślusarz (1): > perf tools: handle spaces in file names obtained from /proc/pid/maps > > Stephane Eranian (5): > perf symbols: add Java demangling support > perf build: Add libcrypto feature detection > perf inject: Add jitdump mmap injection support > perf tools: add JVMTI agent library > perf jit: add source line info support > > Taeung Song (8): > perf config: Document 'ui.show-headers' variable in man page > perf config: Document variables for 'call-graph' section in man page > perf config: Document variables for 'report' section in man page > perf config: Document 'top.children' variable in man page > perf config: Document 'man.viewer' variable in man page > perf config: Document 'pager.<subcommand>' variables in man page > perf config: Document 'kmem.default' variable in man page > perf config: Document 'record.build-id' variable in man page > > tools/build/Makefile.feature | 2 + > tools/build/feature/Makefile | 4 + > tools/build/feature/test-all.c | 5 + > tools/build/feature/test-libcrypto.c | 17 + > tools/perf/Documentation/perf-config.txt | 143 +++++++ > tools/perf/Documentation/perf-inject.txt | 7 + > tools/perf/Makefile | 16 +- > tools/perf/Makefile.perf | 3 + > tools/perf/builtin-inject.c | 107 ++++- > tools/perf/config/Makefile | 11 + > tools/perf/jvmti/Makefile | 76 ++++ > tools/perf/jvmti/jvmti_agent.c | 465 +++++++++++++++++++++ > tools/perf/jvmti/jvmti_agent.h | 36 ++ > tools/perf/jvmti/libjvmti.c | 304 ++++++++++++++ > tools/perf/tests/make | 11 +- > tools/perf/util/Build | 6 + > tools/perf/util/demangle-java.c | 199 +++++++++ > tools/perf/util/demangle-java.h | 10 + > tools/perf/util/event.c | 2 +- > tools/perf/util/genelf.c | 449 +++++++++++++++++++++ > tools/perf/util/genelf.h | 67 +++ > tools/perf/util/genelf_debug.c | 610 ++++++++++++++++++++++++++++ > tools/perf/util/jit.h | 15 + > tools/perf/util/jitdump.c | 672 +++++++++++++++++++++++++++++++ > tools/perf/util/jitdump.h | 124 ++++++ > tools/perf/util/symbol-elf.c | 3 + > 26 files changed, 3357 insertions(+), 7 deletions(-) > create mode 100644 tools/build/feature/test-libcrypto.c > create mode 100644 tools/perf/jvmti/Makefile > create mode 100644 tools/perf/jvmti/jvmti_agent.c > create mode 100644 tools/perf/jvmti/jvmti_agent.h > create mode 100644 tools/perf/jvmti/libjvmti.c > create mode 100644 tools/perf/util/demangle-java.c > create mode 100644 tools/perf/util/demangle-java.h > create mode 100644 tools/perf/util/genelf.c > create mode 100644 tools/perf/util/genelf.h > create mode 100644 tools/perf/util/genelf_debug.c > create mode 100644 tools/perf/util/jit.h > create mode 100644 tools/perf/util/jitdump.c > create mode 100644 tools/perf/util/jitdump.h Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2015-04-08 14:23 Arnaldo Carvalho de Melo 2015-04-08 15:05 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2015-04-08 14:23 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Alexander Shishkin, Andi Kleen, Andrew Morton, Borislav Petkov, David Ahern, Frederic Weisbecker, He Kuang, H. Peter Anvin, Jiri Olsa, John Stultz, Joonsoo Kim, Kaixu Xia, Kan Liang, Linus Torvalds, linux-mm, Markus T Metzger, Masami Hiramatsu, Mathieu Poirier, Mike Galbraith, Minchan Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama, Robert Richter, Stephane Eranian, Steven Rostedt, Thomas Gleixner, Wang Nan, William Cohen, Yunlong Song, Zefan Li, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, it is the pull req from yesterday, minus a patch that introduced a problem, plus a fex fixes. I am investigating a problem I noticed for another patch that is upstream and after that will get back to the removed patch from yesterday's batch, - Arnaldo The following changes since commit 6645f3187f5beb64f7a40515cfa18f3889264ece: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-04-03 07:00:02 +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 for you to fetch changes up to a1e12da4796a4ddd0e911687a290eb396d1c64bf: perf tools: Add 'I' event modifier for exclude_idle bit (2015-04-08 11:00:16 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: - Teach about perf_event_attr.clockid to 'perf record' (Peter Zijlstra) - perf sched replay improvements for high CPU core count machines (Yunlong Song) - Consider PERF_RECORD_ events with cpumode == 0 in 'perf top', removing one cause of long term memory usage buildup, i.e. not processing PERF_RECORD_EXIT events (Arnaldo Carvalho de Melo) - Add 'I' event modifier for perf_event_attr.exclude_idle bit (Jiri Olsa) - Respect -i option 'in perf kmem' (Jiri Olsa) Infrastructure: - Honor operator priority in libtraceevent (Namhyung Kim) - Merge all perf_event_attr print functions (Peter Zijlstra) - Check kmaps access to make code more robust (Wang Nan) - Fix inverted logic in perf_mmap__empty() (He Kuang) - Fix ARM 32 'perf probe' building error (Wang Nan) - Fix perf_event_attr tests (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- He Kuang (1): perf evlist: Fix inverted logic in perf_mmap__empty Jiri Olsa (3): perf kmem: Respect -i option perf tests: Fix attr tests perf tools: Add 'I' event modifier for exclude_idle bit Namhyung Kim (1): tools lib traceevent: Honor operator priority Peter Zijlstra (2): perf record: Add clockid parameter perf tools: Merge all perf_event_attr print functions Wang Nan (3): perf kmaps: Check kmaps to make code more robust perf probe: Fix ARM 32 building error perf report: Don't call map__kmap if map is NULL. Yunlong Song (9): perf sched replay: Use struct task_desc instead of struct task_task for correct meaning perf sched replay: Increase the MAX_PID value to fix assertion failure problem perf sched replay: Alloc the memory of pid_to_task dynamically to adapt to the unexpected change of pid_max perf sched replay: Realloc the memory of pid_to_task stepwise to adapt to the different pid_max configurations perf sched replay: Fix the segmentation fault problem caused by pr_err in threads perf sched replay: Handle the dead halt of sem_wait when create_tasks() fails for any task perf sched replay: Fix the EMFILE error caused by the limitation of the maximum open files perf sched replay: Support using -f to override perf.data file ownership perf sched replay: Use replay_repeat to calculate the runavg of cpu usage instead of the default value 10 tools/lib/traceevent/event-parse.c | 17 +- tools/perf/Documentation/perf-list.txt | 1 + tools/perf/Documentation/perf-record.txt | 7 + tools/perf/builtin-kmem.c | 3 +- tools/perf/builtin-record.c | 87 +++++++++ tools/perf/builtin-report.c | 2 +- tools/perf/builtin-sched.c | 67 +++++-- tools/perf/perf.h | 2 + tools/perf/tests/attr/base-record | 2 +- tools/perf/tests/attr/base-stat | 2 +- tools/perf/tests/parse-events.c | 40 ++++ tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 325 ++++++++++++++++--------------- tools/perf/util/evsel.h | 6 + tools/perf/util/header.c | 28 +-- tools/perf/util/machine.c | 5 +- tools/perf/util/map.c | 20 ++ tools/perf/util/map.h | 6 +- tools/perf/util/parse-events.c | 8 +- tools/perf/util/parse-events.l | 2 +- tools/perf/util/probe-event.c | 5 +- tools/perf/util/session.c | 3 + tools/perf/util/symbol-elf.c | 16 +- tools/perf/util/symbol.c | 34 +++- 24 files changed, 477 insertions(+), 213 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2015-04-08 14:23 Arnaldo Carvalho de Melo @ 2015-04-08 15:05 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2015-04-08 15:05 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Andi Kleen, Andrew Morton, Borislav Petkov, David Ahern, Frederic Weisbecker, He Kuang, H. Peter Anvin, Jiri Olsa, John Stultz, Joonsoo Kim, Kaixu Xia, Kan Liang, Linus Torvalds, linux-mm, Markus T Metzger, Masami Hiramatsu, Mathieu Poirier, Mike Galbraith, Minchan Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama, Robert Richter, Stephane Eranian, Steven Rostedt, Thomas Gleixner, Wang Nan, William Cohen, Yunlong Song, Zefan Li, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, it is the pull req from yesterday, minus a patch > that introduced a problem, plus a fex fixes. > > I am investigating a problem I noticed for another patch that is upstream > and after that will get back to the removed patch from yesterday's batch, > > - Arnaldo > > The following changes since commit 6645f3187f5beb64f7a40515cfa18f3889264ece: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-04-03 07:00:02 +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 > > for you to fetch changes up to a1e12da4796a4ddd0e911687a290eb396d1c64bf: > > perf tools: Add 'I' event modifier for exclude_idle bit (2015-04-08 11:00:16 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > - Teach about perf_event_attr.clockid to 'perf record' (Peter Zijlstra) > > - perf sched replay improvements for high CPU core count machines (Yunlong Song) > > - Consider PERF_RECORD_ events with cpumode == 0 in 'perf top', removing one > cause of long term memory usage buildup, i.e. not processing PERF_RECORD_EXIT > events (Arnaldo Carvalho de Melo) > > - Add 'I' event modifier for perf_event_attr.exclude_idle bit (Jiri Olsa) > > - Respect -i option 'in perf kmem' (Jiri Olsa) > > Infrastructure: > > - Honor operator priority in libtraceevent (Namhyung Kim) > > - Merge all perf_event_attr print functions (Peter Zijlstra) > > - Check kmaps access to make code more robust (Wang Nan) > > - Fix inverted logic in perf_mmap__empty() (He Kuang) > > - Fix ARM 32 'perf probe' building error (Wang Nan) > > - Fix perf_event_attr tests (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > He Kuang (1): > perf evlist: Fix inverted logic in perf_mmap__empty > > Jiri Olsa (3): > perf kmem: Respect -i option > perf tests: Fix attr tests > perf tools: Add 'I' event modifier for exclude_idle bit > > Namhyung Kim (1): > tools lib traceevent: Honor operator priority > > Peter Zijlstra (2): > perf record: Add clockid parameter > perf tools: Merge all perf_event_attr print functions > > Wang Nan (3): > perf kmaps: Check kmaps to make code more robust > perf probe: Fix ARM 32 building error > perf report: Don't call map__kmap if map is NULL. > > Yunlong Song (9): > perf sched replay: Use struct task_desc instead of struct task_task for correct meaning > perf sched replay: Increase the MAX_PID value to fix assertion failure problem > perf sched replay: Alloc the memory of pid_to_task dynamically to adapt to the unexpected change of pid_max > perf sched replay: Realloc the memory of pid_to_task stepwise to adapt to the different pid_max configurations > perf sched replay: Fix the segmentation fault problem caused by pr_err in threads > perf sched replay: Handle the dead halt of sem_wait when create_tasks() fails for any task > perf sched replay: Fix the EMFILE error caused by the limitation of the maximum open files > perf sched replay: Support using -f to override perf.data file ownership > perf sched replay: Use replay_repeat to calculate the runavg of cpu usage instead of the default value 10 > > tools/lib/traceevent/event-parse.c | 17 +- > tools/perf/Documentation/perf-list.txt | 1 + > tools/perf/Documentation/perf-record.txt | 7 + > tools/perf/builtin-kmem.c | 3 +- > tools/perf/builtin-record.c | 87 +++++++++ > tools/perf/builtin-report.c | 2 +- > tools/perf/builtin-sched.c | 67 +++++-- > tools/perf/perf.h | 2 + > tools/perf/tests/attr/base-record | 2 +- > tools/perf/tests/attr/base-stat | 2 +- > tools/perf/tests/parse-events.c | 40 ++++ > tools/perf/util/evlist.c | 2 +- > tools/perf/util/evsel.c | 325 ++++++++++++++++--------------- > tools/perf/util/evsel.h | 6 + > tools/perf/util/header.c | 28 +-- > tools/perf/util/machine.c | 5 +- > tools/perf/util/map.c | 20 ++ > tools/perf/util/map.h | 6 +- > tools/perf/util/parse-events.c | 8 +- > tools/perf/util/parse-events.l | 2 +- > tools/perf/util/probe-event.c | 5 +- > tools/perf/util/session.c | 3 + > tools/perf/util/symbol-elf.c | 16 +- > tools/perf/util/symbol.c | 34 +++- > 24 files changed, 477 insertions(+), 213 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2015-03-21 18:54 Arnaldo Carvalho de Melo 2015-03-22 9:58 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2015-03-21 18:54 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Borislav Petkov, Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, Jiri Olsa, Masami Hiramatsu, Mike Galbraith, Milos Vyletel, Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama, Stephane Eranian, Steven Rostedt, Wang Nan, Yunlong Song, Zefan Li, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, this is on top of my previous pull request, Thanks, - Arnaldo The following changes since commit 0c8c20779c5d56b93b8cb4cd30ba129a927ab437: perf report: Don't allow empty argument for '-t'. (2015-03-19 13:53:28 -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-2 for you to fetch changes up to ca33380adf74afb985bf7aab09ec46707a5d2d57: perf tools: Use kmod_path__parse for machine__new_dso (2015-03-21 14:58:07 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: - Handle legacy syscalls tracepoints (David Ahern, Arnaldo Carvalho de Melo) - Indicate which callchain entries are annotated in the TUI hists browser (report/top) (Arnaldo Carvalho de Melo) - Fix failure to add multiple probes without debuginfo (He Kuang) - Fix 'trace' summary_only option (David Ahern) - Fix race in build_id_cache__add_s() in 'buildid-cache' (Milos Vyletel) - Don't allow empty argument for field-separator, fixing segfault (Wang Nan) Infrastructure: - Add destructor for format_field in libtraceevent (David Ahern) - Prep work for support lzma compressed kernel modules (Jiri Olsa) - Update .gitignore with recently added/renamed feature detection files (Yunlong Song) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (2): perf trace: Handle legacy syscalls tracepoints perf hists browser: Indicate which callchain entries are annotated David Ahern (2): perf trace: Fix summary_only option tools lib traceevent: Add destructor for format_field He Kuang (1): perf probe: Fix failure to add multiple probes without debuginfo Jiri Olsa (10): perf build: Fix feature_check name clash perf build: Separate feature make support into config/Makefile.feature perf build: Make features checks directory configurable perf build: Move feature checks code under tools/build tools build: Add feature check for lzma library perf tools: Add lzma decompression support for kernel module perf tools: Add kmod_path__parse function perf tools: Add dsos__addnew function perf tools: Add machine__module_dso function perf tools: Use kmod_path__parse for machine__new_dso Milos Vyletel (1): perf tools: Fix race in build_id_cache__add_s() Wang Nan (1): perf tools: Don't allow empty argument for field-separator Yunlong Song (2): perf build: Use FEATURE-DUMP instead of PERF-FEATURES in the .gitignore file perf build: Add config/feature-checks/*.output to the .gitignore file tools/build/Makefile.feature | 171 ++++++++++++++++++++ .../feature-checks => build/feature}/.gitignore | 1 + .../feature-checks => build/feature}/Makefile | 8 +- .../feature-checks => build/feature}/test-all.c | 5 + .../feature}/test-backtrace.c | 0 .../feature-checks => build/feature}/test-bionic.c | 0 .../feature}/test-compile.c | 0 .../feature}/test-cplus-demangle.c | 0 .../feature-checks => build/feature}/test-dwarf.c | 0 .../feature}/test-fortify-source.c | 0 .../feature-checks => build/feature}/test-glibc.c | 0 .../feature}/test-gtk2-infobar.c | 0 .../feature-checks => build/feature}/test-gtk2.c | 0 .../feature-checks => build/feature}/test-hello.c | 0 .../feature}/test-libaudit.c | 0 .../feature}/test-libbabeltrace.c | 0 .../feature-checks => build/feature}/test-libbfd.c | 0 .../feature}/test-libdw-dwarf-unwind.c | 0 .../feature}/test-libelf-getphdrnum.c | 0 .../feature}/test-libelf-mmap.c | 0 .../feature-checks => build/feature}/test-libelf.c | 0 .../feature}/test-libnuma.c | 0 .../feature}/test-libperl.c | 0 .../feature}/test-libpython-version.c | 0 .../feature}/test-libpython.c | 0 .../feature}/test-libslang.c | 0 .../feature}/test-libunwind-debug-frame.c | 0 .../feature}/test-libunwind.c | 0 tools/build/feature/test-lzma.c | 10 ++ .../feature}/test-pthread-attr-setaffinity-np.c | 0 .../feature}/test-stackprotector-all.c | 0 .../feature}/test-sync-compare-and-swap.c | 0 .../feature}/test-timerfd.c | 0 .../feature-checks => build/feature}/test-zlib.c | 0 tools/lib/traceevent/event-parse.c | 11 +- tools/lib/traceevent/event-parse.h | 1 + tools/perf/.gitignore | 2 +- tools/perf/Makefile.perf | 4 +- tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-mem.c | 2 +- tools/perf/builtin-trace.c | 21 ++- tools/perf/config/Makefile | 176 ++------------------- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/kmod-path.c | 73 +++++++++ tools/perf/tests/tests.h | 1 + tools/perf/ui/browsers/hists.c | 4 +- tools/perf/util/Build | 1 + tools/perf/util/build-id.c | 3 +- tools/perf/util/dso.c | 90 +++++++++-- tools/perf/util/dso.h | 15 ++ tools/perf/util/lzma.c | 95 +++++++++++ tools/perf/util/machine.c | 83 +++++----- tools/perf/util/probe-event.c | 4 +- tools/perf/util/util.h | 4 + 55 files changed, 557 insertions(+), 235 deletions(-) create mode 100644 tools/build/Makefile.feature rename tools/{perf/config/feature-checks => build/feature}/.gitignore (52%) rename tools/{perf/config/feature-checks => build/feature}/Makefile (96%) rename tools/{perf/config/feature-checks => build/feature}/test-all.c (97%) rename tools/{perf/config/feature-checks => build/feature}/test-backtrace.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-bionic.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-compile.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-cplus-demangle.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-dwarf.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-fortify-source.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-glibc.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-gtk2-infobar.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-gtk2.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-hello.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libaudit.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libbabeltrace.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libbfd.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libdw-dwarf-unwind.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libelf-getphdrnum.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libelf-mmap.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libelf.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libnuma.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libperl.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libpython-version.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libpython.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libslang.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libunwind-debug-frame.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-libunwind.c (100%) create mode 100644 tools/build/feature/test-lzma.c rename tools/{perf/config/feature-checks => build/feature}/test-pthread-attr-setaffinity-np.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-stackprotector-all.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-sync-compare-and-swap.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-timerfd.c (100%) rename tools/{perf/config/feature-checks => build/feature}/test-zlib.c (100%) create mode 100644 tools/perf/tests/kmod-path.c create mode 100644 tools/perf/util/lzma.c ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2015-03-21 18:54 Arnaldo Carvalho de Melo @ 2015-03-22 9:58 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2015-03-22 9:58 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Adrian Hunter, Borislav Petkov, Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker, He Kuang, Jiri Olsa, Masami Hiramatsu, Mike Galbraith, Milos Vyletel, Namhyung Kim, Paul Mackerras, Peter Zijlstra, pi3orama, Stephane Eranian, Steven Rostedt, Wang Nan, Yunlong Song, Zefan Li, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, this is on top of my previous pull request, > > Thanks, > > - Arnaldo > > The following changes since commit 0c8c20779c5d56b93b8cb4cd30ba129a927ab437: > > perf report: Don't allow empty argument for '-t'. (2015-03-19 13:53:28 -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-2 > > for you to fetch changes up to ca33380adf74afb985bf7aab09ec46707a5d2d57: > > perf tools: Use kmod_path__parse for machine__new_dso (2015-03-21 14:58:07 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > - Handle legacy syscalls tracepoints (David Ahern, Arnaldo Carvalho de Melo) > > - Indicate which callchain entries are annotated in the > TUI hists browser (report/top) (Arnaldo Carvalho de Melo) > > - Fix failure to add multiple probes without debuginfo (He Kuang) > > - Fix 'trace' summary_only option (David Ahern) > > - Fix race in build_id_cache__add_s() in 'buildid-cache' (Milos Vyletel) > > - Don't allow empty argument for field-separator, fixing segfault (Wang Nan) > > Infrastructure: > > - Add destructor for format_field in libtraceevent (David Ahern) > > - Prep work for support lzma compressed kernel modules (Jiri Olsa) > > - Update .gitignore with recently added/renamed feature detection files (Yunlong Song) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (2): > perf trace: Handle legacy syscalls tracepoints > perf hists browser: Indicate which callchain entries are annotated > > David Ahern (2): > perf trace: Fix summary_only option > tools lib traceevent: Add destructor for format_field > > He Kuang (1): > perf probe: Fix failure to add multiple probes without debuginfo > > Jiri Olsa (10): > perf build: Fix feature_check name clash > perf build: Separate feature make support into config/Makefile.feature > perf build: Make features checks directory configurable > perf build: Move feature checks code under tools/build > tools build: Add feature check for lzma library > perf tools: Add lzma decompression support for kernel module > perf tools: Add kmod_path__parse function > perf tools: Add dsos__addnew function > perf tools: Add machine__module_dso function > perf tools: Use kmod_path__parse for machine__new_dso > > Milos Vyletel (1): > perf tools: Fix race in build_id_cache__add_s() > > Wang Nan (1): > perf tools: Don't allow empty argument for field-separator > > Yunlong Song (2): > perf build: Use FEATURE-DUMP instead of PERF-FEATURES in the .gitignore file > perf build: Add config/feature-checks/*.output to the .gitignore file > > tools/build/Makefile.feature | 171 ++++++++++++++++++++ > .../feature-checks => build/feature}/.gitignore | 1 + > .../feature-checks => build/feature}/Makefile | 8 +- > .../feature-checks => build/feature}/test-all.c | 5 + > .../feature}/test-backtrace.c | 0 > .../feature-checks => build/feature}/test-bionic.c | 0 > .../feature}/test-compile.c | 0 > .../feature}/test-cplus-demangle.c | 0 > .../feature-checks => build/feature}/test-dwarf.c | 0 > .../feature}/test-fortify-source.c | 0 > .../feature-checks => build/feature}/test-glibc.c | 0 > .../feature}/test-gtk2-infobar.c | 0 > .../feature-checks => build/feature}/test-gtk2.c | 0 > .../feature-checks => build/feature}/test-hello.c | 0 > .../feature}/test-libaudit.c | 0 > .../feature}/test-libbabeltrace.c | 0 > .../feature-checks => build/feature}/test-libbfd.c | 0 > .../feature}/test-libdw-dwarf-unwind.c | 0 > .../feature}/test-libelf-getphdrnum.c | 0 > .../feature}/test-libelf-mmap.c | 0 > .../feature-checks => build/feature}/test-libelf.c | 0 > .../feature}/test-libnuma.c | 0 > .../feature}/test-libperl.c | 0 > .../feature}/test-libpython-version.c | 0 > .../feature}/test-libpython.c | 0 > .../feature}/test-libslang.c | 0 > .../feature}/test-libunwind-debug-frame.c | 0 > .../feature}/test-libunwind.c | 0 > tools/build/feature/test-lzma.c | 10 ++ > .../feature}/test-pthread-attr-setaffinity-np.c | 0 > .../feature}/test-stackprotector-all.c | 0 > .../feature}/test-sync-compare-and-swap.c | 0 > .../feature}/test-timerfd.c | 0 > .../feature-checks => build/feature}/test-zlib.c | 0 > tools/lib/traceevent/event-parse.c | 11 +- > tools/lib/traceevent/event-parse.h | 1 + > tools/perf/.gitignore | 2 +- > tools/perf/Makefile.perf | 4 +- > tools/perf/builtin-diff.c | 2 +- > tools/perf/builtin-mem.c | 2 +- > tools/perf/builtin-trace.c | 21 ++- > tools/perf/config/Makefile | 176 ++------------------- > tools/perf/tests/Build | 1 + > tools/perf/tests/builtin-test.c | 4 + > tools/perf/tests/kmod-path.c | 73 +++++++++ > tools/perf/tests/tests.h | 1 + > tools/perf/ui/browsers/hists.c | 4 +- > tools/perf/util/Build | 1 + > tools/perf/util/build-id.c | 3 +- > tools/perf/util/dso.c | 90 +++++++++-- > tools/perf/util/dso.h | 15 ++ > tools/perf/util/lzma.c | 95 +++++++++++ > tools/perf/util/machine.c | 83 +++++----- > tools/perf/util/probe-event.c | 4 +- > tools/perf/util/util.h | 4 + > 55 files changed, 557 insertions(+), 235 deletions(-) > create mode 100644 tools/build/Makefile.feature > rename tools/{perf/config/feature-checks => build/feature}/.gitignore (52%) > rename tools/{perf/config/feature-checks => build/feature}/Makefile (96%) > rename tools/{perf/config/feature-checks => build/feature}/test-all.c (97%) > rename tools/{perf/config/feature-checks => build/feature}/test-backtrace.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-bionic.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-compile.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-cplus-demangle.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-dwarf.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-fortify-source.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-glibc.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-gtk2-infobar.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-gtk2.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-hello.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libaudit.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libbabeltrace.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libbfd.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libdw-dwarf-unwind.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libelf-getphdrnum.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libelf-mmap.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libelf.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libnuma.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libperl.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libpython-version.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libpython.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libslang.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libunwind-debug-frame.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-libunwind.c (100%) > create mode 100644 tools/build/feature/test-lzma.c > rename tools/{perf/config/feature-checks => build/feature}/test-pthread-attr-setaffinity-np.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-stackprotector-all.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-sync-compare-and-swap.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-timerfd.c (100%) > rename tools/{perf/config/feature-checks => build/feature}/test-zlib.c (100%) > create mode 100644 tools/perf/tests/kmod-path.c > create mode 100644 tools/perf/util/lzma.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2015-02-27 19:22 Arnaldo Carvalho de Melo 0 siblings, 0 replies; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2015-02-27 19:22 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen, Borislav Petkov, David Ahern, He Kuang, Hemant Kumar, Jiri Olsa, Kan Liang, Masami Hiramatsu, Namhyung Kim, Naohiro Aota, Paul Mackerras, Peter Zijlstra, Wang Nan, Yunlong Song, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 0afb1704010f60e7ae85aef0f93fc10f2d99761e: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-02-26 12:25:20 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo for you to fetch changes up to fefd2d9619de3bf0bf02a8622e9f445c3d19cc3f: perf report: Fix branch stack mode cannot be set (2015-02-27 15:52:42 -0300) ---------------------------------------------------------------- perf/core improvements and fixes: User visible: - Fix SIGBUS failures due to misaligned accesses in Sparc64 (David Ahern) - Fix branch stack mode in 'perf report' (He Kuang) - Fix a 'perf probe' operator precedence bug (He Kuang) - Fix Support for different binaries with same name in 'perf diff' (Kan Liang) - Check kprobes blacklist when adding new events via 'perf probe' (Masami Hiramatsu) - Add --purge FILE to remove all caches of FILE in 'perf buildid-cache' (Masami Hiramatsu) - Show usage with some incorrect params (Masami Hiramatsu) - Add new buildid cache if update target is not cached in 'buildid-cache' (Masami Hiramatsu) - Allow listing events with 'tracepoint' prefix in 'perf list' (Yunlong Song) - Sort the output of 'perf list' (Yunlong Song) - Fix bash completion of 'perf --' (Yunlong Song) Developer Zone: - Handle strdup() failure path in 'perf probe' (Arnaldo Carvalho de Melo) - Fix get_real_path to free allocated memory in error path in 'perf probe' (Masami Hiramatsu) - Use pr_debug instead of verbose && pr_info perf buildid-cache (Masami Hiramatsu) - Fix building of 'perf data' with some gcc versions due to incorrect array struct entry (Yunlong Song) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Arnaldo Carvalho de Melo (1): perf probe: Handle strdup() failure David Ahern (1): perf trace: Fix SIGBUS failures due to misaligned accesses He Kuang (2): perf probe: Fix a precedence bug perf report: Fix branch stack mode cannot be set Kan Liang (1): perf diff: Support for different binaries Masami Hiramatsu (6): perf probe: Check kprobes blacklist when adding new events perf probe: Fix get_real_path to free allocated memory in error path perf buildid-cache: Add new buildid cache if update target is not cached perf buildid-cache: Add --purge FILE to remove all caches of FILE perf buildid-cache: Use pr_debug instead of verbose && pr_info perf buildid-cache: Show usage with incorrect params Yunlong Song (8): perf data: Fix sentinel setting for data_cmds array perf list: Sort the output of 'perf list' to view more clearly perf list: Allow listing events with 'tracepoint' prefix perf list: Avoid confusion of perf output and the next command prompt perf tools: Remove the '--(null)' long_name for --list-opts perf list: Clean up the printing functions of hardware/software events perf list: Extend raw-dump to certain kind of events perf tools: Fix the bash completion problem of 'perf --*' tools/perf/Documentation/perf-buildid-cache.txt | 24 ++- tools/perf/Documentation/perf-diff.txt | 5 + tools/perf/Documentation/perf-list.txt | 6 + tools/perf/builtin-buildid-cache.c | 72 ++++++-- tools/perf/builtin-data.c | 2 +- tools/perf/builtin-list.c | 27 ++- tools/perf/builtin-report.c | 2 +- tools/perf/builtin-trace.c | 36 +++- tools/perf/perf-completion.sh | 6 +- tools/perf/perf.c | 28 ++++ tools/perf/util/build-id.c | 105 ++++++++++-- tools/perf/util/build-id.h | 4 + tools/perf/util/parse-events.c | 210 +++++++++++++++++------- tools/perf/util/parse-events.h | 11 +- tools/perf/util/parse-options.c | 5 +- tools/perf/util/probe-event.c | 117 ++++++++++++- tools/perf/util/sort.c | 9 + 17 files changed, 542 insertions(+), 127 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2014-01-17 14:57 Arnaldo Carvalho de Melo 2014-01-19 12:11 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2014-01-17 14:57 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, David A. Long, Frederic Weisbecker, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Oleg Nesterov, Paul Mackerras, Peter Zijlstra, Srikar Dronamraju, Stephane Eranian, Steven Rostedt, yrl.pp-manager.tt, Arnaldo Carvalho de Melo From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 3e7e09dbd1080de5dcf10092830e39bc2e2932ec: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-01-16 09:34:01 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo for you to fetch changes up to 2a29190c040c0b11e39197c67abf6f87e0a61f9a: perf tools: Remove unnecessary callchain cursor state restore on unmatch (2014-01-17 11:25:24 -0300) ---------------------------------------------------------------- Developer stuff: . Improve callchain processing by removing unnecessary work. (Frederic Weisbecker) . Fix comm override error handling (Frederic Weisbecker) . Improve 'perf probe' exit path, release resources (Masami Hiramatsu) . Improve libtraceevent plugins exit path, allowing the registering of an unregister handler to be called at exit time (Namhyung Kim) . Add an alias to the build test makefile (make -C tools/perf build-test) (Namhyung Kim) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Frederic Weisbecker (3): perf tools: Do proper comm override error handling perf callchain: Spare double comparison of callchain first entry perf tools: Remove unnecessary callchain cursor state restore on unmatch Masami Hiramatsu (3): perf probe: Release allocated probe_trace_event if failed perf probe: Release all dynamically allocated parameters perf symbols: Export elf_section_by_name and reuse Namhyung Kim (13): tools lib traceevent: Add pevent_unregister_event_handler() tools lib traceevent: Add pevent_unregister_print_function() tools lib traceevent: Unregister handler when function plugin is unloaded tools lib traceevent: Unregister handler when hrtimer plugin is unloaded tools lib traceevent: Unregister handler when kmem plugin is unloaded tools lib traceevent: Unregister handler when kvm plugin is unloaded tools lib traceevent: Unregister handler when sched_switch plugin is unloaded tools lib traceevent: Unregister handler when mac80211 plugin is unloaded tools lib traceevent: Unregister handler when cfg80211 plugin is unloaded tools lib traceevent: Unregister handler when jbd2 plugin is is unloaded tools lib traceevent: Unregister handler when scsi plugin is unloaded tools lib traceevent: Unregister handler when xen plugin is unloaded perf tools: Add 'build-test' make target tools/lib/traceevent/event-parse.c | 136 ++++++++++++++++++++++++++--- tools/lib/traceevent/event-parse.h | 5 ++ tools/lib/traceevent/plugin_cfg80211.c | 6 ++ tools/lib/traceevent/plugin_function.c | 3 + tools/lib/traceevent/plugin_hrtimer.c | 10 +++ tools/lib/traceevent/plugin_jbd2.c | 9 ++ tools/lib/traceevent/plugin_kmem.c | 22 +++++ tools/lib/traceevent/plugin_kvm.c | 29 ++++++ tools/lib/traceevent/plugin_mac80211.c | 7 ++ tools/lib/traceevent/plugin_sched_switch.c | 12 +++ tools/lib/traceevent/plugin_scsi.c | 6 ++ tools/lib/traceevent/plugin_xen.c | 6 ++ tools/perf/Makefile | 6 ++ tools/perf/builtin-probe.c | 48 ++++++++-- tools/perf/util/callchain.c | 23 +++-- tools/perf/util/comm.c | 19 ++-- tools/perf/util/comm.h | 2 +- tools/perf/util/probe-event.c | 111 +++++++++++++---------- tools/perf/util/probe-event.h | 6 ++ tools/perf/util/symbol-elf.c | 5 +- tools/perf/util/symbol.h | 5 ++ tools/perf/util/thread.c | 5 +- tools/perf/util/unwind.c | 20 +---- 23 files changed, 389 insertions(+), 112 deletions(-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2014-01-17 14:57 Arnaldo Carvalho de Melo @ 2014-01-19 12:11 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2014-01-19 12:11 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, David Ahern, David A. Long, Frederic Weisbecker, Jiri Olsa, Masami Hiramatsu, Namhyung Kim, Oleg Nesterov, Paul Mackerras, Peter Zijlstra, Srikar Dronamraju, Stephane Eranian, Steven Rostedt, yrl.pp-manager.tt, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@infradead.org> wrote: > From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> > > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 3e7e09dbd1080de5dcf10092830e39bc2e2932ec: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-01-16 09:34:01 +0100) > > are available in the git repository at: > > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo > > for you to fetch changes up to 2a29190c040c0b11e39197c67abf6f87e0a61f9a: > > perf tools: Remove unnecessary callchain cursor state restore on unmatch (2014-01-17 11:25:24 -0300) > > ---------------------------------------------------------------- > Developer stuff: > > . Improve callchain processing by removing unnecessary work. (Frederic Weisbecker) > > . Fix comm override error handling (Frederic Weisbecker) > > . Improve 'perf probe' exit path, release resources (Masami Hiramatsu) > > . Improve libtraceevent plugins exit path, allowing the registering of > an unregister handler to be called at exit time (Namhyung Kim) > > . Add an alias to the build test makefile (make -C tools/perf build-test) > (Namhyung Kim) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Frederic Weisbecker (3): > perf tools: Do proper comm override error handling > perf callchain: Spare double comparison of callchain first entry > perf tools: Remove unnecessary callchain cursor state restore on unmatch > > Masami Hiramatsu (3): > perf probe: Release allocated probe_trace_event if failed > perf probe: Release all dynamically allocated parameters > perf symbols: Export elf_section_by_name and reuse > > Namhyung Kim (13): > tools lib traceevent: Add pevent_unregister_event_handler() > tools lib traceevent: Add pevent_unregister_print_function() > tools lib traceevent: Unregister handler when function plugin is unloaded > tools lib traceevent: Unregister handler when hrtimer plugin is unloaded > tools lib traceevent: Unregister handler when kmem plugin is unloaded > tools lib traceevent: Unregister handler when kvm plugin is unloaded > tools lib traceevent: Unregister handler when sched_switch plugin is unloaded > tools lib traceevent: Unregister handler when mac80211 plugin is unloaded > tools lib traceevent: Unregister handler when cfg80211 plugin is unloaded > tools lib traceevent: Unregister handler when jbd2 plugin is is unloaded > tools lib traceevent: Unregister handler when scsi plugin is unloaded > tools lib traceevent: Unregister handler when xen plugin is unloaded > perf tools: Add 'build-test' make target > > tools/lib/traceevent/event-parse.c | 136 ++++++++++++++++++++++++++--- > tools/lib/traceevent/event-parse.h | 5 ++ > tools/lib/traceevent/plugin_cfg80211.c | 6 ++ > tools/lib/traceevent/plugin_function.c | 3 + > tools/lib/traceevent/plugin_hrtimer.c | 10 +++ > tools/lib/traceevent/plugin_jbd2.c | 9 ++ > tools/lib/traceevent/plugin_kmem.c | 22 +++++ > tools/lib/traceevent/plugin_kvm.c | 29 ++++++ > tools/lib/traceevent/plugin_mac80211.c | 7 ++ > tools/lib/traceevent/plugin_sched_switch.c | 12 +++ > tools/lib/traceevent/plugin_scsi.c | 6 ++ > tools/lib/traceevent/plugin_xen.c | 6 ++ > tools/perf/Makefile | 6 ++ > tools/perf/builtin-probe.c | 48 ++++++++-- > tools/perf/util/callchain.c | 23 +++-- > tools/perf/util/comm.c | 19 ++-- > tools/perf/util/comm.h | 2 +- > tools/perf/util/probe-event.c | 111 +++++++++++++---------- > tools/perf/util/probe-event.h | 6 ++ > tools/perf/util/symbol-elf.c | 5 +- > tools/perf/util/symbol.h | 5 ++ > tools/perf/util/thread.c | 5 +- > tools/perf/util/unwind.c | 20 +---- > 23 files changed, 389 insertions(+), 112 deletions(-) Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
* [GIT PULL 00/19] perf/core improvements and fixes @ 2012-05-22 17:39 Arnaldo Carvalho de Melo 2012-05-23 15:06 ` Ingo Molnar 0 siblings, 1 reply; 53+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-05-22 17:39 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Arnaldo Carvalho de Melo, Anshuman Khandual, Corey Ashford, David Ahern, Frederic Weisbecker, Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Tom Zanussi, arnaldo.melo, Arnaldo Carvalho de Melo Hi Ingo, Please consider pulling, - Arnaldo The following changes since commit 73787190d04a34e6da745da893b3ae8bedde418f: Merge branch 'perf/parse-events-4' of git://github.com/fweisbec/tracing into perf/core (2012-05-21 10:42:09 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core for you to fetch changes up to 26252ea675663d1bc6747125fcaa2b7cc4ed8a03: perf evlist: Show event attribute details (2012-05-22 14:30:11 -0300) ---------------------------------------------------------------- Fixes and improvements for perf/core: . Fix perf perl script build fallout from libtraceevent conversion, from Frederic Weisbecker. . Libtraceevent Makefile fixes, from Namhyung Kim . Pipe mode fixes, from Stephane Eranian . Event parsing improvements, from Jiri Olsa. . Endianness fixes, from Jiri Olsa . Bump the default sampling freq to 4 kHz, requested by Ingo Molnar. . Show event attribute details, such as the sampling freq, in the 'perf evlist' command. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> ---------------------------------------------------------------- Anshuman Khandual (1): perf record: Fix documentation for branch stack sampling Arnaldo Carvalho de Melo (2): perf tools: Bump default sample freq to 4 kHz perf evlist: Show event attribute details Frederic Weisbecker (2): perf script: Explicitly handle known default print arg type perf script: Rename struct event to struct event_format in perl engine Jiri Olsa (7): perf test: Move parse event automated tests to separated object perf tools: Add support for displaying event parser debug info perf tools: Use allocated list for each parsed event perf tools: Separate 'mem:' event scanner bits perf tools: Add hardcoded name term for pmu events perf tools: Carry perf_event_attr bitfield throught different endians perf tools: Add union u64_swap type for swapping u64 data Namhyung Kim (3): perf tools: Rename libparsevent to libtraceevent in Makefile perf tools: Always try to build libtraceevent perf target: Add cpu flag to sample_type if target has cpu Stephane Eranian (4): perf tools: rename HEADER_TRACE_INFO to HEADER_TRACING_DATA perf inject: Fix broken perf inject -b perf tools: Fix piped mode read code perf buildid-list: Work better with pipe mode tools/perf/Documentation/perf-evlist.txt | 8 + tools/perf/Documentation/perf-record.txt | 2 +- tools/perf/Makefile | 37 +- tools/perf/builtin-buildid-list.c | 6 +- tools/perf/builtin-evlist.c | 103 +++- tools/perf/builtin-inject.c | 5 + tools/perf/builtin-record.c | 6 +- tools/perf/builtin-test.c | 552 +---------------- tools/perf/builtin-top.c | 5 +- tools/perf/util/build-id.c | 2 + tools/perf/util/evsel.c | 12 +- tools/perf/util/header.c | 10 +- tools/perf/util/header.h | 2 +- tools/perf/util/parse-events-test.c | 625 ++++++++++++++++++++ tools/perf/util/parse-events.c | 69 ++- tools/perf/util/parse-events.h | 20 +- tools/perf/util/parse-events.l | 26 +- tools/perf/util/parse-events.y | 77 ++- tools/perf/util/pmu.c | 4 +- .../perf/util/scripting-engines/trace-event-perl.c | 16 +- tools/perf/util/session.c | 68 ++- tools/perf/util/types.h | 5 + 22 files changed, 1002 insertions(+), 658 deletions(-) create mode 100644 tools/perf/util/parse-events-test.c ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [GIT PULL 00/19] perf/core improvements and fixes 2012-05-22 17:39 Arnaldo Carvalho de Melo @ 2012-05-23 15:06 ` Ingo Molnar 0 siblings, 0 replies; 53+ messages in thread From: Ingo Molnar @ 2012-05-23 15:06 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: linux-kernel, Anshuman Khandual, Corey Ashford, David Ahern, Frederic Weisbecker, Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Namhyung Kim, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian, Steven Rostedt, Tom Zanussi, arnaldo.melo, Arnaldo Carvalho de Melo * Arnaldo Carvalho de Melo <acme@infradead.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit 73787190d04a34e6da745da893b3ae8bedde418f: > > Merge branch 'perf/parse-events-4' of git://github.com/fweisbec/tracing into perf/core (2012-05-21 10:42:09 +0200) > > are available in the git repository at: > > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core > > for you to fetch changes up to 26252ea675663d1bc6747125fcaa2b7cc4ed8a03: > > perf evlist: Show event attribute details (2012-05-22 14:30:11 -0300) > > ---------------------------------------------------------------- > Fixes and improvements for perf/core: > > . Fix perf perl script build fallout from libtraceevent conversion, > from Frederic Weisbecker. > > . Libtraceevent Makefile fixes, from Namhyung Kim > > . Pipe mode fixes, from Stephane Eranian > > . Event parsing improvements, from Jiri Olsa. > > . Endianness fixes, from Jiri Olsa > > . Bump the default sampling freq to 4 kHz, requested by Ingo Molnar. > > . Show event attribute details, such as the sampling freq, in the > 'perf evlist' command. > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Anshuman Khandual (1): > perf record: Fix documentation for branch stack sampling > > Arnaldo Carvalho de Melo (2): > perf tools: Bump default sample freq to 4 kHz > perf evlist: Show event attribute details > > Frederic Weisbecker (2): > perf script: Explicitly handle known default print arg type > perf script: Rename struct event to struct event_format in perl engine > > Jiri Olsa (7): > perf test: Move parse event automated tests to separated object > perf tools: Add support for displaying event parser debug info > perf tools: Use allocated list for each parsed event > perf tools: Separate 'mem:' event scanner bits > perf tools: Add hardcoded name term for pmu events > perf tools: Carry perf_event_attr bitfield throught different endians > perf tools: Add union u64_swap type for swapping u64 data > > Namhyung Kim (3): > perf tools: Rename libparsevent to libtraceevent in Makefile > perf tools: Always try to build libtraceevent > perf target: Add cpu flag to sample_type if target has cpu > > Stephane Eranian (4): > perf tools: rename HEADER_TRACE_INFO to HEADER_TRACING_DATA > perf inject: Fix broken perf inject -b > perf tools: Fix piped mode read code > perf buildid-list: Work better with pipe mode > > tools/perf/Documentation/perf-evlist.txt | 8 + > tools/perf/Documentation/perf-record.txt | 2 +- > tools/perf/Makefile | 37 +- > tools/perf/builtin-buildid-list.c | 6 +- > tools/perf/builtin-evlist.c | 103 +++- > tools/perf/builtin-inject.c | 5 + > tools/perf/builtin-record.c | 6 +- > tools/perf/builtin-test.c | 552 +---------------- > tools/perf/builtin-top.c | 5 +- > tools/perf/util/build-id.c | 2 + > tools/perf/util/evsel.c | 12 +- > tools/perf/util/header.c | 10 +- > tools/perf/util/header.h | 2 +- > tools/perf/util/parse-events-test.c | 625 ++++++++++++++++++++ > tools/perf/util/parse-events.c | 69 ++- > tools/perf/util/parse-events.h | 20 +- > tools/perf/util/parse-events.l | 26 +- > tools/perf/util/parse-events.y | 77 ++- > tools/perf/util/pmu.c | 4 +- > .../perf/util/scripting-engines/trace-event-perl.c | 16 +- > tools/perf/util/session.c | 68 ++- > tools/perf/util/types.h | 5 + > 22 files changed, 1002 insertions(+), 658 deletions(-) > create mode 100644 tools/perf/util/parse-events-test.c Pulled, thanks a lot Arnaldo! Ingo ^ permalink raw reply [flat|nested] 53+ messages in thread
end of thread, other threads:[~2017-11-03 13:58 UTC | newest] Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-11-03 13:54 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 01/19] perf script: Add a few missing conversions to fprintf style Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 02/19] perf script: Use pr_debug where appropriate Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 03/19] perf script: Use event_format__fprintf() Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 04/19] perf evsel: Restore evsel->priv as a tool private area Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 05/19] perf script: Allow creating per-event dump files Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 06/19] tools include uapi: Grab a copy of linux/prctl.h Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 07/19] perf trace beauty prctl: Generate 'option' string table from kernel headers Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 08/19] perf script: Print information about per-event-dump files Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 09/19] perf tools: Rename struct perf_data_file to perf_data Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 10/19] perf tools: Add struct perf_data_file Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 11/19] perf tools: Add perf_data_file__write function Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 12/19] perf stat: Move the shadow stats scale computation in perf_stat__update_shadow_stats Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 13/19] perf stat: Make --per-thread update shadow stats to show metrics Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 14/19] perf callchain: Fix double mapping al->addr for children without self period Arnaldo Carvalho de Melo 2017-11-03 13:54 ` [PATCH 15/19] tools include uapi: Grab a copy of linux/kcmp.h Arnaldo Carvalho de Melo 2017-11-03 13:55 ` [PATCH 16/19] perf trace beauty: Implement pid_fd beautifier Arnaldo Carvalho de Melo 2017-11-03 13:55 ` [PATCH 17/19] perf trace beauty kcmp: Beautify arguments Arnaldo Carvalho de Melo 2017-11-03 13:55 ` [PATCH 18/19] perf srcline: Fix memory leak in addr2inlines() Arnaldo Carvalho de Melo 2017-11-03 13:55 ` [PATCH 19/19] perf srcline: Show correct function name for srcline of callchains Arnaldo Carvalho de Melo -- strict thread matches above, loose matches on Subject: below -- 2017-08-14 16:27 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo 2017-08-14 17:39 ` Ingo Molnar 2017-08-14 17:52 ` Arnaldo Carvalho de Melo 2017-03-14 18:50 Arnaldo Carvalho de Melo 2017-03-15 18:29 ` Ingo Molnar 2016-12-01 18:02 Arnaldo Carvalho de Melo 2016-12-02 9:10 ` Ingo Molnar 2016-09-01 16:45 Arnaldo Carvalho de Melo 2016-09-05 13:16 ` Ingo Molnar 2016-07-14 2:20 Arnaldo Carvalho de Melo 2016-07-14 6:58 ` Ingo Molnar 2016-06-15 18:13 Arnaldo Carvalho de Melo 2016-06-16 6:29 ` Jiri Olsa 2016-06-16 19:54 ` Arnaldo Carvalho de Melo 2016-06-16 8:29 ` Ingo Molnar 2016-04-07 20:58 Arnaldo Carvalho de Melo 2016-04-08 13:15 ` Arnaldo Carvalho de Melo 2016-04-13 6:58 ` Ingo Molnar 2016-03-10 21:04 Arnaldo Carvalho de Melo 2016-03-11 8:43 ` Ingo Molnar 2016-02-26 23:18 Arnaldo Carvalho de Melo 2016-02-27 9:36 ` Ingo Molnar 2016-02-05 16:25 Arnaldo Carvalho de Melo 2016-02-09 9:40 ` Ingo Molnar 2015-04-08 14:23 Arnaldo Carvalho de Melo 2015-04-08 15:05 ` Ingo Molnar 2015-03-21 18:54 Arnaldo Carvalho de Melo 2015-03-22 9:58 ` Ingo Molnar 2015-02-27 19:22 Arnaldo Carvalho de Melo 2014-01-17 14:57 Arnaldo Carvalho de Melo 2014-01-19 12:11 ` Ingo Molnar 2012-05-22 17:39 Arnaldo Carvalho de Melo 2012-05-23 15:06 ` Ingo Molnar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).