Whamcloud - gitweb
b=17671
[fs/lustre-release.git] / lustre / kernel_patches / patches / export-show_task-2.6.18-vanilla.patch
1 Export the show_task() function in order to get better process stacks.
2 It will also print the current process stack, which is useful.
3
4 This is a nice-to-have but not required for Lustre to work.
5
6 Index: linux-2.6/kernel/sched.c
7 ===================================================================
8 --- linux-2.6.orig/kernel/sched.c       2006-07-15 11:51:46.000000000 +0800
9 +++ linux-2.6/kernel/sched.c    2006-07-15 16:24:35.000000000 +0800
10 @@ -4652,7 +4652,7 @@ static inline struct task_struct *younge
11  
12  static const char stat_nam[] = "RSDTtZX";
13  
14 -static void show_task(struct task_struct *p)
15 +void show_task(struct task_struct *p)
16  {
17         struct task_struct *relative;
18         unsigned long free = 0;
19 @@ -4698,9 +4698,10 @@ static void show_task(struct task_struct
20         else
21                 printk(" (NOTLB)\n");
22  
23 -       if (state != TASK_RUNNING)
24 +       if (state != TASK_RUNNING || p == current)
25                 show_stack(p, NULL);
26  }
27 +EXPORT_SYMBOL(show_task);
28  
29  void show_state(void)
30  {