linux/tools
Changbin Du 846e193980 perf ftrace: Add option '-m/--buffer-size' to set per-cpu buffer size
This adds an option '-m/--buffer-size' to allow us set the size of per-cpu
tracing buffer.

Committer testing:

Before running with this option:

  # find /sys/kernel/tracing/ -name buffer_size_kb | xargs cat
  1408
  1408
  1408
  1408
  1408
  1408
  1408
  1408
  1408
  #

Then, run:

  # perf ftrace -m 2048K | head -10
   2)               |  mutex_unlock() {
   2)   ==========> |
   2)               |    smp_irq_work_interrupt() {
   2)               |      irq_enter() {
   2)   0.121 us    |        rcu_irq_enter();
   2)   0.128 us    |        irqtime_account_irq();
   2)   0.719 us    |      }
   2)               |      __wake_up() {
   2)               |        __wake_up_common_lock() {
   2)   0.105 us    |          _raw_spin_lock_irqsave();
  #

Now look at those tracefs knobs:

  # find /sys/kernel/tracing/ -name buffer_size_kb | xargs cat
  2048
  2048
  2048
  2048
  2048
  2048
  2048
  2048
  2048
  #

This should be similar to the -m option in the other perf tools, such as
'perf record', 'perf trace', etc.

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: http://lore.kernel.org/lkml/20200808023141.14227-5-changbin.du@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-08-14 08:37:46 -03:00
..
accounting
arch tools headers kvm s390: Sync headers with the kernel sources 2020-08-12 08:52:32 -03:00
bootconfig
bpf Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-08-05 20:13:21 -07:00
build tools build feature: Quote CC and CXX for their arguments 2020-08-13 10:00:19 -03:00
cgroup tools/cgroup: add memcg_slabinfo.py tool 2020-08-07 11:33:25 -07:00
debugging
edid
firewire
firmware
gpio
hv
iio
include tools headers UAPI: Sync kvm.h headers with the kernel sources 2020-08-12 09:02:40 -03:00
io_uring
kvm/kvm_stat
laptop
leds
lib libperf: Fix man page typos 2020-08-13 09:34:26 -03:00
memory-model These were the main changes in this cycle: 2020-08-03 14:39:35 -07:00
nfsd
objtool Misc updates: 2020-08-03 14:45:33 -07:00
pci
pcmcia
perf perf ftrace: Add option '-m/--buffer-size' to set per-cpu buffer size 2020-08-14 08:37:46 -03:00
power ACPI updates for 5.9-rc1 2020-08-03 20:37:22 -07:00
scripts
spi
testing libnvdimm for 5.9 2020-08-11 10:59:19 -07:00
thermal/tmon
time
usb
virtio virtio: fixes, features 2020-08-11 14:34:17 -07:00
vm
wmi
Makefile