lkml.org 
[lkml]   [2019]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC patch 21/41] proc: Simplify task stack retrieval
On Wed, Apr 10, 2019 at 12:28:15PM +0200, Thomas Gleixner wrote:
> @@ -430,20 +429,16 @@ static int proc_pid_stack(struct seq_fil
> if (!entries)
> return -ENOMEM;
>
> - trace.nr_entries = 0;
> - trace.max_entries = MAX_STACK_TRACE_DEPTH;
> - trace.entries = entries;
> - trace.skip = 0;
> -
> err = lock_trace(task);
> if (!err) {
> - unsigned int i;
> + unsigned int i, nent;
>
> - save_stack_trace_tsk(task, &trace);
> + nent = stack_trace_save_tsk(task, entries,
> + MAX_STACK_TRACE_DEPTH, 0);
>
> - for (i = 0; i < trace.nr_entries; i++) {
> + for (i = 0; i < nent; i++)
> seq_printf(m, "[<0>] %pB\n", (void *)entries[i]);
> - }
> +

I only object to {} removal. The rule of mandatory {} that new languages
have adopted is pretty cool. Otherwise

Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com>

\
 
 \ /
  Last update: 2019-04-14 16:50    [W:0.185 / U:11.736 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site