mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] perf tools: Allow adding --filter to BPF object
@ 2015-08-28  6:20 Wang Nan
  2015-08-28  6:20 ` [PATCH 01/32] bpf tools: New API to get name from a " Wang Nan
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Wang Nan @ 2015-08-28  6:20 UTC (permalink / raw)
  To: acme
  Cc: linux-kernel, ast, brendan.d.gregg, daniel, dsahern, hekuang,
	jolsa, xiakaixu, masami.hiramatsu.pt, namhyung, a.p.zijlstra,
	lizefan, pi3orama, Wang Nan

This 4 patches will be appended into my next perf BPF pull request.
Without them, current perf BPF implementation has a small problem that,
if passing '--filter' after '--event test_bpf.o' event selection, the
filter won't be correctly applied.

Patch 1/4 append a new function to libbpf which allow fetching
object name from bpf_object.

Patch 2/4 add a safety check to avoid access invalid memory if the list
is empty during event parsing.

Patch 3/4 introduces a dummy evsel mechanism.

Patch 4/4 utilizes dummy evsel mechanism, make BPF event collect filter
options by dummy evsel and sync with them after real evsel generated.

The 4th patch should be applied after patch 'perf tools: Add bpf_fd
field to evsel and config it'. Patch 'perf tools: Enable passing bpf
object file to --event' should also be modified to utilize dummy evsel.
Please see my following pull request.

Thank you.

-- 
1.8.3.4


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [GIT PULL 00/32] perf tools: filtering events using eBPF programs
@ 2015-08-28  7:05 Wang Nan
  2015-08-28  7:05 ` [PATCH 01/32] bpf tools: New API to get name from a BPF object Wang Nan
  0 siblings, 1 reply; 7+ messages in thread
From: Wang Nan @ 2015-08-28  7:05 UTC (permalink / raw)
  To: acme, ast
  Cc: brendan.d.gregg, daniel, dsahern, hekuang, jolsa, xiakaixu,
	masami.hiramatsu.pt, namhyung, a.p.zijlstra, lizefan, pi3orama,
	linux-kernel, Wang Nan

Hi Arnaldo,

This time I adjust all Cc and Link field in each patch.

Four new patches (1,2,3,12/32) is newly introduced for fixing a bug
related to '--filter' option. Patch 06/32 is also modified. Please keep
an eye on it.

Since Steven is not very responsive, I still keep patch 31 and 32 in my
tree.

The following changes since commit 327938ee9ea16cc03f02f0e9cc74cdc6ac704cc6:

  tools lib traceeveent: Allow for negative numbers in print format (2015-08-27 11:13:53 -0300)

are available in the git repository at:

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

for you to fetch changes up to 430fc318354a17dddbc66ebb0964a0831f643c77:

  bpf: Introduce function for outputing data to perf event (2015-08-28 06:24:43 +0000)

----------------------------------------------------------------
perf BPF related improvements and bugfix:

 - Call bpf__clear() in command 'record, top, stat and trace' to ensure
   release BPF related resources.

 - Correct --filter option when try to apply filter to BPF object.

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

----------------------------------------------------------------
He Kuang (5):
      perf tools: Move linux/filter.h to tools/include
      perf tools: Introduce arch_get_reg_info() for x86
      perf record: Support custom vmlinux path
      tools lib traceevent: Support function __get_dynamic_array_len
      bpf: Introduce function for outputing data to perf event

Wang Nan (27):
      bpf tools: New API to get name from a BPF object
      perf tools: Don't set cmdline_group_boundary if no evsel is collected
      perf tools: Introduce dummy evsel
      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: Allow filter option to be applied to bof object
      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: 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

 include/trace/events/bpf.h                         |  30 +
 include/uapi/linux/bpf.h                           |   7 +
 kernel/trace/bpf_trace.c                           |  23 +
 samples/bpf/bpf_helpers.h                          |   2 +
 tools/build/Makefile.feature                       |   6 +-
 tools/include/linux/filter.h                       | 237 +++++++
 tools/lib/bpf/libbpf.c                             | 168 ++++-
 tools/lib/bpf/libbpf.h                             |  26 +-
 tools/lib/traceevent/event-parse.c                 |  56 +-
 tools/lib/traceevent/event-parse.h                 |   1 +
 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                        |  64 +-
 tools/perf/builtin-stat.c                          |   9 +-
 tools/perf/builtin-top.c                           |  11 +-
 tools/perf/builtin-trace.c                         |   6 +-
 tools/perf/config/Makefile                         |  31 +-
 tools/perf/tests/Build                             |  10 +-
 tools/perf/tests/bpf-script-example.c              |  44 ++
 tools/perf/tests/bpf.c                             | 170 +++++
 tools/perf/tests/builtin-test.c                    |  12 +
 tools/perf/tests/llvm.c                            | 125 +++-
 tools/perf/tests/llvm.h                            |  15 +
 tools/perf/tests/make                              |   4 +-
 tools/perf/tests/tests.h                           |   3 +
 tools/perf/util/Build                              |   2 +
 tools/perf/util/bpf-loader.c                       | 730 +++++++++++++++++++++
 tools/perf/util/bpf-loader.h                       |  95 +++
 tools/perf/util/bpf-prologue.c                     | 442 +++++++++++++
 tools/perf/util/bpf-prologue.h                     |  34 +
 tools/perf/util/evlist.c                           | 107 +++
 tools/perf/util/evlist.h                           |   2 +
 tools/perf/util/evsel.c                            |  49 ++
 tools/perf/util/evsel.h                            |   7 +
 tools/perf/util/include/dwarf-regs.h               |   7 +
 tools/perf/util/parse-events.c                     |  73 ++-
 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 +
 .../perf/util/scripting-engines/trace-event-perl.c |   1 +
 .../util/scripting-engines/trace-event-python.c    |   1 +
 49 files changed, 2759 insertions(+), 120 deletions(-)
 create mode 100644 include/trace/events/bpf.h
 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

-- 
2.1.0


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

end of thread, other threads:[~2015-09-01  8:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-28  6:20 [PATCH 0/4] perf tools: Allow adding --filter to BPF object Wang Nan
2015-08-28  6:20 ` [PATCH 01/32] bpf tools: New API to get name from a " Wang Nan
2015-09-01  8:30   ` [tip:perf/urgent] " tip-bot for Wang Nan
2015-08-28  6:20 ` [PATCH 02/32] perf tools: Don't set cmdline_group_boundary if no evsel is collected Wang Nan
2015-08-28  6:20 ` [PATCH 03/32] perf tools: Introduce dummy evsel Wang Nan
2015-08-28  6:20 ` [PATCH 12/32] perf tools: Allow filter option to be applied to bof object Wang Nan
2015-08-28  7:05 [GIT PULL 00/32] perf tools: filtering events using eBPF programs Wang Nan
2015-08-28  7:05 ` [PATCH 01/32] bpf tools: New API to get name from a BPF object 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®