]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm: kfence: fix elapsed time for allocated/freed track
authorqiwu.chen <qiwuchen55@gmail.com>
Tue, 24 Sep 2024 08:50:04 +0000 (16:50 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 26 Sep 2024 21:01:44 +0000 (14:01 -0700)
Fix elapsed time for the allocated/freed track introduced by commit
62e73fd85d7bf.

Link: https://lkml.kernel.org/r/20240924085004.75401-1-qiwu.chen@transsion.com
Fixes: 62e73fd85d7b ("mm: kfence: print the elapsed time for allocated/freed track")
Signed-off-by: qiwu.chen <qiwu.chen@transsion.com>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kfence/report.c

index 451991a3a8f2700677106df72bbbb79730f9bea1..6370c5207d1a77aa5f010e1e630244df3971904e 100644 (file)
@@ -109,7 +109,7 @@ static void kfence_print_stack(struct seq_file *seq, const struct kfence_metadat
        const struct kfence_track *track = show_alloc ? &meta->alloc_track : &meta->free_track;
        u64 ts_sec = track->ts_nsec;
        unsigned long rem_nsec = do_div(ts_sec, NSEC_PER_SEC);
-       u64 interval_nsec = local_clock() - meta->alloc_track.ts_nsec;
+       u64 interval_nsec = local_clock() - track->ts_nsec;
        unsigned long rem_interval_nsec = do_div(interval_nsec, NSEC_PER_SEC);
 
        /* Timestamp matches printk timestamp format. */