scx-upstream/scheds/include/scx/namespace.bpf.h
Daniel Hodges 8f4e9e5e3b scx_helpers: Add pid namespace helpers
Add pid namespace helpers for translating namespace pids.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-09-03 11:21:32 -07:00

18 lines
559 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2024 Meta Platforms, Inc. and affiliates.
*/
#ifndef __SCHED_EXT_NAMESPACE_BPF_H
#define __SCHED_EXT_NAMESPACE_BPF_H
#include "vmlinux.h"
struct pid_namespace* get_task_pid_ns(const struct task_struct* task);
struct pid* get_task_pid_ptr(const struct task_struct* task, enum pid_type type);
pid_t get_task_ns_pid(const struct task_struct* task, enum pid_type type);
pid_t get_pid_nr_ns(struct pid* pid, struct pid_namespace* ns);
pid_t get_ns_pid(void);
#endif /* __SCHED_EXT_NAMESPACE_BPF_H */