1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2c757249aSShailabh Nagar /* taskstats_kern.h - kernel header for per-task statistics interface 3c757249aSShailabh Nagar * 4c757249aSShailabh Nagar * Copyright (C) Shailabh Nagar, IBM Corp. 2006 5c757249aSShailabh Nagar * (C) Balbir Singh, IBM Corp. 2006 6c757249aSShailabh Nagar */ 7c757249aSShailabh Nagar 8c757249aSShailabh Nagar #ifndef _LINUX_TASKSTATS_KERN_H 9c757249aSShailabh Nagar #define _LINUX_TASKSTATS_KERN_H 10c757249aSShailabh Nagar 11c757249aSShailabh Nagar #include <linux/taskstats.h> 123f07c014SIngo Molnar #include <linux/sched/signal.h> 135a0e3ad6STejun Heo #include <linux/slab.h> 14c757249aSShailabh Nagar 15c757249aSShailabh Nagar #ifdef CONFIG_TASKSTATS 16e18b890bSChristoph Lameter extern struct kmem_cache *taskstats_cache; 176f44993fSShailabh Nagar extern struct mutex taskstats_exit_mutex; 18c757249aSShailabh Nagar taskstats_tgid_free(struct signal_struct * sig)19ad4ecbcbSShailabh Nagarstatic inline void taskstats_tgid_free(struct signal_struct *sig) 20ad4ecbcbSShailabh Nagar { 21093a8e8aSOleg Nesterov if (sig->stats) 22093a8e8aSOleg Nesterov kmem_cache_free(taskstats_cache, sig->stats); 23ad4ecbcbSShailabh Nagar } 24ad4ecbcbSShailabh Nagar 25115085eaSOleg Nesterov extern void taskstats_exit(struct task_struct *, int group_dead); 26ad4ecbcbSShailabh Nagar extern void taskstats_init_early(void); 27c757249aSShailabh Nagar #else taskstats_exit(struct task_struct * tsk,int group_dead)28115085eaSOleg Nesterovstatic inline void taskstats_exit(struct task_struct *tsk, int group_dead) 29ad4ecbcbSShailabh Nagar {} taskstats_tgid_free(struct signal_struct * sig)30ad4ecbcbSShailabh Nagarstatic inline void taskstats_tgid_free(struct signal_struct *sig) 31c757249aSShailabh Nagar {} taskstats_init_early(void)32c757249aSShailabh Nagarstatic inline void taskstats_init_early(void) 33c757249aSShailabh Nagar {} 34c757249aSShailabh Nagar #endif /* CONFIG_TASKSTATS */ 35c757249aSShailabh Nagar 36c757249aSShailabh Nagar #endif 37c757249aSShailabh Nagar 38