Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* taskstats_kern.h - kernel header for per-task statistics interface
0003  *
0004  * Copyright (C) Shailabh Nagar, IBM Corp. 2006
0005  *           (C) Balbir Singh,   IBM Corp. 2006
0006  */
0007 
0008 #ifndef _LINUX_TASKSTATS_KERN_H
0009 #define _LINUX_TASKSTATS_KERN_H
0010 
0011 #include <linux/taskstats.h>
0012 #include <linux/sched/signal.h>
0013 #include <linux/slab.h>
0014 
0015 #ifdef CONFIG_TASKSTATS
0016 extern struct kmem_cache *taskstats_cache;
0017 extern struct mutex taskstats_exit_mutex;
0018 
0019 static inline void taskstats_tgid_free(struct signal_struct *sig)
0020 {
0021     if (sig->stats)
0022         kmem_cache_free(taskstats_cache, sig->stats);
0023 }
0024 
0025 extern void taskstats_exit(struct task_struct *, int group_dead);
0026 extern void taskstats_init_early(void);
0027 #else
0028 static inline void taskstats_exit(struct task_struct *tsk, int group_dead)
0029 {}
0030 static inline void taskstats_tgid_free(struct signal_struct *sig)
0031 {}
0032 static inline void taskstats_init_early(void)
0033 {}
0034 #endif /* CONFIG_TASKSTATS */
0035 
0036 #endif
0037