Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 // Copyright (c) 2017 Facebook
0003 
0004 #include <vmlinux.h>
0005 #include <bpf/bpf_helpers.h>
0006 
0007 /* taken from /sys/kernel/debug/tracing/events/sched/sched_switch/format */
0008 struct sched_switch_args {
0009     unsigned long long pad;
0010     char prev_comm[TASK_COMM_LEN];
0011     int prev_pid;
0012     int prev_prio;
0013     long long prev_state;
0014     char next_comm[TASK_COMM_LEN];
0015     int next_pid;
0016     int next_prio;
0017 };
0018 
0019 SEC("tracepoint/sched/sched_switch")
0020 int oncpu(struct sched_switch_args *ctx)
0021 {
0022     return 0;
0023 }
0024 
0025 char _license[] SEC("license") = "GPL";