proc: use macro in /proc/latency hook
authorAlexey Dobriyan <adobriyan@gmail.com>
Wed, 22 Aug 2018 04:54:34 +0000 (21:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 22 Aug 2018 17:52:46 +0000 (10:52 -0700)
->latency_record is defined as

struct latency_record[LT_SAVECOUNT];

so use the same macro whie iterating.

Link: http://lkml.kernel.org/r/20180627200534.GA18434@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/base.c

index 4d8dac635da4556796f7fc32150c1f1d6dd401c3..ccf86f16d9f0190c18e7f4345b7ca0960709eb05 100644 (file)
@@ -463,7 +463,7 @@ static int lstats_show_proc(struct seq_file *m, void *v)
        if (!task)
                return -ESRCH;
        seq_puts(m, "Latency Top version : v0.1\n");
-       for (i = 0; i < 32; i++) {
+       for (i = 0; i < LT_SAVECOUNT; i++) {
                struct latency_record *lr = &task->latency_record[i];
                if (lr->backtrace[0]) {
                        int q;