From patchwork Wed Mar 20 11:02:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13597198 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 A43AAC54E68 for ; Wed, 20 Mar 2024 02:06:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5C02F6B0089; Tue, 19 Mar 2024 22:06:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 280526B0085; Tue, 19 Mar 2024 22:06:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB5166B0088; Tue, 19 Mar 2024 22:06:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 894C36B008A for ; Tue, 19 Mar 2024 22:06:13 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 481BA1A0BCA for ; Wed, 20 Mar 2024 02:06:13 +0000 (UTC) X-FDA: 81915777426.30.BEEF4E7 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf08.hostedemail.com (Postfix) with ESMTP id EC958160013 for ; Wed, 20 Mar 2024 02:06:09 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf08.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.56 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710900371; 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; bh=da/n/nOyweklDqbgVvFuNTp9AgXe/uzRw6J4puEoPec=; b=NNf+qtpfrQpV58EtGU6Af3/OfjGiI3m9/Ek1s8uOsySD2hyP0XK3sooBt4rZ2kVa4ClR8F V2hLrI/GzcfS2cAkxSaoIEBTQ/r+Ile2K5pf4ZYKVOUoXk5jKGLK59Cvfp5HpZrpNFDIsJ aQqm0phgFk/f4pPGQ2M+geiKbZlVNu4= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf08.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.56 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710900371; a=rsa-sha256; cv=none; b=3HOPqpSU9MHuQGB9drQIuuseEmPJUGWPc3zhuyEZnnY3istAdmEedakfB0KDHWdgozY6+C NUQ7+fLNOb3meFOl6a2YR300hlQoPT6urhXqncb5HhN3qwJMwq/lgYflxDbdBlBOO8HLxs Do/tbhi5VCUgKDM+8zjVcbQx3WAYZwI= Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TzsQ011Zlz4f3kF5 for ; Wed, 20 Mar 2024 10:06:00 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.252]) by mail.maildlp.com (Postfix) with ESMTP id 21C8C1A0199 for ; Wed, 20 Mar 2024 10:06:06 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.101.6]) by APP3 (Coremail) with SMTP id _Ch0CgAHFZ2KRPplVj2CHQ--.18626S5; Wed, 20 Mar 2024 10:06:05 +0800 (CST) From: Kemeng Shi To: akpm@linux-foundation.org, tj@kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: willy@infradead.org, bfoster@redhat.com, jack@suse.cz, dsterba@suse.com, mjguzik@gmail.com, dhowells@redhat.com, peterz@infradead.org Subject: [PATCH 3/6] workqueue: remove unnecessary import and function in wq_monitor.py Date: Wed, 20 Mar 2024 19:02:19 +0800 Message-Id: <20240320110222.6564-4-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240320110222.6564-1-shikemeng@huaweicloud.com> References: <20240320110222.6564-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: _Ch0CgAHFZ2KRPplVj2CHQ--.18626S5 X-Coremail-Antispam: 1UD129KBjvJXoWrtr1Dtw1xCF15Xr4rXw47Jwb_yoW8Jr15pF sakF47G3yfXryUX3Z5W343AFyfWrWDAF1qgayrXr1avrs8Xr9Ig34xK398Jr95Xa4DXFW0 9a9rWrZ0qr4DZF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPab4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUWwA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l 84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7CjxV A2Y2ka0xkIwI1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAq x4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r 43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF 7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxV WUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU Iq2MUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: EC958160013 X-Stat-Signature: 4skafymhgnwzybc687w54skqppqfjutp X-Rspam-User: X-HE-Tag: 1710900369-711789 X-HE-Meta: U2FsdGVkX18yieCJv2vr8dJYeQ5M7x2Fz3Rak4FKfUZxTAUe0PLN0tg1dv5Vndvu/lYbTjSHDTRukv2vpT1NsxUpUZBfFjheBjnpLs7hbFH/okGeRiBxHqkG8/R51c2/iLrngsaNXdhQjp7v/L2/Xg8q6qJOd+/gLHm9PF+FqNuLbvWIefqhcJcar5Gq1V6f7M88q0QjhPdXe3XjcxQ/HgYhqPHJj8eeLBu3LNtTtn4bSyHVrfLYgKLO4ZncGiu4jpG/0AapKpK7rC+KQGRzPsBR1I+ih6UgaKnp3p0X5Y0pH08lER5N4XovvXtTvd7XNJj//8kQYbbKTY1wuAYffjO3/cvSscxb+VG8h/trZoh4gucClyxwhpDssNEnJFIJ7bikIdAcghw7WAILCUeFeGbIbUd10qclpUBxSemJjvJ4mkBetSxN/IiZ68FTJAcM9ag/6NzgfUn/kjmpiJv9b+tYTmIwWcBmat7dPBasjA1kF3L5cqlHAW3nSwXJ3un6caaB7iom9iLlVg8K5nDpv099MiHwo44OLqmaxY2+OVR0MT3SMfaKIK2v+ws+tTqBiLnYsp3cTVbww81YVzmzoDs2xJ6pFHb3CMIbmP3wfDv4sPrTrMjb8oPP5w6TMLYdottYjdF9vtqapQACzxYAASckq50wTeQe/nMimvLScMLlW2ta9/5s6F/2krAjvpvECCQMEJKJmEjoRsKxq8cRGCSYw73wBwRyzeyB8EJJSWJTsAiB+3ew9YukoU3y3f8siCbU6USwHzGwyytUgnmGgpfFttDCzY1M1KlRcLH32wKZrlsItMo0TCdAOlAdv7AXWK8b6At1lYtX8PIb3da7PRUnR7qxyuTRUs+ie8mECV7vh0AIGAWcFKkBnwbXVN1dF8PlLN5h1isFEu9WfuZnS7cZM0DcPpgTtZDODQ0YTBWdXrkjW231F0I4rO+Z+l5hYiQCXgPiBT2EPo5WKrg hUy+6YaG r09gXrH92jbef/HGG1PLrYfd91lPFSDrpJ/5DLuLs0M7zEDgU1ajLHxgw67wFRQebgWHDJ9+GPuFX09LK2BwAbchlTeKlBIPPtC8u4DADm6j1XstN4vdrCEgPjJo6vyu1+nccMBXb3v6pZzA5fQ1YQ2FyedQpEGV2Oz9wur+Oqb5QTZn932XxVRhwJzVY5ytoomBbjp0PvwgNw45bb2ioFfdIHChVj0zJ3LIN0Se6TvKVnYY+LJj5Z2K/07FRadZaoL6T9Femmvf+EjtgGuuza/SqCSjDSQEQZReV42DavZKlGc1YAW8eJZ4R0jBbpVOqR+6NfNIKRQa8aBs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.001921, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Remove unnecessary import and function in wq_monitor.py Signed-off-by: Kemeng Shi --- tools/workqueue/wq_monitor.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tools/workqueue/wq_monitor.py b/tools/workqueue/wq_monitor.py index a8856a9c45dc..9e964c5be40c 100644 --- a/tools/workqueue/wq_monitor.py +++ b/tools/workqueue/wq_monitor.py @@ -32,16 +32,13 @@ https://github.com/osandov/drgn. rescued The number of work items executed by the rescuer. """ -import sys import signal -import os import re import time import json import drgn -from drgn.helpers.linux.list import list_for_each_entry,list_empty -from drgn.helpers.linux.cpumask import for_each_possible_cpu +from drgn.helpers.linux.list import list_for_each_entry import argparse parser = argparse.ArgumentParser(description=desc, @@ -54,10 +51,6 @@ parser.add_argument('-j', '--json', action='store_true', help='Output in json') args = parser.parse_args() -def err(s): - print(s, file=sys.stderr, flush=True) - sys.exit(1) - workqueues = prog['workqueues'] WQ_UNBOUND = prog['WQ_UNBOUND']