[PATCH(small)]: ptrace.c/print_child_state w/no stack

Chris Chiappa (griffon@snurgle.org)
Fri, 15 Jan 1999 17:35:10 -0500


--IS0zKkzwUGydFO0o
Content-Type: text/plain; charset=us-ascii

print_child_state() in ptrace.c produces a blank line if there's nothing
that ends up being printed on the stack, leading to a lot of syslog messages
like this if you're debugging:
Jan 15 17:01:19 cchiappa-pc1 kernel: Process: foo (stack=c6a5c000,
task=c6a5a000)
Jan 15 17:01:19 cchiappa-pc1 kernel:
This is somewhat irritating since the second line doesn't contain any useful
information. Attached is a small patch which should eliminate the second
line by only printing the carriage return if we've printed something out.

-- 

+------- --- -- -- - | griffon@snurgle.N0-SPAM.org / My opinions represent snurgle.org : ! Unspoilt by progress / http://www.snurgle.org/~griffon | - -- -- --- -------+

--IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ptrace.diff"

--- ptrace.c.old Fri Jan 15 17:14:21 1999 +++ ptrace.c Fri Jan 15 17:18:42 1999 @@ -72,6 +72,7 @@ { unsigned int * stack = (unsigned int *) task->tss.esp0; int count = 40; + int printed = 0; printk("Process: %s (stack=%p, task=%p)\n", task->comm, stack, task); for (;;) { @@ -86,12 +87,14 @@ continue; if (data >= (unsigned long) &_etext) continue; + printed = 1; printk("[<%08x>] ", data); if (--count) continue; break; } - printk("\n"); + if(printed) + printk("\n"); } /*

--IS0zKkzwUGydFO0o--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/