]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
stack usage: add pid to warning printk in check_stack_usage
authorTim Bird <tim.bird@am.sony.com>
Wed, 25 Apr 2012 01:04:42 +0000 (11:04 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 30 Apr 2012 05:17:38 +0000 (15:17 +1000)
In embedded systems, sometimes the same program (busybox) is the cause of
multiple warnings.  Outputting the pid with the program name in the
warning printk helps distinguish which instances of a program are using
the stack most.

This is a small patch, but useful.

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/exit.c

index 78ea40be33fb05e289611d92cf72859574f84b72..1c55e2bebd2a2ea78b9416557e20ef891f8d43d2 100644 (file)
@@ -884,9 +884,9 @@ static void check_stack_usage(void)
 
        spin_lock(&low_water_lock);
        if (free < lowest_to_date) {
-               printk(KERN_WARNING "%s used greatest stack depth: %lu bytes "
-                               "left\n",
-                               current->comm, free);
+               printk(KERN_WARNING "%s (%d) used greatest stack depth: "
+                               "%lu bytes left\n",
+                               current->comm, task_pid_nr(current), free);
                lowest_to_date = free;
        }
        spin_unlock(&low_water_lock);