From patchwork Wed Aug 2 12:09:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ze Gao X-Patchwork-Id: 129821 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp446495vqx; Wed, 2 Aug 2023 06:12:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlFT4/e92PoD54FuaqAAmDcTlRKEcBIaZ1ikdxOEnmIvg5E2ukLLGo31MdHjJnmOHTL1gDKl X-Received: by 2002:a05:6a21:4887:b0:134:e14c:851b with SMTP id av7-20020a056a21488700b00134e14c851bmr14948796pzc.23.1690981952136; Wed, 02 Aug 2023 06:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690981952; cv=none; d=google.com; s=arc-20160816; b=OfyJCNsyAWGFYOsMJq+IU+KV/feV1Eu44AJNW18cCDteAgX2ls+GDpSYivhdAbt3qf OFVPFT+gbo9xIdAWoH6jWdt4y9RGth5w6WinW7F+X74U0ZOu/zgIDkYaPIBlEHNHQdu5 4uP+GTcxgFcC51u+AtHjijy9PIGo0Un6yerlg9rXSUIaddPGquqgM05RH9xXDTMymLsg lofmjsvRn2q65j2FjcMPrFVf3cKjvfSfdnQFFn1TQGXcLHqasH5hojOHYK2ZGNnMZTIC 5pCEB5IcxdWHKvX5HwrIgd6JUYAXs6f94cUfZQbXRsEz4I5Cb/PgbhHnhRhTasLMFzke zRew== 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=QMwGk7rqssSAGhj7vNRsmygfgKVCaIWXJ1YRE7kR0YA=; fh=KxelqS1vSd6AMLVGC49oyyDD8tvbYlRF2dLroWHbcXM=; b=MQPAVDISXxRGJ+f2cwkAzhCDPIMkT/x+nxJL1uOq2yjfmmg62R3kPLQyrEzQtYEulK aF0daXSRHDcmoGMTOGFdzvtOfEtswGPPwX7K4jO6fOsOgib1OZFP1WDy56c18mhPPqPm E31WuyBUiRdwvcMK+5xiamvVa8RQcZCvMCEVs79lj5C5vUw7UGM8Pz7K/zvReMSphwd2 F/vj6/4gk+0o/RjxW3YF0W4t5m4pSyNKZF7HKwkCOxnGPk/wtXeX/J4JEYLhYaqtIDMB xZQZ0vL841HY4N652EQj8WOp53ufeGeDGLkj+iZlBUWEgTMwQRy9wruyktxHYa5E9LCj eSrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Vzy2N+AG; 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 z3-20020a633303000000b00563ea86ad90si10716550pgz.464.2023.08.02.06.12.09; Wed, 02 Aug 2023 06:12:32 -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=Vzy2N+AG; 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 S234447AbjHBMLh (ORCPT + 99 others); Wed, 2 Aug 2023 08:11:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234448AbjHBMLe (ORCPT ); Wed, 2 Aug 2023 08:11:34 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7965F2728; Wed, 2 Aug 2023 05:11:33 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1bb7b8390e8so42034925ad.2; Wed, 02 Aug 2023 05:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690978293; x=1691583093; 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=QMwGk7rqssSAGhj7vNRsmygfgKVCaIWXJ1YRE7kR0YA=; b=Vzy2N+AG7dXCqR617X1+uJMRtDJIV2AwsiOW8fmfACy6LxhPOYD0rTspFdUobZUJmh lNMZTDfIHwePI8PXV3YiW8lJwRqwM9DBjyeKLRu5CSZr5+OBxJyzNfbIU6JSqxdsdw1F 95A12YLXqO+ZV/zztH2/rtV7BsQ2dSJp/Shqalt7QLltqXCfQZ+6mNet7+5ajVek81/F ZLmRvlmNBYrs4aOosyWxMIbTvKOznBcE4rlfSZRK1VZVrW6vl9c3PeDKMqGbt8Tzeb7x nO8WhNhRpkcrVJk/B4w4jeynUyhxQLi8Ep43VnVA3ZGsEaEL34fEKHdLT7o2rx4ritzn Ay1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690978293; x=1691583093; 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=QMwGk7rqssSAGhj7vNRsmygfgKVCaIWXJ1YRE7kR0YA=; b=T3oYiAzHl3dW7nUjkSuVaXIJu91/YOXdQV06EDiw2E2o81wAp7EjK4NOe09qaUhml4 8kfZgUfjOwahjwUoe8SG40H+kS4xlnADthPsejfIwvzv9oidPNII103SPk0I0wrbyvKm 14rjle7aZF/DFe+eM4Tg9ZU6qNljqME6iwjNlHZKT135OXDk04H/x9pFgVal2tJiVFs5 onL5MsaoKSF8/NvGnc6SjDhPbsc32Sld6dnCpCvOnZdade/439MnDiGNJH815smJRjN+ P8aqsm8emfsDqSv1zMwh3VPbVNtCIGkkkVIciZlaayw09QSJhuJmYZsBAJe6HCXRrUds j+Ow== X-Gm-Message-State: ABy/qLbyLplCcs/waSd9CsC07jWEAtlx2FpCF5yFhrDjtgwdmXCeC4Vs 3ZF6KJn3FSzU/MUWGCWUv/8= X-Received: by 2002:a17:902:da83:b0:1bb:4861:d3a7 with SMTP id j3-20020a170902da8300b001bb4861d3a7mr14948719plx.16.1690978292854; Wed, 02 Aug 2023 05:11:32 -0700 (PDT) Received: from localhost.localdomain ([43.132.98.115]) by smtp.googlemail.com with ESMTPSA id kx14-20020a170902f94e00b001b890009634sm12293173plb.139.2023.08.02.05.11.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 05:11:32 -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 , Ze Gao Subject: [RFC PATCH v4 2/7] perf sched: sync state char array with the kernel Date: Wed, 2 Aug 2023 08:09:57 -0400 Message-ID: <20230802121116.324604-3-zegao@tencent.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230802121116.324604-1-zegao@tencent.com> References: <20230802121116.324604-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_NONE,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: 1773123091354496010 X-GMAIL-MSGID: 1773123091354496010 From: Ze Gao Update state char array and then remove unused and stale macros, which are kernel internal representations and not encouraged to use anymore. 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 9ab300b6f131..8dc8f071721c 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,