Alexei Starovoitov | e3edfde | 2016-04-06 18:43:31 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2016 Facebook |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or |
| 4 | * modify it under the terms of version 2 of the GNU General Public |
| 5 | * License as published by the Free Software Foundation. |
| 6 | */ |
Yafang Shao | d068144 | 2022-01-19 18:08:33 -0800 | [diff] [blame] | 7 | #include <linux/sched.h> |
Alexei Starovoitov | e3edfde | 2016-04-06 18:43:31 -0700 | [diff] [blame] | 8 | #include <uapi/linux/bpf.h> |
Toke Høiland-Jørgensen | 7cf245a | 2020-01-20 14:06:49 +0100 | [diff] [blame] | 9 | #include <bpf/bpf_helpers.h> |
Alexei Starovoitov | e3edfde | 2016-04-06 18:43:31 -0700 | [diff] [blame] | 10 | |
| 11 | /* from /sys/kernel/debug/tracing/events/task/task_rename/format */ |
| 12 | struct task_rename { |
| 13 | __u64 pad; |
| 14 | __u32 pid; |
Yafang Shao | d068144 | 2022-01-19 18:08:33 -0800 | [diff] [blame] | 15 | char oldcomm[TASK_COMM_LEN]; |
| 16 | char newcomm[TASK_COMM_LEN]; |
Alexei Starovoitov | e3edfde | 2016-04-06 18:43:31 -0700 | [diff] [blame] | 17 | __u16 oom_score_adj; |
| 18 | }; |
| 19 | SEC("tracepoint/task/task_rename") |
| 20 | int prog(struct task_rename *ctx) |
| 21 | { |
| 22 | return 0; |
| 23 | } |
| 24 | |
| 25 | /* from /sys/kernel/debug/tracing/events/random/urandom_read/format */ |
| 26 | struct urandom_read { |
| 27 | __u64 pad; |
| 28 | int got_bits; |
| 29 | int pool_left; |
| 30 | int input_left; |
| 31 | }; |
| 32 | SEC("tracepoint/random/urandom_read") |
| 33 | int prog2(struct urandom_read *ctx) |
| 34 | { |
| 35 | return 0; |
| 36 | } |
| 37 | char _license[] SEC("license") = "GPL"; |