Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1708322rwo; Wed, 2 Aug 2023 20:31:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlGsSNyQGOehl4lF+UTq8MjBJBnT6Pp9Jwp7QGmampF5aw9qUWKSAPTCgtf+ptZCybGYKpnl X-Received: by 2002:a05:6808:238b:b0:3a3:f13f:8036 with SMTP id bp11-20020a056808238b00b003a3f13f8036mr20307757oib.11.1691033460400; Wed, 02 Aug 2023 20:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691033460; cv=none; d=google.com; s=arc-20160816; b=hn42CCoX1/HUGrPLIuYBI4tSbBt6l3yx+HdxwdvCtPcU0ng9f361ZxpltZmJIdwZni Pnpn67x7DAIaJf24qt8Qp6i2D8E3Na9NjwZ/1t+RcwCyvADoT4FE8nCrq1YJdVsQqjnZ CDkXVBfCnTbYKvfNGGHUOP0GTedJ/+5DbSRi1pfHKExf7MBzJnYsWruBihRCQ/p3wa8R JFXUrB9NrTBdsbw2FtnDkpjehocQsVrvH/8rk3X0D89XvNO49DEe2sw7Frmj5SPSDkYW speG4FcJDgs0PQHAnN2X4ez7xQKExQezxobaon6eXTCQCJmCzjIkrf6WOcw02fIO3Civ zfyg== 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:subject:cc:to:from:date; bh=EXZq1+PmVHLwNOm9ZX2O/kbXgGooq5MvmrlsAmw/pMU=; fh=+W+h24UyqrvCEgcJUSCSBCwhRFkn2iVTZdPAA+CSSz4=; b=ulEM9VgMbl2RC8KwxVoBEtlAyXPAx22jyL2sXJ53UiR363S0orbB7pjgkqIC5yYsuV dA5010EH6bAcxNeUhQh82CkWhUIU3ZfXLc7BKt+X1vZGp1QkOaEvKu74VFbFjOXUNDIx IVGs+X2kgRUfZHAqY87C6aHH6Kh17Xr1YGuBJlbKczItZVZ7+o1gede1TRhNzKQHfiLz N5nKrsZiL4zTL2TD/8CZbKZg4Tn7mfbv2CplIdModBS6BL/ijh+6QkYPkXSmP6yaKtY/ b8MbgCLWPizhzizuP6wb8/PWRx3rlNxAyu2Iss01evryhx/VbB7ZzVSARbKjjE9lVPGh 2rLQ== ARC-Authentication-Results: i=1; mx.google.com; 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 bq24-20020a056a000e1800b00687562db494si3473346pfb.356.2023.08.02.20.30.43; Wed, 02 Aug 2023 20:31:00 -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; 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 S232170AbjHCCs6 (ORCPT + 99 others); Wed, 2 Aug 2023 22:48:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233738AbjHCCs4 (ORCPT ); Wed, 2 Aug 2023 22:48:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1387D198B; Wed, 2 Aug 2023 19:48:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A5A4361BBD; Thu, 3 Aug 2023 02:48:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50875C433C8; Thu, 3 Aug 2023 02:48:51 +0000 (UTC) Date: Wed, 2 Aug 2023 22:48:49 -0400 From: Steven Rostedt To: Ze Gao Cc: Adrian Hunter , Alexander Shishkin , Arnaldo Carvalho de Melo , Ian Rogers , Ingo Molnar , Jiri Olsa , Mark Rutland , Masami Hiramatsu , Namhyung Kim , Peter Zijlstra , 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 v4 5/7] sched, tracing: add to report task state in symbolic chars Message-ID: <20230802224849.215b96b0@gandalf.local.home> In-Reply-To: References: <20230802121116.324604-1-zegao@tencent.com> <20230802121116.324604-6-zegao@tencent.com> <20230802110701.5227346d@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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 On Thu, 3 Aug 2023 10:38:43 +0800 Ze Gao wrote: > > > +static inline char __trace_sched_switch_state_char(bool preempt, > > > + unsigned int prev_state, > > > + struct task_struct *p) > > > +{ > > > + long state; > > > + > > > +#ifdef CONFIG_SCHED_DEBUG > > > + BUG_ON(p != current); > > > > BUG? Why not WARN_ON()? > > I directly copied it from __trace_sched_switch_state since they > are very similar. I had doubt on this too but decided to keep it in > case people want to be 100% sure that the current task is exactly > the one that is being switched, otherwise it's a fatal problem for > scheduler at the point where trace_sched_switch is called. > > If you think WARN_ON_ONCE is more appropriate, I can fix both > in v6. > > Thoughts? Yeah, that BUG_ON is from 2014, and really should not BUG. I'd fix both. Thanks! -- Steve