From patchwork Tue Aug 1 09:01:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ze Gao X-Patchwork-Id: 129159 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2574240vqg; Tue, 1 Aug 2023 03:32:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlG8Q1DTk5jaN9BlKRb/3qb+XM88umWyBqUhYR3tF5AwpebCYwrsxV72B5PgRaLmvpgxgj7x X-Received: by 2002:a17:906:108f:b0:993:e752:1a6d with SMTP id u15-20020a170906108f00b00993e7521a6dmr2243937eju.18.1690885963096; Tue, 01 Aug 2023 03:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690885963; cv=none; d=google.com; s=arc-20160816; b=Aib/v//YDp7rQ7PaF2om5qCyO0e21HiIf65cckjAaY2Rh6St+YHVfImwgMZHmBKsFZ N2gV4PJkEXO5ydTyNCKkgDPK6GXfpIhqn7gUIqYvgNyd0C86UTOjLAG/Ksc5PZPHVBeC myEL51i2EpG3lZP7fcTePpRB2B5uZbppRkbv31/83we6KivUdgZpJP1kmBxMmC6Yee/s A2TYvWEXMsROn/c+4gmNzX+XhHPrTuyKIu8gcwQUHIsFW2TYcO1ph/82mBstiW/WRLjw pCKRgJpTICjKfJ1zDVXPpW7uGqRCJTm03h8pNclzcNcBESeMPwmfMG8jq6ZjRzvBkBfO P37A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ANQBcIlYslUfyuFpH0ut8ZVNsDjb/eKVIKT4N9OJfTI=; fh=4S4dukURCUlSsjzSa0Ofy3qHSrrdu/uT1HnGBPj5BK4=; b=l1NoX5MncHDm+4o45+LAiyVRiL/IeXnsmuakYru9+U72LjbQfJR5DjCittzT7ax+z+ eTg5AQdbk4HHxq7Hgds66F1rCdlHTsF8GIYl4IpEcLXPJr/8/DMaNaQOnyvdXJPQeMOX aeU7+gRV6OpZbSSqY/qsXIykaGEqJ3QtvxuF2veQjQoPlMOa1cAuYl1TIwEPyhPloczY 23jpb+72QKWDe0XvaYezdnGN3XvBbEjBAh/ct8JR0mcbi1y0ZUShhTpB6I7Um0JaVbvO LX9eF+TayOkxccVHt21nkUon0O+mZArYkApgBSEvxFC5MI/jQJbGUTz8dTMJXbL91N1x Iesw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="SU1K5qS/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay21-20020a170906d29500b00988357b5f3fsi5159745ejb.758.2023.08.01.03.32.19; Tue, 01 Aug 2023 03:32:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="SU1K5qS/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231990AbjHAJBp (ORCPT + 99 others); Tue, 1 Aug 2023 05:01:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbjHAJBi (ORCPT ); Tue, 1 Aug 2023 05:01:38 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24114173A; Tue, 1 Aug 2023 02:01:37 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-267fc19280bso4318535a91.1; Tue, 01 Aug 2023 02:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690880496; x=1691485296; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ANQBcIlYslUfyuFpH0ut8ZVNsDjb/eKVIKT4N9OJfTI=; b=SU1K5qS/8yCfPyxZKXlBwc104Wvn8wfdVsSfRcB96eVcbDwHfzY00tKeboUstqxq0T BRMJCfKfzXhVyj8rxZm6f44pcyyQXe+i9GXjHz8RHOeQeg21eAQudXLshb/HC3aGMUZW /WRCupIyCLHEiuD7QM/WI6mK5RqoPEZyTsM6su19ihphcVZtidulyL5iUys7qTDiBq3V 0ZZj5pgtauhC/533lkLJ5yhvVvZV3ret185irdYlO7uU/ViV24rS/vR75BSx2+6TAv0f 14JA/Itc5uu/JdH26Rth4KabmTUms6+bVuJldzQgdB4d+UoSsi5ujVrypsOR1UIgxMiP E51g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690880496; x=1691485296; 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=ANQBcIlYslUfyuFpH0ut8ZVNsDjb/eKVIKT4N9OJfTI=; b=YXPD8FrcOBikmCF8FfUOlrWSF2oai0JvBe1xEJj8GH2zrhO87ia89SC5Fn38K6Kc1Q nanoHIfpmD2I3NtwQ1rfr6JMR10PUhqQS5FfM1C4XdkhCeqmRg9MvLGzh26ZK6VwZW8u j87o/AXTUxIsx3vaTfsg5TQHYRDLuLIhjgb4p60gw0yF7rNO1Qt8N1UoitghCu7ZSx5P M49E6uKTxZveqbaqbDfZOgDYpe29t46m29CbE7VwjcPawbpgbmwmJ/DU6VmhpyeBctmS onO4+v3cVxaDIqc9P+ONGdT1G6eXZ8RozDCYti8oNP0o6mgSgTmCKpAma7Gg23O+4Wwg ONeQ== X-Gm-Message-State: ABy/qLZe8SBmUd1FlEbjGn8wQGCi86/tkKE5f8xUwsoMuNTQBT0wSW+N JZH1kgeKiecMhOv63p6denM= X-Received: by 2002:a17:90b:3c3:b0:268:94b:8d0 with SMTP id go3-20020a17090b03c300b00268094b08d0mr14673309pjb.11.1690880496543; Tue, 01 Aug 2023 02:01:36 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.20]) by smtp.googlemail.com with ESMTPSA id x34-20020a17090a6c2500b00264044cca0fsm1592523pjj.1.2023.08.01.02.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 02:01:36 -0700 (PDT) From: Ze Gao X-Google-Original-From: Ze Gao To: Adrian Hunter , Alexander Shishkin , Arnaldo Carvalho de Melo , Ian Rogers , Ingo Molnar , Jiri Olsa , Mark Rutland , Masami Hiramatsu , Namhyung Kim , Peter Zijlstra , Steven Rostedt Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org, Ze Gao Subject: [RFC PATCH v3 1/6] perf sched: sync state char array with the kernel Date: Tue, 1 Aug 2023 17:01:19 +0800 Message-Id: <20230801090124.8050-2-zegao@tencent.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230801090124.8050-1-zegao@tencent.com> References: <20230801090124.8050-1-zegao@tencent.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773022439597848786 X-GMAIL-MSGID: 1773022439597848786 update state char array and then remove unused and stale macros, which are kernel internal representations and not encouraged to use anymore. this fix is for old kernels, and we will steer to newly added symbolic char to report task state but also maintain compatibility to not break anything. Signed-off-by: Ze Gao --- tools/perf/builtin-sched.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index cc4ba506e119..c0d0ad18fc76 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -92,23 +92,12 @@ struct sched_atom { struct task_desc *wakee; }; -#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKWP" +#define TASK_STATE_TO_CHAR_STR "RSDTtXZPI" /* task state bitmask, copied from include/linux/sched.h */ #define TASK_RUNNING 0 #define TASK_INTERRUPTIBLE 1 #define TASK_UNINTERRUPTIBLE 2 -#define __TASK_STOPPED 4 -#define __TASK_TRACED 8 -/* in tsk->exit_state */ -#define EXIT_DEAD 16 -#define EXIT_ZOMBIE 32 -#define EXIT_TRACE (EXIT_ZOMBIE | EXIT_DEAD) -/* in tsk->state again */ -#define TASK_DEAD 64 -#define TASK_WAKEKILL 128 -#define TASK_WAKING 256 -#define TASK_PARKED 512 enum thread_state { THREAD_SLEEPING = 0,