diff options
Diffstat (limited to 'include/linux/taskstats_kern.h')
-rw-r--r-- | include/linux/taskstats_kern.h | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index 2b6adec3a2e4..16894b7edcc8 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h | |||
@@ -11,30 +11,10 @@ | |||
11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
12 | #include <net/genetlink.h> | 12 | #include <net/genetlink.h> |
13 | 13 | ||
14 | enum { | ||
15 | TASKSTATS_MSG_UNICAST, /* send data only to requester */ | ||
16 | TASKSTATS_MSG_MULTICAST, /* send data to a group */ | ||
17 | }; | ||
18 | |||
19 | #ifdef CONFIG_TASKSTATS | 14 | #ifdef CONFIG_TASKSTATS |
20 | extern kmem_cache_t *taskstats_cache; | 15 | extern kmem_cache_t *taskstats_cache; |
21 | extern struct mutex taskstats_exit_mutex; | 16 | extern struct mutex taskstats_exit_mutex; |
22 | 17 | ||
23 | static inline int taskstats_has_listeners(void) | ||
24 | { | ||
25 | if (!genl_sock) | ||
26 | return 0; | ||
27 | return netlink_has_listeners(genl_sock, TASKSTATS_LISTEN_GROUP); | ||
28 | } | ||
29 | |||
30 | |||
31 | static inline void taskstats_exit_alloc(struct taskstats **ptidstats) | ||
32 | { | ||
33 | *ptidstats = NULL; | ||
34 | if (taskstats_has_listeners()) | ||
35 | *ptidstats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); | ||
36 | } | ||
37 | |||
38 | static inline void taskstats_exit_free(struct taskstats *tidstats) | 18 | static inline void taskstats_exit_free(struct taskstats *tidstats) |
39 | { | 19 | { |
40 | if (tidstats) | 20 | if (tidstats) |
@@ -82,17 +62,18 @@ static inline void taskstats_tgid_free(struct signal_struct *sig) | |||
82 | kmem_cache_free(taskstats_cache, stats); | 62 | kmem_cache_free(taskstats_cache, stats); |
83 | } | 63 | } |
84 | 64 | ||
85 | extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int); | 65 | extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); |
66 | extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int); | ||
86 | extern void taskstats_init_early(void); | 67 | extern void taskstats_init_early(void); |
87 | extern void taskstats_tgid_alloc(struct signal_struct *); | 68 | extern void taskstats_tgid_alloc(struct signal_struct *); |
88 | #else | 69 | #else |
89 | static inline void taskstats_exit_alloc(struct taskstats **ptidstats) | 70 | static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) |
90 | {} | 71 | {} |
91 | static inline void taskstats_exit_free(struct taskstats *ptidstats) | 72 | static inline void taskstats_exit_free(struct taskstats *ptidstats) |
92 | {} | 73 | {} |
93 | static inline void taskstats_exit_send(struct task_struct *tsk, | 74 | static inline void taskstats_exit_send(struct task_struct *tsk, |
94 | struct taskstats *tidstats, | 75 | struct taskstats *tidstats, |
95 | int group_dead) | 76 | int group_dead, unsigned int cpu) |
96 | {} | 77 | {} |
97 | static inline void taskstats_tgid_init(struct signal_struct *sig) | 78 | static inline void taskstats_tgid_init(struct signal_struct *sig) |
98 | {} | 79 | {} |