Igor Lubashev
aa97293ff1
perf evsel: Kernel profiling is disallowed only when perf_event_paranoid > 1
...
Perf was too restrictive about sysctl kernel.perf_event_paranoid. The
kernel only disallows profiling when perf_event_paranoid > 1. Make perf
do the same.
Committer testing:
For a non-root user:
$ id
uid=1000(acme) gid=1000(acme) groups=1000(acme),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
$
Before:
We were restricting it to just userspace (:u suffix) even for a
workload started by the user:
$ perf record sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.001 MB perf.data (8 samples) ]
$ perf evlist
cycles:u
$ perf evlist -v
cycles:u: size: 112, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|PERIOD, read_format: ID, disabled: 1, inherit: 1, exclude_kernel: 1, mmap: 1, comm: 1, freq: 1, enable_on_exec: 1, task: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1
$ perf report --stdio
# To display the perf.data header info, please use --header/--header-only options.
#
# Total Lost Samples: 0
#
# Samples: 8 of event 'cycles:u'
# Event count (approx.): 1040396
#
# Overhead Command Shared Object Symbol
# ........ ....... ................ ......................
#
68.36% sleep libc-2.29.so [.] _dl_addr
27.33% sleep ld-2.29.so [.] dl_main
3.80% sleep ld-2.29.so [.] _dl_setup_hash
#
# (Tip: Order by the overhead of source file name and line number: perf report -s srcline)
#
$
$
After:
When the kernel allows profiling the kernel in that scenario:
$ perf record sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.023 MB perf.data (11 samples) ]
$ perf evlist
cycles
$ perf evlist -v
cycles: size: 112, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|PERIOD, read_format: ID, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, enable_on_exec: 1, task: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, ksymbol: 1, bpf_event: 1
$
$ perf report --stdio
# To display the perf.data header info, please use --header/--header-only options.
#
# Total Lost Samples: 0
#
# Samples: 11 of event 'cycles'
# Event count (approx.): 1601964
#
# Overhead Command Shared Object Symbol
# ........ ....... ................ ..........................
#
28.14% sleep [kernel.vmlinux] [k] __rb_erase_color
27.21% sleep [kernel.vmlinux] [k] unmap_page_range
27.20% sleep ld-2.29.so [.] __tunable_get_val
15.24% sleep [kernel.vmlinux] [k] thp_get_unmapped_area
1.96% perf [kernel.vmlinux] [k] perf_event_exec
0.22% perf [kernel.vmlinux] [k] native_sched_clock
0.02% perf [kernel.vmlinux] [k] intel_bts_enable_local
0.00% perf [kernel.vmlinux] [k] native_write_msr
#
# (Tip: Boolean options have negative forms, e.g.: perf report --no-children)
#
$
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Igor Lubashev <ilubashe@akamai.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: James Morris <jmorris@namei.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1566869956-7154-4-git-send-email-ilubashe@akamai.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-08-28 17:19:05 -03:00
..
2019-03-06 09:47:48 -03:00
2019-07-09 10:13:26 -03:00
2019-06-25 18:31:12 -03:00
2019-07-09 10:13:26 -03:00
2017-11-02 11:10:55 +01:00
2019-08-22 17:16:57 -03:00
2019-08-26 11:58:29 -03:00
2019-07-29 18:34:45 -03:00
2019-03-11 11:56:02 -03:00
2018-01-17 10:23:31 -03:00
2018-01-17 10:23:31 -03:00
2019-07-09 10:13:26 -03:00
2018-01-17 10:23:31 -03:00
2019-08-26 11:58:22 -03:00
2019-08-14 10:59:59 -03:00
2019-01-25 15:12:09 +01:00
2019-01-25 15:12:09 +01:00
2019-02-19 16:11:56 -03:00
2019-02-19 16:11:56 -03:00
2019-08-26 19:39:11 -03:00
2019-08-26 19:39:11 -03:00
2019-08-22 17:16:56 -03:00
2019-07-29 18:34:42 -03:00
2018-06-15 18:10:01 -03:00
2017-11-02 11:10:55 +01:00
2019-01-25 15:12:08 +01:00
2019-08-26 11:58:29 -03:00
2019-07-29 18:34:42 -03:00
2019-07-29 18:34:42 -03:00
2017-11-02 11:10:55 +01:00
2019-08-26 11:58:29 -03:00
2019-08-26 11:58:29 -03:00
2019-07-09 10:13:27 -03:00
2019-06-05 17:36:37 +02:00
2019-08-26 11:58:29 -03:00
2019-07-29 18:34:42 -03:00
2019-08-14 10:48:39 -03:00
2019-08-14 10:59:59 -03:00
2019-07-29 18:34:44 -03:00
2019-07-29 18:34:42 -03:00
2019-05-02 16:00:20 -04:00
2017-11-02 11:10:55 +01:00
2019-01-21 17:38:56 -03:00
2019-01-21 17:38:56 -03:00
2019-01-25 15:12:08 +01:00
2019-07-09 10:13:26 -03:00
2019-01-25 15:12:09 +01:00
2019-05-15 16:36:49 -03:00
2019-07-09 10:13:26 -03:00
2018-05-16 16:11:09 -03:00
2019-07-29 18:34:42 -03:00
2019-08-22 17:16:56 -03:00
2019-02-06 10:00:39 -03:00
2019-08-22 17:16:57 -03:00
2019-08-26 08:36:25 -03:00
2019-08-22 17:16:57 -03:00
2019-06-10 15:50:02 -03:00
2019-08-20 12:20:52 -03:00
2019-06-10 16:20:11 -03:00
2019-07-29 18:34:45 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-08-26 11:58:29 -03:00
2019-03-19 11:56:20 -03:00
2019-07-29 18:34:45 -03:00
2019-07-29 18:34:42 -03:00
2019-07-09 10:13:22 -03:00
2017-11-02 11:10:55 +01:00
2019-07-09 10:13:22 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-07-09 10:13:27 -03:00
2019-03-19 16:52:07 -03:00
2018-12-28 16:33:02 -03:00
2018-12-28 16:33:02 -03:00
2019-07-09 10:13:22 -03:00
2019-05-30 11:26:35 -07:00
2017-11-02 11:10:55 +01:00
2019-08-22 17:16:57 -03:00
2019-07-29 18:34:42 -03:00
2019-08-28 17:17:51 -03:00
2019-08-26 19:39:11 -03:00
2019-08-26 19:39:10 -03:00
2019-07-29 18:34:45 -03:00
2019-07-29 18:34:46 -03:00
2019-08-28 17:19:05 -03:00
2019-08-26 19:39:11 -03:00
2019-08-15 12:26:13 -03:00
2019-08-15 12:25:55 -03:00
2017-11-02 11:10:55 +01:00
2019-01-08 13:28:13 -03:00
2019-06-19 17:09:51 +02:00
2019-06-05 17:30:26 +02:00
2018-10-18 11:16:38 -03:00
2018-04-12 10:33:31 -03:00
2019-08-26 11:58:29 -03:00
2019-07-09 10:13:26 -03:00
2017-11-02 11:10:55 +01:00
2019-08-14 11:00:00 -03:00
2019-07-29 18:34:42 -03:00
2019-07-09 10:13:26 -03:00
2019-08-26 11:58:29 -03:00
2019-07-29 18:34:42 -03:00
2019-08-26 19:39:11 -03:00
2019-06-05 17:36:37 +02:00
2019-08-14 10:59:59 -03:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:37:04 +02:00
2019-01-25 15:12:10 +01:00
2017-11-07 10:30:18 +01:00
2019-07-29 18:34:45 -03:00
2019-06-19 17:09:51 +02:00
2019-08-26 11:58:22 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-07-09 10:13:27 -03:00
2018-08-20 08:54:58 -03:00
2018-08-20 08:54:59 -03:00
2019-08-26 19:39:11 -03:00
2019-08-26 11:58:22 -03:00
2019-08-16 12:25:57 -03:00
2019-02-06 10:00:38 -03:00
2019-08-16 12:25:57 -03:00
2019-07-29 18:34:42 -03:00
2019-08-22 17:16:57 -03:00
2018-03-16 13:52:37 -03:00
2019-02-04 11:32:14 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-08-22 17:16:56 -03:00
2019-08-22 17:16:56 -03:00
2019-08-22 11:14:54 -03:00
2019-05-15 16:36:49 -03:00
2019-08-26 19:39:11 -03:00
2019-08-26 19:39:11 -03:00
2019-07-09 10:13:27 -03:00
2018-12-17 15:02:17 -03:00
2019-08-20 12:18:58 -03:00
2017-11-02 11:10:55 +01:00
2019-08-14 10:59:59 -03:00
2019-08-14 10:59:59 -03:00
2019-08-14 10:59:59 -03:00
2019-07-09 10:13:27 -03:00
2019-07-09 10:13:22 -03:00
2019-05-15 16:36:49 -03:00
2017-12-27 12:15:48 -03:00
2017-12-27 12:15:48 -03:00
2019-05-16 14:17:12 -03:00
2019-06-05 09:47:54 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-05-28 18:37:44 -03:00
2019-08-22 17:16:57 -03:00
2019-07-29 18:34:42 -03:00
2019-06-25 21:02:47 -03:00
2017-11-07 10:30:18 +01:00
2019-07-23 23:41:33 +02:00
2019-05-25 23:04:42 -04:00
2019-07-18 11:51:00 -07:00
2019-05-25 23:04:42 -04:00
2019-07-18 11:51:00 -07:00
2019-06-25 21:02:47 -03:00
2019-07-09 10:13:26 -03:00
2017-11-02 11:10:55 +01:00
2019-08-14 10:48:39 -03:00
2019-08-26 19:39:11 -03:00
2019-01-25 15:12:10 +01:00
2019-06-05 17:37:04 +02:00
2019-01-25 15:12:10 +01:00
2019-08-26 11:58:22 -03:00
2019-08-26 11:58:22 -03:00
2019-07-09 14:59:11 -03:00
2019-07-09 14:59:11 -03:00
2017-09-21 13:28:06 -03:00
2017-09-21 13:28:06 -03:00
2019-01-21 17:00:48 -03:00
2018-08-08 15:26:48 -03:00
2019-07-29 18:34:45 -03:00
2018-08-03 10:34:18 -03:00
2019-07-29 18:34:45 -03:00
2019-07-29 18:34:42 -03:00
2019-07-29 18:34:42 -03:00
2019-08-26 19:39:11 -03:00
2019-07-29 18:34:42 -03:00
2019-07-09 10:13:26 -03:00
2019-08-14 10:48:39 -03:00
2019-06-10 16:20:11 -03:00
2019-08-26 11:58:29 -03:00
2019-08-26 11:58:29 -03:00
2019-07-09 10:13:27 -03:00
2019-02-06 10:00:38 -03:00
2019-07-09 10:13:26 -03:00
2019-01-25 15:12:09 +01:00
2019-08-26 11:58:29 -03:00
2019-07-29 18:34:45 -03:00
2019-08-26 11:58:22 -03:00
2019-08-26 11:58:22 -03:00
2019-07-09 10:13:26 -03:00
2017-11-02 11:10:55 +01:00
2019-07-09 10:13:26 -03:00
2017-11-02 11:10:55 +01:00
2019-07-01 22:50:40 -03:00
2019-07-01 22:50:40 -03:00
2019-07-09 10:13:26 -03:00
2019-01-25 15:12:10 +01:00
2019-08-22 17:16:57 -03:00
2017-11-02 11:10:55 +01:00
2019-07-02 13:20:51 -03:00
2019-01-25 15:12:10 +01:00
2019-07-09 10:13:27 -03:00
2019-07-09 10:13:26 -03:00
2019-08-08 15:41:25 -03:00
2019-08-08 15:41:25 -03:00
2019-07-29 18:34:42 -03:00
2019-07-29 18:34:42 -03:00
2019-07-09 10:13:22 -03:00
2017-12-27 12:15:47 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-08-22 17:16:57 -03:00
2019-08-22 17:16:57 -03:00
2019-07-09 10:13:26 -03:00
2019-06-17 20:48:14 +02:00
2019-08-26 19:39:11 -03:00
2019-08-26 19:39:11 -03:00
2019-06-25 21:39:18 -03:00
2019-03-11 11:56:02 -03:00
2019-08-26 19:39:11 -03:00
2019-07-29 18:34:45 -03:00
2019-08-26 11:58:22 -03:00
2019-07-29 18:34:45 -03:00
2019-06-25 21:02:47 -03:00
2019-06-05 17:37:11 +02:00
2019-07-29 18:34:42 -03:00
2019-04-01 15:18:09 -03:00
2019-07-29 18:34:42 -03:00
2018-03-06 11:31:14 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-07-09 10:13:26 -03:00
2017-11-02 11:10:55 +01:00
2019-08-16 12:25:57 -03:00
2019-08-16 12:30:14 -03:00
2019-08-16 12:25:57 -03:00
2019-07-09 10:13:22 -03:00
2017-11-02 11:10:55 +01:00
2019-08-26 11:58:29 -03:00
2019-08-26 11:58:29 -03:00
2019-07-09 10:13:26 -03:00
2017-11-02 11:10:55 +01:00
2019-07-09 10:13:26 -03:00
2017-11-02 11:10:55 +01:00
2019-07-09 10:13:26 -03:00
2019-01-21 15:15:57 -03:00
2019-07-23 09:04:03 -03:00