mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PULL 00/27] perf tools: filtering events using eBPF programs
@ 2015-08-10  6:15 Wang Nan
  2015-08-10  6:15 ` [PATCH 01/27] perf tools: Make perf depend on libbpf Wang Nan
                   ` (26 more replies)
  0 siblings, 27 replies; 29+ messages in thread
From: Wang Nan @ 2015-08-10  6:15 UTC (permalink / raw)
  To: acme, ast
  Cc: linux-kernel, lizefan, hekuang, xiakaixu, pi3orama,
	brendan.d.gregg, daniel, dsahern, jolsa, masami.hiramatsu.pt,
	namhyung, paulus, a.p.zijlstra

Hi Arnaldo,

   This is patches needs to be reviewed after Ingo's pull. In this series,
I made following improvements:

  1. Remove all pr_err and introduce bpf__strerror_{prepare_load,probe,load}.
     All callers are switched to strerror style;

  2. Avoid the global 'struct perf_probe_event' array used by perf__probe(). This
     is done by moving config_bpf_program() to bpf__probe().

The following changes since commit 64d3e6a927b9fef30efafc0aacab563a3065db24:

  perf tools: Unset perf_event_attr::freq when period term is set (2015-08-08 14:32:00 -0300)

are available in the git repository at:

  https://github.com/WangNan0/linux.git ebpf

for you to fetch changes up to 947b8f665e9ad50071ba5e83cbfb54345706ba98:

  perf tools: Support attach BPF program on uprobe events (2015-08-09 16:45:16 +0000)

----------------------------------------------------------------
He Kuang (3):
      perf tools: Move linux/filter.h to tools/include
      perf tools: Introduce arch_get_reg_info() for x86
      perf record: Support custom vmlinux path

Wang Nan (24):
      perf tools: Make perf depend on libbpf
      perf ebpf: Add the libbpf glue
      perf tools: Enable passing bpf object file to --event
      perf probe: Attach trace_probe_event with perf_probe_event
      perf record, bpf: Parse and probe eBPF programs probe points
      perf bpf: Collect 'struct perf_probe_event' for bpf_program
      perf record: Load all eBPF object into kernel
      perf tools: Add bpf_fd field to evsel and config it
      perf tools: Attach eBPF program to perf event
      perf tools: Suppress probing messages when probing by BPF loading
      perf record: Add clang options for compiling BPF scripts
      perf tools: Infrastructure for compiling scriptlets when passing '.c' to --event
      perf tests: Enforce LLVM test for BPF test
      perf test: Enable 'perf test' run as test targets
      perf test: Add 'perf test BPF'
      bpf tools: Load a program with different instances using preprocessor
      perf tools: Fix probe-event.h include
      perf probe: Reset args and nargs for probe_trace_event when failure
      perf tools: Add BPF_PROLOGUE config options for further patches
      perf tools: Add prologue for BPF programs for fetching arguments
      perf tools: Generate prologue for BPF programs
      perf tools: Use same BPF program if arguments are identical
      perf probe: Init symbol as kprobe
      perf tools: Support attach BPF program on uprobe events

 tools/build/Makefile.feature          |   6 +-
 tools/include/linux/filter.h          | 237 ++++++++++++
 tools/lib/bpf/libbpf.c                | 143 ++++++-
 tools/lib/bpf/libbpf.h                |  22 ++
 tools/perf/MANIFEST                   |   4 +
 tools/perf/Makefile.perf              |  19 +-
 tools/perf/arch/x86/Makefile          |   1 +
 tools/perf/arch/x86/util/Build        |   2 +
 tools/perf/arch/x86/util/dwarf-regs.c | 104 +++--
 tools/perf/builtin-probe.c            |   4 +-
 tools/perf/builtin-record.c           |  52 ++-
 tools/perf/config/Makefile            |  31 +-
 tools/perf/tests/Build                |  10 +-
 tools/perf/tests/bpf-script-example.c |  44 +++
 tools/perf/tests/bpf.c                | 229 +++++++++++
 tools/perf/tests/builtin-test.c       |  61 +++
 tools/perf/tests/llvm.c               | 123 +++++-
 tools/perf/tests/llvm.h               |  15 +
 tools/perf/tests/make                 |   4 +-
 tools/perf/tests/tests.h              |   5 +
 tools/perf/util/Build                 |   2 +
 tools/perf/util/bpf-loader.c          | 707 ++++++++++++++++++++++++++++++++++
 tools/perf/util/bpf-loader.h          |  82 ++++
 tools/perf/util/bpf-prologue.c        | 442 +++++++++++++++++++++
 tools/perf/util/bpf-prologue.h        |  34 ++
 tools/perf/util/evlist.c              |  41 ++
 tools/perf/util/evlist.h              |   1 +
 tools/perf/util/evsel.c               |  17 +
 tools/perf/util/evsel.h               |   1 +
 tools/perf/util/include/dwarf-regs.h  |   7 +
 tools/perf/util/parse-events.c        |  26 ++
 tools/perf/util/parse-events.h        |   4 +
 tools/perf/util/parse-events.l        |   6 +
 tools/perf/util/parse-events.y        |  29 +-
 tools/perf/util/probe-event.c         |  79 ++--
 tools/perf/util/probe-event.h         |   8 +-
 tools/perf/util/probe-file.c          |   5 +-
 tools/perf/util/probe-finder.c        |   4 +
 38 files changed, 2512 insertions(+), 99 deletions(-)
 create mode 100644 tools/include/linux/filter.h
 create mode 100644 tools/perf/tests/bpf-script-example.c
 create mode 100644 tools/perf/tests/bpf.c
 create mode 100644 tools/perf/tests/llvm.h
 create mode 100644 tools/perf/util/bpf-loader.c
 create mode 100644 tools/perf/util/bpf-loader.h
 create mode 100644 tools/perf/util/bpf-prologue.c
 create mode 100644 tools/perf/util/bpf-prologue.h

-- 
1.8.3.4


^ permalink raw reply	[flat|nested] 29+ messages in thread
* [GIT PULL 00/27] perf tools: filtering events using eBPF programs
@ 2015-09-06  7:13 Wang Nan
  2015-09-06  7:13 ` [PATCH 08/27] perf tools: Add bpf_fd field to evsel and config it Wang Nan
  0 siblings, 1 reply; 29+ messages in thread
From: Wang Nan @ 2015-09-06  7:13 UTC (permalink / raw)
  To: acme, ast, masami.hiramatsu.pt, namhyung
  Cc: a.p.zijlstra, brendan.d.gregg, daniel, dsahern, hekuang, jolsa,
	lizefan, paulus, wangnan0, xiakaixu, pi3orama, linux-kernel

(I forget to CC mailing list when sending previous pull req. Sorry for the noisy.)

Hi Arnaldo,


   I rebased my code on your perf/core and send a new pull request. You
can find main changes in the tag message. The most biggest changes
are the resesigning of dummy placeholder and the new testcase for BPF
prologue. They are patch 10, patch 11,  patch 26 and patch 27. Please
have a look at them.

The following changes since commit 0959e527b1593e662cb99639a587eac39ea1232d:

  perf stat: Move sw clock metrics printout to stat-shadow (2015-09-04 20:30:01 -0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/pi3orama/linux tags/perf-ebpf-for-acme

for you to fetch changes up to 3af1c7f44478d1545f202bd0054e767d3f0f8130:

  perf test: Test BPF prologue (2015-09-06 06:10:12 +0000)

----------------------------------------------------------------
BPF related bugfix and improve

 1. Enforce the assumption that event parser never return empty list.

 2. Reuse code and API from kernel's regs_query_register_offset().

 3. Totally redesign dummy placeholder. Reuse existing dummy event instead
    of creating a new one.

 4. Introduce new testcases, test LLVM kbuild searching and BPF prologue.

 5. Adding a missing '!' in add_perf_probe_events.

 6. Use new API ({convert,apply,cleanup}_perf_probe_events) to probe events.
    (while fix a bug that non-root user can't trace non-BPF events, like cycles)

Signed-off-by: Wang Nan <wangnan0@huawei.com>

----------------------------------------------------------------

He Kuang (2):
  perf tools: Add prologue for BPF programs for fetching arguments
  perf record: Support custom vmlinux path

Wang Nan (25):
  perf tools: Don't write to evsel if parser doesn't collect evsel
  perf tools: Make perf depend on libbpf
  perf ebpf: Add the libbpf glue
  perf tools: Enable passing bpf object file to --event
  perf record, bpf: Parse and create probe points for BPF programs
  perf bpf: Collect 'struct perf_probe_event' for bpf_program
  perf record: Load all eBPF object into kernel
  perf tools: Add bpf_fd field to evsel and config it
  perf tools: Attach eBPF program to perf event
  perf tools: Allow BPF placeholder dummy events to collect --filter
    options
  perf tools: Sync setting of real bpf events with placeholder
  perf record: Add clang options for compiling BPF scripts
  perf tools: Compile scriptlets to BPF objects when passing '.c' to
    --event
  perf test: Enforce LLVM test for BPF test
  perf test: Add 'perf test BPF'
  bpf tools: Load a program with different instances using preprocessor
  perf probe: Reset args and nargs for probe_trace_event when failure
  perf tools: Add BPF_PROLOGUE config options for further patches
  perf tools: Introduce regs_query_register_offset() for x86
  perf tools: Generate prologue for BPF programs
  perf tools: Use same BPF program if arguments are identical
  perf probe: Init symbol as kprobe
  perf tools: Allow BPF program attach to uprobe events
  perf test: Enforce LLVM test, add kbuild test
  perf test: Test BPF prologue

 tools/build/Makefile.feature                |   6 +-
 tools/lib/bpf/libbpf.c                      | 143 +++++-
 tools/lib/bpf/libbpf.h                      |  22 +
 tools/perf/MANIFEST                         |   3 +
 tools/perf/Makefile.perf                    |  19 +-
 tools/perf/arch/x86/Makefile                |   1 +
 tools/perf/arch/x86/util/Build              |   1 +
 tools/perf/arch/x86/util/dwarf-regs.c       | 122 +++--
 tools/perf/builtin-record.c                 |  58 ++-
 tools/perf/builtin-stat.c                   |   8 +-
 tools/perf/builtin-top.c                    |  10 +-
 tools/perf/builtin-trace.c                  |   6 +-
 tools/perf/config/Makefile                  |  36 +-
 tools/perf/tests/Build                      |  24 +-
 tools/perf/tests/bpf-script-example.c       |  48 ++
 tools/perf/tests/bpf-script-test-kbuild.c   |  21 +
 tools/perf/tests/bpf-script-test-prologue.c |  35 ++
 tools/perf/tests/bpf.c                      | 229 +++++++++
 tools/perf/tests/builtin-test.c             |  12 +
 tools/perf/tests/llvm.c                     | 210 +++++++-
 tools/perf/tests/llvm.h                     |  29 ++
 tools/perf/tests/make                       |   4 +-
 tools/perf/tests/tests.h                    |   3 +
 tools/perf/util/Build                       |   2 +
 tools/perf/util/bpf-loader.c                | 756 ++++++++++++++++++++++++++++
 tools/perf/util/bpf-loader.h                |  94 ++++
 tools/perf/util/bpf-prologue.c              | 443 ++++++++++++++++
 tools/perf/util/bpf-prologue.h              |  34 ++
 tools/perf/util/evlist.c                    | 115 +++++
 tools/perf/util/evlist.h                    |   1 +
 tools/perf/util/evsel.c                     |  49 ++
 tools/perf/util/evsel.h                     |  24 +
 tools/perf/util/include/dwarf-regs.h        |   8 +
 tools/perf/util/parse-events.c              |  82 ++-
 tools/perf/util/parse-events.h              |   4 +
 tools/perf/util/parse-events.l              |   6 +
 tools/perf/util/parse-events.y              |  29 +-
 tools/perf/util/probe-event.c               |   2 +-
 tools/perf/util/probe-finder.c              |   4 +
 39 files changed, 2618 insertions(+), 85 deletions(-)
 create mode 100644 tools/perf/tests/bpf-script-example.c
 create mode 100644 tools/perf/tests/bpf-script-test-kbuild.c
 create mode 100644 tools/perf/tests/bpf-script-test-prologue.c
 create mode 100644 tools/perf/tests/bpf.c
 create mode 100644 tools/perf/tests/llvm.h
 create mode 100644 tools/perf/util/bpf-loader.c
 create mode 100644 tools/perf/util/bpf-loader.h
 create mode 100644 tools/perf/util/bpf-prologue.c
 create mode 100644 tools/perf/util/bpf-prologue.h

-- 
2.1.0


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2015-09-06  7:15 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-10  6:15 [GIT PULL 00/27] perf tools: filtering events using eBPF programs Wang Nan
2015-08-10  6:15 ` [PATCH 01/27] perf tools: Make perf depend on libbpf Wang Nan
2015-08-10  6:15 ` [PATCH 02/27] perf ebpf: Add the libbpf glue Wang Nan
2015-08-10  6:15 ` [PATCH 03/27] perf tools: Enable passing bpf object file to --event Wang Nan
2015-08-10  6:15 ` [PATCH 04/27] perf probe: Attach trace_probe_event with perf_probe_event Wang Nan
2015-08-10  6:15 ` [PATCH 05/27] perf record, bpf: Parse and probe eBPF programs probe points Wang Nan
2015-08-10  6:15 ` [PATCH 06/27] perf bpf: Collect 'struct perf_probe_event' for bpf_program Wang Nan
2015-08-10  6:15 ` [PATCH 07/27] perf record: Load all eBPF object into kernel Wang Nan
2015-08-10  6:15 ` [PATCH 08/27] perf tools: Add bpf_fd field to evsel and config it Wang Nan
2015-08-10  6:15 ` [PATCH 09/27] perf tools: Attach eBPF program to perf event Wang Nan
2015-08-10  6:15 ` [PATCH 10/27] perf tools: Suppress probing messages when probing by BPF loading Wang Nan
2015-08-10  6:15 ` [PATCH 11/27] perf record: Add clang options for compiling BPF scripts Wang Nan
2015-08-10  6:15 ` [PATCH 12/27] perf tools: Infrastructure for compiling scriptlets when passing '.c' to --event Wang Nan
2015-08-10  6:15 ` [PATCH 13/27] perf tests: Enforce LLVM test for BPF test Wang Nan
2015-08-10  6:15 ` [PATCH 14/27] perf test: Enable 'perf test' run as test targets Wang Nan
2015-08-10  6:15 ` [PATCH 15/27] perf test: Add 'perf test BPF' Wang Nan
2015-08-10  6:15 ` [PATCH 16/27] bpf tools: Load a program with different instances using preprocessor Wang Nan
2015-08-10  6:15 ` [PATCH 17/27] perf tools: Fix probe-event.h include Wang Nan
2015-08-10  6:16 ` [PATCH 18/27] perf probe: Reset args and nargs for probe_trace_event when failure Wang Nan
2015-08-10  6:16 ` [PATCH 19/27] perf tools: Move linux/filter.h to tools/include Wang Nan
2015-08-10  6:16 ` [PATCH 20/27] perf tools: Add BPF_PROLOGUE config options for further patches Wang Nan
2015-08-10  6:16 ` [PATCH 21/27] perf tools: Introduce arch_get_reg_info() for x86 Wang Nan
2015-08-10  6:16 ` [PATCH 22/27] perf tools: Add prologue for BPF programs for fetching arguments Wang Nan
2015-08-10  6:16 ` [PATCH 23/27] perf tools: Generate prologue for BPF programs Wang Nan
2015-08-10  6:16 ` [PATCH 24/27] perf tools: Use same BPF program if arguments are identical Wang Nan
2015-08-10  6:16 ` [PATCH 25/27] perf record: Support custom vmlinux path Wang Nan
2015-08-10  6:16 ` [PATCH 26/27] perf probe: Init symbol as kprobe Wang Nan
2015-08-10  6:16 ` [PATCH 27/27] perf tools: Support attach BPF program on uprobe events Wang Nan
2015-09-06  7:13 [GIT PULL 00/27] perf tools: filtering events using eBPF programs Wang Nan
2015-09-06  7:13 ` [PATCH 08/27] perf tools: Add bpf_fd field to evsel and config it Wang Nan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®