4bd6e32ace
- Explicitly limit exit task stat broadcast to the initial user and pid namespaces, as it is already limited to the initial network namespace. - For broadcast task stats explicitly generate all of the idenitiers in terms of the initial user namespace and the initial pid namespace. - For request stats report them in terms of the current user namespace and the current pid namespace. Netlink messages are delivered syncrhonously to the kernel allowing us to get the user namespace and the pid namespace from the current task. - Pass the namespaces for representing pids and uids and gids into bacct_add_task. Cc: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
39 lines
1.0 KiB
C
39 lines
1.0 KiB
C
/*
|
|
* tsacct_kern.h - kernel header for system accounting over taskstats interface
|
|
*
|
|
* Copyright (C) Jay Lan SGI
|
|
*/
|
|
|
|
#ifndef _LINUX_TSACCT_KERN_H
|
|
#define _LINUX_TSACCT_KERN_H
|
|
|
|
#include <linux/taskstats.h>
|
|
|
|
#ifdef CONFIG_TASKSTATS
|
|
extern void bacct_add_tsk(struct user_namespace *user_ns,
|
|
struct pid_namespace *pid_ns,
|
|
struct taskstats *stats, struct task_struct *tsk);
|
|
#else
|
|
static inline void bacct_add_tsk(struct user_namespace *user_ns,
|
|
struct pid_namespace *pid_ns,
|
|
struct taskstats *stats, struct task_struct *tsk)
|
|
{}
|
|
#endif /* CONFIG_TASKSTATS */
|
|
|
|
#ifdef CONFIG_TASK_XACCT
|
|
extern void xacct_add_tsk(struct taskstats *stats, struct task_struct *p);
|
|
extern void acct_update_integrals(struct task_struct *tsk);
|
|
extern void acct_clear_integrals(struct task_struct *tsk);
|
|
#else
|
|
static inline void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
|
|
{}
|
|
static inline void acct_update_integrals(struct task_struct *tsk)
|
|
{}
|
|
static inline void acct_clear_integrals(struct task_struct *tsk)
|
|
{}
|
|
#endif /* CONFIG_TASK_XACCT */
|
|
|
|
#endif
|
|
|
|
|