perf/core improvements and fixes
Arnaldo Carvalho de Melo
maintainerHi Ingo,
Please consider pulling,
- Arnaldo
Test results at the end of this message, as usual.
The following changes since commit fd7647979a3948dae4fc6f25dbbdf9ba269bed78:
Merge tag 'perf-core-for-mingo-4.12-20170424' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-04-24 23:31:35 +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.12-20170503
for you to fetch changes up to 4341ec6b3db4c3e903d6c44958722918baec1e59:
perf config: Refactor a duplicated code for obtaining config file name (2017-05-02 18:23:12 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
Fixes:
- Support setting probes in versioned user space symbols, such as pthread_create@@GLIBC_2.1, picking the default one, more work needed to make it possible to set it on the other versions, as the 'perf probe' syntax already uses @ for other purposes. (Paul Clarke)
- Do not special case address zero as an error for routines that return addresses (symbol lookup), instead use the return as the success/error indication and pass a pointer to return the address, fixing 'perf test vmlinux' (the one that compares address between vmlinux and kallsyms) on s/390, where the '_text' address is equal to zero (Arnaldo Carvalho de Melo)
Infrastructure:
- More header sanitization, moving stuff out of util.h into more appropriate headers and objects and sometimes creating new ones (Arnaldo Carvalho de Melo)
- Refactor a duplicated code for obtaining config file name (Taeung Song)
----------------------------------------------------------------
Arnaldo Carvalho de Melo (8):
perf buildid: Move prototypes from util.h to build-id.h perf tools: Move event prototypes from util.h to event.h perf memswap: Split the byteswap memory range wrappers from util.[ch] perf tools: Move HAS_BOOL define to where perl headers are used perf ui gtk: Move gtk .so name to the only place where it is used perf units: Move parse_tag_value() to units.[ch]
tools lib string: Adopt prefixcmp() from perf and subcmd perf symbols: Accept symbols starting at address 0
Paul Clarke (1):
perf symbols: Allow user probes on versioned symbols
Taeung Song (1):
perf config: Refactor a duplicated code for obtaining config file name
tools/include/linux/string.h | 2 + tools/lib/string.c | 9 +++ tools/lib/subcmd/help.c | 1 + tools/lib/subcmd/parse-options.c | 1 + tools/lib/subcmd/subcmd-util.h | 9 --- tools/perf/arch/powerpc/util/sym-handling.c | 12 ++++ tools/perf/builtin-buildid-cache.c | 13 ++-- tools/perf/builtin-c2c.c | 1 + tools/perf/builtin-config.c | 19 +++--- tools/perf/builtin-top.c | 2 +- tools/perf/builtin-trace.c | 1 + tools/perf/perf.c | 1 + tools/perf/tests/hists_cumulate.c | 1 + tools/perf/tests/hists_filter.c | 1 + tools/perf/tests/hists_output.c | 1 + tools/perf/tests/sdt.c | 1 - tools/perf/ui/setup.c | 3 + tools/perf/util/Build | 1 + tools/perf/util/build-id.h | 4 ++ tools/perf/util/event.c | 10 +-- tools/perf/util/event.h | 12 +++- tools/perf/util/evsel.c | 1 + tools/perf/util/header.c | 1 + tools/perf/util/intel-pt.c | 1 + tools/perf/util/machine.c | 28 +++++---- tools/perf/util/map.c | 5 -- tools/perf/util/map.h | 5 +- tools/perf/util/memswap.c | 24 ++++++++ tools/perf/util/memswap.h | 7 +++ .../perf/util/scripting-engines/trace-event-perl.c | 4 +- tools/perf/util/session.c | 1 + tools/perf/util/strbuf.c | 9 --- tools/perf/util/symbol.c | 72 ++++++++++++++++------ tools/perf/util/symbol.h | 11 ++++ tools/perf/util/units.c | 29 +++++++++ tools/perf/util/units.h | 7 +++ tools/perf/util/util.c | 49 --------------- tools/perf/util/util.h | 26 -------- 38 files changed, 230 insertions(+), 155 deletions(-) create mode 100644 tools/perf/util/memswap.c create mode 100644 tools/perf/util/memswap.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.
# time 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:9: Ok 12 debian:experimental: Ok 13 debian:experimental-x-arm64: Ok 14 debian:experimental-x-mips: Ok 15 debian:experimental-x-mips64: Ok 16 debian:experimental-x-mipsel: Ok 17 fedora:20: Ok 18 fedora:21: Ok 19 fedora:22: Ok 20 fedora:23: Ok 21 fedora:24: Ok 22 fedora:24-x-ARC-uClibc: Ok 23 fedora:25: Ok 24 fedora:rawhide: Ok 25 mageia:5: Ok 26 opensuse:13.2: Ok 27 opensuse:42.1: Ok 28 opensuse:tumbleweed: Ok 29 ubuntu:12.04.5: Ok 30 ubuntu:14.04.4: Ok 31 ubuntu:14.04.4-x-linaro-arm64: Ok 32 ubuntu:15.10: Ok 33 ubuntu:16.04: Ok 34 ubuntu:16.04-x-arm: Ok 35 ubuntu:16.04-x-arm64: Ok 36 ubuntu:16.04-x-powerpc: Ok 37 ubuntu:16.04-x-powerpc64: Ok 38 ubuntu:16.04-x-s390: Ok 39 ubuntu:16.10: Ok 40 ubuntu:17.04: Ok # # uname -a Linux jouet 4.11.0-rc8+ #8 SMP Wed Apr 26 08:50:41 -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 #
$ make -C tools/perf build-test
make: Entering directory '/home/acme/git/linux/tools/perf'
- tarpkg: ./tests/perf-targz-src-pkg .
make_no_libperl_O: make NO_LIBPERL=1
make_no_libaudit_O: make NO_LIBAUDIT=1
make_no_libelf_O: make NO_LIBELF=1
make_doc_O: make doc
make_no_libunwind_O: make NO_LIBUNWIND=1
make_clean_all_O: make clean all
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_util_map_o_O: make util/map.o
make_no_libnuma_O: make NO_LIBNUMA=1
make_with_clangllvm_O: make LIBCLANGLLVM=1
make_no_demangle_O: make NO_DEMANGLE=1
make_tags_O: make tags
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_no_slang_O: make NO_SLANG=1
make_help_O: make help
make_no_gtk2_O: make NO_GTK2=1
make_install_prefix_O: make install prefix=/tmp/krava
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_install_O: make install
make_no_libbionic_O: make NO_LIBBIONIC=1
make_no_libpython_O: make NO_LIBPYTHON=1
make_perf_o_O: make perf.o
make_no_auxtrace_O: make NO_AUXTRACE=1
make_pure_O: make
make_no_libbpf_O: make NO_LIBBPF=1
make_no_newt_O: make NO_NEWT=1
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_with_babeltrace_O: make LIBBABELTRACE=1
make_static_O: make LDFLAGS=-static
make_install_bin_O: make install-bin
make_debug_O: make DEBUG=1
make_no_backtrace_O: make NO_BACKTRACE=1
OK
make: Leaving directory '/home/acme/git/linux/tools/perf'
$ Arnaldo Carvalho de Melo
maintainerPATCH 1/10 perf buildid: Move prototypes from util.h to build-id.h
From: Arnaldo Carvalho de Melo <[email protected]>
Where they belong.
--- tools/perf/tests/sdt.c | 1 - tools/perf/util/build-id.h | 4 ++++ tools/perf/util/util.h | 3 --- 3 files changed, 4 insertions(+), 4 deletions(-)
tools/perf/tests/sdt.c +0 -1
@@ -1,7 +1,6 @@#include <errno.h> #include <stdio.h> #include <sys/epoll.h> -#include <util/util.h> #include <util/evlist.h> #include <linux/filter.h> #include "tests.h"
tools/perf/util/build-id.h +4 -0
@@ -44,6 +44,10 @@ bool build_id_cache__cached(const char *sbuild_id);int build_id_cache__add_s (const char *sbuild_id,const char *name,bool is_kallsyms,bool is_vdso);int build_id_cache__remove_s (const char *sbuild_id); + +extern char buildid_dir[]; + +void set_buildid_dir (const char *dir);void disable_buildid_cache (void );#endif
tools/perf/util/util.h +0 -3
@@ -14,8 +14,6 @@#include <stdarg.h> #include <linux/types.h> -extern char buildid_dir[]; -#ifdef __GNUC__#define NORETURN __attribute__((__noreturn__))#else
@@ -36,7 +34,6 @@ void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));void set_warning_routine (void (*routine)(const char *err,va_list params));int prefixcmp (const char *str,const char *prefix); -void set_buildid_dir (const char *dir);static inline void *zalloc (size_t size) {
Signature · 1 line
2.9.3
Arnaldo Carvalho de Melo
maintainerPATCH 2/10 perf tools: Move event prototypes from util.h to event.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
More needs to be done to have the actual functions and variables in a smaller .c file that can then be included in the python binding, avoiding dragging more stuff into it.
--- tools/perf/builtin-c2c.c | 1 + tools/perf/builtin-top.c | 2 +- tools/perf/builtin-trace.c | 1 + tools/perf/perf.c | 1 + tools/perf/tests/hists_cumulate.c | 1 + tools/perf/tests/hists_filter.c | 1 + tools/perf/tests/hists_output.c | 1 + tools/perf/util/event.c | 1 + tools/perf/util/event.h | 8 ++++++++ tools/perf/util/evsel.c | 1 + tools/perf/util/util.h | 8 -------- 11 files changed, 17 insertions(+), 9 deletions(-)
tools/perf/builtin-c2c.c +1 -0
@@ -27,6 +27,7 @@#include "tool.h" #include "data.h" #include "sort.h" +#include "event.h" #include "evlist.h" #include "evsel.h" #include <asm/bug.h>
tools/perf/builtin-top.c +1 -1
@@ -27,13 +27,13 @@#include "util/drv_configs.h" #include "util/evlist.h" #include "util/evsel.h" +#include "util/event.h" #include "util/machine.h" #include "util/session.h" #include "util/symbol.h" #include "util/thread.h" #include "util/thread_map.h" #include "util/top.h" -#include "util/util.h" #include <linux/rbtree.h> #include <subcmd/parse-options.h> #include "util/parse-events.h"
tools/perf/builtin-trace.c +1 -0
@@ -21,6 +21,7 @@#include "builtin.h" #include "util/color.h" #include "util/debug.h" +#include "util/event.h" #include "util/evlist.h" #include <subcmd/exec-cmd.h> #include "util/machine.h"
tools/perf/perf.c +1 -0
@@ -17,6 +17,7 @@#include <subcmd/parse-options.h> #include "util/bpf-loader.h" #include "util/debug.h" +#include "util/event.h" #include <api/fs/fs.h> #include <api/fs/tracing_path.h> #include <errno.h>
tools/perf/tests/hists_cumulate.c +1 -0
@@ -1,5 +1,6 @@#include "perf.h" #include "util/debug.h" +#include "util/event.h" #include "util/symbol.h" #include "util/sort.h" #include "util/evsel.h"
tools/perf/tests/hists_filter.c +1 -0
@@ -3,6 +3,7 @@#include "util/symbol.h" #include "util/sort.h" #include "util/evsel.h" +#include "util/event.h" #include "util/evlist.h" #include "util/machine.h" #include "util/thread.h"
tools/perf/tests/hists_output.c +1 -0
@@ -1,5 +1,6 @@#include "perf.h" #include "util/debug.h" +#include "util/event.h" #include "util/symbol.h" #include "util/sort.h" #include "util/evsel.h"
tools/perf/util/event.c +1 -0
@@ -8,6 +8,7 @@#include <unistd.h> #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */ #include <api/fs/fs.h> +#include <linux/perf_event.h> #include "event.h" #include "debug.h" #include "hist.h"
tools/perf/util/event.h +8 -0
@@ -681,4 +681,12 @@ u64 kallsyms__get_function_start(const char *kallsyms_filename,void *cpu_map_data__alloc (struct cpu_map *map,size_t *size,u16 *type,int *max);void cpu_map_data__synthesize (struct cpu_map_data *data,struct cpu_map *map,u16 type,int max); + +void event_attr_init (struct perf_event_attr *attr); + +int perf_event_paranoid (void ); + +extern int sysctl_perf_event_max_stack; +extern int sysctl_perf_event_max_contexts_per_stack; +#endif /* __PERF_RECORD_H */
tools/perf/util/evsel.c +1 -0
@@ -21,6 +21,7 @@#include "asm/bug.h" #include "callchain.h" #include "cgroup.h" +#include "event.h" #include "evsel.h" #include "evlist.h" #include "util.h"
tools/perf/util/util.h +0 -8
@@ -56,17 +56,11 @@ int copyfile_offset(int fromfd, loff_t from_ofs, int tofd, loff_t to_ofs, u64 sissize_t readn (int fd,void *buf,size_t n);ssize_t writen (int fd,void *buf,size_t n); -struct perf_event_attr ; - -void event_attr_init (struct perf_event_attr *attr); -size_t hex_width (u64 v);int hex2u64 (const char *ptr,u64 *val);extern unsigned int page_size;extern int cacheline_size; -extern int sysctl_perf_event_max_stack; -extern int sysctl_perf_event_max_contexts_per_stack;struct parse_tag {char tag;
@@ -75,8 +69,6 @@ struct parse_tag {unsigned long parse_tag_value (const char *str,struct parse_tag *tags); -int perf_event_paranoid (void ); -void mem_bswap_64 (void *src,int byte_size);void mem_bswap_32 (void *src,int byte_size);
Signature · 1 line
2.9.3
Arnaldo Carvalho de Melo
maintainerPATCH 3/10 perf memswap: Split the byteswap memory range wrappers from util.[ch]
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Just one more step into splitting util.[ch] to reduce the includes hell.
--- tools/perf/util/Build | 1 + tools/perf/util/header.c | 1 + tools/perf/util/intel-pt.c | 1 + tools/perf/util/memswap.c | 24 ++++++++++++++++++++++++ tools/perf/util/memswap.h | 7 +++++++ tools/perf/util/session.c | 1 + tools/perf/util/util.c | 22 ---------------------- tools/perf/util/util.h | 3 --- 8 files changed, 35 insertions(+), 25 deletions(-) create mode 100644 tools/perf/util/memswap.c create mode 100644 tools/perf/util/memswap.h
tools/perf/util/Build +1 -0
@@ -13,6 +13,7 @@ libperf-y += find_bit.o libperf-y += kallsyms.o libperf-y += levenshtein.o libperf-y += llvm-utils.o +libperf-y += memswap.o libperf-y += parse-events.o libperf-y += perf_regs.o libperf-y += path.o
tools/perf/util/header.c +1 -0
@@ -19,6 +19,7 @@#include "evlist.h" #include "evsel.h" #include "header.h" +#include "memswap.h" #include "../perf.h" #include "trace-event.h" #include "session.h"
tools/perf/util/intel-pt.c +1 -0
@@ -23,6 +23,7 @@#include "../perf.h" #include "session.h" #include "machine.h" +#include "memswap.h" #include "sort.h" #include "tool.h" #include "event.h"
tools/perf/util/memswap.c new file +24 -0
@@ -0,0 +1,24 @@ +#include <byteswap.h> +#include "memswap.h" +#include <linux/types.h> + +void mem_bswap_32 (void *src,int byte_size) +{ +u32 *m = src; +while (byte_size >0 ) { + *m =bswap_32 (*m); + byte_size -=sizeof (u32); + ++m; + } +} + +void mem_bswap_64 (void *src,int byte_size) +{ +u64 *m = src; + +while (byte_size >0 ) { + *m =bswap_64 (*m); + byte_size -=sizeof (u64); + ++m; + } +}
tools/perf/util/memswap.h new file +7 -0
@@ -0,0 +1,7 @@ +#ifndef PERF_MEMSWAP_H_ +#define PERF_MEMSWAP_H_ + +void mem_bswap_64 (void *src,int byte_size); +void mem_bswap_32 (void *src,int byte_size); + +#endif /* PERF_MEMSWAP_H_ */
tools/perf/util/session.c +1 -0
@@ -11,6 +11,7 @@#include "evlist.h" #include "evsel.h" +#include "memswap.h" #include "session.h" #include "tool.h" #include "sort.h"
tools/perf/util/util.c +0 -22
@@ -13,7 +13,6 @@#include <string.h> #include <errno.h> #include <limits.h> -#include <byteswap.h> #include <linux/kernel.h> #include <linux/log2.h> #include <linux/time64.h>
@@ -372,27 +371,6 @@ int perf_event_paranoid(void)return value; } -void mem_bswap_32 (void *src,int byte_size) -{ -u32 *m = src; -while (byte_size >0 ) { - *m =bswap_32 (*m); - byte_size -=sizeof (u32); - ++m; - } -} - -void mem_bswap_64 (void *src,int byte_size) -{ -u64 *m = src; - -while (byte_size >0 ) { - *m =bswap_64 (*m); - byte_size -=sizeof (u64); - ++m; - } -} -bool find_process (const char *name) {size_t len =strlen (name);
tools/perf/util/util.h +0 -3
@@ -69,9 +69,6 @@ struct parse_tag {unsigned long parse_tag_value (const char *str,struct parse_tag *tags); -void mem_bswap_64 (void *src,int byte_size); -void mem_bswap_32 (void *src,int byte_size); -bool find_process (const char *name); int fetch_kernel_version(unsigned int *puint,
Signature · 1 line
2.9.3
Arnaldo Carvalho de Melo
maintainerPATCH 4/10 perf tools: Move HAS_BOOL define to where perl headers are used
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
This is a perl specific hack, so move it from util.h to where perl headers are used.
--- tools/perf/util/scripting-engines/trace-event-perl.c | 4 +++- tools/perf/util/util.h | 1 - 2 files changed, 3 insertions(+), 2 deletions(-)
tools/perf/util/scripting-engines/trace-event-perl.c +3 -1
@@ -28,7 +28,9 @@#include <linux/bitmap.h> #include <linux/time64.h> -#include "../util.h" +#include <stdbool.h> +/* perl needs the following define, right after including stdbool.h */ +#define HAS_BOOL #include <EXTERN.h> #include <perl.h>
tools/perf/util/util.h +0 -1
@@ -5,7 +5,6 @@#define _BSD_SOURCE 1/* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */ #define _DEFAULT_SOURCE 1 -#define HAS_BOOL #include <fcntl.h> #include <stdbool.h>
Signature · 1 line
2.9.3
Arnaldo Carvalho de Melo
maintainerPATCH 5/10 perf ui gtk: Move gtk .so name to the only place where it is used
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
No need to pollute util.h with this.
--- tools/perf/ui/setup.c | 3 +++ tools/perf/util/util.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-)
tools/perf/ui/setup.c +3 -0
@@ -10,7 +10,10 @@ pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER;void *perf_gtk_handle;int use_browser =-1 ; +#define PERF_GTK_DSO "libperf-gtk.so" +#ifdef HAVE_GTK2_SUPPORT +static int setup_gtk_browser (void ) {int (*perf_ui_init)(void );
tools/perf/util/util.h +0 -2
@@ -22,8 +22,6 @@#endif #endif -#define PERF_GTK_DSO "libperf-gtk.so" -/* General helper functions */ void usage(const char *err) NORETURN; void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));
Signature · 1 line
2.9.3
Arnaldo Carvalho de Melo
maintainerPATCH 6/10 perf units: Move parse_tag_value() to units.[ch]
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Its basically to do units handling, so move to a more appropriately named object.
--- tools/perf/util/units.c | 29 +++++++++++++++++++++++++++++ tools/perf/util/units.h | 7 +++++++ tools/perf/util/util.c | 27 --------------------------- tools/perf/util/util.h | 7 ------- 4 files changed, 36 insertions(+), 34 deletions(-)
tools/perf/util/units.c +29 -0
@@ -1,8 +1,37 @@#include "units.h" #include <inttypes.h> +#include <limits.h> +#include <stdlib.h> +#include <string.h> #include <linux/kernel.h> #include <linux/time64.h> +unsigned long parse_tag_value (const char *str,struct parse_tag *tags) +{ +struct parse_tag *i = tags; + +while (i->tag) { +char *s =strchr (str, i->tag); + +if (s) { +unsigned long int value; +char *endptr; + + value =strtoul (str, &endptr,10 ); +if (s != endptr) +break ; + +if (value >ULONG_MAX / i->mult) +break ; + value *= i->mult; +return value; + } + i++; + } + +return (unsigned long )-1 ; +} +unsigned long convert_unit (unsigned long value,char *unit) { *unit =' ' ;
tools/perf/util/units.h +7 -0
@@ -4,6 +4,13 @@#include <stddef.h> #include <linux/types.h> +struct parse_tag { +char tag; +int mult; +}; + +unsigned long parse_tag_value (const char *str,struct parse_tag *tags); +unsigned long convert_unit (unsigned long value,char *unit);int unit_number__scnprintf (char *buf,size_t size,u64 n);
tools/perf/util/util.c +0 -27
@@ -334,33 +334,6 @@ int hex2u64(const char *ptr, u64 *long_val)return p - ptr; } -unsigned long parse_tag_value (const char *str,struct parse_tag *tags) -{ -struct parse_tag *i = tags; - -while (i->tag) { -char *s; - - s =strchr (str, i->tag); -if (s) { -unsigned long int value; -char *endptr; - - value =strtoul (str, &endptr,10 ); -if (s != endptr) -break ; - -if (value >ULONG_MAX / i->mult) -break ; - value *= i->mult; -return value; - } - i++; - } - -return (unsigned long )-1 ; -} -int perf_event_paranoid (void ) {int value;
tools/perf/util/util.h +0 -7
@@ -59,13 +59,6 @@ int hex2u64(const char *ptr, u64 *val);extern unsigned int page_size;extern int cacheline_size; -struct parse_tag { -char tag; -int mult; -}; - -unsigned long parse_tag_value (const char *str,struct parse_tag *tags); -bool find_process (const char *name); int fetch_kernel_version(unsigned int *puint,
Signature · 1 line
2.9.3
Arnaldo Carvalho de Melo
maintainerPATCH 7/10 tools lib string: Adopt prefixcmp() from perf and subcmd
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Both had copies originating from git.git, move those to tools/lib/string.c, getting both tools/lib/subcmd/ and tools/perf/ to use it.
--- tools/include/linux/string.h | 2 ++ tools/lib/string.c | 9 +++++++++ tools/lib/subcmd/help.c | 1 + tools/lib/subcmd/parse-options.c | 1 + tools/lib/subcmd/subcmd-util.h | 9 --------- tools/perf/util/strbuf.c | 9 --------- tools/perf/util/util.h | 2 -- 7 files changed, 13 insertions(+), 20 deletions(-)
tools/include/linux/string.h +2 -0
@@ -18,4 +18,6 @@ extern size_t strlcpy(char *dest, const char *src, size_t size);char *str_error_r (int errnum,char *buf,size_t buflen); +int prefixcmp (const char *str,const char *prefix); +#endif /* _LINUX_STRING_H_ */
tools/lib/string.c +9 -0
@@ -87,3 +87,12 @@ size_t __weak strlcpy(char *dest, const char *src, size_t size) }return ret; } + +int prefixcmp (const char *str,const char *prefix) +{ +for (; ; str++, prefix++) +if (!*prefix) +return 0 ; +else if (*str != *prefix) +return (unsigned char )*prefix - (unsigned char )*str; +}
tools/lib/subcmd/help.c +1 -0
@@ -1,6 +1,7 @@#include <stdio.h> #include <stdlib.h> #include <string.h> +#include <linux/string.h> #include <termios.h> #include <sys/ioctl.h> #include <sys/types.h>
tools/lib/subcmd/parse-options.c +1 -0
@@ -1,4 +1,5 @@#include <linux/compiler.h> +#include <linux/string.h> #include <linux/types.h> #include <stdio.h> #include <stdlib.h>
tools/lib/subcmd/subcmd-util.h +0 -9
@@ -79,13 +79,4 @@ static inline void astrcat(char **out, const char *add) free(tmp); } -static inline int prefixcmp (const char *str,const char *prefix) -{ -for (; ; str++, prefix++) -if (!*prefix) -return 0 ; -else if (*str != *prefix) -return (unsigned char )*prefix - (unsigned char )*str; -} -#endif /* __SUBCMD_UTIL_H */
tools/perf/util/strbuf.c +0 -9
@@ -3,15 +3,6 @@#include <linux/kernel.h> #include <errno.h> -int prefixcmp (const char *str,const char *prefix) -{ -for (; ; str++, prefix++) -if (!*prefix) -return 0 ; -else if (*str != *prefix) -return (unsigned char )*prefix - (unsigned char )*str; -} -/* * Used as the default ->buf value, so that people can always assume * buf is non NULL and ->buf is NUL terminated even for a freshly
tools/perf/util/util.h +0 -2
@@ -30,8 +30,6 @@ void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));void set_warning_routine (void (*routine)(const char *err,va_list params)); -int prefixcmp (const char *str,const char *prefix); -static inline void *zalloc (size_t size) {return calloc (1 , size);
Signature · 1 line
2.9.3
Arnaldo Carvalho de Melo
maintainerPATCH 8/10 perf symbols: Accept symbols starting at address 0
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
That is the case of _text on s390, and we have some functions that return an address, using address zero to report problems, oops.
This would lead the symbol loading routines to not use "_text" as the reference relocation symbol, or the first symbol for the kernel, but use instead "_stext", that is at the same address on x86_64 and others, but not on s390:
[acme@localhost perf-4.11.0-rc6]$ head -15 /proc/kallsyms 0000000000000000 T _text
0000000000000418 t iplstart
0000000000000800 T start
000000000000080a t .base
000000000000082e t .sk8x8
0000000000000834 t .gotr
0000000000000842 t .cmd
0000000000000846 t .parm
000000000000084a t .lowcase
0000000000010000 T startup
0000000000010010 T startup_kdump 0000000000010214 t startup_kdump_relocated 0000000000011000 T startup_continue 00000000000112a0 T _ehead
0000000000100000 T _stext
[acme@localhost perf-4.11.0-rc6]$
Which in turn would make 'perf test vmlinux' to fail because it wouldn't find the symbols before "_stext" in kallsyms.
Fix it by using the return value only for errors and storing the address, when the symbol is successfully found, in a provided pointer arg.
Before this patch:
After:
[acme@localhost perf-4.11.0-rc6]$ tools/perf/perf test -v 1
1: vmlinux symtab matches kallsyms :
--- start ---
test child forked, pid 40693
Looking at the vmlinux_path (8 entries long)
Using /usr/lib/debug/lib/modules/3.10.0-654.el7.s390x/vmlinux for symbols ERR : 0: _text not on kallsyms
ERR : 0x418: iplstart not on kallsyms
ERR : 0x800: start not on kallsyms
ERR : 0x80a: .base not on kallsyms
ERR : 0x82e: .sk8x8 not on kallsyms
ERR : 0x834: .gotr not on kallsyms
ERR : 0x842: .cmd not on kallsyms
ERR : 0x846: .parm not on kallsyms
ERR : 0x84a: .lowcase not on kallsyms
ERR : 0x10000: startup not on kallsyms
ERR : 0x10010: startup_kdump not on kallsyms
ERR : 0x10214: startup_kdump_relocated not on kallsyms
ERR : 0x11000: startup_continue not on kallsyms
ERR : 0x112a0: _ehead not on kallsyms
<SNIP warnings>
test child finished with -1
---- end ----
vmlinux symtab matches kallsyms: FAILED!
[acme@localhost perf-4.11.0-rc6]$
After:
[acme@localhost perf-4.11.0-rc6]$ tools/perf/perf test -v 1
1: vmlinux symtab matches kallsyms :
--- start ---
test child forked, pid 47160
<SNIP warnings>
test child finished with 0
---- end ----
vmlinux symtab matches kallsyms: Ok [acme@localhost perf-4.11.0-rc6]$
--- tools/perf/builtin-buildid-cache.c | 13 ++++++++----- tools/perf/util/event.c | 9 +++++---- tools/perf/util/event.h | 4 ++-- tools/perf/util/machine.c | 28 +++++++++++++++++----------- tools/perf/util/symbol.c | 11 +++++------ 5 files changed, 37 insertions(+), 28 deletions(-)
tools/perf/builtin-buildid-cache.c +8 -5
@@ -49,19 +49,22 @@ static bool same_kallsyms_reloc(const char *from_dir, char *to_dir)char to[PATH_MAX ];const char *name;u64 addr1 =0 , addr2 =0 ; -int i; +int i, err =-1 ;scnprintf (from,sizeof (from),"%s/kallsyms" , from_dir);scnprintf (to,sizeof (to),"%s/kallsyms" , to_dir);for (i =0 ; (name = ref_reloc_sym_names[i]) !=NULL ; i++) { - addr1 =kallsyms__get_function_start (from, name); -if (addr1) + err =kallsyms__get_function_start (from, name, &addr1); +if (!err)break ; } -if (name) - addr2 =kallsyms__get_function_start (to, name); +if (err) +return false; + +if (kallsyms__get_function_start (to, name, &addr2)) +return false;return addr1 == addr2; }
tools/perf/util/event.c +5 -4
@@ -768,15 +768,16 @@ static int find_symbol_cb(void *arg, const char *name, char type,return 1 ; } -u64 kallsyms__get_function_start (const char *kallsyms_filename, -const char *symbol_name) +int kallsyms__get_function_start (const char *kallsyms_filename, +const char *symbol_name,u64 *addr) {struct process_symbol_args args = { .name = symbol_name, };if (kallsyms__parse (kallsyms_filename, &args, find_symbol_cb) <=0 ) -return 0 ; +return -1 ; -return args.start; + *addr = args.start; +return 0 ; } int perf_event__synthesize_kernel_mmap(struct perf_tool *tool,
tools/perf/util/event.h +2 -2
@@ -675,8 +675,8 @@ size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp);size_t perf_event__fprintf_namespaces (union perf_event *event,FILE *fp);size_t perf_event__fprintf (union perf_event *event,FILE *fp); -u64 kallsyms__get_function_start (const char *kallsyms_filename, -const char *symbol_name); +int kallsyms__get_function_start (const char *kallsyms_filename, +const char *symbol_name,u64 *addr);void *cpu_map_data__alloc (struct cpu_map *map,size_t *size,u16 *type,int *max); void cpu_map_data__synthesize(struct cpu_map_data *data, struct cpu_map *map,
tools/perf/util/machine.c +17 -11
@@ -796,11 +796,11 @@ const char *ref_reloc_sym_names[] = {"_text", "_stext", NULL};* Returns the name of the start symbol in *symbol_name. Pass in NULL as * symbol_name if it's not that important. */ -static u64 machine__get_running_kernel_start (struct machine *machine, -const char **symbol_name) +static int machine__get_running_kernel_start (struct machine *machine, +const char **symbol_name,u64 *start) {char filename[PATH_MAX ]; -int i; +int i, err =-1 ;const char *name;u64 addr =0 ;
@@ -810,21 +810,28 @@ static u64 machine__get_running_kernel_start(struct machine *machine,return 0 ;for (i =0 ; (name = ref_reloc_sym_names[i]) !=NULL ; i++) { - addr =kallsyms__get_function_start (filename, name); -if (addr) + err =kallsyms__get_function_start (filename, name, &addr); +if (!err)break ; } +if (err) +return -1 ; +if (symbol_name) *symbol_name = name; -return addr; + *start = addr; +return 0 ; }int __machine__create_kernel_maps (struct machine *machine,struct dso *kernel) {int type; -u64 start =machine__get_running_kernel_start (machine,NULL ); +u64 start =0 ; + +if (machine__get_running_kernel_start (machine,NULL , &start)) +return -1 ;/* In case of renewal the kernel map, destroy previous one */ machine__destroy_kernel_maps (machine);
@@ -1185,8 +1192,8 @@ static int machine__create_modules(struct machine *machine)int machine__create_kernel_maps (struct machine *machine) {struct dso *kernel =machine__get_kernel (machine); -const char *name; -u64 addr; +const char *name =NULL ; +u64 addr =0 ;int ret;if (kernel ==NULL )
@@ -1211,8 +1218,7 @@ int machine__create_kernel_maps(struct machine *machine)*/ map_groups__fixup_end (&machine->kmaps); - addr =machine__get_running_kernel_start (machine, &name); -if (!addr) { +if (machine__get_running_kernel_start (machine, &name, &addr)) { }else if (maps__set_kallsyms_ref_reloc_sym (machine->vmlinux_maps, name, addr)) {machine__destroy_kernel_maps (machine);return -1 ;
tools/perf/util/symbol.c +5 -6
@@ -466,7 +466,7 @@ void dso__insert_symbol(struct dso *dso, enum map_type type, struct symbol *sym)struct symbol *dso__find_symbol (struct dso *dso,enum map_type type,u64 addr) { -if (dso->last_find_result[type].addr != addr) { +if (dso->last_find_result[type].addr != addr || dso->last_find_result[type].symbol ==NULL ) { dso->last_find_result[type].addr = addr; dso->last_find_result[type].symbol =symbols__find (&dso->symbols[type], addr); }
@@ -1075,8 +1075,9 @@ static int validate_kcore_addresses(const char *kallsyms_filename,if (kmap->ref_reloc_sym && kmap->ref_reloc_sym->name) {u64 start; - start =kallsyms__get_function_start (kallsyms_filename, - kmap->ref_reloc_sym->name); +if (kallsyms__get_function_start (kallsyms_filename, + kmap->ref_reloc_sym->name, &start)) +return -ENOENT ;if (start != kmap->ref_reloc_sym->addr)return -EINVAL ; }
@@ -1248,9 +1249,7 @@ static int kallsyms__delta(struct map *map, const char *filename, u64 *delta)if (!kmap->ref_reloc_sym || !kmap->ref_reloc_sym->name)return 0 ; - addr =kallsyms__get_function_start (filename, - kmap->ref_reloc_sym->name); -if (!addr) +if (kallsyms__get_function_start (filename, kmap->ref_reloc_sym->name, &addr))return -1 ; *delta = addr - kmap->ref_reloc_sym->addr;
Signature · 1 line
2.9.3
Arnaldo Carvalho de Melo
maintainerPATCH 9/10 perf symbols: Allow user probes on versioned symbols
In reply to Arnaldo Carvalho de MeloFrom: Paul Clarke <[email protected]>
Symbol versioning, as in glibc, results in symbols being defined as:
<real symbol>@[@]<version>
(Note that "@@" identifies a default symbol, if the symbol name is repeated.)
perf is currently unable to deal with this, and is unable to create user probes at such symbols:
--
$ nm /lib/powerpc64le-linux-gnu/libpthread.so.0 | grep pthread_create
0000000000008d30 t __pthread_create_2_1
0000000000008d30 T pthread_create@@GLIBC_2.17
$ /usr/bin/sudo perf probe -v -x /lib/powerpc64le-linux-gnu/libpthread.so.0 pthread_create
probe-definition(0): pthread_create
symbol:pthread_create file:(null) line:0 offset:0 return:0 lazy:(null)
0 arguments
Open Debuginfo file: /usr/lib/debug/lib/powerpc64le-linux-gnu/libpthread-2.19.so
Try to find probe point from debuginfo.
Probe point 'pthread_create' not found.
Error: Failed to add events. Reason: No such file or directory (Code: -2)
--One is not able to specify the fully versioned symbol, either, due to syntactic conflicts with other uses of "@" by perf:
--
$ /usr/bin/sudo perf probe -v -x /lib/powerpc64le-linux-gnu/libpthread.so.0 pthread_create@@GLIBC_2.17
probe-definition(0): pthread_create@@GLIBC_2.17
Semantic error :SRC@SRC is not allowed.
0 arguments
Error: Command Parse Error. Reason: Invalid argument (Code: -22)
--This patch ignores versioning for default symbols, thus allowing probes to be created for these symbols:
--
$ /usr/bin/sudo ./perf probe -x /lib/powerpc64le-linux-gnu/libpthread.so.0 pthread_create
Added new event:
probe_libpthread:pthread_create (on pthread_create in /lib/powerpc64le-linux-gnu/libpthread-2.19.so)You can now use it in all perf tools, such as:
perf record -e probe_libpthread:pthread_create -aR sleep 1
$ /usr/bin/sudo ./perf record -e probe_libpthread:pthread_create -aR ./test 2
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.052 MB perf.data (2 samples) ]
$ /usr/bin/sudo ./perf script
test 2915 [000] 19124.260729: probe_libpthread:pthread_create: (3fff99248d38)
test 2916 [000] 19124.260962: probe_libpthread:pthread_create: (3fff99248d38)
$ /usr/bin/sudo ./perf probe --del=probe_libpthread:pthread_create
Removed event: probe_libpthread:pthread_create
--Committer note:
Change the variable storing the result of strlen() to 'int', to fix the build on debian:experimental-x-mipsel, fedora:24-x-ARC-uClibc, ubuntu:16.04-x-arm, etc:
util/symbol.c: In function 'symbol__match_symbol_name':
util/symbol.c:422:11: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
if (len < versioning - name)
^
--- tools/perf/arch/powerpc/util/sym-handling.c | 12 ++++++ tools/perf/util/map.c | 5 --- tools/perf/util/map.h | 5 ++- tools/perf/util/symbol.c | 61 +++++++++++++++++++++++------ tools/perf/util/symbol.h | 11 ++++++ 5 files changed, 74 insertions(+), 20 deletions(-)
tools/perf/arch/powerpc/util/sym-handling.c +12 -0
@@ -52,6 +52,18 @@ int arch__compare_symbol_names(const char *namea, const char *nameb) return strcmp(namea, nameb); } + +int arch__compare_symbol_names_n (const char *namea,const char *nameb, +unsigned int n) +{ +/* Skip over initial dot */ +if (*namea =='.' ) + namea++; +if (*nameb =='.' ) + nameb++; + +return strncmp (namea, nameb, n); +}#endif #if defined(_CALL_ELF) && _CALL_ELF ==2
tools/perf/util/map.c +0 -5
@@ -325,11 +325,6 @@ int map__load(struct map *map)return 0 ; } -int __weak arch__compare_symbol_names (const char *namea,const char *nameb) -{ -return strcmp (namea, nameb); -} -struct symbol *map__find_symbol (struct map *map,u64 addr) {if (map__load (map) <0 )
tools/perf/util/map.h +3 -2
@@ -130,13 +130,14 @@ struct thread;*/ #define __map__for_each_symbol_by_name (map, sym_name, pos) \ for (pos = map__find_symbol_by_name(map, sym_name); \ - pos && arch__compare_symbol_names(pos->name, sym_name) == 0; \ + pos && \ + !symbol__match_symbol_name(pos->name, sym_name, \ + SYMBOL_TAG_INCLUDE__DEFAULT_ONLY); \ pos = symbol__next_by_name(pos))#define map__for_each_symbol_by_name (map, sym_name, pos) \ __map__for_each_symbol_by_name(map, sym_name, (pos)) -int arch__compare_symbol_names (const char *namea,const char *nameb);void map__init (struct map *map,enum map_type type,u64 start,u64 end,u64 pgoff,struct dso *dso); struct map *map__new(struct machine *machine, u64 start, u64 len,
tools/perf/util/symbol.c +48 -13
96 lines not on this page · raw message
tools/perf/util/symbol.h +11 -0
@@ -348,8 +348,19 @@ void arch__sym_update(struct symbol *s, GElf_Sym *sym);#define SYMBOL_A 0#define SYMBOL_B 1 +int arch__compare_symbol_names (const char *namea,const char *nameb); +int arch__compare_symbol_names_n (const char *namea,const char *nameb, +unsigned int n);int arch__choose_best_symbol (struct symbol *syma,struct symbol *symb); +enum symbol_tag_include { +SYMBOL_TAG_INCLUDE__NONE =0 , +SYMBOL_TAG_INCLUDE__DEFAULT_ONLY +}; + +int symbol__match_symbol_name (const char *namea,const char *nameb, +enum symbol_tag_include includes); +/* structure containing an SDT note's info */ struct sdt_note {char *name;/* name of the note*/
Signature · 1 line
2.9.3
Arnaldo Carvalho de Melo
maintainerPATCH 10/10 perf config: Refactor a duplicated code for obtaining config file name
In reply to Arnaldo Carvalho de MeloFrom: Taeung Song <[email protected]>
We were doing the same sequence to figure out what is the config pathname to use, fix it by doing it before those two uses.
--- tools/perf/builtin-config.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
tools/perf/builtin-config.c +8 -11
@@ -159,6 +159,7 @@ int cmd_config(int argc, const char **argv)int i, ret =0 ;struct perf_config_set *set;char *user_config =mkpath ("%s/.perfconfig" ,getenv ("HOME" )); +const char *config_filename; argc =parse_options (argc, argv, config_options, config_usage,PARSE_OPT_STOP_AT_NON_OPTION );
@@ -175,6 +176,11 @@ int cmd_config(int argc, const char **argv)else if (use_user_config) config_exclusive_filename = user_config; +if (!config_exclusive_filename) + config_filename = user_config; +else + config_filename = config_exclusive_filename; +/* * At only 'config' sub-command, individually use the config set * because of reinitializing with options config file location.
@@ -192,13 +198,9 @@ int cmd_config(int argc, const char **argv)parse_options_usage (config_usage, config_options,"l" ,1 ); }else { ret =show_config (set); -if (ret <0 ) { -const char * config_filename = config_exclusive_filename; -if (!config_exclusive_filename) - config_filename = user_config; +if (ret <0 )pr_err ("Nothing configured, " "please check your %s \n" , config_filename); - } }break ;default :
@@ -221,13 +223,8 @@ int cmd_config(int argc, const char **argv)if (value ==NULL ) ret =show_spec_config (set, var); -else { -const char *config_filename = config_exclusive_filename; - -if (!config_exclusive_filename) - config_filename = user_config; +else ret =set_config (set, config_filename, var, value); - }free (arg); } }else
Signature · 1 line
2.9.3
Quoted 98 lines · 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
fd7647979a3948dae4fc6f25dbbdf9ba269bed78:Merge tag 'perf-core-for-mingo-4.12-20170424' of
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linuxinto perf/core (2017-04-24 23:31:35 +0200)are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.gittags/perf-core-for-mingo-4.12-20170503for you to fetch changes up to
4341ec6b3db4c3e903d6c44958722918baec1e59:perf config: Refactor a duplicated code for obtaining config file name (2017-05-02 18:23:12 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:Fixes:
- Support setting probes in versioned user space symbols, such as pthread_create@@GLIBC_2.1, picking the default one, more work needed to make it possible to set it on the other versions, as the 'perf probe' syntax already uses @ for other purposes. (Paul Clarke)
- Do not special case address zero as an error for routines that return addresses (symbol lookup), instead use the return as the success/error indication and pass a pointer to return the address, fixing 'perf test vmlinux' (the one that compares address between vmlinux and kallsyms) on s/390, where the '
_text' address is equal to zero (Arnaldo Carvalho de Melo)Infrastructure:
- More header sanitization, moving stuff out of
util.hinto more appropriate headers and objects and sometimes creating new ones (Arnaldo Carvalho de Melo)- Refactor a duplicated code for obtaining config file name (Taeung Song)
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>----------------------------------------------------------------
Arnaldo Carvalho de Melo (8):
perf buildid: Move prototypes fromutil.htobuild-id.hperf tools: Move event prototypes fromutil.htoevent.hperf memswap: Split the byteswap memory range wrappers from util.[ch] perf tools: MoveHAS_BOOLdefine to where perl headers are used perf ui gtk: Move gtk .so name to the only place where it is used perf units: Moveparse_tag_value()to units.[ch]
tools lib string: Adoptprefixcmp()from perf and subcmd perf symbols: Accept symbols starting at address 0Paul Clarke (1):
perf symbols: Allow user probes on versioned symbolsTaeung Song (1):
perf config: Refactor a duplicated code for obtaining config file nametools/include/linux/string.h | 2 + tools/lib/string.c | 9 +++ tools/lib/subcmd/help.c | 1 + tools/lib/subcmd/parse-options.c | 1 + tools/lib/subcmd/subcmd-util.h | 9 --- tools/perf/arch/powerpc/util/sym-handling.c | 12 ++++ tools/perf/builtin-buildid-cache.c | 13 ++-- tools/perf/builtin-c2c.c | 1 + tools/perf/builtin-config.c | 19 +++--- tools/perf/builtin-top.c | 2 +- tools/perf/builtin-trace.c | 1 + tools/perf/perf.c | 1 + tools/perf/tests/hists_cumulate.c | 1 + tools/perf/tests/hists_filter.c | 1 + tools/perf/tests/hists_output.c | 1 + tools/perf/tests/sdt.c | 1 - tools/perf/ui/setup.c | 3 + tools/perf/util/Build | 1 + tools/perf/util/build-id.h | 4 ++ tools/perf/util/event.c | 10 +-- tools/perf/util/event.h | 12 +++- tools/perf/util/evsel.c | 1 + tools/perf/util/header.c | 1 + tools/perf/util/intel-pt.c | 1 + tools/perf/util/machine.c | 28 +++++---- tools/perf/util/map.c | 5 -- tools/perf/util/map.h | 5 +- tools/perf/util/memswap.c | 24 ++++++++ tools/perf/util/memswap.h | 7 +++ .../perf/util/scripting-engines/trace-event-perl.c | 4 +- tools/perf/util/session.c | 1 + tools/perf/util/strbuf.c | 9 --- tools/perf/util/symbol.c | 72 ++++++++++++++++------
Quoted 8 lines
tools/perf/util/symbol.h | 11 ++++ tools/perf/util/units.c | 29 +++++++++ tools/perf/util/units.h | 7 +++ tools/perf/util/util.c | 49 --------------- tools/perf/util/util.h | 26 -------- 38 files changed, 230 insertions(+), 155 deletions(-) create mode 100644 tools/perf/util/memswap.c create mode 100644 tools/perf/util/memswap.h
Pulled, thanks a lot Arnaldo!
Ingo