Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4211245rwb; Mon, 31 Jul 2023 03:28:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEotFndNf8Ebo0Qcfq+24f2JLvcgZudgVgMFZhYR7lc2yV6eIh21nA94xa9xGb/hd8jWEGd X-Received: by 2002:a05:6402:78e:b0:522:27c4:3865 with SMTP id d14-20020a056402078e00b0052227c43865mr7061409edy.41.1690799290978; Mon, 31 Jul 2023 03:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690799290; cv=none; d=google.com; s=arc-20160816; b=iCaKeJmiuzJCKQ9KHnGkhxiVVKW1xao3ZTV1/o1tYzIhCYCxQT+GCCq72C4qioVjc2 J0Wq0fs85Vi0GDHCfeKtzkHEsyzDPKph56WtBZ3oqyrniGinxQ6ULq2xs2+Vyt5Owpyi JWpiXL82xizC0syurxHqjT2a25cj0EY2ayHqBYGz3qaAk+HTFBMXvOzo2n5HGEn7Lct/ q5ANxslpX1JbAyXOAex55DNNvpux+PPPwZkRjTocHeBmVQ0CW0lEy8+NDsaMMRCaUAfD PY1uDb5QuxG78u+J/NRVHjkI3KMx9P8cb3Uw5ikC5KGIHHPg+fgMpgNrm2QljGcrjXht Obfw== 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=t2+TzLb7sWKIP1es6o89LAr2hjHeBB9vBotRjORzxp8=; fh=SGQT2dPqNpNiQETH1AqhYVEdxsnobQsz42oPZJ7/AV4=; b=uJa4YnzCF0psVgeMwpF6OdGz1I2KBmO5GWpE8OiIZPAF2DvHgCv4bY32KtvtQ9wdBe scftw1YrIf2iG36BWCWO5h56zuVRXN2Cmq4J1yZPjBYSyoaVxuQxrQh8Q0ZsRWlHQ4DK nbS+sNDrKfQS3gd7UUQzsUwbT1t9W3I5cwKsS0KaXwJePc9Y5cRWjDyfrtysg+WoBd1e e39gWxYB04ZWJCptlHCrmjBimvk85QCBWWPqFUIxHRGZE9I5YbwRYYMekJuPvZpvUo4g xuj/spDAl3XZZDWYo4kNSFtuALnP2j2iKAGLIjHjiSHICf1pk7uqT1A32//h7fAg8HhV v2bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Xx3N1Yer; 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 f14-20020a056402150e00b00522ab2a485dsi3811207edw.579.2023.07.31.03.27.46; Mon, 31 Jul 2023 03:28:10 -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=Xx3N1Yer; 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 S231171AbjGaJiR (ORCPT + 99 others); Mon, 31 Jul 2023 05:38:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231373AbjGaJh3 (ORCPT ); Mon, 31 Jul 2023 05:37:29 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51B2910D; Mon, 31 Jul 2023 02:37:28 -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=t2+TzLb7sWKIP1es6o89LAr2hjHeBB9vBotRjORzxp8=; b=Xx3N1Yerc4trPakPXJjx9xoHgB LK6y2tw/YWytSFaJC2Wde5BfJJhzJQvHD2P257W+7+BEhOcNMBNIeudVvNUbEhRfehVSVKpxBYXqS dIFIEnleYdnGJYqxXyLZhX3L0Fxs6oAGMjvLdYg8SeeezzxYjOS1Za6Qsg9nwHTvcFttcz47l+AOv ZdP5JkJEykPzCWwS+6boiIDyLuXdDxc/wVxNiv8lD2LnA9/Htr94YF7rmHeZ0WH8LNLfMmAgX3t/6 O6UTvKd4yz5zK22CWCKerIOQPVgNnlDlgSPfMkTFnurkJIO+TDBaJdCQYZ2mkayaCLZS3pUnlpVab ytlmSiFg==; 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 1qQPKi-000uM6-FO; Mon, 31 Jul 2023 09:36:57 +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)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 80F363001DD; Mon, 31 Jul 2023 11:36:55 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5D1A220238A9A; Mon, 31 Jul 2023 11:36:55 +0200 (CEST) Date: Mon, 31 Jul 2023 11:36:55 +0200 From: Peter Zijlstra To: Ze Gao Cc: Steven Rostedt , Namhyung Kim , Adrian Hunter , Alexander Shishkin , Arnaldo Carvalho de Melo , Ian Rogers , Ingo Molnar , Jiri Olsa , Mark Rutland , Masami Hiramatsu , 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 v2 1/3] sched, tracing: add to report task state in symbolic chars Message-ID: <20230731093655.GC29590@hirez.programming.kicks-ass.net> References: <20230726121618.19198-1-zegao@tencent.com> <20230726121618.19198-2-zegao@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230726121618.19198-2-zegao@tencent.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 On Wed, Jul 26, 2023 at 08:16:16PM +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 not a good choice, which can easily break a userspace > observability tool as kernel evolves. For example, perf suffers from > this and still reports wrong states by this patch. > > OTOH, some masqueraded state like TASK_REPORT_IDLE and TASK_REPORT_MAX > are also reported inadvertently, which confuses things even more. > > So add a new variable in company with the old raw value to report task > state in symbolic char, which is self-explaining and no further > translation is needed, and also report priorities in 'short' to save > some buffer space. 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. So I really dont much like this. This looses the ability to see the actual wait state flags, there could be multiple. Eg, things like TASK_FREEZEABLE gets lost completely. And this is on top of my reluctance to touch any of this at all, for fear of further regressions.