linux/tools/perf
Yang Jihong daf07d2207 perf kwork: Implement BPF trace
'perf record' generates perf.data, which generates extra interrupts
for hard disk, amount of data to be collected increases with time.

Using eBPF trace can process the data in kernel, which solves the
preceding two problems.

Add -b/--use-bpf option for latency and report to support
tracing kwork events using eBPF:

1. Create bpf prog and attach to tracepoints,
2. Start tracing after command is entered,
3. After user hit "ctrl+c", stop tracing and report,
4. Support CPU and name filtering.

This commit implements the framework code and
does not add specific event support.

Test cases:

  # perf kwork rep -h

   Usage: perf kwork report [<options>]

      -b, --use-bpf         Use BPF to measure kwork runtime
      -C, --cpu <cpu>       list of cpus to profile
      -i, --input <file>    input file name
      -n, --name <name>     event name to profile
      -s, --sort <key[,key2...]>
                            sort by key(s): runtime, max, count
      -S, --with-summary    Show summary with statistics
          --time <str>      Time span for analysis (start,stop)

  # perf kwork lat -h

   Usage: perf kwork latency [<options>]

      -b, --use-bpf         Use BPF to measure kwork latency
      -C, --cpu <cpu>       list of cpus to profile
      -i, --input <file>    input file name
      -n, --name <name>     event name to profile
      -s, --sort <key[,key2...]>
                            sort by key(s): avg, max, count
          --time <str>      Time span for analysis (start,stop)

  # perf kwork lat -b
  Unsupported bpf trace class irq

  # perf kwork rep -b
  Unsupported bpf trace class irq

Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220709015033.38326-15-yangjihong1@huawei.com
[ Simplify work_findnew() ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2022-07-26 16:31:54 -03:00
..
arch perf tsc: Add cpuinfo fall back for arch_get_tsc_freq() 2022-07-25 12:29:07 -03:00
bench
dlfilters
Documentation perf kwork: Implement BPF trace 2022-07-26 16:31:54 -03:00
examples/bpf
include perf dlfilter: Add machine_pid and vcpu 2022-07-20 11:08:13 -03:00
jvmti
pmu-events perf jevents: Remove jevents.c 2022-06-29 18:39:10 -03:00
python
scripts perf python: Ignore unused command line arguments when building with clang 2022-07-20 15:14:39 -03:00
tests perf test: Add test for #system_tsc_freq in metrics 2022-07-25 12:29:07 -03:00
trace perf trace beauty: Fix generation of errno id->str table on ALT Linux 2022-06-26 12:32:55 -03:00
ui
util perf kwork: Implement BPF trace 2022-07-26 16:31:54 -03:00
.gitignore
Build perf kwork: New tool to trace time properties of kernel work (such as softirq, and workqueue) 2022-07-26 16:01:24 -03:00
builtin-annotate.c perf gtk: Only support --gtk if compiled in 2022-07-20 11:09:11 -03:00
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c perf buildid-list: Add a "-m" option to show kernel and modules build-ids 2022-07-18 16:35:34 -03:00
builtin-c2c.c
builtin-config.c
builtin-daemon.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c
builtin-help.c
builtin-inject.c perf inject: Add support for injecting guest sideband events 2022-07-20 11:08:37 -03:00
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c
builtin-kwork.c perf kwork: Implement BPF trace 2022-07-26 16:31:54 -03:00
builtin-list.c
builtin-lock.c perf lock: Support -t option for 'contention' subcommand 2022-07-25 17:58:42 -03:00
builtin-mem.c
builtin-probe.c
builtin-record.c perf record: Add finished init event 2022-06-23 11:54:22 -03:00
builtin-report.c perf gtk: Only support --gtk if compiled in 2022-07-20 11:09:11 -03:00
builtin-sched.c
builtin-script.c perf script: Add machine_pid and vcpu 2022-07-20 11:08:13 -03:00
builtin-stat.c perf stat: Enable ignore_missing_thread 2022-06-26 12:32:55 -03:00
builtin-timechart.c
builtin-top.c
builtin-trace.c perf trace: Fix SIGSEGV when processing syscall args 2022-07-17 10:59:52 -03:00
builtin-version.c
builtin.h perf kwork: New tool to trace time properties of kernel work (such as softirq, and workqueue) 2022-07-26 16:01:24 -03:00
check-headers.sh
command-list.txt perf kwork: New tool to trace time properties of kernel work (such as softirq, and workqueue) 2022-07-26 16:01:24 -03:00
CREDITS
design.txt
Makefile
Makefile.config perf build: Avoid defining _FORTIFY_SOURCE multiple times 2022-07-20 13:21:45 -03:00
Makefile.perf perf kwork: Implement BPF trace 2022-07-26 16:31:54 -03:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf kwork: New tool to trace time properties of kernel work (such as softirq, and workqueue) 2022-07-26 16:01:24 -03:00
perf.h