2017-12-11 11:39:03 -08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
// Copyright (c) 2017 Facebook
|
|
|
|
|
2022-01-19 18:08:40 -08:00
|
|
|
#include <vmlinux.h>
|
2020-01-20 14:06:45 +01:00
|
|
|
#include <bpf/bpf_helpers.h>
|
2017-12-11 11:39:03 -08:00
|
|
|
|
2023-03-13 14:56:28 -06:00
|
|
|
/* taken from /sys/kernel/tracing/events/sched/sched_switch/format */
|
2017-12-11 11:39:03 -08:00
|
|
|
struct sched_switch_args {
|
|
|
|
unsigned long long pad;
|
2022-01-19 18:08:40 -08:00
|
|
|
char prev_comm[TASK_COMM_LEN];
|
2017-12-11 11:39:03 -08:00
|
|
|
int prev_pid;
|
|
|
|
int prev_prio;
|
|
|
|
long long prev_state;
|
2022-01-19 18:08:40 -08:00
|
|
|
char next_comm[TASK_COMM_LEN];
|
2017-12-11 11:39:03 -08:00
|
|
|
int next_pid;
|
|
|
|
int next_prio;
|
|
|
|
};
|
|
|
|
|
|
|
|
SEC("tracepoint/sched/sched_switch")
|
|
|
|
int oncpu(struct sched_switch_args *ctx)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
char _license[] SEC("license") = "GPL";
|