mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-26 16:15:05 +07:00
d2912cb15b
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
66 lines
1.3 KiB
C
66 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
*
|
|
* Copyright (C) 2017 Hari Bathini, IBM Corporation
|
|
*/
|
|
|
|
#ifndef __PERF_NAMESPACES_H
|
|
#define __PERF_NAMESPACES_H
|
|
|
|
#include <sys/types.h>
|
|
#include <linux/stddef.h>
|
|
#include <linux/perf_event.h>
|
|
#include <linux/refcount.h>
|
|
#include <linux/types.h>
|
|
|
|
struct namespaces_event;
|
|
|
|
struct namespaces {
|
|
struct list_head list;
|
|
u64 end_time;
|
|
struct perf_ns_link_info link_info[];
|
|
};
|
|
|
|
struct namespaces *namespaces__new(struct namespaces_event *event);
|
|
void namespaces__free(struct namespaces *namespaces);
|
|
|
|
struct nsinfo {
|
|
pid_t pid;
|
|
pid_t tgid;
|
|
pid_t nstgid;
|
|
bool need_setns;
|
|
char *mntns_path;
|
|
refcount_t refcnt;
|
|
};
|
|
|
|
struct nscookie {
|
|
int oldns;
|
|
int newns;
|
|
char *oldcwd;
|
|
};
|
|
|
|
int nsinfo__init(struct nsinfo *nsi);
|
|
struct nsinfo *nsinfo__new(pid_t pid);
|
|
struct nsinfo *nsinfo__copy(struct nsinfo *nsi);
|
|
void nsinfo__delete(struct nsinfo *nsi);
|
|
|
|
struct nsinfo *nsinfo__get(struct nsinfo *nsi);
|
|
void nsinfo__put(struct nsinfo *nsi);
|
|
|
|
void nsinfo__mountns_enter(struct nsinfo *nsi, struct nscookie *nc);
|
|
void nsinfo__mountns_exit(struct nscookie *nc);
|
|
|
|
char *nsinfo__realpath(const char *path, struct nsinfo *nsi);
|
|
|
|
static inline void __nsinfo__zput(struct nsinfo **nsip)
|
|
{
|
|
if (nsip) {
|
|
nsinfo__put(*nsip);
|
|
*nsip = NULL;
|
|
}
|
|
}
|
|
|
|
#define nsinfo__zput(nsi) __nsinfo__zput(&nsi)
|
|
|
|
#endif /* __PERF_NAMESPACES_H */
|