1c757249aSShailabh Nagar /* taskstats_kern.h - kernel header for per-task statistics interface
2c757249aSShailabh Nagar  *
3c757249aSShailabh Nagar  * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4c757249aSShailabh Nagar  *           (C) Balbir Singh,   IBM Corp. 2006
5c757249aSShailabh Nagar  */
6c757249aSShailabh Nagar 
7c757249aSShailabh Nagar #ifndef _LINUX_TASKSTATS_KERN_H
8c757249aSShailabh Nagar #define _LINUX_TASKSTATS_KERN_H
9c757249aSShailabh Nagar 
10c757249aSShailabh Nagar #include <linux/taskstats.h>
113f07c014SIngo Molnar #include <linux/sched/signal.h>
125a0e3ad6STejun Heo #include <linux/slab.h>
13c757249aSShailabh Nagar 
14c757249aSShailabh Nagar #ifdef CONFIG_TASKSTATS
15e18b890bSChristoph Lameter extern struct kmem_cache *taskstats_cache;
166f44993fSShailabh Nagar extern struct mutex taskstats_exit_mutex;
17c757249aSShailabh Nagar 
18ad4ecbcbSShailabh Nagar static inline void taskstats_tgid_free(struct signal_struct *sig)
19ad4ecbcbSShailabh Nagar {
20093a8e8aSOleg Nesterov 	if (sig->stats)
21093a8e8aSOleg Nesterov 		kmem_cache_free(taskstats_cache, sig->stats);
22ad4ecbcbSShailabh Nagar }
23ad4ecbcbSShailabh Nagar 
24115085eaSOleg Nesterov extern void taskstats_exit(struct task_struct *, int group_dead);
25ad4ecbcbSShailabh Nagar extern void taskstats_init_early(void);
26c757249aSShailabh Nagar #else
27115085eaSOleg Nesterov static inline void taskstats_exit(struct task_struct *tsk, int group_dead)
28ad4ecbcbSShailabh Nagar {}
29ad4ecbcbSShailabh Nagar static inline void taskstats_tgid_free(struct signal_struct *sig)
30c757249aSShailabh Nagar {}
31c757249aSShailabh Nagar static inline void taskstats_init_early(void)
32c757249aSShailabh Nagar {}
33c757249aSShailabh Nagar #endif /* CONFIG_TASKSTATS */
34c757249aSShailabh Nagar 
35c757249aSShailabh Nagar #endif
36c757249aSShailabh Nagar 
37