Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1096786rwi; Thu, 20 Oct 2022 08:35:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5wLN2LEW/W2B1TN3ZeXMZFAp+IQwjUvczkaRxvIRUMR7Wa1Q3093Z4Ht3UNfBqTnExAO5L X-Received: by 2002:aa7:c144:0:b0:459:f897:793e with SMTP id r4-20020aa7c144000000b00459f897793emr12734139edp.8.1666280143673; Thu, 20 Oct 2022 08:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666280143; cv=none; d=google.com; s=arc-20160816; b=Or1VejuSXamjHe1dbt2e1TBLhz3U06K00E2l2vLWmfVq95XGED3pm86YH4+d2WS7Zf WBtp+AxDvjpb5zX3+DEKCXiH28U35oOIkxoHcaR2hLaA0co/6B1LPh4b/MHpvuHSgb+B aqJn8VK5+1XuKZ72NGrRekv83rKKwoSWqpIYQQ0ILePB50xcK2KlPEX+EHmM0xsX/Wkt HlOpXyoLOzqzj0+CmAjImhHJbCmyoQuntWZC6NXs0ddv/O+8oPUJZPFUgIxBn56DA5M0 EPhtRW5ve1FZ7rusUY47SrYv0vJrZsM39KK/aw+hVPAsjYcq0VI/JHwvwSoPyUUKzmzM +GlQ== 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=QJdsEua/XalbKQDnc0k2p/2w6p6knI11+3c+w7sDkqA=; b=chw+y/h7c7P0IrY6sv8jhtbi/bxkCjxUb9kz5uBDLTgNoEEsj+KLSu13ng6ZAL+/op /lPxnIBrWBzgT7Hjil3KAGofRewJm017141loDglP7cucvZ3/Ee8Q3pp83Geft/zuATe 00YfptUsM4ctL1bM/A2+eX6ukJQrNchVFNKSgQTUr/t4Wa8hJHCKVAnwP4ID6pdCyg1u QvZ9XO2uJQ7WaDhZRJUnFf+ZWCm0d0g5ptwjTzCMLFfAvoFVYJWqqzE6YarlApzU7Sk2 xMcVn1pYXFZiNG+4M+nO5Y/+wvQhXJjCuzwkdEVpyHKESEGeBeNKDpPypLSFCWAQBjYX wVbA== 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 i15-20020a50d74f000000b00458264c2df2si15885393edj.164.2022.10.20.08.35.04; Thu, 20 Oct 2022 08:35:43 -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 S230253AbiJTPVE (ORCPT + 99 others); Thu, 20 Oct 2022 11:21:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbiJTPUv (ORCPT ); Thu, 20 Oct 2022 11:20:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7C50EC51E; Thu, 20 Oct 2022 08:20:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8BE91B827AE; Thu, 20 Oct 2022 15:20:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EEDBC433D7; Thu, 20 Oct 2022 15:20:16 +0000 (UTC) Date: Thu, 20 Oct 2022 11:20:20 -0400 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: LKML , Linux Trace Kernel , Andrew Morton , Mathieu Desnoyers , "Paul E. McKenney" , Joel Fernandes , Tom Zanussi Subject: Re: [PATCH] tracing: Add trace_trigger kernel command line option Message-ID: <20221020112020.540d3b77@gandalf.local.home> In-Reply-To: <20221020233318.aa41f0b5bb123c87af881316@kernel.org> References: <20221019200137.70343645@gandalf.local.home> <20221020233318.aa41f0b5bb123c87af881316@kernel.org> X-Mailer: Claws Mail 3.17.8 (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 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, 20 Oct 2022 23:33:18 +0900 Masami Hiramatsu (Google) wrote: > On Wed, 19 Oct 2022 20:01:37 -0400 > Steven Rostedt wrote: > > > From: "Steven Rostedt (Google)" > > > > Allow triggers to be enabled at kernel boot up. For example: > > > > trace_trigger="sched_switch.stacktrace if prev_state == 2" > > > > The above will enable the stacktrace trigger on top of the sched_switch > > event and only trigger if its prev_state is 2 (TASK_UNINTERRUPTIBLE). Then > > at boot up, a stacktrace will trigger and be recorded in the tracing ring > > buffer every time the sched_switch happens where the previous state is > > TASK_INTERRUPTIBLE. > > > > As this calls into tracepoint logic during very early boot (before > > interrupts are enabled), a check has to be done to see if early boot > > interrupts are still disabled, and if so, avoid any call to RCU > > synchronization, as that will enable interrupts and cause boot up issues. > > Just out of curiousity, can you do it by boot-time tracer? > (Is it too late for your issue?) Yeah, I'm looking at adding triggers very early. I could even add "traceoff" trigger too here. I'm guessing that bootconf is done later in boot up? Especially since I needed to fix RCU calls to get this working. > > $ cat >> stacktrace.bconf > ftrace.event.sched.sched_switch.actions = "stacktrace if prev_state == 2" > ^D > $ bootconfig -a stacktrace.bconf initrd.img > Not to mention, I'm doing this for Chromebooks where it's easy to update the command line (on dev devices), but not as easy to modify the kernel. -- Steve