Skip to content

Commit

Permalink
latency_top: Remove the ULONG_MAX stack trace hackery
Browse files Browse the repository at this point in the history
No architecture terminates the stack trace with ULONG_MAX anymore. The
consumer terminates on the first zero entry or at the number of entries, so
no functional change.

Remove the cruft.

Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
KAGA-KOKO committed Apr 14, 2019
1 parent ead97a4 commit accddc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,9 @@ static int lstats_show_proc(struct seq_file *m, void *v)
lr->count, lr->time, lr->max);
for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
unsigned long bt = lr->backtrace[q];

if (!bt)
break;
if (bt == ULONG_MAX)
break;
seq_printf(m, " %ps", (void *)bt);
}
seq_putc(m, '\n');
Expand Down
12 changes: 6 additions & 6 deletions kernel/latencytop.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ account_global_scheduler_latency(struct task_struct *tsk,
break;
}

/* 0 and ULONG_MAX entries mean end of backtrace: */
if (record == 0 || record == ULONG_MAX)
/* 0 entry marks end of backtrace: */
if (!record)
break;
}
if (same) {
Expand Down Expand Up @@ -210,8 +210,8 @@ __account_scheduler_latency(struct task_struct *tsk, int usecs, int inter)
break;
}

/* 0 and ULONG_MAX entries mean end of backtrace: */
if (record == 0 || record == ULONG_MAX)
/* 0 entry is end of backtrace */
if (!record)
break;
}
if (same) {
Expand Down Expand Up @@ -252,10 +252,10 @@ static int lstats_show(struct seq_file *m, void *v)
lr->count, lr->time, lr->max);
for (q = 0; q < LT_BACKTRACEDEPTH; q++) {
unsigned long bt = lr->backtrace[q];

if (!bt)
break;
if (bt == ULONG_MAX)
break;

seq_printf(m, " %ps", (void *)bt);
}
seq_puts(m, "\n");
Expand Down

0 comments on commit accddc4

Please sign in to comment.