Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5622854rwb; Tue, 1 Aug 2023 05:46:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlFtEpro+yp+G8pQWLaGtzWkzaudgGreKWCG1w2z96alDMpLygNhfh9+lOWqd5aKm8cDE4hS X-Received: by 2002:a05:6a21:47c7:b0:137:a3c9:aaa2 with SMTP id as7-20020a056a2147c700b00137a3c9aaa2mr14614102pzc.30.1690894006493; Tue, 01 Aug 2023 05:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690894006; cv=none; d=google.com; s=arc-20160816; b=EKn+zGuZeEleH2jYmvfg+iRQS0IwKPsrfQ7UswcsyDBDo8F2Bfvws0wfryS/FRk+GR 9yH58GeqYgIbjjha2ilaSOvRXUcLF0k762Edl/wib8UWuneX8ebYj86Gp2SD6NSGdqBZ I46jJ/qXIFXvC1FPEwtZq+Bfygeh7L0k+C4H4gOW4uZhxeUHg3vszVKbFBuS80yIwGoH sO7OgFgdu0R8uBwTZIU3PLEBCwqslVTh2qgtirIlb4AiPyu3tM2S99R8tjO7IfzFIg0z 945JvgdkglkzYBKqbOygaewaX4hEGQGxVyYErl8FENMfZZh9QrPBtIVrp1AUL3ygBTpH M15w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=m1F9HPkA3rCfG5++ie5WawGo0UTj2vVNhV/5rI+7dho=; fh=P0SkYcLhQgsUgORHxsOSsuoJfcBX/xB8NsxVGr0adWE=; b=ve+dRi/62uSqgtLcMIXfzsR6ZpE5YGZogc4y6HxhZ1TWfIVTtPCyscURwArnbioeiL Wj+mGIzUCN4WauAygdmcrW2gI9U3sqxE5y0eM/iQLFIHCLna7oG40x4LCKIFFNNZtj1a FXz5ltQE5ol9MSBASxvyvjnntyt1UXgqVU0BZxgxomjNtPfv7kMCZYL/rySMRmE1Vw4P jmv4HCZfAN4RFbYLAkBrdnZssNsRB+2rd5AHWX9XT0ImOmFuIalAjRHvFcQ70rmOqiVC kkOdUxFKls0GalUWwqXHl1werPMsoMW2vaSEu7DoavII2rMfrr6YqR7usaJLP64+JdiG NqzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mB9lQRj8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bs184-20020a6328c1000000b0056383a7ddc2si8673635pgb.400.2023.08.01.05.46.34; Tue, 01 Aug 2023 05:46:46 -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=@infradead.org header.s=casper.20170209 header.b=mB9lQRj8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233785AbjHALef (ORCPT + 99 others); Tue, 1 Aug 2023 07:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233774AbjHALed (ORCPT ); Tue, 1 Aug 2023 07:34:33 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38536D3; Tue, 1 Aug 2023 04:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=m1F9HPkA3rCfG5++ie5WawGo0UTj2vVNhV/5rI+7dho=; b=mB9lQRj8ne7QFWU/SvSHLBtwb6 h8xkNxWTv4f5uznh/z9xyszKEHyfllEKko5I05DM439vdurXjN3Ng5UlhclOvPdYJlzKN75ic1PuZ MkQx7FVcynX8dz8FJWvDGDtTmTY6w2TLbbQbh1NXLy0plifn86o+u0GEsiobPMM55N+aULATCl7o5 IdlMhHYGS/bCJUhVDMRtgJ0e44vX5wwj0q4PNb9Z8iad4ngKUWtCkhUbkQ5tg+F1QUWm/fiUrNvg3 EPHixlaFooaWC4Zv49H6rXFD2n+pHXC40U/U929HsM7rOoe7LlXEaVvwd+4uv5LM1aBGZQGY/RYTp 2VqoqZEA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qQndb-008R8A-MR; Tue, 01 Aug 2023 11:34:03 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 3184E300134; Tue, 1 Aug 2023 13:34:02 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id EDD41200C570F; Tue, 1 Aug 2023 13:34:01 +0200 (CEST) Date: Tue, 1 Aug 2023 13:34:01 +0200 From: Peter Zijlstra To: Ze Gao Cc: Adrian Hunter , Alexander Shishkin , Arnaldo Carvalho de Melo , Ian Rogers , Ingo Molnar , Jiri Olsa , Mark Rutland , Masami Hiramatsu , Namhyung Kim , Steven Rostedt , 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: Re: [RFC PATCH v3 3/6] sched, tracing: add to report task state in symbolic chars Message-ID: <20230801113401.GC79828@hirez.programming.kicks-ass.net> References: <20230801090124.8050-1-zegao@tencent.com> <20230801090124.8050-4-zegao@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801090124.8050-4-zegao@tencent.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Tue, Aug 01, 2023 at 05:01:21PM +0800, Ze Gao wrote: > Internal representations of task state are likely to be changed > or ordered, and reporting them to userspace without exporting > them as part of API is basically wrong, which can easily break > a userspace observability tool as kernel evolves. For example, > perf suffers from this and still reports wrong states as of this > writing. > > OTOH, some masqueraded states like TASK_REPORT_IDLE and > TASK_REPORT_MAX are also reported inadvertently, which confuses > things even more and most userspace tools do not even take them > into consideration. > > So add a new variable in company with the old raw value to > report task state in symbolic chars, which are self-explaining > and no further translation is needed. Of course this does not > break any userspace tool. > > Note for PREEMPT_ACTIVE, we introduce 'p' to report it and use > the old conventions for the rest. *sigh*... just because userspace if daft, we need to change the kernel? Why do we need this character anyway, why not just print the state in hex and leave it at that? These single character state things are a relic, please just let them die.