"[PATCH] Fix leaks on /proc/{*/sched,sched_debug,timer_list,timer_stats}" and
[mmotm.git] / include / linux / utrace_struct.h
blobaba7e0967ba46850867a1068caf4063df8f0935b
1 /*
2 * 'struct utrace' data structure for kernel/utrace.c private use.
4 * Copyright (C) 2006-2009 Red Hat, Inc. All rights reserved.
6 * This copyrighted material is made available to anyone wishing to use,
7 * modify, copy, or redistribute it subject to the terms and conditions
8 * of the GNU General Public License v.2.
9 */
11 #ifndef _LINUX_UTRACE_STRUCT_H
12 #define _LINUX_UTRACE_STRUCT_H 1
14 #ifdef CONFIG_UTRACE
16 #include <linux/list.h>
17 #include <linux/spinlock.h>
20 * Per-thread structure private to utrace implementation. This properly
21 * belongs in kernel/utrace.c and its use is entirely private to the code
22 * there. It is only defined in a header file so that it can be embedded
23 * in the struct task_struct layout. It is here rather than in utrace.h
24 * to avoid header nesting order issues getting too complex.
27 struct utrace {
28 struct task_struct *cloning;
30 struct list_head attached, attaching;
31 spinlock_t lock;
33 struct utrace_engine *reporting;
35 unsigned int stopped:1;
36 unsigned int report:1;
37 unsigned int interrupt:1;
38 unsigned int signal_handler:1;
39 unsigned int vfork_stop:1; /* need utrace_stop() before vfork wait */
40 unsigned int death:1; /* in utrace_report_death() now */
41 unsigned int reap:1; /* release_task() has run */
44 # define INIT_UTRACE(tsk) \
45 .utrace_flags = 0, \
46 .utrace = { \
47 .lock = __SPIN_LOCK_UNLOCKED(tsk.utrace.lock), \
48 .attached = LIST_HEAD_INIT(tsk.utrace.attached), \
49 .attaching = LIST_HEAD_INIT(tsk.utrace.attaching), \
52 #else
54 # define INIT_UTRACE(tsk) /* Nothing. */
56 #endif /* CONFIG_UTRACE */
58 #endif /* linux/utrace_struct.h */