blob: dbb4d124c7d7c1b6b928e42105877fd400f574cf [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Shailabh Nagarc7572492006-07-14 00:24:40 -07002/* taskstats_kern.h - kernel header for per-task statistics interface
3 *
4 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
5 * (C) Balbir Singh, IBM Corp. 2006
6 */
7
8#ifndef _LINUX_TASKSTATS_KERN_H
9#define _LINUX_TASKSTATS_KERN_H
10
11#include <linux/taskstats.h>
Ingo Molnar3f07c012017-02-08 18:51:30 +010012#include <linux/sched/signal.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090013#include <linux/slab.h>
Shailabh Nagarc7572492006-07-14 00:24:40 -070014
Shailabh Nagarc7572492006-07-14 00:24:40 -070015#ifdef CONFIG_TASKSTATS
Christoph Lametere18b8902006-12-06 20:33:20 -080016extern struct kmem_cache *taskstats_cache;
Shailabh Nagar6f449932006-07-14 00:24:41 -070017extern struct mutex taskstats_exit_mutex;
Shailabh Nagarc7572492006-07-14 00:24:40 -070018
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070019static inline void taskstats_tgid_free(struct signal_struct *sig)
20{
Oleg Nesterov093a8e82006-10-28 10:38:51 -070021 if (sig->stats)
22 kmem_cache_free(taskstats_cache, sig->stats);
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070023}
24
Oleg Nesterov115085e2006-12-06 20:36:51 -080025extern void taskstats_exit(struct task_struct *, int group_dead);
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070026extern void taskstats_init_early(void);
Shailabh Nagarc7572492006-07-14 00:24:40 -070027#else
Oleg Nesterov115085e2006-12-06 20:36:51 -080028static inline void taskstats_exit(struct task_struct *tsk, int group_dead)
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070029{}
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070030static inline void taskstats_tgid_free(struct signal_struct *sig)
Shailabh Nagarc7572492006-07-14 00:24:40 -070031{}
32static inline void taskstats_init_early(void)
33{}
34#endif /* CONFIG_TASKSTATS */
35
36#endif
37