From patchwork Tue Jul 23 06:48:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuan-Ying Lee X-Patchwork-Id: 13739587 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C1FDC3DA64 for ; Tue, 23 Jul 2024 06:49:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B4A96B00AC; Tue, 23 Jul 2024 02:49:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 264FF6B00BF; Tue, 23 Jul 2024 02:49:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0EA476B00C0; Tue, 23 Jul 2024 02:49:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D92F26B00AC for ; Tue, 23 Jul 2024 02:49:36 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9B0251C424D for ; Tue, 23 Jul 2024 06:49:36 +0000 (UTC) X-FDA: 82370091552.28.78796A9 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by imf27.hostedemail.com (Postfix) with ESMTP id 80EE740028 for ; Tue, 23 Jul 2024 06:49:34 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=canonical.com header.s=20210705 header.b=CampAaxH; spf=pass (imf27.hostedemail.com: domain of kuan-ying.lee@canonical.com designates 185.125.188.122 as permitted sender) smtp.mailfrom=kuan-ying.lee@canonical.com; dmarc=pass (policy=none) header.from=canonical.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721717313; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rC35uQ15eqvudJFKCmfhKueP5euBpEMwrUgBuRH1430=; b=fPqh1e/MPQaGuuIoiGSskUVt28Oc26oMSregW+kZRnuVG+sGebHi7u6jnkxx2AqdBn2rHp C9BxQlHekgBVMhJt4Z7qobpFu8eiakTfPwBuhw0P1dDGpOKFWsS6P6KIeHoCRE3TS9KyjA l4KoT29C76bZQ+I3YNYvM9lpQqtlRvg= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=canonical.com header.s=20210705 header.b=CampAaxH; spf=pass (imf27.hostedemail.com: domain of kuan-ying.lee@canonical.com designates 185.125.188.122 as permitted sender) smtp.mailfrom=kuan-ying.lee@canonical.com; dmarc=pass (policy=none) header.from=canonical.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721717313; a=rsa-sha256; cv=none; b=4yUQ3/VvwoFJWiT4KYEm3ViUsJ1d1J6rV/0RN1fC5jPCCcRklQG9/FrxvXuYmtJoFzxyVF TvxJPZQUmMuHRwnafLifL3r4AMlYuTLeHeJmcSMnYYahTKckir69iJMcBgtO9pTaoIBMt/ hhDYvQAkZqebvYrn15JMsTNnjLg/O9Y= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 1A4493F1EE for ; Tue, 23 Jul 2024 06:49:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1721717373; bh=rC35uQ15eqvudJFKCmfhKueP5euBpEMwrUgBuRH1430=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CampAaxH3Di0LFQkZ+08akaVRVHBHWp+eWMfWj9gs9u8K17cQxubn6+F+5aoKI/Dv lBQCosqAK73Q5UpqQ/21I4MSd1HAPtTNDfIXDeESzDhgRcdSKkMdBYsfFKqKCM+ro6 Et6UHyZM98LiZ08YYvRgPBDOIoed440VC6QnnpSbI9pI1i+xgfDWG8lB/zc4DDSf0o KmksX1/E9Dfpni8Xst5+7qMlZ6Mc8/4Q9wtIUzwbwD+plYVntXwQZrmz8RGGNShLAq m3tlb6ky82C1TU+eFKS4Kgu7dLEWZf4MSSrpQ7whcOsLWaVZoUuINBUN92EM2yQVEL nq0IZJu2QOJ8w== Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-2cb7364bac9so4766987a91.0 for ; Mon, 22 Jul 2024 23:49:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721717371; x=1722322171; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rC35uQ15eqvudJFKCmfhKueP5euBpEMwrUgBuRH1430=; b=tN6GWJSllxjVzFuL5RikqLnZy0H9DYE1tatZUcDYD29p/gomuAtKmEEiyJNlNzN3P6 sWibANY9dFUW9l3D0xxGY5Jn7FIhLV033jbw1tYR6UnVEGmIUnF1btqKXCNU4Kk6wAZ+ YI2MEEdMxqn2bwp2/81Lx8x70mw/EuoDDFtbiNFMeKENkHKSK7sBM3Z96WrW7VyDRoa6 O8dERAdmaS+vBuXBNUUrOjS0qsfavzUfJAWSMU5BkFdiNOj/M6xO8YATCEULFJHhesCH fhbm7sYv1qRQ+erGp+00CxTtef37QAbrh4iM+cV5NgCaBsUpSkjD6WW0Cyq2g/qyKbJB XDuw== X-Gm-Message-State: AOJu0YzNUqVYHV/1J8xRUvYUsRvscc1Pu6Am0heZO2mOGHc+j19eqj6o +ibLMrBXxj/2fjFpN9BlbRI9bg1Y9syKYeihMCIYgan3DQtTaQ0hCOTOe/3emiGUmWdRl/+o/jB LMq0MNacZu/ebzSvyIQIs+pLTTlAJgfVKn3+sfRDLQgUnQ78terXdGeVp2VpjvEkA X-Received: by 2002:a17:90b:4c8a:b0:2c7:d24b:57f with SMTP id 98e67ed59e1d1-2cd8d11c9ccmr1897651a91.19.1721717371634; Mon, 22 Jul 2024 23:49:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdcDBoDGFSCrA52BVnISHDjdXUedskgJ+Mos8j+PlbYjDf49OcjwGMpoau4hD8clEwbyyrBQ== X-Received: by 2002:a17:90b:4c8a:b0:2c7:d24b:57f with SMTP id 98e67ed59e1d1-2cd8d11c9ccmr1897632a91.19.1721717371242; Mon, 22 Jul 2024 23:49:31 -0700 (PDT) Received: from kylee-ThinkPad-E16-Gen-1.. ([122.147.171.160]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ccf7c5391bsm8354749a91.24.2024.07.22.23.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 23:49:31 -0700 (PDT) From: Kuan-Ying Lee To: kuan-ying.lee@canonical.com, Andrew Morton , Jan Kiszka , Kieran Bingham , Thomas Gleixner , Frederic Weisbecker Cc: linux-mm@kvack.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/5] scripts/gdb: fix timerlist parsing issue Date: Tue, 23 Jul 2024 14:48:57 +0800 Message-Id: <20240723064902.124154-2-kuan-ying.lee@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240723064902.124154-1-kuan-ying.lee@canonical.com> References: <20240723064902.124154-1-kuan-ying.lee@canonical.com> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 80EE740028 X-Stat-Signature: eunw83q81dfz7cc4guh1kytb3fawombg X-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gtYYaGR1KhDvvhtoQzPcpb2Z74Yhbst3UGFN2LSBeri86fwg54pVBjoTLXM2CsMyBoJm5Wy96uKYwSdbcZ2eFLJlXN0muCLcYi1OVBeXOwBbJPKXNJSVltdTGSQio62qNOOcZEShoNPp0uzzYzTO3nNgw2RDGaxvoRCX/yiWPoVtwrQMQhKGtifPswIkP0/dNg5sGnt57lYPkzYfGiATHzoI+xoK1xCJRV2PPEsU6X0nigqHI1IGxJj1254MrEwSRv3SgL4FjzQL50L3qSW7onitrJoWf/ApbriI+wnqDVdZSVzMTScsAQsXuzWBhY3x/BW2VLuHxaME3ENxkoGZ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Commit 7988e5ae2be7 ("tick: Split nohz and highres features from nohz_mode") and commit 7988e5ae2be7 ("tick: Split nohz and highres features from nohz_mode") move 'tick_stopped' and 'nohz_mode' to flags field which will break the gdb lx-mounts command: (gdb) lx-timerlist Python Exception : There is no member named nohz_mode. Error occurred in Python: There is no member named nohz_mode. (gdb) lx-timerlist Python Exception : There is no member named tick_stopped. Error occurred in Python: There is no member named tick_stopped. We move 'tick_stopped' and 'nohz_mode' to flags field instead. Fixes: a478ffb2ae23 ("tick: Move individual bit features to debuggable mask accesses") Fixes: 7988e5ae2be7 ("tick: Split nohz and highres features from nohz_mode") Cc: Signed-off-by: Kuan-Ying Lee --- scripts/gdb/linux/timerlist.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/scripts/gdb/linux/timerlist.py b/scripts/gdb/linux/timerlist.py index 64bc87191003..98445671fe83 100644 --- a/scripts/gdb/linux/timerlist.py +++ b/scripts/gdb/linux/timerlist.py @@ -87,21 +87,22 @@ def print_cpu(hrtimer_bases, cpu, max_clock_bases): text += "\n" if constants.LX_CONFIG_TICK_ONESHOT: - fmts = [(" .{} : {}", 'nohz_mode'), - (" .{} : {} nsecs", 'last_tick'), - (" .{} : {}", 'tick_stopped'), - (" .{} : {}", 'idle_jiffies'), - (" .{} : {}", 'idle_calls'), - (" .{} : {}", 'idle_sleeps'), - (" .{} : {} nsecs", 'idle_entrytime'), - (" .{} : {} nsecs", 'idle_waketime'), - (" .{} : {} nsecs", 'idle_exittime'), - (" .{} : {} nsecs", 'idle_sleeptime'), - (" .{}: {} nsecs", 'iowait_sleeptime'), - (" .{} : {}", 'last_jiffies'), - (" .{} : {}", 'next_timer'), - (" .{} : {} nsecs", 'idle_expires')] - text += "\n".join([s.format(f, ts[f]) for s, f in fmts]) + TS_FLAG_STOPPED = 1 << 1 + TS_FLAG_NOHZ = 1 << 4 + text += f" .{'nohz':15s}: {int(bool(ts['flags'] & TS_FLAG_NOHZ))}\n" + text += f" .{'last_tick':15s}: {ts['last_tick']}\n" + text += f" .{'tick_stopped':15s}: {int(bool(ts['flags'] & TS_FLAG_STOPPED))}\n" + text += f" .{'idle_jiffies':15s}: {ts['idle_jiffies']}\n" + text += f" .{'idle_calls':15s}: {ts['idle_calls']}\n" + text += f" .{'idle_sleeps':15s}: {ts['idle_sleeps']}\n" + text += f" .{'idle_entrytime':15s}: {ts['idle_entrytime']} nsecs\n" + text += f" .{'idle_waketime':15s}: {ts['idle_waketime']} nsecs\n" + text += f" .{'idle_exittime':15s}: {ts['idle_exittime']} nsecs\n" + text += f" .{'idle_sleeptime':15s}: {ts['idle_sleeptime']} nsecs\n" + text += f" .{'iowait_sleeptime':15s}: {ts['iowait_sleeptime']} nsecs\n" + text += f" .{'last_jiffies':15s}: {ts['last_jiffies']}\n" + text += f" .{'next_timer':15s}: {ts['next_timer']}\n" + text += f" .{'idle_expires':15s}: {ts['idle_expires']} nsecs\n" text += "\njiffies: {}\n".format(jiffies) text += "\n"