Back to home page

OSCL-LXR

 
 

    


0001 /* Copyright (c) 2016 Facebook
0002  *
0003  * This program is free software; you can redistribute it and/or
0004  * modify it under the terms of version 2 of the GNU General Public
0005  * License as published by the Free Software Foundation.
0006  */
0007 #include <linux/sched.h>
0008 #include <uapi/linux/bpf.h>
0009 #include <bpf/bpf_helpers.h>
0010 
0011 /* from /sys/kernel/debug/tracing/events/task/task_rename/format */
0012 struct task_rename {
0013     __u64 pad;
0014     __u32 pid;
0015     char oldcomm[TASK_COMM_LEN];
0016     char newcomm[TASK_COMM_LEN];
0017     __u16 oom_score_adj;
0018 };
0019 SEC("tracepoint/task/task_rename")
0020 int prog(struct task_rename *ctx)
0021 {
0022     return 0;
0023 }
0024 
0025 /* from /sys/kernel/debug/tracing/events/random/urandom_read/format */
0026 struct urandom_read {
0027     __u64 pad;
0028     int got_bits;
0029     int pool_left;
0030     int input_left;
0031 };
0032 SEC("tracepoint/random/urandom_read")
0033 int prog2(struct urandom_read *ctx)
0034 {
0035     return 0;
0036 }
0037 char _license[] SEC("license") = "GPL";