Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5472285rwb; Tue, 1 Aug 2023 03:14:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlHnBjhtRPhZV3ivRckCvGI2dyL4eN3RVUoLzQVTpxsugobzOTVTCNgd7MBHnz7Jn/MKDeOt X-Received: by 2002:a05:6a00:1910:b0:682:edbe:4cbd with SMTP id y16-20020a056a00191000b00682edbe4cbdmr14844115pfi.15.1690884846697; Tue, 01 Aug 2023 03:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690884846; cv=none; d=google.com; s=arc-20160816; b=a9JoW4DOHGfL6z1Tj/3v20Fcam/AMYkkSxQSeZWPAo9rKsMxo7aCRYOGvCVnyVK6ka X7SsyvrEvS9rR3IrN3KSCRNbGCfgUtROZvYOe1s5RIWtdYOZO8mDSx87UOa3zvxC+Drp zq2PaOmMRHUEc6df4AXsAygkQIJRsUUK9lG87OkL59lMrpc9bdX9FE7DMDQlKlxgmRxi JDWVnRh7wjr1MhubuNfZXY9HKq3LwIMwCo2KYTt5HWjqN0hBnKEWU8YS6u/ikS2Myzi8 Hmx2jflB5ZcFFQyvh3RoKyjJc/PYWTPN6KanOk9STT7+TNajMpQfbjAZdNf3vNrms7bK 4+aQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dc3-20020a056a0035c300b0065caa80ad8csi3142527pfb.398.2023.08.01.03.13.54; Tue, 01 Aug 2023 03:14:06 -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 S231966AbjHAJBo (ORCPT + 99 others); Tue, 1 Aug 2023 05:01:44 -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 Content-Transfer-Encoding: 8bit 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 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, -- 2.40.1