From 10be945708fb5f2fdfb131249b32ffe320a5caf2 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Sun, 23 Apr 2017 17:39:31 +0000 Subject: [PATCH] Improve BUF_TRACKING by not displaying NULL entries. Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10443 --- sys/kern/vfs_bio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 41b4828af192..caf3c17eae07 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -4927,9 +4927,12 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) db_printf("b_io_tracking: b_io_tcnt = %u\n", bp->b_io_tcnt); i = bp->b_io_tcnt % BUF_TRACKING_SIZE; - for (j = 1; j <= BUF_TRACKING_SIZE; j++) + for (j = 1; j <= BUF_TRACKING_SIZE; j++) { + if (bp->b_io_tracking[BUF_TRACKING_ENTRY(i - j)] == NULL) + continue; db_printf(" %2u: %s\n", j, bp->b_io_tracking[BUF_TRACKING_ENTRY(i - j)]); + } #elif defined(BUF_TRACKING) db_printf("b_io_tracking: %s\n", bp->b_io_tracking); #endif