Yonghong Song
cf5f5cea27
bpf: add support for sys_enter_* and sys_exit_* tracepoints
...
Currently, bpf programs cannot be attached to sys_enter_* and sys_exit_*
style tracepoints. The iovisor/bcc issue #748
(https://github.com/iovisor/bcc/issues/748 ) documents this issue.
For example, if you try to attach a bpf program to tracepoints
syscalls/sys_enter_newfstat, you will get the following error:
# ./tools/trace.py t:syscalls:sys_enter_newfstat
Ioctl(PERF_EVENT_IOC_SET_BPF): Invalid argument
Failed to attach BPF to tracepoint
The main reason is that syscalls/sys_enter_* and syscalls/sys_exit_*
tracepoints are treated differently from other tracepoints and there
is no bpf hook to it.
This patch adds bpf support for these syscalls tracepoints by
. permitting bpf attachment in ioctl PERF_EVENT_IOC_SET_BPF
. calling bpf programs in perf_syscall_enter and perf_syscall_exit
The legality of bpf program ctx access is also checked.
Function trace_event_get_offsets returns correct max offset for each
specific syscall tracepoint, which is compared against the maximum offset
access in bpf program.
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-08-07 14:09:48 -07:00
..
2017-07-09 18:48:37 -07:00
2017-08-01 16:46:45 +02:00
2017-08-01 16:46:44 +02:00
2017-07-07 12:40:27 -07:00
2017-07-12 10:04:56 -07:00
2017-07-03 20:55:59 -07:00
2017-06-15 09:45:06 +01:00
2017-07-13 15:58:02 -04:00
2017-07-11 09:55:47 -07:00
2017-07-17 21:21:24 -04:00
2017-08-07 10:47:07 +03:00
2017-06-20 10:30:49 +02:00
2017-07-13 12:07:44 -07:00
2017-06-19 19:38:24 +02:00
2017-06-19 19:09:19 +02:00
2017-07-27 13:43:22 +01:00
2017-06-29 14:30:49 +02:00
2017-08-01 10:07:50 -07:00
2017-07-27 00:05:22 -07:00
2017-08-03 21:37:30 -07:00
2017-06-29 17:34:57 +02:00
2017-07-06 11:38:59 -07:00
2017-07-13 13:56:24 -07:00
2017-07-22 08:55:16 -07:00
2017-06-15 11:41:37 +01:00
2017-07-10 15:23:45 -07:00
2017-07-04 22:35:16 +01:00
2017-07-12 16:26:05 -07:00
2017-06-30 12:00:51 -07:00
2017-07-03 17:00:59 -06:00
2017-07-10 16:32:34 -07:00
2017-06-27 12:05:27 -06:00
2017-06-20 15:42:32 -04:00
2017-07-03 13:08:04 -07:00
2017-06-27 12:13:45 -06:00
2017-07-06 16:24:33 -07:00
2017-07-17 09:48:06 -07:00
2017-07-20 15:20:27 -07:00
2017-07-17 13:37:56 -07:00
2017-07-17 21:58:32 -07:00
2017-07-10 10:51:53 -07:00
2017-07-10 16:32:34 -07:00
2017-07-10 16:32:34 -07:00
2017-07-03 16:56:28 -06:00
2017-06-30 12:00:51 -07:00
2017-06-28 14:45:21 -04:00
2017-07-14 12:37:41 -07:00
2017-07-03 16:14:51 -07:00
2017-07-06 20:57:13 -07:00
2017-07-06 16:24:29 -07:00
2017-07-19 08:55:18 -07:00
2017-07-19 08:55:18 -07:00
2017-06-22 15:43:47 +01:00
2017-07-14 13:12:32 -07:00
2017-07-03 18:08:06 -07:00
2017-08-02 17:16:12 -07:00
2017-07-12 16:26:00 -07:00
2017-07-19 08:55:18 -07:00
2017-07-26 15:55:44 -04:00
2017-07-19 08:55:18 -07:00
2017-07-07 09:44:06 -07:00
2017-07-07 09:49:24 +10:00
2017-06-19 11:03:51 -04:00
2017-07-14 16:09:55 -03:00
2017-07-20 16:09:10 +02:00
2017-06-15 13:46:00 +02:00
2017-06-18 10:08:55 -06:00
2017-07-06 07:02:24 -04:00
2017-07-29 23:23:44 -07:00
2017-06-20 12:18:27 +02:00
2017-07-12 16:26:01 -07:00
2017-07-10 16:32:35 -07:00
2017-07-17 09:48:06 -07:00
2017-07-03 18:44:02 -04:00
2017-06-30 12:00:51 -07:00
2017-07-19 08:55:18 -07:00
2017-07-09 09:31:22 -07:00
2017-06-23 19:59:08 -04:00
2017-07-07 20:09:10 -04:00
2017-07-20 09:27:29 -04:00
2017-07-12 13:32:46 +02:00
2017-07-12 16:26:03 -07:00
2017-06-30 13:49:53 -07:00
2017-07-10 11:11:25 +02:00
2017-06-15 14:25:38 +02:00
2017-06-30 04:14:14 -04:00
2017-07-10 16:32:31 -07:00
2017-07-15 12:00:42 -07:00
2017-06-12 20:48:05 -04:00
2017-07-08 21:51:43 +02:00
2017-06-30 09:47:24 +03:00
2017-06-16 11:48:40 -04:00
2017-08-07 11:39:22 -07:00
2017-06-21 14:37:12 -04:00
2017-06-20 07:25:17 -03:00
2017-07-01 07:39:08 -07:00
2017-07-05 09:54:15 +02:00
2017-07-10 16:32:34 -07:00
2017-07-09 10:24:46 -07:00
2017-07-10 10:51:53 -07:00
2017-06-30 12:00:51 -07:00
2017-07-19 08:55:18 -07:00
2017-08-07 11:39:22 -07:00
2017-07-27 15:40:02 +02:00
2017-07-04 12:46:16 +02:00
2017-06-22 18:29:34 +02:00
2017-07-17 09:22:34 -07:00
2017-07-12 16:25:59 -07:00
2017-07-12 16:26:00 -07:00
2017-06-30 12:00:51 -07:00
2017-07-03 21:13:25 -07:00
2017-07-10 16:32:31 -07:00
2017-07-06 16:24:34 -07:00
2017-06-30 12:00:51 -07:00
2017-07-19 08:55:18 -07:00
2017-07-08 11:05:34 +02:00
2017-08-02 16:34:47 -07:00
2017-06-26 10:39:40 +02:00
2017-08-02 22:41:02 +02:00
2017-06-20 12:18:27 +02:00
2017-07-10 13:41:04 -04:00
2017-07-03 16:54:58 -07:00
2017-07-10 16:32:33 -07:00
2017-07-19 15:33:50 -07:00
2017-07-19 08:55:18 -07:00
2017-06-22 10:29:53 -04:00
2017-07-06 16:24:35 -07:00
2017-07-06 16:24:35 -07:00
2017-07-06 16:24:35 -07:00
2017-07-06 16:24:34 -07:00
2017-07-12 16:26:04 -07:00
2017-06-16 11:48:37 -04:00
2017-08-02 16:34:46 -07:00
2017-07-07 18:39:15 -07:00
2017-06-20 15:42:32 -04:00
2017-07-10 16:32:33 -07:00
2017-07-19 08:55:18 -07:00
2017-07-02 15:37:23 -07:00
2017-06-30 12:00:51 -07:00
2017-06-30 12:00:51 -07:00
2017-06-29 13:50:38 -07:00
2017-08-01 15:26:18 -07:00
2017-07-24 13:52:59 -07:00
2017-08-07 09:42:37 -07:00
2017-07-17 17:01:10 +02:00
2017-07-01 07:39:08 -07:00
2017-07-13 16:00:15 -04:00
2017-07-13 16:00:12 -04:00
2017-07-21 11:51:19 -04:00
2017-07-13 17:12:07 -04:00
2017-08-01 16:28:55 -04:00
2017-07-12 16:26:02 -07:00
2017-07-06 16:24:32 -07:00
2017-07-06 16:24:35 -07:00
2017-07-06 11:30:07 -04:00
2017-07-25 18:05:25 +02:00
2017-07-25 17:58:32 +02:00
2017-07-10 14:27:39 +02:00
2017-06-22 11:14:48 -05:00
2017-06-13 14:00:16 -04:00
2017-07-10 15:23:45 -07:00
2017-06-19 22:06:28 -04:00
2017-07-10 16:32:31 -07:00
2017-07-06 16:24:31 -07:00
2017-08-02 17:16:13 -07:00
2017-06-30 12:00:51 -07:00
2017-07-07 13:41:28 -05:00
2017-07-08 15:51:57 -07:00
2017-06-20 15:42:32 -04:00
2017-07-05 12:31:59 -07:00
2017-08-06 20:55:29 -07:00
2017-08-06 20:55:29 -07:00
2017-06-30 12:00:51 -07:00
2017-07-03 08:31:43 +02:00
2017-06-13 15:15:08 +02:00
2017-06-24 01:41:55 +02:00
2017-06-28 01:52:52 +02:00
2017-06-28 01:52:52 +02:00
2017-06-20 12:18:27 +02:00
2017-06-25 21:58:46 -04:00
2017-06-30 12:00:51 -07:00
2017-06-28 22:49:11 +10:00
2017-06-22 02:55:34 +02:00
2017-07-03 15:12:52 -07:00
2017-06-22 11:46:48 -04:00
2017-07-15 12:44:02 -07:00
2017-06-29 10:48:57 +01:00
2017-07-02 11:24:36 +02:00
2017-07-03 16:20:28 +01:00
2017-06-14 00:00:42 +02:00
2017-07-12 23:11:23 +02:00
2017-06-15 14:30:14 +02:00
2017-07-19 08:55:18 -07:00
2017-08-03 09:45:47 -07:00
2017-06-23 11:55:57 +10:00
2017-07-19 08:55:18 -07:00
2017-07-06 16:24:30 -07:00
2017-08-06 20:55:29 -07:00
2017-06-30 12:00:51 -07:00
2017-07-06 20:57:13 -07:00
2017-08-03 21:37:30 -07:00
2017-07-12 16:26:03 -07:00
2017-07-06 16:24:30 -07:00
2017-08-03 21:37:29 -07:00
2017-07-15 12:00:42 -07:00
2017-06-15 00:55:44 +02:00
2017-07-06 16:24:31 -07:00
2017-07-10 16:32:33 -07:00
2017-07-10 16:32:30 -07:00
2017-08-07 14:09:48 -07:00
2017-07-19 08:55:18 -07:00
2017-07-03 16:56:25 -06:00
2017-08-06 21:25:10 -07:00
2017-06-29 22:21:21 -04:00
2017-07-06 20:57:13 -07:00
2017-06-20 22:13:59 -07:00
2017-07-20 09:27:29 -04:00
2017-06-13 17:10:57 -04:00
2017-06-30 12:00:51 -07:00
2017-07-19 08:55:18 -07:00
2017-07-08 10:15:02 -07:00
2017-07-10 07:40:49 -04:00
2017-06-30 12:00:51 -07:00
2017-06-30 12:00:51 -07:00
2017-07-24 17:50:37 +02:00
2017-06-22 16:15:45 -07:00
2017-07-26 13:30:23 -06:00
2017-07-17 09:52:58 -07:00
2017-07-06 16:24:35 -07:00
2017-07-06 16:24:35 -07:00
2017-07-05 09:54:14 +02:00
2017-06-20 12:19:14 +02:00
2017-07-25 11:17:02 +02:00
2017-07-25 13:28:56 -04:00