1bd4aed0eSJiong Wang // SPDX-License-Identifier: GPL-2.0 2bd4aed0eSJiong Wang // Copyright (c) 2017 Facebook 3bd4aed0eSJiong Wang 43087c61eSYafang Shao #include <vmlinux.h> 53e689141SToke Høiland-Jørgensen #include <bpf/bpf_helpers.h> 6bd4aed0eSJiong Wang 7*ab4c15feSRoss Zwisler /* taken from /sys/kernel/tracing/events/sched/sched_switch/format */ 8bd4aed0eSJiong Wang struct sched_switch_args { 9bd4aed0eSJiong Wang unsigned long long pad; 103087c61eSYafang Shao char prev_comm[TASK_COMM_LEN]; 11bd4aed0eSJiong Wang int prev_pid; 12bd4aed0eSJiong Wang int prev_prio; 13bd4aed0eSJiong Wang long long prev_state; 143087c61eSYafang Shao char next_comm[TASK_COMM_LEN]; 15bd4aed0eSJiong Wang int next_pid; 16bd4aed0eSJiong Wang int next_prio; 17bd4aed0eSJiong Wang }; 18bd4aed0eSJiong Wang 19bd4aed0eSJiong Wang SEC("tracepoint/sched/sched_switch") oncpu(struct sched_switch_args * ctx)20bd4aed0eSJiong Wangint oncpu(struct sched_switch_args *ctx) 21bd4aed0eSJiong Wang { 22bd4aed0eSJiong Wang return 0; 23bd4aed0eSJiong Wang } 24bd4aed0eSJiong Wang 25bd4aed0eSJiong Wang char _license[] SEC("license") = "GPL"; 26