From: Yousef Alhouseen <alhouseenyousef@gmail.com>
To: willy@infradead.org, jack@suse.cz
Cc: shikemeng@huaweicloud.com, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Yousef Alhouseen <alhouseenyousef@gmail.com>
Subject: [PATCH] tools/writeback: parse help before importing drgn
Date: Wed, 24 Jun 2026 14:35:14 +0200 [thread overview]
Message-ID: <20260624123514.7822-1-alhouseenyousef@gmail.com> (raw)
wb_monitor.py imports drgn before argparse can handle "-h". That makes
help fail on systems where drgn is not installed, even though the script
does not need drgn to print usage text.
Parse arguments before importing drgn so the help path works without the
runtime debugging dependency. While there, fix a typo in the help text.
Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com>
---
tools/writeback/wb_monitor.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/writeback/wb_monitor.py b/tools/writeback/wb_monitor.py
index 5e3591f1f..e09e00ee2 100644
--- a/tools/writeback/wb_monitor.py
+++ b/tools/writeback/wb_monitor.py
@@ -14,7 +14,7 @@ backing dev. For more info on drgn, visit https://github.com/osandov/drgn.
dirtied(kB) Amount of pages have been dirtied.
- wrttien(kB) Amount of dirty pages have been written back to disk.
+ written(kB) Amount of dirty pages have been written back to disk.
avg_wb(kBps) Smoothly estimated write bandwidth of writing dirty pages
back to disk.
@@ -25,9 +25,6 @@ import re
import time
import json
-import drgn
-from drgn.helpers.linux.list import list_for_each_entry
-
import argparse
parser = argparse.ArgumentParser(description=desc,
formatter_class=argparse.RawTextHelpFormatter)
@@ -41,6 +38,9 @@ parser.add_argument('-c', '--cgroup', action='store_true',
help='show writeback of bdi in cgroup')
args = parser.parse_args()
+import drgn
+from drgn.helpers.linux.list import list_for_each_entry
+
bdi_list = prog['bdi_list']
WB_RECLAIMABLE = prog['WB_RECLAIMABLE']
--
2.54.0
next reply other threads:[~2026-06-24 12:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 12:35 Yousef Alhouseen [this message]
2026-06-25 0:27 ` SeongJae Park
2026-06-25 8:59 ` Yousef Alhouseen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260624123514.7822-1-alhouseenyousef@gmail.com \
--to=alhouseenyousef@gmail.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shikemeng@huaweicloud.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®