linux-stable/tools/perf/bench
Namhyung Kim 79a3371bdf perf bench sched pipe: Add -G/--cgroups option
The -G/--cgroups option is to put sender and receiver in different
cgroups in order to measure cgroup context switch overheads.

Users need to make sure the cgroups exist and accessible.  The following
example should the effect of this change.  Please don't forget taskset
before the perf bench to measure cgroup switches properly.  Otherwise
each task would run on a different CPU and generate cgroup switches
regardless of this change.

  # perf stat -e context-switches,cgroup-switches \
  > taskset -c 0 perf bench sched pipe -l 10000 > /dev/null

   Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000':

              20,001      context-switches
                   2      cgroup-switches

         0.053449651 seconds time elapsed

         0.011286000 seconds user
         0.041869000 seconds sys

  # perf stat -e context-switches,cgroup-switches \
  > taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB > /dev/null

   Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB':

              20,001      context-switches
              20,001      cgroup-switches

         0.052768627 seconds time elapsed

         0.006284000 seconds user
         0.046266000 seconds sys

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lore.kernel.org/r/20231017202342.1353124-1-namhyung@kernel.org
2023-10-25 10:02:10 -07:00
..
Build perf tools changes for v6.6: 2023-09-09 20:06:17 -07:00
bench.h perf tools changes for v6.6: 2023-09-09 20:06:17 -07:00
breakpoint.c perf bench breakpoint: Skip run if no breakpoints available 2023-08-23 08:39:02 -03:00
epoll-ctl.c perf bench epoll: Fix missing frees/puts on the exit path 2023-06-12 18:18:14 -03:00
epoll-wait.c perf bench epoll: Fix missing frees/puts on the exit path 2023-06-12 18:18:14 -03:00
evlist-open-close.c perf evlist: Rename cpus to user_requested_cpus 2022-04-01 16:19:35 -03:00
find-bit-bench.c perf bench: Avoid NDEBUG warning 2023-04-04 09:39:56 -03:00
futex-hash.c perf bench: Update use of pthread mutex/cond 2022-10-04 08:55:19 -03:00
futex-lock-pi.c perf bench futex: Avoid memory leaks from pthread_attr 2023-06-12 18:18:14 -03:00
futex-requeue.c perf bench futex: Avoid memory leaks from pthread_attr 2023-06-12 18:18:14 -03:00
futex-wake-parallel.c perf bench futex: Avoid memory leaks from pthread_attr 2023-06-12 18:18:14 -03:00
futex-wake.c perf bench futex: Avoid memory leaks from pthread_attr 2023-06-12 18:18:14 -03:00
futex.h Revert "perf bench futex: Add support for 32-bit systems with 64-bit time_t" 2021-11-01 11:42:54 -03:00
inject-buildid.c perf bench inject-buildid: Use zfree() to reduce chances of use after free 2023-04-12 10:14:01 -03:00
kallsyms-parse.c perf bench: Add kallsyms parsing 2020-05-05 16:35:32 -03:00
mem-functions.c perf bench mem: Always memset source before memcpy 2020-08-13 09:34:26 -03:00
mem-memcpy-arch.h
mem-memcpy-x86-64-asm-def.h tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memcpy-x86-64-asm.S tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memset-arch.h
mem-memset-x86-64-asm-def.h tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memset-x86-64-asm.S tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
numa.c perf bench numa: Fix type of loop iterator in do_work, it should be 'long' 2023-04-04 09:39:56 -03:00
pmu-scan.c perf pmu: Abstract alias/event struct 2023-08-24 10:42:46 -03:00
sched-messaging.c perf bench messaging: Kill child processes when exit abnormally in process mode 2023-09-26 21:47:12 -07:00
sched-pipe.c perf bench sched pipe: Add -G/--cgroups option 2023-10-25 10:02:10 -07:00
sched-seccomp-notify.c perf bench sched-seccomp-notify: Use the tools copy of seccomp.h UAPI 2023-09-13 08:49:00 -03:00
synthesize.c perf tools: Allow controlling synthesizing PERF_RECORD_ metadata events during record 2021-09-17 08:44:19 -03:00
syscall.c perf bench syscall: Add fork syscall benchmark 2023-04-04 09:39:55 -03:00
uprobe.c perf bench uprobe: Fix potential use of memory after free 2023-10-12 10:01:55 -07:00