Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1626475 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2017-04-19 18:30 +0200 |
| Last post | 2017-04-20 21:00 +0200 |
| Articles | 13 — 2 participants |
Back to article view | Back to linux.kernel
[GIT PULL 00/28] perf/core fixes and cleanups Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-19 18:30 +0200
[PATCH 12/28] perf tools: Replace STR() calls with __stringify() Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-19 18:30 +0200
[PATCH 10/28] perf tools: Including missing inttypes.h header Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-19 18:30 +0200
[PATCH 23/28] perf tools: No need to include bitops.h in util.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-19 18:30 +0200
[PATCH 09/28] perf tools: Remove unused macros from util.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-19 18:30 +0200
[PATCH 22/28] perf tools: Move path related functions to util/path.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-19 18:30 +0200
[PATCH 11/28] perf tools: Remove PRI[xu] macros from perf.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-19 18:30 +0200
Re: [GIT PULL 00/28] perf/core fixes and cleanups Ingo Molnar <mingo@kernel.org> - 2017-04-20 10:20 +0200
Re: [GIT PULL 00/28] perf/core fixes and cleanups Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-20 13:30 +0200
Re: [GIT PULL 00/28] perf/core fixes and cleanups Ingo Molnar <mingo@kernel.org> - 2017-04-20 13:40 +0200
Re: [GIT PULL 00/28] perf/core fixes and cleanups Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-20 19:20 +0200
Re: [GIT PULL 00/28] perf/core fixes and cleanups Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-20 20:40 +0200
Re: [GIT PULL 00/28] perf/core fixes and cleanups Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-20 21:00 +0200
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-04-19 18:30 +0200 |
| Subject | [GIT PULL 00/28] perf/core fixes and cleanups |
| Message-ID | <ty0uK-5Cb-19@gated-at.bofh.it> |
Hi Ingo,
Please consider pulling,
- Arnaldo
Test results at the end of this message, as usual.
The following changes since commit e720c19e0d5412f45736d62258d21dc7b056c4ad:
Merge tag 'perf-core-for-mingo-4.12-20170413' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-04-17 10:11:09 +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-20170419
for you to fetch changes up to 1b5ad16c7aa7177512ce141e345ff36b9f1a6136:
perf tools: Ditch unused strchrnul() reimplementation (2017-04-19 13:01:57 -0300)
----------------------------------------------------------------
perf/core cleanups: (Arnaldo Carvalho de Melo)
. Introduce new header files out of the hodge-podge that util/util.h
became, trying to disentangle the includes hell that all C projects
end up growing. This should help in build times, as changes to
seemingly unrelated files (util.h included tons of headers) won't
trigger a rebuild of most object files.
. Use equivalent facilities found in the kernel source code base
originated tools/include/ header files, such as __stringify(),
ARRAY_SIZE, that has extra checks (__must_be_array()), etc.
. For that get some more files from the kernel sources, like
include/linux/bug.h, some just with the bits needed at this time.
. Use the headers where facilities declared in them are used, such
as PRIxu(32,64) macros (inttypes.h), errno defines (errno.h), etc.
. Remove various leftovers from the initial code base we copied from
git.git: FLEX_ARRAY, etc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (28):
perf unwind arm64: Add missing errno.h header
perf tools: Remove FLEX_ARRAY definition
tools include: Introduce linux/bug.h, from the kernel sources
tools include: Adopt __same_type() and __must_be_array() from the kernel
tools include: Move ARRAY_SIZE() to linux/kernel.h
perf tools: Add include <linux/kernel.h> where ARRAY_SIZE() is used
objtool: Drop ARRAY_SIZE() definition, tools/include/linux/kernel.h has it now
tools include: Drop ARRAY_SIZE() definition from linux/hashtable.h
perf tools: Remove unused macros from util.h
perf tools: Including missing inttypes.h header
perf tools: Remove PRI[xu] macros from perf.h
perf tools: Replace STR() calls with __stringify()
perf tools: Ditch unused PATH_SEP, STRIP_EXTENSION
perf tools: Move sane ctype stuff from util.h to sane_ctype.h
tools include: Include missing headers for fls() and types in linux/log2.h
perf tools: Move print_binary definitions to separate files
perf tools: Move srcline definitions to separate header
perf tools: Move extra string util functions to util/string2.h
perf tools: Include errno.h where needed
perf str{filter,list}: Disentangle headers
perf tools: Don't include terminal handling headers in util.h
perf tools: Move path related functions to util/path.h
perf tools: No need to include bitops.h in util.h
perf tools: Use api/fs/tracing_path.h where needed
perf tools: Remove misplaced __maybe_unused in some functions
perf tools: Remove include dirent.h from util.h
perf tools: Remove regex.h and fnmatch.h from util.h
perf tools: Ditch unused strchrnul() reimplementation
tools/include/linux/bug.h | 10 +
tools/include/linux/compiler-gcc.h | 3 +
tools/include/linux/compiler.h | 5 +
tools/include/linux/hashtable.h | 4 -
tools/include/linux/kernel.h | 3 +
tools/include/linux/log2.h | 3 +
tools/lib/symbol/kallsyms.c | 1 +
tools/objtool/builtin-check.c | 3 +-
tools/objtool/objtool.c | 3 +-
tools/perf/MANIFEST | 1 +
tools/perf/arch/arm/util/dwarf-regs.c | 4 +-
tools/perf/arch/arm64/util/dwarf-regs.c | 4 +-
tools/perf/arch/arm64/util/unwind-libunwind.c | 2 +-
tools/perf/arch/common.c | 2 +
tools/perf/arch/powerpc/util/dwarf-regs.c | 5 +-
tools/perf/arch/powerpc/util/kvm-stat.c | 1 +
tools/perf/arch/powerpc/util/perf_regs.c | 1 +
tools/perf/arch/s390/util/kvm-stat.c | 1 +
tools/perf/arch/x86/tests/intel-cqm.c | 1 +
tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +
tools/perf/arch/x86/util/auxtrace.c | 1 +
tools/perf/arch/x86/util/intel-bts.c | 1 +
tools/perf/arch/x86/util/intel-pt.c | 1 +
tools/perf/arch/x86/util/kvm-stat.c | 1 +
tools/perf/arch/x86/util/perf_regs.c | 1 +
tools/perf/bench/mem-functions.c | 1 +
tools/perf/bench/numa.c | 2 +
tools/perf/builtin-annotate.c | 1 +
tools/perf/builtin-buildid-cache.c | 1 +
tools/perf/builtin-buildid-list.c | 1 +
tools/perf/builtin-c2c.c | 2 +
tools/perf/builtin-diff.c | 2 +
tools/perf/builtin-ftrace.c | 2 +
tools/perf/builtin-help.c | 6 +-
tools/perf/builtin-inject.c | 1 +
tools/perf/builtin-kallsyms.c | 1 +
tools/perf/builtin-kmem.c | 5 +
tools/perf/builtin-kvm.c | 4 +
tools/perf/builtin-lock.c | 3 +
tools/perf/builtin-mem.c | 1 +
tools/perf/builtin-record.c | 2 +
tools/perf/builtin-report.c | 4 +-
tools/perf/builtin-sched.c | 5 +
tools/perf/builtin-script.c | 8 +
tools/perf/builtin-stat.c | 5 +
tools/perf/builtin-timechart.c | 4 +-
tools/perf/builtin-top.c | 3 +
tools/perf/builtin-trace.c | 8 +
tools/perf/perf.c | 12 +-
tools/perf/tests/attr.c | 2 +
tools/perf/tests/backward-ring-buffer.c | 1 +
tools/perf/tests/bpf.c | 2 +
tools/perf/tests/builtin-test.c | 2 +
tools/perf/tests/clang.c | 1 +
tools/perf/tests/code-reading.c | 6 +-
tools/perf/tests/dso-data.c | 2 +
tools/perf/tests/dwarf-unwind.c | 1 +
tools/perf/tests/event-times.c | 2 +
tools/perf/tests/evsel-roundtrip-name.c | 2 +
tools/perf/tests/hists_common.c | 2 +
tools/perf/tests/hists_cumulate.c | 1 +
tools/perf/tests/hists_filter.c | 1 +
tools/perf/tests/hists_link.c | 2 +
tools/perf/tests/hists_output.c | 1 +
tools/perf/tests/is_printable_array.c | 3 +-
tools/perf/tests/mmap-basic.c | 3 +
tools/perf/tests/mmap-thread-lookup.c | 2 +
tools/perf/tests/openat-syscall-all-cpus.c | 6 +
tools/perf/tests/openat-syscall-tp-fields.c | 1 +
tools/perf/tests/openat-syscall.c | 5 +
tools/perf/tests/parse-events.c | 5 +-
tools/perf/tests/parse-no-sample-id-all.c | 1 +
tools/perf/tests/perf-record.c | 2 +
tools/perf/tests/pmu.c | 2 +
tools/perf/tests/sample-parsing.c | 2 +
tools/perf/tests/sdt.c | 1 +
tools/perf/tests/sw-clock.c | 2 +
tools/perf/tests/switch-tracking.c | 1 +
tools/perf/tests/task-exit.c | 1 +
tools/perf/tests/unit_number__scnprintf.c | 1 +
tools/perf/tests/vmlinux-kallsyms.c | 1 +
tools/perf/ui/browser.c | 2 +
tools/perf/ui/browsers/annotate.c | 3 +
tools/perf/ui/browsers/header.c | 2 +
tools/perf/ui/browsers/hists.c | 8 +
tools/perf/ui/browsers/map.c | 2 +
tools/perf/ui/gtk/annotate.c | 2 +-
tools/perf/ui/gtk/hists.c | 1 +
tools/perf/ui/hist.c | 1 +
tools/perf/ui/setup.c | 1 +
tools/perf/ui/stdio/hist.c | 4 +-
tools/perf/ui/tui/setup.c | 1 +
tools/perf/util/Build | 1 +
tools/perf/util/annotate.c | 6 +
tools/perf/util/auxtrace.c | 6 +-
tools/perf/util/auxtrace.h | 1 +
tools/perf/util/bpf-loader.c | 3 +
tools/perf/util/bpf-loader.h | 2 +
tools/perf/util/bpf-prologue.c | 1 +
tools/perf/util/bpf-prologue.h | 2 +
tools/perf/util/build-id.c | 9 +-
tools/perf/util/build-id.h | 4 +-
tools/perf/util/c++/clang-c.h | 1 +
tools/perf/util/callchain.c | 1 +
tools/perf/util/cgroup.c | 5 +-
tools/perf/util/cloexec.c | 1 +
tools/perf/util/comm.c | 1 +
tools/perf/util/config.c | 3 +
tools/perf/util/counts.c | 2 +
tools/perf/util/cpumap.c | 3 +
tools/perf/util/ctype.c | 2 +-
tools/perf/util/data-convert-bt.c | 4 +
tools/perf/util/data.c | 1 +
tools/perf/util/debug.c | 4 +
tools/perf/util/demangle-java.c | 2 +
tools/perf/util/drv_configs.c | 1 +
tools/perf/util/dso.c | 4 +
tools/perf/util/dwarf-aux.c | 3 +
tools/perf/util/dwarf-regs.c | 1 +
tools/perf/util/env.c | 1 +
tools/perf/util/event.c | 7 +-
tools/perf/util/evlist.c | 2 +
tools/perf/util/evlist.h | 1 +
tools/perf/util/evsel.c | 4 +
tools/perf/util/evsel_fprintf.c | 2 +
tools/perf/util/header.c | 5 +
tools/perf/util/hist.c | 2 +
tools/perf/util/intel-bts.c | 2 +
tools/perf/util/intel-pt.c | 1 +
tools/perf/util/jitdump.c | 7 +-
tools/perf/util/lzma.c | 1 +
tools/perf/util/machine.c | 8 +-
tools/perf/util/map.c | 2 +-
tools/perf/util/mem-events.c | 1 +
tools/perf/util/ordered-events.c | 2 +
tools/perf/util/parse-events.c | 7 +-
tools/perf/util/path.c | 28 ++-
tools/perf/util/path.h | 9 +
tools/perf/util/perf-hooks.c | 1 +
tools/perf/util/pmu.c | 2 +
tools/perf/util/print_binary.c | 55 +++++
tools/perf/util/print_binary.h | 28 +++
tools/perf/util/probe-event.c | 5 +
tools/perf/util/probe-event.h | 7 +-
tools/perf/util/probe-file.c | 3 +
tools/perf/util/probe-file.h | 6 +-
tools/perf/util/probe-finder.c | 3 +
tools/perf/util/probe-finder.h | 2 +-
tools/perf/util/python-ext-sources | 1 +
tools/perf/util/python.c | 1 +
tools/perf/util/quote.c | 1 +
tools/perf/util/record.c | 1 +
tools/perf/util/sane_ctype.h | 51 +++++
.../perf/util/scripting-engines/trace-event-perl.c | 1 +
.../util/scripting-engines/trace-event-python.c | 2 +
tools/perf/util/session.c | 2 +
tools/perf/util/session.h | 1 +
tools/perf/util/sort.c | 5 +
tools/perf/util/sort.h | 4 +-
tools/perf/util/srcline.c | 2 +
tools/perf/util/srcline.h | 34 +++
tools/perf/util/stat.c | 2 +
tools/perf/util/strbuf.c | 1 +
tools/perf/util/strfilter.c | 5 +-
tools/perf/util/string.c | 18 +-
tools/perf/util/string2.h | 42 ++++
tools/perf/util/symbol-elf.c | 3 +-
tools/perf/util/symbol-minimal.c | 1 +
tools/perf/util/symbol.c | 3 +
tools/perf/util/symbol.h | 2 +-
tools/perf/util/term.c | 6 +-
tools/perf/util/thread-stack.c | 1 +
tools/perf/util/thread.c | 2 +
tools/perf/util/thread_map.c | 2 +
tools/perf/util/trace-event-parse.c | 3 +-
tools/perf/util/unwind-libdw.c | 1 +
tools/perf/util/unwind-libunwind-local.c | 2 +
tools/perf/util/util.c | 64 +-----
tools/perf/util/util.h | 249 +--------------------
tools/perf/util/vdso.c | 2 +-
180 files changed, 659 insertions(+), 376 deletions(-)
create mode 100644 tools/include/linux/bug.h
create mode 100644 tools/perf/util/path.h
create mode 100644 tools/perf/util/print_binary.c
create mode 100644 tools/perf/util/print_binary.h
create mode 100644 tools/perf/util/sane_ctype.h
create mode 100644 tools/perf/util/srcline.h
create mode 100644 tools/perf/util/string2.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.
For this specific pull request the samples/bpf/ was disabled, as 'make headers_install'
is failing with the following error, in this case in fedora:rawhide:
INSTALL usr/include/uapi/ (0 file)
/git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file ./arch/x86/include/generated/uapi/asm/unistd_32.h. Stop.
make[1]: *** [/git/linux/Makefile:1151: headers_install] Error 2
make[1]: Leaving directory '/tmp/build/linux'
make: *** [Makefile:152: sub-make] Error 2
make: Leaving directory '/git/linux'
I'll investigate later, perf and objtool builds just fine, with clang and gcc.
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: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-rc6+ #7 SMP Tue Apr 11 11:53:14 -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_clean_all_O: make clean all
make_no_libbionic_O: make NO_LIBBIONIC=1
make_tags_O: make tags
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_no_libpython_O: make NO_LIBPYTHON=1
make_no_auxtrace_O: make NO_AUXTRACE=1
make_no_slang_O: make NO_SLANG=1
make_no_libperl_O: make NO_LIBPERL=1
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_no_gtk2_O: make NO_GTK2=1
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_no_libnuma_O: make NO_LIBNUMA=1
make_install_prefix_O: make install prefix=/tmp/krava
make_install_O: make install
make_with_clangllvm_O: make LIBCLANGLLVM=1
make_no_backtrace_O: make NO_BACKTRACE=1
make_util_map_o_O: make util/map.o
make_pure_O: make
make_static_O: make LDFLAGS=-static
make_debug_O: make DEBUG=1
make_with_babeltrace_O: make LIBBABELTRACE=1
make_no_libelf_O: make NO_LIBELF=1
make_no_libaudit_O: make NO_LIBAUDIT=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_libunwind_O: make NO_LIBUNWIND=1
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_no_libbpf_O: make NO_LIBBPF=1
make_perf_o_O: make perf.o
make_help_O: make help
make_install_bin_O: make install-bin
make_doc_O: make doc
make_no_newt_O: make NO_NEWT=1
make_no_demangle_O: make NO_DEMANGLE=1
OK
make: Leaving directory '/home/acme/git/linux/tools/perf'
$
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-04-19 18:30 +0200 |
| Subject | [PATCH 12/28] perf tools: Replace STR() calls with __stringify() |
| Message-ID | <ty0Er-5Fr-55@gated-at.bofh.it> |
| In reply to | #1626475 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Both do the same thing, the later is the one we get from
linux/stringify.h, i.e. we now use the same function name/practice as
the kernel sources.
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-w2sxa5o4bfx7fjrd5mu4zmke@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/arch/arm/util/dwarf-regs.c | 4 ++--
tools/perf/arch/arm64/util/dwarf-regs.c | 3 ++-
tools/perf/arch/powerpc/util/dwarf-regs.c | 5 +++--
tools/perf/util/cgroup.c | 5 +++--
tools/perf/util/jitdump.c | 3 ++-
tools/perf/util/util.h | 3 ---
6 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/tools/perf/arch/arm/util/dwarf-regs.c b/tools/perf/arch/arm/util/dwarf-regs.c
index 33ec5b339da8..8bb176a37990 100644
--- a/tools/perf/arch/arm/util/dwarf-regs.c
+++ b/tools/perf/arch/arm/util/dwarf-regs.c
@@ -9,6 +9,7 @@
*/
#include <stddef.h>
+#include <linux/stringify.h>
#include <dwarf-regs.h>
struct pt_regs_dwarfnum {
@@ -16,10 +17,9 @@ struct pt_regs_dwarfnum {
unsigned int dwarfnum;
};
-#define STR(s) #s
#define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num}
#define GPR_DWARFNUM_NAME(num) \
- {.name = STR(%r##num), .dwarfnum = num}
+ {.name = __stringify(%r##num), .dwarfnum = num}
#define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0}
/*
diff --git a/tools/perf/arch/arm64/util/dwarf-regs.c b/tools/perf/arch/arm64/util/dwarf-regs.c
index 068b6189157b..aea610c292e6 100644
--- a/tools/perf/arch/arm64/util/dwarf-regs.c
+++ b/tools/perf/arch/arm64/util/dwarf-regs.c
@@ -11,6 +11,7 @@
#include <stddef.h>
#include <dwarf-regs.h>
#include <linux/ptrace.h> /* for struct user_pt_regs */
+#include <linux/stringify.h>
#include "util.h"
struct pt_regs_dwarfnum {
@@ -20,7 +21,7 @@ struct pt_regs_dwarfnum {
#define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num}
#define GPR_DWARFNUM_NAME(num) \
- {.name = STR(%x##num), .dwarfnum = num}
+ {.name = __stringify(%x##num), .dwarfnum = num}
#define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0}
#define DWARFNUM2OFFSET(index) \
(index * sizeof((struct user_pt_regs *)0)->regs[0])
diff --git a/tools/perf/arch/powerpc/util/dwarf-regs.c b/tools/perf/arch/powerpc/util/dwarf-regs.c
index 41bdf9530d82..98ac87052a74 100644
--- a/tools/perf/arch/powerpc/util/dwarf-regs.c
+++ b/tools/perf/arch/powerpc/util/dwarf-regs.c
@@ -15,6 +15,7 @@
#include <dwarf-regs.h>
#include <linux/ptrace.h>
#include <linux/kernel.h>
+#include <linux/stringify.h>
#include "util.h"
struct pt_regs_dwarfnum {
@@ -24,10 +25,10 @@ struct pt_regs_dwarfnum {
};
#define REG_DWARFNUM_NAME(r, num) \
- {.name = STR(%)STR(r), .dwarfnum = num, \
+ {.name = __stringify(%)__stringify(r), .dwarfnum = num, \
.ptregs_offset = offsetof(struct pt_regs, r)}
#define GPR_DWARFNUM_NAME(num) \
- {.name = STR(%gpr##num), .dwarfnum = num, \
+ {.name = __stringify(%gpr##num), .dwarfnum = num, \
.ptregs_offset = offsetof(struct pt_regs, gpr[num])}
#define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0, .ptregs_offset = 0}
diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c
index 86399eda3684..03347748f3fa 100644
--- a/tools/perf/util/cgroup.c
+++ b/tools/perf/util/cgroup.c
@@ -4,6 +4,7 @@
#include "evsel.h"
#include "cgroup.h"
#include "evlist.h"
+#include <linux/stringify.h>
int nr_cgroups;
@@ -27,8 +28,8 @@ cgroupfs_find_mountpoint(char *buf, size_t maxlen)
path_v1[0] = '\0';
path_v2[0] = '\0';
- while (fscanf(fp, "%*s %"STR(PATH_MAX)"s %"STR(PATH_MAX)"s %"
- STR(PATH_MAX)"s %*d %*d\n",
+ while (fscanf(fp, "%*s %"__stringify(PATH_MAX)"s %"__stringify(PATH_MAX)"s %"
+ __stringify(PATH_MAX)"s %*d %*d\n",
mountpoint, type, tokens) == 3) {
if (!path_v1[0] && !strcmp(type, "cgroup")) {
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index c9a941ef0f6d..da6262dbe9e3 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -9,6 +9,7 @@
#include <byteswap.h>
#include <sys/stat.h>
#include <sys/mman.h>
+#include <linux/stringify.h>
#include "util.h"
#include "event.h"
@@ -181,7 +182,7 @@ jit_open(struct jit_buf_desc *jd, const char *name)
jd->use_arch_timestamp);
if (header.version > JITHEADER_VERSION) {
- pr_err("wrong jitdump version %u, expected " STR(JITHEADER_VERSION),
+ pr_err("wrong jitdump version %u, expected " __stringify(JITHEADER_VERSION),
header.version);
goto error;
}
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 593a24192924..aa35509464b5 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -180,9 +180,6 @@ struct perf_event_attr;
void event_attr_init(struct perf_event_attr *attr);
-#define _STR(x) #x
-#define STR(x) _STR(x)
-
size_t hex_width(u64 v);
int hex2u64(const char *ptr, u64 *val);
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-04-19 18:30 +0200 |
| Subject | [PATCH 10/28] perf tools: Including missing inttypes.h header |
| Message-ID | <ty0Er-5Fr-47@gated-at.bofh.it> |
| In reply to | #1626475 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Needed to use the PRI[xu](32,64) formatting macros.
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-wkbho8kaw24q67dd11q0j39f@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/arch/x86/tests/perf-time-to-tsc.c | 1 +
tools/perf/bench/numa.c | 1 +
tools/perf/builtin-c2c.c | 1 +
tools/perf/builtin-diff.c | 1 +
tools/perf/builtin-kallsyms.c | 1 +
tools/perf/builtin-kmem.c | 1 +
tools/perf/builtin-kvm.c | 1 +
tools/perf/builtin-lock.c | 1 +
tools/perf/builtin-mem.c | 1 +
tools/perf/builtin-record.c | 1 +
tools/perf/builtin-report.c | 1 +
tools/perf/builtin-sched.c | 1 +
tools/perf/builtin-script.c | 1 +
tools/perf/builtin-stat.c | 1 +
tools/perf/builtin-timechart.c | 1 +
tools/perf/builtin-trace.c | 1 +
tools/perf/tests/attr.c | 1 +
tools/perf/tests/code-reading.c | 1 +
tools/perf/tests/dwarf-unwind.c | 1 +
tools/perf/tests/event-times.c | 1 +
tools/perf/tests/hists_common.c | 1 +
tools/perf/tests/mmap-basic.c | 1 +
tools/perf/tests/mmap-thread-lookup.c | 1 +
tools/perf/tests/openat-syscall-all-cpus.c | 1 +
tools/perf/tests/openat-syscall.c | 1 +
tools/perf/tests/perf-record.c | 1 +
tools/perf/tests/sample-parsing.c | 1 +
tools/perf/tests/sw-clock.c | 1 +
tools/perf/tests/unit_number__scnprintf.c | 1 +
tools/perf/tests/vmlinux-kallsyms.c | 1 +
tools/perf/ui/browsers/annotate.c | 1 +
tools/perf/ui/browsers/hists.c | 1 +
tools/perf/ui/gtk/annotate.c | 2 +-
tools/perf/ui/hist.c | 1 +
tools/perf/util/annotate.c | 1 +
tools/perf/util/auxtrace.c | 1 +
tools/perf/util/callchain.c | 1 +
tools/perf/util/data-convert-bt.c | 1 +
tools/perf/util/debug.c | 1 +
tools/perf/util/dwarf-aux.c | 1 +
tools/perf/util/event.c | 1 +
tools/perf/util/evlist.c | 1 +
tools/perf/util/evsel.c | 1 +
tools/perf/util/evsel_fprintf.c | 1 +
tools/perf/util/header.c | 1 +
tools/perf/util/intel-bts.c | 1 +
tools/perf/util/intel-pt.c | 1 +
tools/perf/util/machine.c | 1 +
tools/perf/util/ordered-events.c | 1 +
tools/perf/util/probe-event.c | 1 +
tools/perf/util/probe-finder.c | 1 +
tools/perf/util/scripting-engines/trace-event-perl.c | 1 +
tools/perf/util/scripting-engines/trace-event-python.c | 1 +
tools/perf/util/session.c | 1 +
tools/perf/util/sort.c | 1 +
tools/perf/util/srcline.c | 1 +
tools/perf/util/stat.c | 1 +
tools/perf/util/unwind-libunwind-local.c | 1 +
tools/perf/util/util.c | 1 +
59 files changed, 59 insertions(+), 1 deletion(-)
diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
index 5c76cc83186a..a8e37f3148c2 100644
--- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c
+++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <stdio.h>
#include <unistd.h>
#include <linux/types.h>
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
index 27ebd50ee619..27de0c8c5c19 100644
--- a/tools/perf/bench/numa.c
+++ b/tools/perf/bench/numa.c
@@ -4,6 +4,7 @@
* numa: Simulate NUMA-sensitive workload and measure their NUMA performance
*/
+#include <inttypes.h>
/* For the CLR_() macros */
#include <pthread.h>
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 70c2c773a2b8..cc8156a969ac 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -9,6 +9,7 @@
* Dick Fowles <fowles@inreach.com>
* Joe Mario <jmario@redhat.com>
*/
+#include <inttypes.h>
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <linux/stringify.h>
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index cd2605d86984..09be77b13788 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -19,6 +19,7 @@
#include "util/data.h"
#include "util/config.h"
+#include <inttypes.h>
#include <stdlib.h>
#include <math.h>
diff --git a/tools/perf/builtin-kallsyms.c b/tools/perf/builtin-kallsyms.c
index 8ff38c4eb2c0..bcfb363112d3 100644
--- a/tools/perf/builtin-kallsyms.c
+++ b/tools/perf/builtin-kallsyms.c
@@ -7,6 +7,7 @@
*
* Released under the GPL v2. (and only v2, not any later version)
*/
+#include <inttypes.h>
#include "builtin.h"
#include <linux/compiler.h>
#include <subcmd/parse-options.h>
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 8f0b94563936..fa6bf1c39b65 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -23,6 +23,7 @@
#include <linux/kernel.h>
#include <linux/rbtree.h>
#include <linux/string.h>
+#include <inttypes.h>
#include <locale.h>
#include <regex.h>
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index a7d7f4c6052e..e82a6979327f 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -26,6 +26,7 @@
#include <linux/kernel.h>
#include <linux/time64.h>
+#include <inttypes.h>
#include <termios.h>
#include <semaphore.h>
#include <pthread.h>
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index f74dd869f88b..6f93a6f0e268 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include "builtin.h"
#include "perf.h"
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index 643f4faac0d0..1ebc67390898 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include "builtin.h"
#include "perf.h"
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 3191ab063852..65429d1b29c8 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -40,6 +40,7 @@
#include "util/perf-hooks.h"
#include "asm/bug.h"
+#include <inttypes.h>
#include <unistd.h>
#include <sched.h>
#include <sys/mman.h>
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index c18158b83eb1..66a2f44518de 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -40,6 +40,7 @@
#include "util/auxtrace.h"
#include <dlfcn.h>
+#include <inttypes.h>
#include <linux/bitmap.h>
#include <linux/stringify.h>
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 5cd60882c8d9..d4677fb7f7f5 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -26,6 +26,7 @@
#include <linux/log2.h>
#include <sys/prctl.h>
#include <sys/resource.h>
+#include <inttypes.h>
#include <semaphore.h>
#include <pthread.h>
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 36b076653d16..c4e36b4743f4 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -30,6 +30,7 @@
#include "asm/bug.h"
#include "util/mem-events.h"
#include "util/dump-insn.h"
+#include <inttypes.h>
static char const *script_name;
static char const *generate_script_lang;
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 610225b6326e..b7199f029073 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -70,6 +70,7 @@
#include <api/fs/fs.h>
#include <stdlib.h>
#include <sys/prctl.h>
+#include <inttypes.h>
#include <locale.h>
#include <math.h>
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 822c8d39ca1d..a24b229a785f 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -12,6 +12,7 @@
* of the License.
*/
+#include <inttypes.h>
#include <traceevent/event-parse.h>
#include "builtin.h"
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 2792ed1fae43..aba5fac41529 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -39,6 +39,7 @@
#include "syscalltbl.h"
#include "rb_resort.h"
+#include <inttypes.h>
#include <libaudit.h> /* FIXME: Still needed for audit_errno_to_name */
#include <stdlib.h>
#include <string.h>
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index 88dc51f4c27b..bb2bc487f703 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -18,6 +18,7 @@
* permissions. All the event text files are stored there.
*/
+#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <linux/types.h>
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 99dbd5ae294a..6effcfb7e0c1 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -1,5 +1,6 @@
#include <linux/kernel.h>
#include <linux/types.h>
+#include <inttypes.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
index 1046491de4b2..dfe5c89e2049 100644
--- a/tools/perf/tests/dwarf-unwind.c
+++ b/tools/perf/tests/dwarf-unwind.c
@@ -1,5 +1,6 @@
#include <linux/compiler.h>
#include <linux/types.h>
+#include <inttypes.h>
#include <unistd.h>
#include "tests.h"
#include "debug.h"
diff --git a/tools/perf/tests/event-times.c b/tools/perf/tests/event-times.c
index 19ef77bd6eb4..8d376e155697 100644
--- a/tools/perf/tests/event-times.c
+++ b/tools/perf/tests/event-times.c
@@ -1,4 +1,5 @@
#include <linux/compiler.h>
+#include <inttypes.h>
#include <string.h>
#include "tests.h"
#include "evlist.h"
diff --git a/tools/perf/tests/hists_common.c b/tools/perf/tests/hists_common.c
index f6c580e3ed84..00b8dc50f3db 100644
--- a/tools/perf/tests/hists_common.c
+++ b/tools/perf/tests/hists_common.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include "perf.h"
#include "util/debug.h"
#include "util/symbol.h"
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
index a7cb80805993..aba40eb4c56f 100644
--- a/tools/perf/tests/mmap-basic.c
+++ b/tools/perf/tests/mmap-basic.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
/* For the CLR_() macros */
#include <pthread.h>
diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c
index 0c5ce44f723f..a5ffb754f8c6 100644
--- a/tools/perf/tests/mmap-thread-lookup.c
+++ b/tools/perf/tests/mmap-thread-lookup.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/types.h>
diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c
index c8d9592eb142..eb7b1a6d507e 100644
--- a/tools/perf/tests/openat-syscall-all-cpus.c
+++ b/tools/perf/tests/openat-syscall-all-cpus.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
/* For the CPU_* macros */
#include <pthread.h>
diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c
index d7414128d7fe..5964938d4b85 100644
--- a/tools/perf/tests/openat-syscall.c
+++ b/tools/perf/tests/openat-syscall.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <api/fs/tracing_path.h>
#include <linux/err.h>
#include "thread_map.h"
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index 87893f3ba5f1..a8b6fdaf8df1 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
/* For the CLR_() macros */
#include <pthread.h>
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c
index 73b5e47ef20b..bac5c3885b3b 100644
--- a/tools/perf/tests/sample-parsing.c
+++ b/tools/perf/tests/sample-parsing.c
@@ -1,4 +1,5 @@
#include <stdbool.h>
+#include <inttypes.h>
#include <linux/kernel.h>
#include <linux/types.h>
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c
index 4c9fd046d57b..29f11c4b3e60 100644
--- a/tools/perf/tests/sw-clock.c
+++ b/tools/perf/tests/sw-clock.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
diff --git a/tools/perf/tests/unit_number__scnprintf.c b/tools/perf/tests/unit_number__scnprintf.c
index 623c2aa53c4a..f84cb70ee5e5 100644
--- a/tools/perf/tests/unit_number__scnprintf.c
+++ b/tools/perf/tests/unit_number__scnprintf.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <linux/compiler.h>
#include <linux/types.h>
#include "tests.h"
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index 862b043e5924..8456175fc234 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -1,5 +1,6 @@
#include <linux/compiler.h>
#include <linux/rbtree.h>
+#include <inttypes.h>
#include <string.h>
#include "map.h"
#include "symbol.h"
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 9adce112d255..2ed64124276f 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -9,6 +9,7 @@
#include "../../util/symbol.h"
#include "../../util/evsel.h"
#include "../../util/config.h"
+#include <inttypes.h>
#include <pthread.h>
#include <linux/kernel.h>
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index da24072bb76e..a2ea1fa15ae6 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/perf/ui/gtk/annotate.c b/tools/perf/ui/gtk/annotate.c
index 8c9308ac30b7..71359b898b67 100644
--- a/tools/perf/ui/gtk/annotate.c
+++ b/tools/perf/ui/gtk/annotate.c
@@ -3,7 +3,7 @@
#include "util/annotate.h"
#include "util/evsel.h"
#include "ui/helpline.h"
-
+#include <inttypes.h>
enum {
ANN_COL__PERCENT,
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 5d632dca672a..59addd52d9cd 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <math.h>
#include <linux/compiler.h>
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 45df4a38811a..4d4faf99d52d 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -7,6 +7,7 @@
* Released under the GPL v2. (and only v2, not any later version)
*/
+#include <inttypes.h>
#include "util.h"
#include "ui/ui.h"
#include "sort.h"
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index 78bd632f144d..a81a402a7459 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -13,6 +13,7 @@
*
*/
+#include <inttypes.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <stdbool.h>
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 2e5eff5abef0..0096d45a06b3 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -9,6 +9,7 @@
*
*/
+#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index b7917519f6cc..ef80221e0d9c 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -7,6 +7,7 @@
* Released under the GPL v2. (and only v2, not any later version)
*/
+#include <inttypes.h>
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <babeltrace/ctf-writer/writer.h>
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
index 03eb81f30d0d..4d5df25f155a 100644
--- a/tools/perf/util/debug.c
+++ b/tools/perf/util/debug.c
@@ -2,6 +2,7 @@
#include "../perf.h"
+#include <inttypes.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index 41e068e94349..5fb186d142f6 100644
--- a/tools/perf/util/dwarf-aux.c
+++ b/tools/perf/util/dwarf-aux.c
@@ -17,6 +17,7 @@
*
*/
+#include <inttypes.h>
#include <stdbool.h>
#include "util.h"
#include "debug.h"
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index a0f59f69f46a..b761b0eb60af 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 50420cd35446..cf27039df100 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -8,6 +8,7 @@
*/
#include "util.h"
#include <api/fs/fs.h>
+#include <inttypes.h>
#include <poll.h>
#include "cpumap.h"
#include "thread_map.h"
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 3779b9f3f134..99a13a63ff1f 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -8,6 +8,7 @@
*/
#include <byteswap.h>
+#include <inttypes.h>
#include <linux/bitops.h>
#include <api/fs/tracing_path.h>
#include <traceevent/event-parse.h>
diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c
index 4ef5184819a0..8000f62d5d53 100644
--- a/tools/perf/util/evsel_fprintf.c
+++ b/tools/perf/util/evsel_fprintf.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <stdio.h>
#include <stdbool.h>
#include <traceevent/event-parse.h>
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 2ccc7f06db79..0371f3483ede 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include "util.h"
#include <sys/types.h>
#include <byteswap.h>
diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c
index 6c2eb5da4afc..471ed8b26a1c 100644
--- a/tools/perf/util/intel-bts.c
+++ b/tools/perf/util/intel-bts.c
@@ -15,6 +15,7 @@
#include <endian.h>
#include <byteswap.h>
+#include <inttypes.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/bitops.h>
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index da20cd5612e9..bdd4a28c6cee 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -13,6 +13,7 @@
*
*/
+#include <inttypes.h>
#include <stdio.h>
#include <stdbool.h>
#include <errno.h>
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index dfc600446586..15b2a17cf76e 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include "callchain.h"
#include "debug.h"
#include "event.h"
diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index e70e935b1841..df05be69cc9e 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <linux/list.h>
#include <linux/compiler.h>
#include <linux/string.h>
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index e4b889444447..e61b4b34a929 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -19,6 +19,7 @@
*
*/
+#include <inttypes.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 57cd268d4275..9ddd7dad2e6e 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -19,6 +19,7 @@
*
*/
+#include <inttypes.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
index dff043a29589..2b12bdb3ce33 100644
--- a/tools/perf/util/scripting-engines/trace-event-perl.c
+++ b/tools/perf/util/scripting-engines/trace-event-perl.c
@@ -19,6 +19,7 @@
*
*/
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 783326cfbaa6..dd61213e7a3c 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -21,6 +21,7 @@
#include <Python.h>
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 7b740a73e595..0695e08d2252 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <linux/kernel.h>
#include <traceevent/event-parse.h>
#include <api/fs/fs.h>
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 13b9af1d1b45..63ad5374f364 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <sys/mman.h>
#include "sort.h"
#include "hist.h"
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index 778ccb5d99d1..ef192802edc9 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 0d51334a9b46..bbf30b2d1614 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <math.h>
#include "stat.h"
#include "evlist.h"
diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index bfb9b7987692..788f4d3c76f5 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -18,6 +18,7 @@
#include <elf.h>
#include <gelf.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 6097d87429e2..524bd3b9d98d 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -7,6 +7,7 @@
#ifdef HAVE_BACKTRACE_SUPPORT
#include <execinfo.h>
#endif
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-04-19 18:30 +0200 |
| Subject | [PATCH 23/28] perf tools: No need to include bitops.h in util.h |
| Message-ID | <ty0Es-5Fr-61@gated-at.bofh.it> |
| In reply to | #1626475 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
When we switched to the kernel's roundup_pow_of_two we forgot to remove
this include from util.h, do it now.
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>
Fixes: 91529834d1de ("perf evlist: Use roundup_pow_of_two")
Link: http://lkml.kernel.org/n/tip-kfye5rxivib6155cltx0bw4h@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/util.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 617965644ff4..423ed7f8bcc0 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -35,7 +35,6 @@
#include <linux/kernel.h>
#include <linux/types.h>
#include <api/fs/tracing_path.h>
-#include <linux/bitops.h>
extern char buildid_dir[];
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-04-19 18:30 +0200 |
| Subject | [PATCH 09/28] perf tools: Remove unused macros from util.h |
| Message-ID | <ty0Es-5Fr-67@gated-at.bofh.it> |
| In reply to | #1626475 |
From: Arnaldo Carvalho de Melo <acme@redhat.com> TYPEOF(), for instance, was only used by MSB() that wasn't used at all, besides typeof() is used in many places, should be the preferred way. 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-golox8oa2w1oq28snki14z6s@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/util.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 3eccd6f21d17..2abd4f783ffd 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -1,18 +1,6 @@ #ifndef GIT_COMPAT_UTIL_H #define GIT_COMPAT_UTIL_H -#ifdef __GNUC__ -#define TYPEOF(x) (__typeof__(x)) -#else -#define TYPEOF(x) -#endif - -#define MSB(x, bits) ((x) & TYPEOF(x)(~0ULL << (sizeof(x) * 8 - (bits)))) -#define HAS_MULTI_BITS(i) ((i) & ((i) - 1)) /* checks if an integer has more than 1 bit set */ - -/* Approximation of the length of the decimal representation of this type. */ -#define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1) - #define _ALL_SOURCE 1 #define _BSD_SOURCE 1 /* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */ -- 2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-04-19 18:30 +0200 |
| Subject | [PATCH 22/28] perf tools: Move path related functions to util/path.h |
| Message-ID | <ty0Es-5Fr-73@gated-at.bofh.it> |
| In reply to | #1626475 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Disentangling util.h header mess a bit more.
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-aj6je8ly377i4upedmjzdsq6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 1 +
tools/perf/tests/mmap-thread-lookup.c | 1 +
tools/perf/tests/openat-syscall-all-cpus.c | 4 ++++
tools/perf/tests/openat-syscall.c | 3 +++
tools/perf/ui/setup.c | 1 +
tools/perf/util/build-id.c | 1 +
tools/perf/util/counts.c | 1 +
tools/perf/util/dso.c | 1 +
tools/perf/util/path.c | 28 +++++++++++++++++++++++++++-
tools/perf/util/path.h | 9 +++++++++
tools/perf/util/symbol.c | 1 +
tools/perf/util/symbol.h | 2 +-
tools/perf/util/unwind-libdw.c | 1 +
tools/perf/util/util.c | 10 ----------
tools/perf/util/util.h | 16 ----------------
15 files changed, 52 insertions(+), 28 deletions(-)
create mode 100644 tools/perf/util/path.h
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index e065c4a12f58..d1c8cdc6788b 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -24,6 +24,7 @@
#include "util/evlist.h"
#include <subcmd/exec-cmd.h>
#include "util/machine.h"
+#include "util/path.h"
#include "util/session.h"
#include "util/thread.h"
#include <subcmd/parse-options.h>
diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c
index a5ffb754f8c6..6ea4d8a5d26b 100644
--- a/tools/perf/tests/mmap-thread-lookup.c
+++ b/tools/perf/tests/mmap-thread-lookup.c
@@ -12,6 +12,7 @@
#include "thread_map.h"
#include "symbol.h"
#include "thread.h"
+#include "util.h"
#define THREADS 4
diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c
index b7dece0de42c..1a74dd9fd067 100644
--- a/tools/perf/tests/openat-syscall-all-cpus.c
+++ b/tools/perf/tests/openat-syscall-all-cpus.c
@@ -3,8 +3,12 @@
/* For the CPU_* macros */
#include <pthread.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#include <api/fs/fs.h>
#include <linux/err.h>
+#include <api/fs/tracing_path.h>
#include "evsel.h"
#include "tests.h"
#include "thread_map.h"
diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c
index 5f0c700b4693..e44506e21ee7 100644
--- a/tools/perf/tests/openat-syscall.c
+++ b/tools/perf/tests/openat-syscall.c
@@ -2,6 +2,9 @@
#include <inttypes.h>
#include <api/fs/tracing_path.h>
#include <linux/err.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#include "thread_map.h"
#include "evsel.h"
#include "debug.h"
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index 50d13e58210f..5ea0b40c4fc2 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -4,6 +4,7 @@
#include "../util/cache.h"
#include "../util/debug.h"
#include "../util/hist.h"
+#include "../util/util.h"
pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER;
void *perf_gtk_handle;
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index f9ccd053cdf6..b5c4892c2e18 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -18,6 +18,7 @@
#include "tool.h"
#include "header.h"
#include "vdso.h"
+#include "path.h"
#include "probe-file.h"
#include "strlist.h"
diff --git a/tools/perf/util/counts.c b/tools/perf/util/counts.c
index 83fedd0d22a1..c4af82ab7808 100644
--- a/tools/perf/util/counts.c
+++ b/tools/perf/util/counts.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include "evsel.h"
#include "counts.h"
+#include "util.h"
struct perf_counts *perf_counts__new(int ncpus, int nthreads)
{
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index cd061dc1de70..cbfe17f5168a 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -3,6 +3,7 @@
#include <sys/time.h>
#include <sys/resource.h>
#include <errno.h>
+#include "path.h"
#include "symbol.h"
#include "dso.h"
#include "machine.h"
diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c
index 7c7630be5a89..50ec3bc87a60 100644
--- a/tools/perf/util/path.c
+++ b/tools/perf/util/path.c
@@ -11,8 +11,13 @@
* which is what it's designed for.
*/
#include "cache.h"
-#include "util.h"
+#include "path.h"
+#include <linux/kernel.h>
#include <limits.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
static char bad_path[] = "/bad-path/";
/*
@@ -50,3 +55,24 @@ char *mkpath(const char *fmt, ...)
return bad_path;
return cleanup_path(pathname);
}
+
+int path__join(char *bf, size_t size, const char *path1, const char *path2)
+{
+ return scnprintf(bf, size, "%s%s%s", path1, path1[0] ? "/" : "", path2);
+}
+
+int path__join3(char *bf, size_t size, const char *path1, const char *path2, const char *path3)
+{
+ return scnprintf(bf, size, "%s%s%s%s%s", path1, path1[0] ? "/" : "",
+ path2, path2[0] ? "/" : "", path3);
+}
+
+bool is_regular_file(const char *file)
+{
+ struct stat st;
+
+ if (stat(file, &st))
+ return false;
+
+ return S_ISREG(st.st_mode);
+}
diff --git a/tools/perf/util/path.h b/tools/perf/util/path.h
new file mode 100644
index 000000000000..9a276a58e3c2
--- /dev/null
+++ b/tools/perf/util/path.h
@@ -0,0 +1,9 @@
+#ifndef _PERF_PATH_H
+#define _PERF_PATH_H
+
+int path__join(char *bf, size_t size, const char *path1, const char *path2);
+int path__join3(char *bf, size_t size, const char *path1, const char *path2, const char *path3);
+
+bool is_regular_file(const char *file);
+
+#endif /* _PERF_PATH_H */
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 68f14d770083..2cb7665e9973 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -19,6 +19,7 @@
#include "strlist.h"
#include "intlist.h"
#include "header.h"
+#include "path.h"
#include "sane_ctype.h"
#include <elf.h>
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 5245d2fb1a0a..7acd70fce68e 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -13,7 +13,7 @@
#include <libgen.h>
#include "build-id.h"
#include "event.h"
-#include "util.h"
+#include "path.h"
#ifdef HAVE_LIBELF_SUPPORT
#include <libelf.h>
diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c
index 783a53fb7a4e..f90e11a555b2 100644
--- a/tools/perf/util/unwind-libdw.c
+++ b/tools/perf/util/unwind-libdw.c
@@ -12,6 +12,7 @@
#include "event.h"
#include "perf_regs.h"
#include "callchain.h"
+#include "util.h"
static char *debuginfo_path;
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 4fb8ee552a31..64877c6d09b2 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -713,16 +713,6 @@ const char *perf_tip(const char *dirpath)
return tip;
}
-bool is_regular_file(const char *file)
-{
- struct stat st;
-
- if (stat(file, &st))
- return false;
-
- return S_ISREG(st.st_mode);
-}
-
int fetch_current_timestamp(char *buf, size_t sz)
{
struct timeval tv;
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index fa8c2e59a0bc..617965644ff4 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -120,21 +120,6 @@ struct parse_tag {
unsigned long parse_tag_value(const char *str, struct parse_tag *tags);
-static inline int path__join(char *bf, size_t size,
- const char *path1, const char *path2)
-{
- return scnprintf(bf, size, "%s%s%s", path1, path1[0] ? "/" : "", path2);
-}
-
-static inline int path__join3(char *bf, size_t size,
- const char *path1, const char *path2,
- const char *path3)
-{
- return scnprintf(bf, size, "%s%s%s%s%s",
- path1, path1[0] ? "/" : "",
- path2, path2[0] ? "/" : "", path3);
-}
-
int perf_event_paranoid(void);
void mem_bswap_64(void *src, int byte_size);
@@ -162,7 +147,6 @@ int fetch_kernel_version(unsigned int *puint,
#define KVER_PARAM(x) KVER_VERSION(x), KVER_PATCHLEVEL(x), KVER_SUBLEVEL(x)
const char *perf_tip(const char *dirpath);
-bool is_regular_file(const char *file);
int fetch_current_timestamp(char *buf, size_t sz);
#ifndef HAVE_SCHED_GETCPU_SUPPORT
--
2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-04-19 18:30 +0200 |
| Subject | [PATCH 11/28] perf tools: Remove PRI[xu] macros from perf.h |
| Message-ID | <ty0Es-5Fr-71@gated-at.bofh.it> |
| In reply to | #1626475 |
From: Arnaldo Carvalho de Melo <acme@redhat.com> We get them from inttypes.h. 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-qla4e4mwbf1oewafp1ee2etd@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/util.h | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 2abd4f783ffd..593a24192924 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -34,7 +34,6 @@ #include <poll.h> #include <sys/socket.h> #include <sys/ioctl.h> -#include <inttypes.h> #include <linux/kernel.h> #include <linux/types.h> #include <sys/ttydefaults.h> @@ -50,25 +49,6 @@ extern const char *spaces; extern const char *dots; extern char buildid_dir[]; -/* On most systems <limits.h> would have given us this, but - * not on some systems (e.g. GNU/Hurd). - */ -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif - -#ifndef PRIuMAX -#define PRIuMAX "llu" -#endif - -#ifndef PRIu32 -#define PRIu32 "u" -#endif - -#ifndef PRIx32 -#define PRIx32 "x" -#endif - #ifndef PATH_SEP #define PATH_SEP ':' #endif -- 2.9.3
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2017-04-20 10:20 +0200 |
| Message-ID | <tyftL-6wC-9@gated-at.bofh.it> |
| In reply to | #1626475 |
* 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 e720c19e0d5412f45736d62258d21dc7b056c4ad:
>
> Merge tag 'perf-core-for-mingo-4.12-20170413' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2017-04-17 10:11:09 +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-20170419
>
> for you to fetch changes up to 1b5ad16c7aa7177512ce141e345ff36b9f1a6136:
>
> perf tools: Ditch unused strchrnul() reimplementation (2017-04-19 13:01:57 -0300)
>
> ----------------------------------------------------------------
> perf/core cleanups: (Arnaldo Carvalho de Melo)
>
> . Introduce new header files out of the hodge-podge that util/util.h
> became, trying to disentangle the includes hell that all C projects
> end up growing. This should help in build times, as changes to
> seemingly unrelated files (util.h included tons of headers) won't
> trigger a rebuild of most object files.
>
> . Use equivalent facilities found in the kernel source code base
> originated tools/include/ header files, such as __stringify(),
> ARRAY_SIZE, that has extra checks (__must_be_array()), etc.
>
> . For that get some more files from the kernel sources, like
> include/linux/bug.h, some just with the bits needed at this time.
>
> . Use the headers where facilities declared in them are used, such
> as PRIxu(32,64) macros (inttypes.h), errno defines (errno.h), etc.
>
> . Remove various leftovers from the initial code base we copied from
> git.git: FLEX_ARRAY, etc.
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (28):
> perf unwind arm64: Add missing errno.h header
> perf tools: Remove FLEX_ARRAY definition
> tools include: Introduce linux/bug.h, from the kernel sources
> tools include: Adopt __same_type() and __must_be_array() from the kernel
> tools include: Move ARRAY_SIZE() to linux/kernel.h
> perf tools: Add include <linux/kernel.h> where ARRAY_SIZE() is used
> objtool: Drop ARRAY_SIZE() definition, tools/include/linux/kernel.h has it now
> tools include: Drop ARRAY_SIZE() definition from linux/hashtable.h
> perf tools: Remove unused macros from util.h
> perf tools: Including missing inttypes.h header
> perf tools: Remove PRI[xu] macros from perf.h
> perf tools: Replace STR() calls with __stringify()
> perf tools: Ditch unused PATH_SEP, STRIP_EXTENSION
> perf tools: Move sane ctype stuff from util.h to sane_ctype.h
> tools include: Include missing headers for fls() and types in linux/log2.h
> perf tools: Move print_binary definitions to separate files
> perf tools: Move srcline definitions to separate header
> perf tools: Move extra string util functions to util/string2.h
> perf tools: Include errno.h where needed
> perf str{filter,list}: Disentangle headers
> perf tools: Don't include terminal handling headers in util.h
> perf tools: Move path related functions to util/path.h
> perf tools: No need to include bitops.h in util.h
> perf tools: Use api/fs/tracing_path.h where needed
> perf tools: Remove misplaced __maybe_unused in some functions
> perf tools: Remove include dirent.h from util.h
> perf tools: Remove regex.h and fnmatch.h from util.h
> perf tools: Ditch unused strchrnul() reimplementation
>
> tools/include/linux/bug.h | 10 +
> tools/include/linux/compiler-gcc.h | 3 +
> tools/include/linux/compiler.h | 5 +
> tools/include/linux/hashtable.h | 4 -
> tools/include/linux/kernel.h | 3 +
> tools/include/linux/log2.h | 3 +
> tools/lib/symbol/kallsyms.c | 1 +
> tools/objtool/builtin-check.c | 3 +-
> tools/objtool/objtool.c | 3 +-
> tools/perf/MANIFEST | 1 +
> tools/perf/arch/arm/util/dwarf-regs.c | 4 +-
> tools/perf/arch/arm64/util/dwarf-regs.c | 4 +-
> tools/perf/arch/arm64/util/unwind-libunwind.c | 2 +-
> tools/perf/arch/common.c | 2 +
> tools/perf/arch/powerpc/util/dwarf-regs.c | 5 +-
> tools/perf/arch/powerpc/util/kvm-stat.c | 1 +
> tools/perf/arch/powerpc/util/perf_regs.c | 1 +
> tools/perf/arch/s390/util/kvm-stat.c | 1 +
> tools/perf/arch/x86/tests/intel-cqm.c | 1 +
> tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +
> tools/perf/arch/x86/util/auxtrace.c | 1 +
> tools/perf/arch/x86/util/intel-bts.c | 1 +
> tools/perf/arch/x86/util/intel-pt.c | 1 +
> tools/perf/arch/x86/util/kvm-stat.c | 1 +
> tools/perf/arch/x86/util/perf_regs.c | 1 +
> tools/perf/bench/mem-functions.c | 1 +
> tools/perf/bench/numa.c | 2 +
> tools/perf/builtin-annotate.c | 1 +
> tools/perf/builtin-buildid-cache.c | 1 +
> tools/perf/builtin-buildid-list.c | 1 +
> tools/perf/builtin-c2c.c | 2 +
> tools/perf/builtin-diff.c | 2 +
> tools/perf/builtin-ftrace.c | 2 +
> tools/perf/builtin-help.c | 6 +-
> tools/perf/builtin-inject.c | 1 +
> tools/perf/builtin-kallsyms.c | 1 +
> tools/perf/builtin-kmem.c | 5 +
> tools/perf/builtin-kvm.c | 4 +
> tools/perf/builtin-lock.c | 3 +
> tools/perf/builtin-mem.c | 1 +
> tools/perf/builtin-record.c | 2 +
> tools/perf/builtin-report.c | 4 +-
> tools/perf/builtin-sched.c | 5 +
> tools/perf/builtin-script.c | 8 +
> tools/perf/builtin-stat.c | 5 +
> tools/perf/builtin-timechart.c | 4 +-
> tools/perf/builtin-top.c | 3 +
> tools/perf/builtin-trace.c | 8 +
> tools/perf/perf.c | 12 +-
> tools/perf/tests/attr.c | 2 +
> tools/perf/tests/backward-ring-buffer.c | 1 +
> tools/perf/tests/bpf.c | 2 +
> tools/perf/tests/builtin-test.c | 2 +
> tools/perf/tests/clang.c | 1 +
> tools/perf/tests/code-reading.c | 6 +-
> tools/perf/tests/dso-data.c | 2 +
> tools/perf/tests/dwarf-unwind.c | 1 +
> tools/perf/tests/event-times.c | 2 +
> tools/perf/tests/evsel-roundtrip-name.c | 2 +
> tools/perf/tests/hists_common.c | 2 +
> tools/perf/tests/hists_cumulate.c | 1 +
> tools/perf/tests/hists_filter.c | 1 +
> tools/perf/tests/hists_link.c | 2 +
> tools/perf/tests/hists_output.c | 1 +
> tools/perf/tests/is_printable_array.c | 3 +-
> tools/perf/tests/mmap-basic.c | 3 +
> tools/perf/tests/mmap-thread-lookup.c | 2 +
> tools/perf/tests/openat-syscall-all-cpus.c | 6 +
> tools/perf/tests/openat-syscall-tp-fields.c | 1 +
> tools/perf/tests/openat-syscall.c | 5 +
> tools/perf/tests/parse-events.c | 5 +-
> tools/perf/tests/parse-no-sample-id-all.c | 1 +
> tools/perf/tests/perf-record.c | 2 +
> tools/perf/tests/pmu.c | 2 +
> tools/perf/tests/sample-parsing.c | 2 +
> tools/perf/tests/sdt.c | 1 +
> tools/perf/tests/sw-clock.c | 2 +
> tools/perf/tests/switch-tracking.c | 1 +
> tools/perf/tests/task-exit.c | 1 +
> tools/perf/tests/unit_number__scnprintf.c | 1 +
> tools/perf/tests/vmlinux-kallsyms.c | 1 +
> tools/perf/ui/browser.c | 2 +
> tools/perf/ui/browsers/annotate.c | 3 +
> tools/perf/ui/browsers/header.c | 2 +
> tools/perf/ui/browsers/hists.c | 8 +
> tools/perf/ui/browsers/map.c | 2 +
> tools/perf/ui/gtk/annotate.c | 2 +-
> tools/perf/ui/gtk/hists.c | 1 +
> tools/perf/ui/hist.c | 1 +
> tools/perf/ui/setup.c | 1 +
> tools/perf/ui/stdio/hist.c | 4 +-
> tools/perf/ui/tui/setup.c | 1 +
> tools/perf/util/Build | 1 +
> tools/perf/util/annotate.c | 6 +
> tools/perf/util/auxtrace.c | 6 +-
> tools/perf/util/auxtrace.h | 1 +
> tools/perf/util/bpf-loader.c | 3 +
> tools/perf/util/bpf-loader.h | 2 +
> tools/perf/util/bpf-prologue.c | 1 +
> tools/perf/util/bpf-prologue.h | 2 +
> tools/perf/util/build-id.c | 9 +-
> tools/perf/util/build-id.h | 4 +-
> tools/perf/util/c++/clang-c.h | 1 +
> tools/perf/util/callchain.c | 1 +
> tools/perf/util/cgroup.c | 5 +-
> tools/perf/util/cloexec.c | 1 +
> tools/perf/util/comm.c | 1 +
> tools/perf/util/config.c | 3 +
> tools/perf/util/counts.c | 2 +
> tools/perf/util/cpumap.c | 3 +
> tools/perf/util/ctype.c | 2 +-
> tools/perf/util/data-convert-bt.c | 4 +
> tools/perf/util/data.c | 1 +
> tools/perf/util/debug.c | 4 +
> tools/perf/util/demangle-java.c | 2 +
> tools/perf/util/drv_configs.c | 1 +
> tools/perf/util/dso.c | 4 +
> tools/perf/util/dwarf-aux.c | 3 +
> tools/perf/util/dwarf-regs.c | 1 +
> tools/perf/util/env.c | 1 +
> tools/perf/util/event.c | 7 +-
> tools/perf/util/evlist.c | 2 +
> tools/perf/util/evlist.h | 1 +
> tools/perf/util/evsel.c | 4 +
> tools/perf/util/evsel_fprintf.c | 2 +
> tools/perf/util/header.c | 5 +
> tools/perf/util/hist.c | 2 +
> tools/perf/util/intel-bts.c | 2 +
> tools/perf/util/intel-pt.c | 1 +
> tools/perf/util/jitdump.c | 7 +-
> tools/perf/util/lzma.c | 1 +
> tools/perf/util/machine.c | 8 +-
> tools/perf/util/map.c | 2 +-
> tools/perf/util/mem-events.c | 1 +
> tools/perf/util/ordered-events.c | 2 +
> tools/perf/util/parse-events.c | 7 +-
> tools/perf/util/path.c | 28 ++-
> tools/perf/util/path.h | 9 +
> tools/perf/util/perf-hooks.c | 1 +
> tools/perf/util/pmu.c | 2 +
> tools/perf/util/print_binary.c | 55 +++++
> tools/perf/util/print_binary.h | 28 +++
> tools/perf/util/probe-event.c | 5 +
> tools/perf/util/probe-event.h | 7 +-
> tools/perf/util/probe-file.c | 3 +
> tools/perf/util/probe-file.h | 6 +-
> tools/perf/util/probe-finder.c | 3 +
> tools/perf/util/probe-finder.h | 2 +-
> tools/perf/util/python-ext-sources | 1 +
> tools/perf/util/python.c | 1 +
> tools/perf/util/quote.c | 1 +
> tools/perf/util/record.c | 1 +
> tools/perf/util/sane_ctype.h | 51 +++++
> .../perf/util/scripting-engines/trace-event-perl.c | 1 +
> .../util/scripting-engines/trace-event-python.c | 2 +
> tools/perf/util/session.c | 2 +
> tools/perf/util/session.h | 1 +
> tools/perf/util/sort.c | 5 +
> tools/perf/util/sort.h | 4 +-
> tools/perf/util/srcline.c | 2 +
> tools/perf/util/srcline.h | 34 +++
> tools/perf/util/stat.c | 2 +
> tools/perf/util/strbuf.c | 1 +
> tools/perf/util/strfilter.c | 5 +-
> tools/perf/util/string.c | 18 +-
> tools/perf/util/string2.h | 42 ++++
> tools/perf/util/symbol-elf.c | 3 +-
> tools/perf/util/symbol-minimal.c | 1 +
> tools/perf/util/symbol.c | 3 +
> tools/perf/util/symbol.h | 2 +-
> tools/perf/util/term.c | 6 +-
> tools/perf/util/thread-stack.c | 1 +
> tools/perf/util/thread.c | 2 +
> tools/perf/util/thread_map.c | 2 +
> tools/perf/util/trace-event-parse.c | 3 +-
> tools/perf/util/unwind-libdw.c | 1 +
> tools/perf/util/unwind-libunwind-local.c | 2 +
> tools/perf/util/util.c | 64 +-----
> tools/perf/util/util.h | 249 +--------------------
> tools/perf/util/vdso.c | 2 +-
> 180 files changed, 659 insertions(+), 376 deletions(-)
> create mode 100644 tools/include/linux/bug.h
> create mode 100644 tools/perf/util/path.h
> create mode 100644 tools/perf/util/print_binary.c
> create mode 100644 tools/perf/util/print_binary.h
> create mode 100644 tools/perf/util/sane_ctype.h
> create mode 100644 tools/perf/util/srcline.h
> create mode 100644 tools/perf/util/string2.h
Pulled, thanks a lot Arnaldo!
> For this specific pull request the samples/bpf/ was disabled, as 'make headers_install'
> is failing with the following error, in this case in fedora:rawhide:
>
> INSTALL usr/include/uapi/ (0 file)
> /git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file
./arch/x86/include/generated/uapi/asm/unistd_32.h. Stop.
> make[1]: *** [/git/linux/Makefile:1151: headers_install] Error 2
> make[1]: Leaving directory '/tmp/build/linux'
> make: *** [Makefile:152: sub-make] Error 2
> make: Leaving directory '/git/linux'
Beyond this build fix, could we also do a header file synchronization round:
Warning: include/uapi/linux/stat.h differs from kernel
Warning: arch/x86/include/asm/cpufeatures.h differs from kernel
Warning: arch/x86/lib/memcpy_64.S differs from kernel
... so that Linus does not see these warnings when pulling these bits in the merge
window?
Thanks,
Ingo
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-04-20 13:30 +0200 |
| Message-ID | <tyirE-8jz-5@gated-at.bofh.it> |
| In reply to | #1627184 |
Em Thu, Apr 20, 2017 at 10:10:49AM +0200, Ingo Molnar escreveu: > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Pulled, thanks a lot Arnaldo! > > > For this specific pull request the samples/bpf/ was disabled, as 'make headers_install' > > is failing with the following error, in this case in fedora:rawhide: > > > > INSTALL usr/include/uapi/ (0 file) > > /git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file > ./arch/x86/include/generated/uapi/asm/unistd_32.h. Stop. > > make[1]: *** [/git/linux/Makefile:1151: headers_install] Error 2 > > make[1]: Leaving directory '/tmp/build/linux' > > make: *** [Makefile:152: sub-make] Error 2 > > make: Leaving directory '/git/linux' > > Beyond this build fix, I haven't checked this lately, will do, hopefully this was already taken care of by someone dealing with the headers_install code. > could we also do a header file synchronization round: > Warning: include/uapi/linux/stat.h differs from kernel > Warning: arch/x86/include/asm/cpufeatures.h differs from kernel > Warning: arch/x86/lib/memcpy_64.S differs from kernel > > ... so that Linus does not see these warnings when pulling these bits in the merge > window? Sure, will do. - Arnaldo
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2017-04-20 13:40 +0200 |
| Message-ID | <tyiBj-8mU-3@gated-at.bofh.it> |
| In reply to | #1627353 |
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Em Thu, Apr 20, 2017 at 10:10:49AM +0200, Ingo Molnar escreveu: > > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > Pulled, thanks a lot Arnaldo! > > > > > For this specific pull request the samples/bpf/ was disabled, as 'make headers_install' > > > is failing with the following error, in this case in fedora:rawhide: > > > > > > INSTALL usr/include/uapi/ (0 file) > > > /git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file > > ./arch/x86/include/generated/uapi/asm/unistd_32.h. Stop. > > > make[1]: *** [/git/linux/Makefile:1151: headers_install] Error 2 > > > make[1]: Leaving directory '/tmp/build/linux' > > > make: *** [Makefile:152: sub-make] Error 2 > > > make: Leaving directory '/git/linux' > > > > Beyond this build fix, > > I haven't checked this lately, will do, hopefully this was already taken > care of by someone dealing with the headers_install code. Ah, sorry, I thought it's a problem introduced by perf - if it's an existing upstream bug then never mind! Thanks, Ingo
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-04-20 19:20 +0200 |
| Message-ID | <tynUm-3h3-25@gated-at.bofh.it> |
| In reply to | #1627376 |
Em Thu, Apr 20, 2017 at 01:29:26PM +0200, Ingo Molnar escreveu: > > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > Em Thu, Apr 20, 2017 at 10:10:49AM +0200, Ingo Molnar escreveu: > > > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > Pulled, thanks a lot Arnaldo! > > > > > > > For this specific pull request the samples/bpf/ was disabled, as 'make headers_install' > > > > is failing with the following error, in this case in fedora:rawhide: > > > > > > > > INSTALL usr/include/uapi/ (0 file) > > > > /git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file > > > ./arch/x86/include/generated/uapi/asm/unistd_32.h. Stop. > > > > make[1]: *** [/git/linux/Makefile:1151: headers_install] Error 2 > > > > make[1]: Leaving directory '/tmp/build/linux' > > > > make: *** [Makefile:152: sub-make] Error 2 > > > > make: Leaving directory '/git/linux' > > > > > > Beyond this build fix, > > > > I haven't checked this lately, will do, hopefully this was already taken > > care of by someone dealing with the headers_install code. > > Ah, sorry, I thought it's a problem introduced by perf - if it's an existing > upstream bug then never mind! Checking it now, this is what I disabled in the recent containers with recent enough distros/tollchains to build this, like debian:experimental: +# make -C /git/linux O=/tmp/build/linux allmodconfig && \ +# make -C /git/linux O=/tmp/build/linux headers_install && \ +# make -C /git/linux O=/tmp/build/linux samples/bpf/o [root@jouet bin]# dsh debian:experimental $ bash perfbuilder@91b0b6879760:/$ make -C /git/linux O=/tmp/build/linux allmodconfig make: Entering directory '/git/linux' make[1]: Entering directory '/tmp/build/linux' HOSTCC scripts/basic/fixdep GEN ./Makefile HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf scripts/kconfig/conf --allmodconfig Kconfig # # configuration written to .config # make[1]: Leaving directory '/tmp/build/linux' make: Leaving directory '/git/linux' perfbuilder@91b0b6879760:/$ make -C /git/linux O=/tmp/build/linux headers_install make: Entering directory '/git/linux' make[1]: Entering directory '/tmp/build/linux' CHK include/generated/uapi/linux/version.h UPD include/generated/uapi/linux/version.h SYSTBL arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_32.h HOSTCC arch/x86/tools/relocs_32.o HOSTCC arch/x86/tools/relocs_64.o HOSTCC arch/x86/tools/relocs_common.o HOSTLD arch/x86/tools/relocs HOSTCC scripts/unifdef INSTALL usr/include/asm-generic/ (35 files) INSTALL usr/include/drm/ (22 files) INSTALL usr/include/linux/android/ (1 file) INSTALL usr/include/linux/byteorder/ (2 files) INSTALL usr/include/linux/caif/ (2 files) INSTALL usr/include/linux/can/ (5 files) INSTALL usr/include/linux/dvb/ (8 files) INSTALL usr/include/linux/hdlc/ (1 file) INSTALL usr/include/linux/hsi/ (2 files) INSTALL usr/include/linux/iio/ (2 files) INSTALL usr/include/linux/isdn/ (1 file) INSTALL usr/include/linux/mmc/ (1 file) INSTALL usr/include/linux/netfilter/ipset/ (4 files) INSTALL usr/include/linux/netfilter/ (87 files) INSTALL usr/include/linux/netfilter_arp/ (2 files) INSTALL usr/include/linux/netfilter_bridge/ (17 files) INSTALL usr/include/linux/netfilter_ipv4/ (9 files) INSTALL usr/include/linux/netfilter_ipv6/ (12 files) INSTALL usr/include/linux/nfsd/ (5 files) INSTALL usr/include/linux/raid/ (2 files) INSTALL usr/include/linux/spi/ (1 file) INSTALL usr/include/linux/sunrpc/ (1 file) INSTALL usr/include/linux/tc_act/ (15 files) INSTALL usr/include/linux/tc_ematch/ (4 files) INSTALL usr/include/linux/usb/ (11 files) INSTALL usr/include/linux/wimax/ (1 file) INSTALL usr/include/linux/ (452 files) INSTALL usr/include/misc/ (1 file) INSTALL usr/include/mtd/ (5 files) INSTALL usr/include/rdma/hfi/ (2 files) INSTALL usr/include/rdma/ (18 files) INSTALL usr/include/scsi/fc/ (4 files) INSTALL usr/include/scsi/ (4 files) INSTALL usr/include/sound/ (15 files) INSTALL usr/include/video/ (3 files) INSTALL usr/include/xen/ (4 files) INSTALL usr/include/uapi/ (0 file) /git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file ./arch/x86/include/generated/uapi/asm/unistd_64.h. Stop. /git/linux/Makefile:1149: recipe for target 'headers_install' failed make[1]: *** [headers_install] Error 2 make[1]: Leaving directory '/tmp/build/linux' Makefile:152: recipe for target 'sub-make' failed make: *** [sub-make] Error 2 make: Leaving directory '/git/linux' perfbuilder@91b0b6879760:/$ Now if I try outside the container, on a fedora:25 system, same result: [acme@jouet linux]$ rm -rf /tmp/build/linux [acme@jouet linux]$ mkdir /tmp/build/linux [acme@jouet linux]$ make O=/tmp/build/linux allmodconfig make[1]: Entering directory '/tmp/build/linux' HOSTCC scripts/basic/fixdep GEN ./Makefile HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf scripts/kconfig/conf --allmodconfig Kconfig # # configuration written to .config # make[1]: Leaving directory '/tmp/build/linux' [acme@jouet linux]$ make O=/tmp/build/linux headers_install make[1]: Entering directory '/tmp/build/linux' CHK include/generated/uapi/linux/version.h UPD include/generated/uapi/linux/version.h SYSTBL arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_32.h HOSTCC arch/x86/tools/relocs_32.o HOSTCC arch/x86/tools/relocs_64.o HOSTCC arch/x86/tools/relocs_common.o HOSTLD arch/x86/tools/relocs HOSTCC scripts/unifdef INSTALL usr/include/asm-generic/ (35 files) INSTALL usr/include/drm/ (22 files) INSTALL usr/include/linux/android/ (1 file) INSTALL usr/include/linux/byteorder/ (2 files) INSTALL usr/include/linux/caif/ (2 files) INSTALL usr/include/linux/can/ (5 files) INSTALL usr/include/linux/dvb/ (8 files) INSTALL usr/include/linux/hdlc/ (1 file) INSTALL usr/include/linux/hsi/ (2 files) INSTALL usr/include/linux/iio/ (2 files) INSTALL usr/include/linux/isdn/ (1 file) INSTALL usr/include/linux/mmc/ (1 file) INSTALL usr/include/linux/netfilter/ipset/ (4 files) INSTALL usr/include/linux/netfilter/ (87 files) INSTALL usr/include/linux/netfilter_arp/ (2 files) INSTALL usr/include/linux/netfilter_bridge/ (17 files) INSTALL usr/include/linux/netfilter_ipv4/ (9 files) INSTALL usr/include/linux/netfilter_ipv6/ (12 files) INSTALL usr/include/linux/nfsd/ (5 files) INSTALL usr/include/linux/raid/ (2 files) INSTALL usr/include/linux/spi/ (1 file) INSTALL usr/include/linux/sunrpc/ (1 file) INSTALL usr/include/linux/tc_act/ (15 files) INSTALL usr/include/linux/tc_ematch/ (4 files) INSTALL usr/include/linux/usb/ (11 files) INSTALL usr/include/linux/wimax/ (1 file) INSTALL usr/include/linux/ (452 files) INSTALL usr/include/misc/ (1 file) INSTALL usr/include/mtd/ (5 files) INSTALL usr/include/rdma/hfi/ (2 files) INSTALL usr/include/rdma/ (18 files) INSTALL usr/include/scsi/fc/ (4 files) INSTALL usr/include/scsi/ (4 files) INSTALL usr/include/sound/ (15 files) INSTALL usr/include/video/ (3 files) INSTALL usr/include/xen/ (4 files) INSTALL usr/include/uapi/ (0 file) /home/acme/git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file ./arch/x86/include/generated/uapi/asm/unistd_64.h. Stop. /home/acme/git/linux/Makefile:1149: recipe for target 'headers_install' failed make[1]: *** [headers_install] Error 2 make[1]: Leaving directory '/tmp/build/linux' Makefile:152: recipe for target 'sub-make' failed make: *** [sub-make] Error 2 [acme@jouet linux]$ Trying to investigate this further now... Perhaps I'm missing something :-\ - Arnaldo
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-04-20 20:40 +0200 |
| Message-ID | <typ9M-3Yq-23@gated-at.bofh.it> |
| In reply to | #1627694 |
Em Thu, Apr 20, 2017 at 02:10:58PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Thu, Apr 20, 2017 at 01:29:26PM +0200, Ingo Molnar escreveu: > > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > Em Thu, Apr 20, 2017 at 10:10:49AM +0200, Ingo Molnar escreveu: > > > > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > > Pulled, thanks a lot Arnaldo! > > > > > > > > > For this specific pull request the samples/bpf/ was disabled, as 'make headers_install' > > > > > is failing with the following error, in this case in fedora:rawhide: > > > > > > > > > > INSTALL usr/include/uapi/ (0 file) > > > > > /git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file > > > > ./arch/x86/include/generated/uapi/asm/unistd_32.h. Stop. > > > > > make[1]: *** [/git/linux/Makefile:1151: headers_install] Error 2 > > > > > make[1]: Leaving directory '/tmp/build/linux' > > > > > make: *** [Makefile:152: sub-make] Error 2 > > > > > make: Leaving directory '/git/linux' > > > > > > > > Beyond this build fix, > > > > > > I haven't checked this lately, will do, hopefully this was already taken > > > care of by someone dealing with the headers_install code. > > > > Ah, sorry, I thought it's a problem introduced by perf - if it's an existing > > upstream bug then never mind! > > > Now if I try outside the container, on a fedora:25 system, same result: > > [acme@jouet linux]$ rm -rf /tmp/build/linux > [acme@jouet linux]$ mkdir /tmp/build/linux > [acme@jouet linux]$ make O=/tmp/build/linux allmodconfig > make[1]: Entering directory '/tmp/build/linux' > HOSTCC scripts/basic/fixdep > GEN ./Makefile > HOSTCC scripts/kconfig/conf.o > SHIPPED scripts/kconfig/zconf.tab.c > SHIPPED scripts/kconfig/zconf.lex.c > SHIPPED scripts/kconfig/zconf.hash.c > HOSTCC scripts/kconfig/zconf.tab.o > HOSTLD scripts/kconfig/conf > scripts/kconfig/conf --allmodconfig Kconfig > # > # configuration written to .config > # > make[1]: Leaving directory '/tmp/build/linux' > [acme@jouet linux]$ make O=/tmp/build/linux headers_install > make[1]: Entering directory '/tmp/build/linux' > INSTALL usr/include/sound/ (15 files) > INSTALL usr/include/video/ (3 files) > /home/acme/git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file ./arch/x86/include/generated/uapi/asm/unistd_64.h. Stop. > /home/acme/git/linux/Makefile:1149: recipe for target 'headers_install' failed > make[1]: *** [headers_install] Error 2 > make[1]: Leaving directory '/tmp/build/linux' > Makefile:152: recipe for target 'sub-make' failed > make: *** [sub-make] Error 2 > [acme@jouet linux]$ > > Trying to investigate this further now... Perhaps I'm missing something > :-\ So, it seems that headers_install needs to have as a dependency the target that generates those headers (/generated/), as it works if I actually start building the kernel and then do the headers_install step. that or allmodconfig is broken, probably the former, checking... - Arnaldo
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2017-04-20 21:00 +0200 |
| Message-ID | <typt7-45C-9@gated-at.bofh.it> |
| In reply to | #1627739 |
Em Thu, Apr 20, 2017 at 03:29:54PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Thu, Apr 20, 2017 at 02:10:58PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Thu, Apr 20, 2017 at 01:29:26PM +0200, Ingo Molnar escreveu: > > > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > > Em Thu, Apr 20, 2017 at 10:10:49AM +0200, Ingo Molnar escreveu: > > > > > * Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > > > Pulled, thanks a lot Arnaldo! > > > > > > > > > > > For this specific pull request the samples/bpf/ was disabled, as 'make headers_install' > > > > > > is failing with the following error, in this case in fedora:rawhide: > > > > > > > > > > > > INSTALL usr/include/uapi/ (0 file) > > > > > > /git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file > > > > > ./arch/x86/include/generated/uapi/asm/unistd_32.h. Stop. > > > > > > make[1]: *** [/git/linux/Makefile:1151: headers_install] Error 2 > > > > > > make[1]: Leaving directory '/tmp/build/linux' > > > > > > make: *** [Makefile:152: sub-make] Error 2 > > > > > > make: Leaving directory '/git/linux' > > > > > > > > > > Beyond this build fix, > > > > > > > > I haven't checked this lately, will do, hopefully this was already taken > > > > care of by someone dealing with the headers_install code. > > > > > > Ah, sorry, I thought it's a problem introduced by perf - if it's an existing > > > upstream bug then never mind! > > > > > > Now if I try outside the container, on a fedora:25 system, same result: > > > > [acme@jouet linux]$ rm -rf /tmp/build/linux > > [acme@jouet linux]$ mkdir /tmp/build/linux > > [acme@jouet linux]$ make O=/tmp/build/linux allmodconfig <SNIP> > > /home/acme/git/linux/scripts/Makefile.headersinst:62: *** Missing generated UAPI file ./arch/x86/include/generated/uapi/asm/unistd_64.h. Stop. > > /home/acme/git/linux/Makefile:1149: recipe for target 'headers_install' failed > > make[1]: *** [headers_install] Error 2 > > make[1]: Leaving directory '/tmp/build/linux' > > Makefile:152: recipe for target 'sub-make' failed > > make: *** [sub-make] Error 2 > > [acme@jouet linux]$ > > > > Trying to investigate this further now... Perhaps I'm missing something > > :-\ > > So, it seems that headers_install needs to have as a dependency the > target that generates those headers (/generated/), as it works if I > actually start building the kernel and then do the headers_install > step. > that or allmodconfig is broken, probably the former, checking... Well, I tried using 'make defconfig' instead of 'make allmodconfig' and things are back working... Now debian:experimental is again building all the tests. Will use that and reenable building samples/bpf/ in all the recent enough distro containers. - Arnaldo
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web