Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1441890 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2016-07-13 01:00 +0200 |
| Last post | 2016-07-13 09:40 +0200 |
| Articles | 13 — 4 participants |
Back to article view | Back to linux.kernel
[GIT PULL 00/66] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 01:00 +0200
[PATCH 25/66] perf tools: Add missing header to color.c Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 01:00 +0200
[PATCH 33/66] perf bench futex: Add missing compiler.h header Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 01:00 +0200
[PATCH 09/66] perf trace beauty open_flags: Add missing headers Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 01:00 +0200
[PATCH 15/66] perf tests: Add missing pthread.h include for CPU_*() macros Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 01:00 +0200
[PATCH 37/66] tools lib bpf: Copy bpf.h and bpf_common.h from the kernel Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 01:00 +0200
Re: [GIT PULL 00/66] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-07-13 09:10 +0200
Re: [GIT PULL 00/66] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-07-13 09:40 +0200
Re: [GIT PULL 00/66] perf/core improvements and fixes Josh Poimboeuf <jpoimboe@redhat.com> - 2016-07-13 22:50 +0200
Re: [GIT PULL 00/66] perf/core improvements and fixes Peter Zijlstra <peterz@infradead.org> - 2016-07-13 23:00 +0200
Re: [GIT PULL 00/66] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-14 01:30 +0200
Re: [GIT PULL 00/66] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-07-13 09:40 +0200
Re: [GIT PULL 00/66] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-07-13 09:40 +0200
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-07-13 01:00 +0200 |
| Subject | [GIT PULL 00/66] perf/core improvements and fixes |
| Message-ID | <rUeF3-2Ns-3@gated-at.bofh.it> |
Hi Ingo,
Please consider pulling, several more patches in my queue pending
review, this branch now builds in all of these systems, with Alpine Linux, that
uses different versions of libelf, libc helping in keeping this codebase
portable, soon I'll add containers for the Android SDK and Yocto:
# perf stat dm
alpine:3.4: Ok
centos:5: Ok
centos:6: Ok
centos:7: Ok
debian:7: Ok
debian:8: Ok
debian:experimental: Ok
fedora:21: Ok
fedora:22: Ok
fedora:23: Ok
fedora:24: Ok
fedora:rawhide: Ok
mageia:5: Ok
opensuse:13.2: Ok
opensuse:42.1: Ok
ubuntu:12.04.5: Ok
ubuntu:14.04.4: Ok
ubuntu:15.10: Ok
ubuntu:16.04: Ok
Performance counter stats for 'dm':
1734.724897 task-clock (msec) # 0.003 CPUs utilized
70,156 context-switches # 0.040 M/sec
7,182 cpu-migrations # 0.004 M/sec
51,490 page-faults # 0.030 M/sec
5,093,434,618 cycles # 2.936 GHz
4,839,787,241 instructions # 0.95 insn per cycle
898,488,442 branches # 517.943 M/sec
16,155,791 branch-misses # 1.80% of all branches
684.926493347 seconds time elapsed
#
- Arnaldo
The following changes since commit 44530d588e142a96cf0cd345a7cb8911c4f88720:
Revert "perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86" (2016-07-10 20:58:36 +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-20160712
for you to fetch changes up to 6d248fbda59c51ef5f2e90e11551d9e17aeb226f:
tools lib traceevent: Add filter on task CPU id (2016-07-12 16:27:39 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
- Add demangling of symbols in programs written in the Rust language (David Tolnay)
- Add support for tracepoints in the python binding, including an example, that
sets up and parses sched:sched_switch events, tools/perf/python/tracepoint.py
(Jiri Olsa)
- Introduce --stdio-color to setup the color output mode selection in
'annotate' and 'report', allowing emit color escape sequences when
redirecting the output of these tools (Arnaldo Carvalho de Melo)
Infrastructure:
- Various tweaks to allow the 'perf trace' beautifiers to build without using
kernel headers and in a wider range of Linux distributions/releases (Arnaldo Carvalho de Melo)
- Stop using kernel source files, instead copy what is needed and
check when the original kernel source file gets modified, warning
the developers about it. This helps in building the tool in older
systems and even in recent ones, for just added kernel features
for which ABI details (struct changes, defines, etc) still are not
available on system headers (Arnaldo Carvalho de Melo)
- Be consistent in how to use strerror_r, adding a wrapper that makes sure that
it returns a pointer to passed buffer, and using the XSI variant, that is
available in more libc implementations (Arnaldo Carvalho de Melo)
- Avoid checking code drift on busibox's diff perf intel-pt-decoder, as it
doesn't have the '-I' command line switch to check for regexps (Arnaldo Carvalho de Melo)
- Add missing headers in various places (Arnaldo Carvalho de Melo)
- Remove unneeded headers from various other places (Arnaldo Carvalho de Melo)
- Add feature detection for gelf_getnote(), disabling SDT support if not
present (Arnaldo Carvalho de Melo)
- Fix oddities with gcc 5.3.0 by initializing some variables (Arnaldo Carvalho de Melo)
- With those changes in place perf now builds on Alpine Linux 3.4, in addition to
on centos (5, 6, 7), debian (7, 8, experimental), fedora (21, 22, 23, 24, rawhide),
mageia 5, opensuse (13.2, 42.1) and ubuntu (12.04.5, 14.04.4, 15.10, 16.04) and
will be test build on those systems prior to future pull requests.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (52):
perf ui stdio: Add way to setup the color output mode selection
perf annotate: Introduce --stdio-color to setup the color output mode selection
perf report: Introduce --stdio-color to setup the color output mode selection
perf trace beauty msg_flags: Remove MSG_TRYHARD
perf trace beauty flock: Add missing fcntl.h include
perf trace beauty open_flags: Add missing headers
perf trace beauty mmap: Add more conditional defines
perf trace beauty flock: Add more conditional defines
perf trace beauty open_flags: Add more conditional defines
tools: Introduce str_error_r()
perf bench: Add missing pthread.h include for CPU_*() macros
perf tests: Add missing pthread.h include for CPU_*() macros
perf trace: Add conditional define for AT_FDCWD
perf tests openat-syscall-tp-fields: Add some conditional defines
perf bench: Disentangle headers
perf tools: Move syscall number fallbacks from perf-sys.h to tools/arch/x86/include/asm/
perf strbuf: Add missing headers
perf quote: Disentangle headers
perf tests cpumap: Add missing headers
perf test fdarray: Add missing poll.h header
perf tests x86 rdpmc: Add missing headers
perf tools: Add missing header to color.c
perf tools: Remove needless includes from cache.h
perf evsel: Uninline the is_function_event method
perf tools: Uninline scnprintf() and vscnprint()
tools lib traceevent: Use str_error_r()
tools lib api fs: Use str_error_r()
tools lib: Guard the strlcpy() header with __GLIBC__
tools lib subcmd: Use str_error_r()
perf bench futex: Add missing compiler.h header
perf tools: event.h needs asm/perf_regs.h
tools: Add copy of perf_event.h to tools/include/linux/
perf bench: Copy kernel files needed to build mem{cpy,set} x86_64 benchmarks
tools lib bpf: Copy bpf.h and bpf_common.h from the kernel
tools: Copy uapi/asm/perf_regs.h from the kernel
perf test bpf: Use epoll_wait() instead of epoll_pwait()
tools: Copy uapi/linux/hw_breakpoint.h from the kernel
perf tools: Introduce weak alternative to sched_getcpu()
perf tools: Remove unneeded magic.h include from util.h
perf trace: Remove unused sys/ptrace.h include
kvm arm/arm64: Remove trailing whitespace from headers
tools: Copy the header files needed by perf tools
perf tools: Fallback to reading sysfs to get cacheline size
perf trace beauty futex_op: Add missing defines for older systems
perf trace beauty seccomp: Remove seccomp.h include
perf symbols: Provide a GElf_Nhdr typedef
perf script python: Silence -Werror=maybe-uninitialized on gcc 5.3.0
tools: Copy the bitsperlong.h files from the kernel
perf tools: Add the tools/ stringify copy to the MANIFEST
perf tools: Don't add kernel directories to the header search path
perf intel-pt-decoder: Avoid checking code drift on busibox's diff
perf tools: Add feature detection for gelf_getnote()
David Tolnay (1):
perf symbols: Add Rust demangling
Jiri Olsa (12):
perf hists: Introduce hist_entry__init function
perf hists: Introduce hist_entry_ops
perf hists: Introduce hists__add_entry_ops function
perf evlist: Make event2evsel public
perf tools: Introduce trace_event__tp_format_id()
perf python: Init perf_event_attr::size in perf.evsel constructor
perf python: Fix pyrf_evlist__read_on_cpu event consuming
perf python: Put perf.event objects into dictionary
perf python: Add perf.tracepoint method
perf python: Add struct evsel into struct pyrf_event
perf python: Add support to resolve tracepoint fields
perf python: Add tracepoint example
Steven Rostedt (1):
tools lib traceevent: Add filter on task CPU id
arch/arm/include/uapi/asm/kvm.h | 4 +-
tools/arch/alpha/include/uapi/asm/bitsperlong.h | 8 +
tools/arch/arm/include/uapi/asm/kvm.h | 224 +++++
tools/arch/arm/include/uapi/asm/perf_regs.h | 23 +
tools/arch/arm64/include/uapi/asm/bitsperlong.h | 23 +
tools/arch/arm64/include/uapi/asm/kvm.h | 258 ++++++
tools/arch/arm64/include/uapi/asm/perf_regs.h | 40 +
tools/arch/frv/include/uapi/asm/bitsperlong.h | 1 +
tools/arch/h8300/include/asm/bitsperlong.h | 14 +
tools/arch/hexagon/include/uapi/asm/bitsperlong.h | 26 +
tools/arch/ia64/include/uapi/asm/bitsperlong.h | 8 +
tools/arch/m32r/include/uapi/asm/bitsperlong.h | 1 +
.../arch/microblaze/include/uapi/asm/bitsperlong.h | 1 +
tools/arch/mips/include/uapi/asm/bitsperlong.h | 8 +
tools/arch/mips/include/uapi/asm/kvm.h | 208 +++++
tools/arch/mn10300/include/uapi/asm/bitsperlong.h | 1 +
tools/arch/parisc/include/uapi/asm/bitsperlong.h | 14 +
tools/arch/powerpc/include/uapi/asm/bitsperlong.h | 12 +
tools/arch/powerpc/include/uapi/asm/kvm.h | 612 +++++++++++++
tools/arch/powerpc/include/uapi/asm/perf_regs.h | 50 ++
tools/arch/s390/include/uapi/asm/bitsperlong.h | 12 +
tools/arch/s390/include/uapi/asm/kvm.h | 192 ++++
tools/arch/s390/include/uapi/asm/kvm_perf.h | 25 +
tools/arch/s390/include/uapi/asm/sie.h | 250 ++++++
tools/arch/score/include/uapi/asm/bitsperlong.h | 6 +
tools/arch/sparc/include/uapi/asm/bitsperlong.h | 12 +
tools/arch/tile/include/uapi/asm/bitsperlong.h | 26 +
tools/arch/x86/include/asm/cpufeatures.h | 316 +++++++
tools/arch/x86/include/asm/disabled-features.h | 60 ++
tools/arch/x86/include/asm/required-features.h | 103 +++
tools/arch/x86/include/asm/unistd_32.h | 12 +
tools/arch/x86/include/asm/unistd_64.h | 12 +
tools/arch/x86/include/uapi/asm/bitsperlong.h | 12 +
tools/arch/x86/include/uapi/asm/kvm.h | 360 ++++++++
tools/arch/x86/include/uapi/asm/kvm_perf.h | 16 +
tools/arch/x86/include/uapi/asm/perf_regs.h | 33 +
tools/arch/x86/include/uapi/asm/svm.h | 178 ++++
tools/arch/x86/include/uapi/asm/vmx.h | 136 +++
tools/arch/x86/lib/memcpy_64.S | 297 +++++++
tools/arch/x86/lib/memset_64.S | 138 +++
tools/build/Makefile.feature | 1 +
tools/build/feature/Makefile | 4 +
tools/build/feature/test-all.c | 5 +
tools/build/feature/test-libelf-gelf_getnote.c | 7 +
tools/include/asm-generic/bitops/__ffs.h | 1 +
tools/include/asm-generic/bitops/atomic.h | 1 +
tools/include/asm-generic/bitsperlong.h | 25 +
.../{perf/util => }/include/asm/alternative-asm.h | 4 +-
tools/include/linux/kernel.h | 28 +-
tools/include/linux/string.h | 4 +-
tools/include/uapi/asm-generic/bitsperlong.h | 15 +
tools/include/uapi/linux/bpf.h | 389 ++++++++
tools/include/uapi/linux/bpf_common.h | 55 ++
tools/include/uapi/linux/hw_breakpoint.h | 30 +
tools/include/uapi/linux/perf_event.h | 983 +++++++++++++++++++++
tools/lib/api/Makefile | 1 +
tools/lib/api/fs/tracing_path.c | 3 +-
tools/lib/bpf/Makefile | 8 +-
tools/lib/str_error_r.c | 26 +
tools/lib/subcmd/run-command.c | 5 +-
tools/lib/traceevent/event-parse.c | 8 +-
tools/lib/traceevent/parse-filter.c | 18 +-
tools/lib/vsprintf.c | 24 +
tools/objtool/Build | 5 +
tools/objtool/builtin-check.c | 1 +
tools/perf/Documentation/perf-annotate.txt | 7 +
tools/perf/Documentation/perf-report.txt | 7 +
tools/perf/MANIFEST | 41 +-
tools/perf/Makefile.perf | 63 ++
tools/perf/arch/common.c | 1 +
tools/perf/arch/x86/tests/rdpmc.c | 8 +-
tools/perf/bench/futex-hash.c | 15 +-
tools/perf/bench/futex-lock-pi.c | 11 +-
tools/perf/bench/futex-requeue.c | 11 +-
tools/perf/bench/futex-wake-parallel.c | 11 +-
tools/perf/bench/futex-wake.c | 11 +-
tools/perf/bench/mem-memcpy-x86-64-asm.S | 2 +-
tools/perf/bench/mem-memset-x86-64-asm.S | 2 +-
tools/perf/bench/numa.c | 4 +-
tools/perf/builtin-annotate.c | 3 +
tools/perf/builtin-buildid-cache.c | 8 +-
tools/perf/builtin-help.c | 8 +-
tools/perf/builtin-kvm.c | 4 +-
tools/perf/builtin-probe.c | 2 +-
tools/perf/builtin-record.c | 6 +-
tools/perf/builtin-report.c | 3 +
tools/perf/builtin-sched.c | 2 +-
tools/perf/builtin-stat.c | 4 +-
tools/perf/builtin-top.c | 6 +-
tools/perf/builtin-trace.c | 9 +-
tools/perf/config/Makefile | 16 +-
tools/perf/perf-sys.h | 18 -
tools/perf/perf.c | 18 +-
tools/perf/python/tracepoint.py | 47 +
tools/perf/tests/backward-ring-buffer.c | 4 +-
tools/perf/tests/bpf-script-example.c | 4 +-
tools/perf/tests/bpf.c | 10 +-
tools/perf/tests/builtin-test.c | 2 +-
tools/perf/tests/cpumap.c | 7 +
tools/perf/tests/event-times.c | 2 +-
tools/perf/tests/fdarray.c | 1 +
tools/perf/tests/llvm.c | 1 +
tools/perf/tests/mmap-basic.c | 9 +-
tools/perf/tests/openat-syscall-all-cpus.c | 7 +-
tools/perf/tests/openat-syscall-tp-fields.c | 11 +-
tools/perf/tests/openat-syscall.c | 2 +-
tools/perf/tests/perf-record.c | 11 +-
tools/perf/tests/sw-clock.c | 4 +-
tools/perf/tests/task-exit.c | 4 +-
tools/perf/trace/beauty/flock.c | 17 +
tools/perf/trace/beauty/futex_op.c | 16 +
tools/perf/trace/beauty/mmap.c | 77 +-
tools/perf/trace/beauty/msg_flags.c | 1 -
tools/perf/trace/beauty/open_flags.c | 15 +
tools/perf/trace/beauty/seccomp.c | 2 -
tools/perf/ui/browsers/hists.c | 2 +-
tools/perf/ui/gtk/util.c | 1 +
tools/perf/ui/helpline.c | 1 +
tools/perf/ui/setup.c | 7 +
tools/perf/ui/tui/setup.c | 2 +
tools/perf/ui/ui.h | 4 +
tools/perf/util/Build | 11 +
tools/perf/util/alias.c | 1 +
tools/perf/util/bpf-loader.c | 2 +-
tools/perf/util/build-id.c | 2 +-
tools/perf/util/cache.h | 3 -
tools/perf/util/cloexec.c | 18 +-
tools/perf/util/color.c | 3 +
tools/perf/util/data.c | 4 +-
tools/perf/util/debug.h | 2 +-
tools/perf/util/demangle-rust.c | 269 ++++++
tools/perf/util/demangle-rust.h | 7 +
tools/perf/util/dso.c | 6 +-
tools/perf/util/dso.h | 1 +
tools/perf/util/event.h | 1 +
tools/perf/util/evlist.c | 8 +-
tools/perf/util/evlist.h | 3 +
tools/perf/util/evsel.c | 20 +-
tools/perf/util/evsel.h | 18 +-
tools/perf/util/help-unknown-cmd.c | 1 +
tools/perf/util/hist.c | 204 +++--
tools/perf/util/hist.h | 11 +
tools/perf/util/include/asm/unistd_32.h | 1 -
tools/perf/util/include/asm/unistd_64.h | 1 -
tools/perf/util/intel-pt-decoder/Build | 5 +-
tools/perf/util/levenshtein.c | 4 +-
tools/perf/util/llvm-utils.c | 10 +-
tools/perf/util/path.c | 2 +
tools/perf/util/probe-event.c | 6 +-
tools/perf/util/probe-file.c | 12 +-
tools/perf/util/probe-finder.c | 4 +-
tools/perf/util/python-ext-sources | 2 +
tools/perf/util/python.c | 162 +++-
tools/perf/util/quote.c | 4 +-
tools/perf/util/quote.h | 3 +-
.../util/scripting-engines/trace-event-python.c | 4 +-
tools/perf/util/sort.h | 6 +
tools/perf/util/strbuf.c | 2 +-
tools/perf/util/strbuf.h | 3 +
tools/perf/util/symbol-elf.c | 11 +
tools/perf/util/target.c | 3 +-
tools/perf/util/trace-event.c | 8 +
tools/perf/util/trace-event.h | 2 +
tools/perf/util/util.h | 6 +-
164 files changed, 6478 insertions(+), 333 deletions(-)
create mode 100644 tools/arch/alpha/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/arm/include/uapi/asm/kvm.h
create mode 100644 tools/arch/arm/include/uapi/asm/perf_regs.h
create mode 100644 tools/arch/arm64/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/arm64/include/uapi/asm/kvm.h
create mode 100644 tools/arch/arm64/include/uapi/asm/perf_regs.h
create mode 100644 tools/arch/frv/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/h8300/include/asm/bitsperlong.h
create mode 100644 tools/arch/hexagon/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/ia64/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/m32r/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/microblaze/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/mips/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/mips/include/uapi/asm/kvm.h
create mode 100644 tools/arch/mn10300/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/parisc/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/powerpc/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/powerpc/include/uapi/asm/kvm.h
create mode 100644 tools/arch/powerpc/include/uapi/asm/perf_regs.h
create mode 100644 tools/arch/s390/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/s390/include/uapi/asm/kvm.h
create mode 100644 tools/arch/s390/include/uapi/asm/kvm_perf.h
create mode 100644 tools/arch/s390/include/uapi/asm/sie.h
create mode 100644 tools/arch/score/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/sparc/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/tile/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/x86/include/asm/cpufeatures.h
create mode 100644 tools/arch/x86/include/asm/disabled-features.h
create mode 100644 tools/arch/x86/include/asm/required-features.h
create mode 100644 tools/arch/x86/include/asm/unistd_32.h
create mode 100644 tools/arch/x86/include/asm/unistd_64.h
create mode 100644 tools/arch/x86/include/uapi/asm/bitsperlong.h
create mode 100644 tools/arch/x86/include/uapi/asm/kvm.h
create mode 100644 tools/arch/x86/include/uapi/asm/kvm_perf.h
create mode 100644 tools/arch/x86/include/uapi/asm/perf_regs.h
create mode 100644 tools/arch/x86/include/uapi/asm/svm.h
create mode 100644 tools/arch/x86/include/uapi/asm/vmx.h
create mode 100644 tools/arch/x86/lib/memcpy_64.S
create mode 100644 tools/arch/x86/lib/memset_64.S
create mode 100644 tools/build/feature/test-libelf-gelf_getnote.c
create mode 100644 tools/include/asm-generic/bitsperlong.h
rename tools/{perf/util => }/include/asm/alternative-asm.h (66%)
create mode 100644 tools/include/uapi/asm-generic/bitsperlong.h
create mode 100644 tools/include/uapi/linux/bpf.h
create mode 100644 tools/include/uapi/linux/bpf_common.h
create mode 100644 tools/include/uapi/linux/hw_breakpoint.h
create mode 100644 tools/include/uapi/linux/perf_event.h
create mode 100644 tools/lib/str_error_r.c
create mode 100644 tools/lib/vsprintf.c
create mode 100755 tools/perf/python/tracepoint.py
create mode 100644 tools/perf/util/demangle-rust.c
create mode 100644 tools/perf/util/demangle-rust.h
delete mode 100644 tools/perf/util/include/asm/unistd_32.h
delete mode 100644 tools/perf/util/include/asm/unistd_64.h
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-07-13 01:00 +0200 |
| Subject | [PATCH 25/66] perf tools: Add missing header to color.c |
| Message-ID | <rUeOL-2RS-69@gated-at.bofh.it> |
| In reply to | #1441890 |
From: Arnaldo Carvalho de Melo <acme@redhat.com> It uses isatty(), so needs unistd.h, include it. 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-ivwuz8f68tb3sdcpguo9wmvx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/color.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c index 1210ba555d07..47a34b561f5d 100644 --- a/tools/perf/util/color.c +++ b/tools/perf/util/color.c @@ -3,6 +3,7 @@ #include "config.h" #include "color.h" #include <math.h> +#include <unistd.h> int perf_use_color_default = -1; -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-07-13 01:00 +0200 |
| Subject | [PATCH 33/66] perf bench futex: Add missing compiler.h header |
| Message-ID | <rUeOM-2RS-81@gated-at.bofh.it> |
| In reply to | #1441890 |
From: Arnaldo Carvalho de Melo <acme@redhat.com> Since these files use __maybe_unused, and that is defined in linux/compiler.h, include it. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Davidlohr Bueso <dbueso@suse.de> Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> 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-1llbf59ut6xon6ti88jm0n9j@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/bench/futex-hash.c | 1 + tools/perf/bench/futex-lock-pi.c | 1 + tools/perf/bench/futex-requeue.c | 1 + tools/perf/bench/futex-wake-parallel.c | 1 + tools/perf/bench/futex-wake.c | 1 + 5 files changed, 5 insertions(+) diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c index caa9726ec9bd..8024cd5febd2 100644 --- a/tools/perf/bench/futex-hash.c +++ b/tools/perf/bench/futex-hash.c @@ -14,6 +14,7 @@ #include <errno.h> #include <signal.h> #include <stdlib.h> +#include <linux/compiler.h> #include <linux/kernel.h> #include <sys/time.h> diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c index e2ba0d6f64fe..936d89d30483 100644 --- a/tools/perf/bench/futex-lock-pi.c +++ b/tools/perf/bench/futex-lock-pi.c @@ -8,6 +8,7 @@ #include <signal.h> #include "../util/stat.h" #include <subcmd/parse-options.h> +#include <linux/compiler.h> #include <linux/kernel.h> #include <errno.h> #include "bench.h" diff --git a/tools/perf/bench/futex-requeue.c b/tools/perf/bench/futex-requeue.c index 7eceb0500900..f96e22ed9f87 100644 --- a/tools/perf/bench/futex-requeue.c +++ b/tools/perf/bench/futex-requeue.c @@ -14,6 +14,7 @@ #include <signal.h> #include "../util/stat.h" #include <subcmd/parse-options.h> +#include <linux/compiler.h> #include <linux/kernel.h> #include <errno.h> #include "bench.h" diff --git a/tools/perf/bench/futex-wake-parallel.c b/tools/perf/bench/futex-wake-parallel.c index 8143b54ff119..4a2ecd7438ca 100644 --- a/tools/perf/bench/futex-wake-parallel.c +++ b/tools/perf/bench/futex-wake-parallel.c @@ -13,6 +13,7 @@ #include <signal.h> #include "../util/stat.h" #include <subcmd/parse-options.h> +#include <linux/compiler.h> #include <linux/kernel.h> #include <errno.h> #include "bench.h" diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c index e978d5610e5f..87d8f4f292d9 100644 --- a/tools/perf/bench/futex-wake.c +++ b/tools/perf/bench/futex-wake.c @@ -14,6 +14,7 @@ #include <signal.h> #include "../util/stat.h" #include <subcmd/parse-options.h> +#include <linux/compiler.h> #include <linux/kernel.h> #include <errno.h> #include "bench.h" -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-07-13 01:00 +0200 |
| Subject | [PATCH 09/66] perf trace beauty open_flags: Add missing headers |
| Message-ID | <rUeOM-2RS-77@gated-at.bofh.it> |
| In reply to | #1441890 |
From: Arnaldo Carvalho de Melo <acme@redhat.com> Those beautifiers need to make sure they include what they reference, as changes in builtin-trace.c may end up removing needed stuff, like when undefining _GNU_SOURCE. 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-a9cz8za6lqutfapn5e7uum09@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/trace/beauty/open_flags.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/trace/beauty/open_flags.c b/tools/perf/trace/beauty/open_flags.c index 0f3679e0cdcf..9c3a4cb3bd35 100644 --- a/tools/perf/trace/beauty/open_flags.c +++ b/tools/perf/trace/beauty/open_flags.c @@ -1,3 +1,6 @@ +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> static size_t syscall_arg__scnprintf_open_flags(char *bf, size_t size, struct syscall_arg *arg) -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-07-13 01:00 +0200 |
| Subject | [PATCH 15/66] perf tests: Add missing pthread.h include for CPU_*() macros |
| Message-ID | <rUeOM-2RS-83@gated-at.bofh.it> |
| In reply to | #1441890 |
From: Arnaldo Carvalho de Melo <acme@redhat.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-dfcynqzvecsu55zmpxub9jgv@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/tests/mmap-basic.c | 3 +++ tools/perf/tests/openat-syscall-all-cpus.c | 3 +++ tools/perf/tests/perf-record.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index 5c9b931b7b66..634bce9caebd 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c @@ -1,3 +1,6 @@ +/* For the CLR_() macros */ +#include <pthread.h> + #include "evlist.h" #include "evsel.h" #include "thread_map.h" diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c index 265abb12dfff..c8d9592eb142 100644 --- a/tools/perf/tests/openat-syscall-all-cpus.c +++ b/tools/perf/tests/openat-syscall-all-cpus.c @@ -1,3 +1,6 @@ +/* For the CPU_* macros */ +#include <pthread.h> + #include <api/fs/fs.h> #include <linux/err.h> #include "evsel.h" diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c index 3eb67a977b6a..8f2e1de6d0ea 100644 --- a/tools/perf/tests/perf-record.c +++ b/tools/perf/tests/perf-record.c @@ -1,3 +1,6 @@ +/* For the CLR_() macros */ +#include <pthread.h> + #include <sched.h> #include "evlist.h" #include "evsel.h" -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-07-13 01:00 +0200 |
| Subject | [PATCH 37/66] tools lib bpf: Copy bpf.h and bpf_common.h from the kernel |
| Message-ID | <rUeOM-2RS-85@gated-at.bofh.it> |
| In reply to | #1441890 |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To allow the build to complete on older systems, where those files are
either not uptodate, lacking some recent additions or not present at
all.
And check if the copy drifts from the kernel, as in this synthetic test:
BUILD: Doing 'make -j4' parallel build
Warning: tools/include/linux/bpf.h differs from kernel
Warning: tools/include/linux/bpf_common.h differs from kernel
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-5plvi2gq4x469dcyybiu226q@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/include/uapi/linux/bpf.h | 389 ++++++++++++++++++++++++++++++++++
tools/include/uapi/linux/bpf_common.h | 55 +++++
tools/lib/bpf/Makefile | 8 +-
tools/perf/MANIFEST | 5 +-
tools/perf/config/Makefile | 5 +-
5 files changed, 456 insertions(+), 6 deletions(-)
create mode 100644 tools/include/uapi/linux/bpf.h
create mode 100644 tools/include/uapi/linux/bpf_common.h
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
new file mode 100644
index 000000000000..406459b935a2
--- /dev/null
+++ b/tools/include/uapi/linux/bpf.h
@@ -0,0 +1,389 @@
+/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ */
+#ifndef _UAPI__LINUX_BPF_H__
+#define _UAPI__LINUX_BPF_H__
+
+#include <linux/types.h>
+#include <linux/bpf_common.h>
+
+/* Extended instruction set based on top of classic BPF */
+
+/* instruction classes */
+#define BPF_ALU64 0x07 /* alu mode in double word width */
+
+/* ld/ldx fields */
+#define BPF_DW 0x18 /* double word */
+#define BPF_XADD 0xc0 /* exclusive add */
+
+/* alu/jmp fields */
+#define BPF_MOV 0xb0 /* mov reg to reg */
+#define BPF_ARSH 0xc0 /* sign extending arithmetic shift right */
+
+/* change endianness of a register */
+#define BPF_END 0xd0 /* flags for endianness conversion: */
+#define BPF_TO_LE 0x00 /* convert to little-endian */
+#define BPF_TO_BE 0x08 /* convert to big-endian */
+#define BPF_FROM_LE BPF_TO_LE
+#define BPF_FROM_BE BPF_TO_BE
+
+#define BPF_JNE 0x50 /* jump != */
+#define BPF_JSGT 0x60 /* SGT is signed '>', GT in x86 */
+#define BPF_JSGE 0x70 /* SGE is signed '>=', GE in x86 */
+#define BPF_CALL 0x80 /* function call */
+#define BPF_EXIT 0x90 /* function return */
+
+/* Register numbers */
+enum {
+ BPF_REG_0 = 0,
+ BPF_REG_1,
+ BPF_REG_2,
+ BPF_REG_3,
+ BPF_REG_4,
+ BPF_REG_5,
+ BPF_REG_6,
+ BPF_REG_7,
+ BPF_REG_8,
+ BPF_REG_9,
+ BPF_REG_10,
+ __MAX_BPF_REG,
+};
+
+/* BPF has 10 general purpose 64-bit registers and stack frame. */
+#define MAX_BPF_REG __MAX_BPF_REG
+
+struct bpf_insn {
+ __u8 code; /* opcode */
+ __u8 dst_reg:4; /* dest register */
+ __u8 src_reg:4; /* source register */
+ __s16 off; /* signed offset */
+ __s32 imm; /* signed immediate constant */
+};
+
+/* BPF syscall commands, see bpf(2) man-page for details. */
+enum bpf_cmd {
+ BPF_MAP_CREATE,
+ BPF_MAP_LOOKUP_ELEM,
+ BPF_MAP_UPDATE_ELEM,
+ BPF_MAP_DELETE_ELEM,
+ BPF_MAP_GET_NEXT_KEY,
+ BPF_PROG_LOAD,
+ BPF_OBJ_PIN,
+ BPF_OBJ_GET,
+};
+
+enum bpf_map_type {
+ BPF_MAP_TYPE_UNSPEC,
+ BPF_MAP_TYPE_HASH,
+ BPF_MAP_TYPE_ARRAY,
+ BPF_MAP_TYPE_PROG_ARRAY,
+ BPF_MAP_TYPE_PERF_EVENT_ARRAY,
+ BPF_MAP_TYPE_PERCPU_HASH,
+ BPF_MAP_TYPE_PERCPU_ARRAY,
+ BPF_MAP_TYPE_STACK_TRACE,
+};
+
+enum bpf_prog_type {
+ BPF_PROG_TYPE_UNSPEC,
+ BPF_PROG_TYPE_SOCKET_FILTER,
+ BPF_PROG_TYPE_KPROBE,
+ BPF_PROG_TYPE_SCHED_CLS,
+ BPF_PROG_TYPE_SCHED_ACT,
+ BPF_PROG_TYPE_TRACEPOINT,
+};
+
+#define BPF_PSEUDO_MAP_FD 1
+
+/* flags for BPF_MAP_UPDATE_ELEM command */
+#define BPF_ANY 0 /* create new element or update existing */
+#define BPF_NOEXIST 1 /* create new element if it didn't exist */
+#define BPF_EXIST 2 /* update existing element */
+
+#define BPF_F_NO_PREALLOC (1U << 0)
+
+union bpf_attr {
+ struct { /* anonymous struct used by BPF_MAP_CREATE command */
+ __u32 map_type; /* one of enum bpf_map_type */
+ __u32 key_size; /* size of key in bytes */
+ __u32 value_size; /* size of value in bytes */
+ __u32 max_entries; /* max number of entries in a map */
+ __u32 map_flags; /* prealloc or not */
+ };
+
+ struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
+ __u32 map_fd;
+ __aligned_u64 key;
+ union {
+ __aligned_u64 value;
+ __aligned_u64 next_key;
+ };
+ __u64 flags;
+ };
+
+ struct { /* anonymous struct used by BPF_PROG_LOAD command */
+ __u32 prog_type; /* one of enum bpf_prog_type */
+ __u32 insn_cnt;
+ __aligned_u64 insns;
+ __aligned_u64 license;
+ __u32 log_level; /* verbosity level of verifier */
+ __u32 log_size; /* size of user buffer */
+ __aligned_u64 log_buf; /* user supplied buffer */
+ __u32 kern_version; /* checked when prog_type=kprobe */
+ };
+
+ struct { /* anonymous struct used by BPF_OBJ_* commands */
+ __aligned_u64 pathname;
+ __u32 bpf_fd;
+ };
+} __attribute__((aligned(8)));
+
+/* integer value in 'imm' field of BPF_CALL instruction selects which helper
+ * function eBPF program intends to call
+ */
+enum bpf_func_id {
+ BPF_FUNC_unspec,
+ BPF_FUNC_map_lookup_elem, /* void *map_lookup_elem(&map, &key) */
+ BPF_FUNC_map_update_elem, /* int map_update_elem(&map, &key, &value, flags) */
+ BPF_FUNC_map_delete_elem, /* int map_delete_elem(&map, &key) */
+ BPF_FUNC_probe_read, /* int bpf_probe_read(void *dst, int size, void *src) */
+ BPF_FUNC_ktime_get_ns, /* u64 bpf_ktime_get_ns(void) */
+ BPF_FUNC_trace_printk, /* int bpf_trace_printk(const char *fmt, int fmt_size, ...) */
+ BPF_FUNC_get_prandom_u32, /* u32 prandom_u32(void) */
+ BPF_FUNC_get_smp_processor_id, /* u32 raw_smp_processor_id(void) */
+
+ /**
+ * skb_store_bytes(skb, offset, from, len, flags) - store bytes into packet
+ * @skb: pointer to skb
+ * @offset: offset within packet from skb->mac_header
+ * @from: pointer where to copy bytes from
+ * @len: number of bytes to store into packet
+ * @flags: bit 0 - if true, recompute skb->csum
+ * other bits - reserved
+ * Return: 0 on success
+ */
+ BPF_FUNC_skb_store_bytes,
+
+ /**
+ * l3_csum_replace(skb, offset, from, to, flags) - recompute IP checksum
+ * @skb: pointer to skb
+ * @offset: offset within packet where IP checksum is located
+ * @from: old value of header field
+ * @to: new value of header field
+ * @flags: bits 0-3 - size of header field
+ * other bits - reserved
+ * Return: 0 on success
+ */
+ BPF_FUNC_l3_csum_replace,
+
+ /**
+ * l4_csum_replace(skb, offset, from, to, flags) - recompute TCP/UDP checksum
+ * @skb: pointer to skb
+ * @offset: offset within packet where TCP/UDP checksum is located
+ * @from: old value of header field
+ * @to: new value of header field
+ * @flags: bits 0-3 - size of header field
+ * bit 4 - is pseudo header
+ * other bits - reserved
+ * Return: 0 on success
+ */
+ BPF_FUNC_l4_csum_replace,
+
+ /**
+ * bpf_tail_call(ctx, prog_array_map, index) - jump into another BPF program
+ * @ctx: context pointer passed to next program
+ * @prog_array_map: pointer to map which type is BPF_MAP_TYPE_PROG_ARRAY
+ * @index: index inside array that selects specific program to run
+ * Return: 0 on success
+ */
+ BPF_FUNC_tail_call,
+
+ /**
+ * bpf_clone_redirect(skb, ifindex, flags) - redirect to another netdev
+ * @skb: pointer to skb
+ * @ifindex: ifindex of the net device
+ * @flags: bit 0 - if set, redirect to ingress instead of egress
+ * other bits - reserved
+ * Return: 0 on success
+ */
+ BPF_FUNC_clone_redirect,
+
+ /**
+ * u64 bpf_get_current_pid_tgid(void)
+ * Return: current->tgid << 32 | current->pid
+ */
+ BPF_FUNC_get_current_pid_tgid,
+
+ /**
+ * u64 bpf_get_current_uid_gid(void)
+ * Return: current_gid << 32 | current_uid
+ */
+ BPF_FUNC_get_current_uid_gid,
+
+ /**
+ * bpf_get_current_comm(char *buf, int size_of_buf)
+ * stores current->comm into buf
+ * Return: 0 on success
+ */
+ BPF_FUNC_get_current_comm,
+
+ /**
+ * bpf_get_cgroup_classid(skb) - retrieve a proc's classid
+ * @skb: pointer to skb
+ * Return: classid if != 0
+ */
+ BPF_FUNC_get_cgroup_classid,
+ BPF_FUNC_skb_vlan_push, /* bpf_skb_vlan_push(skb, vlan_proto, vlan_tci) */
+ BPF_FUNC_skb_vlan_pop, /* bpf_skb_vlan_pop(skb) */
+
+ /**
+ * bpf_skb_[gs]et_tunnel_key(skb, key, size, flags)
+ * retrieve or populate tunnel metadata
+ * @skb: pointer to skb
+ * @key: pointer to 'struct bpf_tunnel_key'
+ * @size: size of 'struct bpf_tunnel_key'
+ * @flags: room for future extensions
+ * Retrun: 0 on success
+ */
+ BPF_FUNC_skb_get_tunnel_key,
+ BPF_FUNC_skb_set_tunnel_key,
+ BPF_FUNC_perf_event_read, /* u64 bpf_perf_event_read(&map, index) */
+ /**
+ * bpf_redirect(ifindex, flags) - redirect to another netdev
+ * @ifindex: ifindex of the net device
+ * @flags: bit 0 - if set, redirect to ingress instead of egress
+ * other bits - reserved
+ * Return: TC_ACT_REDIRECT
+ */
+ BPF_FUNC_redirect,
+
+ /**
+ * bpf_get_route_realm(skb) - retrieve a dst's tclassid
+ * @skb: pointer to skb
+ * Return: realm if != 0
+ */
+ BPF_FUNC_get_route_realm,
+
+ /**
+ * bpf_perf_event_output(ctx, map, index, data, size) - output perf raw sample
+ * @ctx: struct pt_regs*
+ * @map: pointer to perf_event_array map
+ * @index: index of event in the map
+ * @data: data on stack to be output as raw data
+ * @size: size of data
+ * Return: 0 on success
+ */
+ BPF_FUNC_perf_event_output,
+ BPF_FUNC_skb_load_bytes,
+
+ /**
+ * bpf_get_stackid(ctx, map, flags) - walk user or kernel stack and return id
+ * @ctx: struct pt_regs*
+ * @map: pointer to stack_trace map
+ * @flags: bits 0-7 - numer of stack frames to skip
+ * bit 8 - collect user stack instead of kernel
+ * bit 9 - compare stacks by hash only
+ * bit 10 - if two different stacks hash into the same stackid
+ * discard old
+ * other bits - reserved
+ * Return: >= 0 stackid on success or negative error
+ */
+ BPF_FUNC_get_stackid,
+
+ /**
+ * bpf_csum_diff(from, from_size, to, to_size, seed) - calculate csum diff
+ * @from: raw from buffer
+ * @from_size: length of from buffer
+ * @to: raw to buffer
+ * @to_size: length of to buffer
+ * @seed: optional seed
+ * Return: csum result
+ */
+ BPF_FUNC_csum_diff,
+
+ /**
+ * bpf_skb_[gs]et_tunnel_opt(skb, opt, size)
+ * retrieve or populate tunnel options metadata
+ * @skb: pointer to skb
+ * @opt: pointer to raw tunnel option data
+ * @size: size of @opt
+ * Return: 0 on success for set, option size for get
+ */
+ BPF_FUNC_skb_get_tunnel_opt,
+ BPF_FUNC_skb_set_tunnel_opt,
+ __BPF_FUNC_MAX_ID,
+};
+
+/* All flags used by eBPF helper functions, placed here. */
+
+/* BPF_FUNC_skb_store_bytes flags. */
+#define BPF_F_RECOMPUTE_CSUM (1ULL << 0)
+#define BPF_F_INVALIDATE_HASH (1ULL << 1)
+
+/* BPF_FUNC_l3_csum_replace and BPF_FUNC_l4_csum_replace flags.
+ * First 4 bits are for passing the header field size.
+ */
+#define BPF_F_HDR_FIELD_MASK 0xfULL
+
+/* BPF_FUNC_l4_csum_replace flags. */
+#define BPF_F_PSEUDO_HDR (1ULL << 4)
+#define BPF_F_MARK_MANGLED_0 (1ULL << 5)
+
+/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
+#define BPF_F_INGRESS (1ULL << 0)
+
+/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
+#define BPF_F_TUNINFO_IPV6 (1ULL << 0)
+
+/* BPF_FUNC_get_stackid flags. */
+#define BPF_F_SKIP_FIELD_MASK 0xffULL
+#define BPF_F_USER_STACK (1ULL << 8)
+#define BPF_F_FAST_STACK_CMP (1ULL << 9)
+#define BPF_F_REUSE_STACKID (1ULL << 10)
+
+/* BPF_FUNC_skb_set_tunnel_key flags. */
+#define BPF_F_ZERO_CSUM_TX (1ULL << 1)
+#define BPF_F_DONT_FRAGMENT (1ULL << 2)
+
+/* BPF_FUNC_perf_event_output flags. */
+#define BPF_F_INDEX_MASK 0xffffffffULL
+#define BPF_F_CURRENT_CPU BPF_F_INDEX_MASK
+
+/* user accessible mirror of in-kernel sk_buff.
+ * new fields can only be added to the end of this structure
+ */
+struct __sk_buff {
+ __u32 len;
+ __u32 pkt_type;
+ __u32 mark;
+ __u32 queue_mapping;
+ __u32 protocol;
+ __u32 vlan_present;
+ __u32 vlan_tci;
+ __u32 vlan_proto;
+ __u32 priority;
+ __u32 ingress_ifindex;
+ __u32 ifindex;
+ __u32 tc_index;
+ __u32 cb[5];
+ __u32 hash;
+ __u32 tc_classid;
+ __u32 data;
+ __u32 data_end;
+};
+
+struct bpf_tunnel_key {
+ __u32 tunnel_id;
+ union {
+ __u32 remote_ipv4;
+ __u32 remote_ipv6[4];
+ };
+ __u8 tunnel_tos;
+ __u8 tunnel_ttl;
+ __u16 tunnel_ext;
+ __u32 tunnel_label;
+};
+
+#endif /* _UAPI__LINUX_BPF_H__ */
diff --git a/tools/include/uapi/linux/bpf_common.h b/tools/include/uapi/linux/bpf_common.h
new file mode 100644
index 000000000000..a5c220e0828f
--- /dev/null
+++ b/tools/include/uapi/linux/bpf_common.h
@@ -0,0 +1,55 @@
+#ifndef _UAPI__LINUX_BPF_COMMON_H__
+#define _UAPI__LINUX_BPF_COMMON_H__
+
+/* Instruction classes */
+#define BPF_CLASS(code) ((code) & 0x07)
+#define BPF_LD 0x00
+#define BPF_LDX 0x01
+#define BPF_ST 0x02
+#define BPF_STX 0x03
+#define BPF_ALU 0x04
+#define BPF_JMP 0x05
+#define BPF_RET 0x06
+#define BPF_MISC 0x07
+
+/* ld/ldx fields */
+#define BPF_SIZE(code) ((code) & 0x18)
+#define BPF_W 0x00
+#define BPF_H 0x08
+#define BPF_B 0x10
+#define BPF_MODE(code) ((code) & 0xe0)
+#define BPF_IMM 0x00
+#define BPF_ABS 0x20
+#define BPF_IND 0x40
+#define BPF_MEM 0x60
+#define BPF_LEN 0x80
+#define BPF_MSH 0xa0
+
+/* alu/jmp fields */
+#define BPF_OP(code) ((code) & 0xf0)
+#define BPF_ADD 0x00
+#define BPF_SUB 0x10
+#define BPF_MUL 0x20
+#define BPF_DIV 0x30
+#define BPF_OR 0x40
+#define BPF_AND 0x50
+#define BPF_LSH 0x60
+#define BPF_RSH 0x70
+#define BPF_NEG 0x80
+#define BPF_MOD 0x90
+#define BPF_XOR 0xa0
+
+#define BPF_JA 0x00
+#define BPF_JEQ 0x10
+#define BPF_JGT 0x20
+#define BPF_JGE 0x30
+#define BPF_JSET 0x40
+#define BPF_SRC(code) ((code) & 0x08)
+#define BPF_K 0x00
+#define BPF_X 0x08
+
+#ifndef BPF_MAXINSNS
+#define BPF_MAXINSNS 4096
+#endif
+
+#endif /* _UAPI__LINUX_BPF_COMMON_H__ */
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index fc1bc75ae56d..62d89d50fcbd 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -68,7 +68,7 @@ FEATURE_USER = .libbpf
FEATURE_TESTS = libelf libelf-getphdrnum libelf-mmap bpf
FEATURE_DISPLAY = libelf bpf
-INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi
+INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi
FEATURE_CHECK_CFLAGS-bpf = $(INCLUDES)
check_feat := 1
@@ -154,6 +154,12 @@ all: fixdep $(VERSION_FILES) all_cmd
all_cmd: $(CMD_TARGETS)
$(BPF_IN): force elfdep bpfdep
+ @(test -f ../../../include/uapi/linux/bpf.h -a -f ../../../include/uapi/linux/bpf.h && ( \
+ (diff -B ../../include/uapi/linux/bpf.h ../../../include/uapi/linux/bpf.h >/dev/null) || \
+ echo "Warning: tools/include/uapi/linux/bpf.h differs from kernel" >&2 )) || true
+ @(test -f ../../../include/uapi/linux/bpf_common.h -a -f ../../../include/uapi/linux/bpf_common.h && ( \
+ (diff -B ../../include/uapi/linux/bpf_common.h ../../../include/uapi/linux/bpf_common.h >/dev/null) || \
+ echo "Warning: tools/include/uapi/linux/bpf_common.h differs from kernel" >&2 )) || true
$(Q)$(MAKE) $(build)=libbpf
$(OUTPUT)libbpf.so: $(BPF_IN)
diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST
index cf85d1cd1c91..a300cbb13541 100644
--- a/tools/perf/MANIFEST
+++ b/tools/perf/MANIFEST
@@ -23,7 +23,6 @@ tools/build
tools/arch/x86/include/asm/atomic.h
tools/arch/x86/include/asm/rmwcc.h
tools/lib/traceevent
-tools/lib/bpf
tools/lib/api
tools/lib/bpf
tools/lib/subcmd
@@ -60,6 +59,8 @@ tools/include/linux/hash.h
tools/include/linux/kernel.h
tools/include/linux/list.h
tools/include/linux/log2.h
+tools/include/uapi/linux/bpf.h
+tools/include/uapi/linux/bpf_common.h
tools/include/uapi/linux/perf_event.h
tools/include/linux/poison.h
tools/include/linux/rbtree.h
@@ -82,8 +83,6 @@ arch/*/include/uapi/asm/unistd*.h
arch/*/include/uapi/asm/perf_regs.h
include/linux/poison.h
include/linux/hw_breakpoint.h
-include/uapi/linux/bpf.h
-include/uapi/linux/bpf_common.h
include/uapi/linux/const.h
include/uapi/linux/swab.h
include/uapi/linux/hw_breakpoint.h
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index bbb22101be2e..d629e5f5abdc 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -115,7 +115,7 @@ endif
FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS)
FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf
-FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi
+FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi
# include ARCH specific config
-include $(src-perf)/arch/$(ARCH)/Makefile
@@ -210,7 +210,8 @@ CFLAGS += -I$(srctree)/tools/include/uapi
CFLAGS += -I$(srctree)/tools/include/
CFLAGS += -I$(srctree)/arch/$(ARCH)/include/uapi
CFLAGS += -I$(srctree)/arch/$(ARCH)/include
-CFLAGS += -I$(srctree)/tools/arch/$(ARCH)/include
+CFLAGS += -I$(srctree)/tools/arch/$(ARCH)/include/uapi
+CFLAGS += -I$(srctree)/tools/arch/$(ARCH)/
CFLAGS += -I$(srctree)/include/uapi
CFLAGS += -I$(srctree)/include
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2016-07-13 09:10 +0200 |
| Message-ID | <rUmsW-8a9-19@gated-at.bofh.it> |
| In reply to | #1441890 |
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, several more patches in my queue pending > review, this branch now builds in all of these systems, with Alpine Linux, that > uses different versions of libelf, libc helping in keeping this codebase > portable, soon I'll add containers for the Android SDK and Yocto: > > # perf stat dm > alpine:3.4: Ok > centos:5: Ok > centos:6: Ok > centos:7: Ok > debian:7: Ok > debian:8: Ok > debian:experimental: Ok > fedora:21: Ok > fedora:22: Ok > fedora:23: Ok > fedora:24: Ok > fedora:rawhide: Ok > mageia:5: Ok > opensuse:13.2: Ok > opensuse:42.1: Ok > ubuntu:12.04.5: Ok > ubuntu:14.04.4: Ok > ubuntu:15.10: Ok > ubuntu:16.04: Ok > > Performance counter stats for 'dm': > > 1734.724897 task-clock (msec) # 0.003 CPUs utilized > 70,156 context-switches # 0.040 M/sec > 7,182 cpu-migrations # 0.004 M/sec > 51,490 page-faults # 0.030 M/sec > 5,093,434,618 cycles # 2.936 GHz > 4,839,787,241 instructions # 0.95 insn per cycle > 898,488,442 branches # 517.943 M/sec > 16,155,791 branch-misses # 1.80% of all branches > > 684.926493347 seconds time elapsed > # > > - Arnaldo > > The following changes since commit 44530d588e142a96cf0cd345a7cb8911c4f88720: > > Revert "perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86" (2016-07-10 20:58:36 +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-20160712 > > for you to fetch changes up to 6d248fbda59c51ef5f2e90e11551d9e17aeb226f: > > tools lib traceevent: Add filter on task CPU id (2016-07-12 16:27:39 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - Add demangling of symbols in programs written in the Rust language (David Tolnay) > > - Add support for tracepoints in the python binding, including an example, that > sets up and parses sched:sched_switch events, tools/perf/python/tracepoint.py > (Jiri Olsa) > > - Introduce --stdio-color to setup the color output mode selection in > 'annotate' and 'report', allowing emit color escape sequences when > redirecting the output of these tools (Arnaldo Carvalho de Melo) > > Infrastructure: > > - Various tweaks to allow the 'perf trace' beautifiers to build without using > kernel headers and in a wider range of Linux distributions/releases (Arnaldo Carvalho de Melo) > > - Stop using kernel source files, instead copy what is needed and > check when the original kernel source file gets modified, warning > the developers about it. This helps in building the tool in older > systems and even in recent ones, for just added kernel features > for which ABI details (struct changes, defines, etc) still are not > available on system headers (Arnaldo Carvalho de Melo) > > - Be consistent in how to use strerror_r, adding a wrapper that makes sure that > it returns a pointer to passed buffer, and using the XSI variant, that is > available in more libc implementations (Arnaldo Carvalho de Melo) > > - Avoid checking code drift on busibox's diff perf intel-pt-decoder, as it > doesn't have the '-I' command line switch to check for regexps (Arnaldo Carvalho de Melo) > > - Add missing headers in various places (Arnaldo Carvalho de Melo) > > - Remove unneeded headers from various other places (Arnaldo Carvalho de Melo) > > - Add feature detection for gelf_getnote(), disabling SDT support if not > present (Arnaldo Carvalho de Melo) > > - Fix oddities with gcc 5.3.0 by initializing some variables (Arnaldo Carvalho de Melo) > > - With those changes in place perf now builds on Alpine Linux 3.4, in addition to > on centos (5, 6, 7), debian (7, 8, experimental), fedora (21, 22, 23, 24, rawhide), > mageia 5, opensuse (13.2, 42.1) and ubuntu (12.04.5, 14.04.4, 15.10, 16.04) and > will be test build on those systems prior to future pull requests. That's really impressive build coverage! Pulled, thanks a lot Arnaldo! Ingo
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2016-07-13 09:40 +0200 |
| Message-ID | <rUmVY-8lM-9@gated-at.bofh.it> |
| In reply to | #1442045 |
Hm, the objtool build broke:
GEN arch/x86/insn/inat-tables.c
CC arch/x86/decode.o
In file included from /home/mingo/tip/tools/include/linux/hashtable.h:12:0,
from arch/x86/../../elf.h:24,
from arch/x86/decode.c:26:
/home/mingo/tip/tools/include/linux/bitops.h:12:0: error: "BITS_PER_LONG"
redefined [-Werror]
#define BITS_PER_LONG __WORDSIZE
^
In file included from /usr/include/x86_64-linux-gnu/asm/bitsperlong.h:10:0,
from /usr/include/asm-generic/int-ll64.h:11,
from /usr/include/asm-generic/types.h:6,
from /usr/include/x86_64-linux-gnu/asm/types.h:4,
from /home/mingo/tip/tools/include/linux/types.h:9,
from /home/mingo/tip/tools/include/linux/list.h:4,
from arch/x86/../../elf.h:23,
from arch/x86/decode.c:26:
/home/mingo/tip/tools/include/asm-generic/bitsperlong.h:10:0: note: this is the
location of the previous definition
#define BITS_PER_LONG 32
^
and this breaks the x86 allyesconfig build.
Thanks,
Ingo
[toc] | [prev] | [next] | [standalone]
| From | Josh Poimboeuf <jpoimboe@redhat.com> |
|---|---|
| Date | 2016-07-13 22:50 +0200 |
| Message-ID | <rUzgv-87F-41@gated-at.bofh.it> |
| In reply to | #1442117 |
On Wed, Jul 13, 2016 at 09:35:27AM +0200, Ingo Molnar wrote: > > Hm, the objtool build broke: > > GEN arch/x86/insn/inat-tables.c > CC arch/x86/decode.o > In file included from /home/mingo/tip/tools/include/linux/hashtable.h:12:0, > from arch/x86/../../elf.h:24, > from arch/x86/decode.c:26: > /home/mingo/tip/tools/include/linux/bitops.h:12:0: error: "BITS_PER_LONG" > redefined [-Werror] > #define BITS_PER_LONG __WORDSIZE > ^ > In file included from /usr/include/x86_64-linux-gnu/asm/bitsperlong.h:10:0, > from /usr/include/asm-generic/int-ll64.h:11, > from /usr/include/asm-generic/types.h:6, > from /usr/include/x86_64-linux-gnu/asm/types.h:4, > from /home/mingo/tip/tools/include/linux/types.h:9, > from /home/mingo/tip/tools/include/linux/list.h:4, > from arch/x86/../../elf.h:23, > from arch/x86/decode.c:26: > /home/mingo/tip/tools/include/asm-generic/bitsperlong.h:10:0: note: this is the > location of the previous definition > #define BITS_PER_LONG 32 > ^ Hi Ingo, There's still another issue. Notice in the last line there that BITS_PER_LONG is getting incorrectly set to 32, at least for objtool. That '#define BITS_PER_LONG 32' comes from the following code in tools/include/asm-generic/bitsperlong.h: #ifdef CONFIG_64BIT #define BITS_PER_LONG 64 #else #define BITS_PER_LONG 32 #endif /* CONFIG_64BIT */ Because objtool doesn't have CONFIG_64BIT defined, it falls through to the '#else' condition. I think tools code shouldn't be relying on kernel config options. -- Josh
[toc] | [prev] | [next] | [standalone]
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2016-07-13 23:00 +0200 |
| Message-ID | <rUzq9-8bo-9@gated-at.bofh.it> |
| In reply to | #1442840 |
On Wed, Jul 13, 2016 at 03:49:14PM -0500, Josh Poimboeuf wrote: > That '#define BITS_PER_LONG 32' comes from the following code in > tools/include/asm-generic/bitsperlong.h: > > #ifdef CONFIG_64BIT > #define BITS_PER_LONG 64 > #else > #define BITS_PER_LONG 32 > #endif /* CONFIG_64BIT */ > > Because objtool doesn't have CONFIG_64BIT defined, it falls through to > the '#else' condition. I think tools code shouldn't be relying on > kernel config options. Right.. __LP64__ would work in general I think, or __SIZEOF_LONG__ * __CHAR_BIT__.
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-07-14 01:30 +0200 |
| Message-ID | <rUBLj-1qO-5@gated-at.bofh.it> |
| In reply to | #1442843 |
Em Wed, Jul 13, 2016 at 10:54:49PM +0200, Peter Zijlstra escreveu:
> On Wed, Jul 13, 2016 at 03:49:14PM -0500, Josh Poimboeuf wrote:
> > That '#define BITS_PER_LONG 32' comes from the following code in
> > tools/include/asm-generic/bitsperlong.h:
> >
> > #ifdef CONFIG_64BIT
> > #define BITS_PER_LONG 64
> > #else
> > #define BITS_PER_LONG 32
> > #endif /* CONFIG_64BIT */
> >
> > Because objtool doesn't have CONFIG_64BIT defined, it falls through to
> > the '#else' condition. I think tools code shouldn't be relying on
> > kernel config options.
>
> Right.. __LP64__ would work in general I think, or __SIZEOF_LONG__ *
> __CHAR_BIT__.
Ok, to keep it close to the kernel counterpart, I ended up with the
patch below, that builds for all the distros I have in my container set.
commit 2a00f026a15d161b47ba3d3417d0fec5193468c3
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Wed Jul 13 15:04:04 2016 -0300
tools: Fix up BITS_PER_LONG setting
It was set based on CONFIG_64BIT, that is available only when using
Kconfig, which we're working towards but not to the point of having this
CONFIG variable set, so synthesize it from available compiler defined
defines, __SIZEOF_LONG__ or, lacking that, __WORDSIZE.
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-og5fmkr17856lhupacihwxvb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/tools/include/asm-generic/bitsperlong.h b/tools/include/asm-generic/bitsperlong.h
index d1d70aa19021..cfd661c6fc17 100644
--- a/tools/include/asm-generic/bitsperlong.h
+++ b/tools/include/asm-generic/bitsperlong.h
@@ -3,6 +3,24 @@
#include <uapi/asm-generic/bitsperlong.h>
+/*
+ * In the kernel, where this file comes from, we can rely on CONFIG_64BIT,
+ * here we have to make amends with what the various compilers provides us
+ * to figure out if we're on a 64-bit machine...
+ */
+#ifdef __SIZEOF_LONG__
+# if __SIZEOF_LONG__ == 8
+# define CONFIG_64BIT
+# endif
+#else
+# ifdef __WORDSIZE
+# if __WORDSIZE == 64
+# define CONFIG_64BIT
+# endif
+# else
+# error Failed to determine BITS_PER_LONG value
+# endif
+#endif
#ifdef CONFIG_64BIT
#define BITS_PER_LONG 64
@@ -10,11 +28,7 @@
#define BITS_PER_LONG 32
#endif /* CONFIG_64BIT */
-/*
- * FIXME: The check currently breaks x86-64 build, so it's
- * temporarily disabled. Please fix x86-64 and reenable
- */
-#if 0 && BITS_PER_LONG != __BITS_PER_LONG
+#if BITS_PER_LONG != __BITS_PER_LONG
#error Inconsistent word size. Check asm/bitsperlong.h
#endif
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2016-07-13 09:40 +0200 |
| Message-ID | <rUmVY-8lM-19@gated-at.bofh.it> |
| In reply to | #1442045 |
I have worked around the build failure for the time being via the patch below - but I guess there must be a better way. Thanks, Ingo tools/include/linux/bitops.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/include/linux/bitops.h b/tools/include/linux/bitops.h index 5ad9ee1dd7f6..49c929a104ee 100644 --- a/tools/include/linux/bitops.h +++ b/tools/include/linux/bitops.h @@ -9,7 +9,9 @@ #define __WORDSIZE (__SIZEOF_LONG__ * 8) #endif -#define BITS_PER_LONG __WORDSIZE +#ifndef BITS_PER_LONG +# define BITS_PER_LONG __WORDSIZE +#endif #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) #define BIT_WORD(nr) ((nr) / BITS_PER_LONG)
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2016-07-13 09:40 +0200 |
| Message-ID | <rUmVY-8lM-15@gated-at.bofh.it> |
| In reply to | #1441890 |
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > - Introduce --stdio-color to setup the color output mode selection in > 'annotate' and 'report', allowing emit color escape sequences when > redirecting the output of these tools (Arnaldo Carvalho de Melo) That's a pretty neat trick, as doing: perf report --stdio-color > tmp ... can now be used to put color coded output into Git logs! Thanks, Ingo
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web