Shailabh Nagar | c757249 | 2006-07-14 00:24:40 -0700 | [diff] [blame] | 1 | /* 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 Nagar | c892436 | 2006-07-14 00:24:46 -0700 | [diff] [blame] | 12 | #include <net/genetlink.h> |
Shailabh Nagar | c757249 | 2006-07-14 00:24:40 -0700 | [diff] [blame] | 13 | |
Shailabh Nagar | c757249 | 2006-07-14 00:24:40 -0700 | [diff] [blame] | 14 | #ifdef CONFIG_TASKSTATS |
Christoph Lameter | e18b890 | 2006-12-06 20:33:20 -0800 | [diff] [blame] | 15 | extern struct kmem_cache *taskstats_cache; |
Shailabh Nagar | 6f44993 | 2006-07-14 00:24:41 -0700 | [diff] [blame] | 16 | extern struct mutex taskstats_exit_mutex; |
Shailabh Nagar | c757249 | 2006-07-14 00:24:40 -0700 | [diff] [blame] | 17 | |
Shailabh Nagar | ad4ecbc | 2006-07-14 00:24:44 -0700 | [diff] [blame] | 18 | static inline void taskstats_tgid_init(struct signal_struct *sig) |
| 19 | { |
Shailabh Nagar | ad4ecbc | 2006-07-14 00:24:44 -0700 | [diff] [blame] | 20 | sig->stats = NULL; |
| 21 | } |
Shailabh Nagar | c757249 | 2006-07-14 00:24:40 -0700 | [diff] [blame] | 22 | |
Shailabh Nagar | ad4ecbc | 2006-07-14 00:24:44 -0700 | [diff] [blame] | 23 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
| 24 | { |
Oleg Nesterov | 093a8e8 | 2006-10-28 10:38:51 -0700 | [diff] [blame] | 25 | if (sig->stats) |
| 26 | kmem_cache_free(taskstats_cache, sig->stats); |
Shailabh Nagar | ad4ecbc | 2006-07-14 00:24:44 -0700 | [diff] [blame] | 27 | } |
| 28 | |
Oleg Nesterov | 115085e | 2006-12-06 20:36:51 -0800 | [diff] [blame] | 29 | extern void taskstats_exit(struct task_struct *, int group_dead); |
Shailabh Nagar | ad4ecbc | 2006-07-14 00:24:44 -0700 | [diff] [blame] | 30 | extern void taskstats_init_early(void); |
Shailabh Nagar | c757249 | 2006-07-14 00:24:40 -0700 | [diff] [blame] | 31 | #else |
Oleg Nesterov | 115085e | 2006-12-06 20:36:51 -0800 | [diff] [blame] | 32 | static inline void taskstats_exit(struct task_struct *tsk, int group_dead) |
Shailabh Nagar | ad4ecbc | 2006-07-14 00:24:44 -0700 | [diff] [blame] | 33 | {} |
| 34 | static inline void taskstats_tgid_init(struct signal_struct *sig) |
| 35 | {} |
Shailabh Nagar | ad4ecbc | 2006-07-14 00:24:44 -0700 | [diff] [blame] | 36 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
Shailabh Nagar | c757249 | 2006-07-14 00:24:40 -0700 | [diff] [blame] | 37 | {} |
| 38 | static inline void taskstats_init_early(void) |
| 39 | {} |
| 40 | #endif /* CONFIG_TASKSTATS */ |
| 41 | |
| 42 | #endif |
| 43 | |