blob: 7e9680f4afdd9290415c1a8b4ccf8594bf29bd14 [file] [log] [blame]
Shailabh Nagarc7572492006-07-14 00:24:40 -07001/* taskstats_kern.h - kernel header for per-task statistics interface
2 *
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 * (C) Balbir Singh, IBM Corp. 2006
5 */
6
7#ifndef _LINUX_TASKSTATS_KERN_H
8#define _LINUX_TASKSTATS_KERN_H
9
10#include <linux/taskstats.h>
11#include <linux/sched.h>
Shailabh Nagarc8924362006-07-14 00:24:46 -070012#include <net/genetlink.h>
Shailabh Nagarc7572492006-07-14 00:24:40 -070013
Shailabh Nagarc7572492006-07-14 00:24:40 -070014#ifdef CONFIG_TASKSTATS
Christoph Lametere18b8902006-12-06 20:33:20 -080015extern struct kmem_cache *taskstats_cache;
Shailabh Nagar6f449932006-07-14 00:24:41 -070016extern struct mutex taskstats_exit_mutex;
Shailabh Nagarc7572492006-07-14 00:24:40 -070017
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070018static inline void taskstats_tgid_init(struct signal_struct *sig)
19{
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070020 sig->stats = NULL;
21}
Shailabh Nagarc7572492006-07-14 00:24:40 -070022
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070023static inline void taskstats_tgid_free(struct signal_struct *sig)
24{
Oleg Nesterov093a8e82006-10-28 10:38:51 -070025 if (sig->stats)
26 kmem_cache_free(taskstats_cache, sig->stats);
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070027}
28
Oleg Nesterov115085e2006-12-06 20:36:51 -080029extern void taskstats_exit(struct task_struct *, int group_dead);
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070030extern void taskstats_init_early(void);
Shailabh Nagarc7572492006-07-14 00:24:40 -070031#else
Oleg Nesterov115085e2006-12-06 20:36:51 -080032static inline void taskstats_exit(struct task_struct *tsk, int group_dead)
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070033{}
34static inline void taskstats_tgid_init(struct signal_struct *sig)
35{}
Shailabh Nagarad4ecbc2006-07-14 00:24:44 -070036static inline void taskstats_tgid_free(struct signal_struct *sig)
Shailabh Nagarc7572492006-07-14 00:24:40 -070037{}
38static inline void taskstats_init_early(void)
39{}
40#endif /* CONFIG_TASKSTATS */
41
42#endif
43