* [PATCH dlm-tool] tool: ignore file header on lockdebug
@ 2024-04-05 17:46 Alexander Aring
0 siblings, 0 replies; only message in thread
From: Alexander Aring @ 2024-04-05 17:46 UTC (permalink / raw)
To: gfs2; +Cc: aahringo
Since kernel commit 5beebc1dda47 ("dlm: update format header reflect
current format") the headline of some debugfs entries was updated to the
current format so it is possible to lookup what - what is instead of
looking up the source code. As side effect there is now an ugly:
print_rsb error rv 2 line "rsb ptr nodeid first_lkid flags
!root_list_empty !recover_list_empty recover_locks_count len
in front of every lockdebug dump as dlm_tool parse everything (including
the file header). Afterwards the dump proceeds. This patch will ignore
the first line of lockdebug in dlm_tool that is not required for
lockdebug pretty printout.
---
dlm_tool/main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dlm_tool/main.c b/dlm_tool/main.c
index 2e6810d6..5878ebc5 100644
--- a/dlm_tool/main.c
+++ b/dlm_tool/main.c
@@ -1085,6 +1085,10 @@ static void do_lockdebug(char *name)
memset(&summary, 0, sizeof(struct summary));
memset(&info, 0, sizeof(struct rinfo));
+ /* skip file header */
+ if (!fgets(line, LOCK_LINE_MAX, file))
+ goto done;
+
while (fgets(line, LOCK_LINE_MAX, file)) {
if (old)
@@ -1114,6 +1118,7 @@ static void do_lockdebug(char *name)
raw:
printf("%s", line);
}
+ done:
count_rinfo(&summary, &info);
clear_rinfo(&info);
printf("\n");
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-05 17:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-05 17:46 [PATCH dlm-tool] tool: ignore file header on lockdebug Alexander Aring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox