From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9F84238D54 for ; Wed, 24 Jun 2026 12:35:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782304533; cv=none; b=n0nMInH0F8cyqF4NPdIqrJjqnKGDfd4liEXMnWKwNO2sPp5FnlZwMXiq336JHKQVD+cvjaAJx2O6PA0F8eAuFeu1ob5JhjGMqFIV37v+Npx94NHMjpSTDCqdyBuWFKJ2/zDdMeGKtQ6Yr7CSzEf2iotFfKuDHqZ6HsG2eHWaxZw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782304533; c=relaxed/simple; bh=dWiwdISBxmWp3lcye7zsMFqe48+MmBd+5ewSexoxLn8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=b/AYNmpkktSBcemK7LaqnoKLa34RMywL9RuuZBWLtDVMo+gAtMCevo1uRYmEZefl6aOiOfiqKALxL6N5fgKDCj+Ej7nmPNvdpgkgLuRUSxQv8sj7IlsTUiOze4S2Ivv5/G9anEJJhhIYp33pbqqqgA/TajZAaH5Up+4p/G6/bQ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FovHO7Mc; arc=none smtp.client-ip=209.85.128.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FovHO7Mc" Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-7e86d46b02dso12421207b3.3 for ; Wed, 24 Jun 2026 05:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782304531; x=1782909331; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=xPDpBmKtPUywZjFdZYdiGW+cb6iQbByKydMzv17TTi4=; b=FovHO7McPPkI4QmwF3ibW9qlsYiuGX76P2JYsZeppl7UmyEPzE1KEdGPTm+WMw6aJD RHEiTNIcm0Hq2u2duZeJb1829neT4tP0Hw7lTHH9a4VzhsxTaOBhTQt+U20wt2NWlAlV E8jNqeOfqD6BnbZqwNY8BRpI0vQkMy+J5cQVT+HS9hKsP3pGpAlW3ny9Sty6he0QCGcj ul7cKwqBbqXHbexQc25rz+9ywrGzyO/ukOQ4zrMu53HjzfuyaWzq34vBuPwPZT0V2YRh fLD0WjcsoYi2adO0t9HWv6jkLn8hysbk4QH6g2zl61lB2Y1SXa+wpMkXCLPejV4ruA62 hflw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782304531; x=1782909331; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xPDpBmKtPUywZjFdZYdiGW+cb6iQbByKydMzv17TTi4=; b=AYQAH0FBHjHRTzsmxmgks4NBj5f32ZqkDyUA0h5Cs/RYmZ2k5dLS8ey//4OC5lxPKd QJmWNzm+gJaS7lDbXci+jdVEq+F0VBLqfE0TB8Je8WcmSkG/tZ4Cu2+DD2A6QIZxQTzO 8HrkSRzs2UAVDXKoT9xgXJljiJrnAttifRzuI2pY1JQ1FOtEnPZ/q8+6LLHBbAIHu8IB YRzgkmYMVj/qkn3+sZalvYrjC3ChYmYVJdPIHFlJPuHaNv1s5mdQcbcE+/A3t2A9a19f qS+hqYLFlglCtriwQx/vKJRP9Wldzk2H6qFmIYodnSybO7UComZlSac/PGhC8KdWQl39 zHuA== X-Forwarded-Encrypted: i=1; AHgh+RrH8ozPSrR8hUWA6ib6AGrWBNiPrawDwU63B3W+Nf7gwqnjHk6JBSA7EnN8cthq6nE4yLI4x+sSCh+MKFY=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6ihxWfWWrULIb4bfzxDEY/6ztZdAsqZ+P+BAlRmn2Lss04HMl Cn4Q22bxb/XPrOBcsA6jwKlPziomli+VUS8FxZrvHH5YZzGGm5bQlB5D X-Gm-Gg: AfdE7cn4wm7njbQQbOgDVpWezAyqacorIW933jJBeTiI+Mdhskx2cI0x/P3kPbR01h6 caaLf9lOeCtI9mWmv+AyEx9Rm0sKBHG0l7defUIKjEZ0WwQnoDzTuQ9mhhDnXLfesDt90d98U4H y2SWU9ju6KAc+wF7VK4zC5XvZg0tjAVZfZxViXJppaa3nK4pHrYjMRukTfRI3qFml/vFNO+fzn7 pvguBwFe2kBftcv3lYuq6DOYIulxNEFefvFQExTjSKRw9yYHMT1NGWsMMs3LzMlCVSajh3qGPBf lBEbfhN4QyIU9YwClM4pFSN/vYCYS9YSV7HUfkNRh4qYNsqdxoOpupo/qrgZIWwfv630uNzLuFh bSbxITKc4g3SqIJBQujv9kYONv6OM4Kg+2R6F4sEfDMoey3D8kJISfmZAfr7Eg9GSOl7qsO1mZJ wThNJrFWP994BmiSISjUbdB66mcg== X-Received: by 2002:a05:690c:3341:b0:806:5a1c:d892 with SMTP id 00721157ae682-807f5633ca1mr28141257b3.47.1782304530790; Wed, 24 Jun 2026 05:35:30 -0700 (PDT) Received: from Dev-Null-MSI ([2a0d:3344:52ac:a808:98a4:4381:be45:536f]) by smtp.gmail.com with ESMTPSA id 00721157ae682-8025c97032esm58728607b3.10.2026.06.24.05.35.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2026 05:35:30 -0700 (PDT) From: Yousef Alhouseen 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 Subject: [PATCH] tools/writeback: parse help before importing drgn Date: Wed, 24 Jun 2026 14:35:14 +0200 Message-ID: <20260624123514.7822-1-alhouseenyousef@gmail.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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