Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp823726rdb; Fri, 2 Feb 2024 05:20:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMZJCnfeQHKpUzkgRM3h/115e6idj9v6ZlJS+taKGt6qg+qdZ4o20OLWeUn0gGqXModKeB X-Received: by 2002:a17:906:c1b:b0:a34:a6af:22f1 with SMTP id s27-20020a1709060c1b00b00a34a6af22f1mr1369151ejf.62.1706880002136; Fri, 02 Feb 2024 05:20:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706880002; cv=pass; d=google.com; s=arc-20160816; b=pCAjxxQTqcW3mpq/tBURg/sXKm/tuBsCbrQtrnK9B3b5wv4qfseh0uubGi1wbnyFKy NbIAMqAS6dlHxO4q69HDEwR0DOX3j/dg1a5k+r67PAd6RDOHj30fpmWd7L68ibs7JoEe 4Jl/ph8uXDqHvbHommgBysmR8JK9t2GSOXu4ob0jf7UX0lEZwERxYh6AdZ9PQ7v8VFED a1xFjOhmTW4PZv7hfw0UfZdYCgfq4egJ8StIUrtVq1OfAtgtbc0p1lHvOu2J7xoVUgfO E2nyq5uat7zYQMWvprecRvaKM3ItnDCE5MBJcyrQbHBdYjuuNjp9a6PWMXR6p0MNwEgy Ke7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=IRb9OhwXkqw9ivo8NPcwCyOZRTp3hXDd67TtZA1oVNs=; fh=4z9jqwSEHm1v4Ik2s7S0cI7k+6y0PdBRp0V/6uoepbM=; b=hmp2cDBL2Hj1qE7DIC69ZeAR2DimpVqd+VkkWp1EsPH1pIXGULxTUUKcNBTQ9Nowdc wz6a3BmdEy7IBngdIzd1uvYkpxSOECqcO3LtVK95qhUR/wF3JHoDcHtJoP590s0WFsvI Oqg1IsaG733lTx2XY0aCbty0PFeXFQVZ9vCIu+n7NYGEG+A+Ggh18GSGgji2/9kFYMfS uPAlJ1zynTSJTBWbqibYT602FDi+3yYM7IHg06785oWdm7qC9sl9LLkgw5ZisAhYLI0x fGFFG2zzgYiMwhXjEius84f/7YiCFvzHMj3ag33y6XTVKvb3krHhbW7/dUqkY5Q8xD+l 2COQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-49891-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49891-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUtP87K51ThPFWQWCsOt+xa0puA8svUH+6ECi4hRDGqZZ1QT9frOIZAAxJGtPffo4hjwJ1MZIDg1GZgPgbfC+73PIEpHB+3ErIqsfK2BA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l18-20020a170906079200b00a36cb79a69csi775784ejc.782.2024.02.02.05.20.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 05:20:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49891-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-49891-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49891-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D92441F292C4 for ; Fri, 2 Feb 2024 13:20:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8A5132C88; Fri, 2 Feb 2024 13:19:54 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F79D1773D for ; Fri, 2 Feb 2024 13:19:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706879994; cv=none; b=n6WYkuOiSI/fdHY/21C0p9wWLUZhd9fFTj8eBb5qvk3HATyTBifVcIT0XtUneYwc+Wnbf6/kyDDcoAnvpVBWGBHQHJh+CSfeUAJ4FiaFOnQICMYIeXkyNPRwWZY2dw/134AjmTaGUmEPDHHpRKZtemRHYYaUiCYll6wHWFYwCxA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706879994; c=relaxed/simple; bh=oZHUavBtNPdmVsPG9WWBLfxVsvO5hsWg0lk+25BOilg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ZXg/OjcrT7nvlEJ4Ewb4TjhEyZ9RF/xn/2pqQxT5O8ulxAlmGreNzhhl+VATTO/wWBFNUOuYWX5si5qBktn0DWRkZRnNLkeEyjEy16O25m/ZcrMhYBQSShxdNxIn3i/0+pwP/iZSTOAn7JSE1xxp8dTIZYNtrJHjbWuo20PIDWQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rVtSC-0004Gn-EC; Fri, 02 Feb 2024 14:19:44 +0100 Message-ID: <13f53836-b1f8-4e2a-a3df-80b60102d396@pengutronix.de> Date: Fri, 2 Feb 2024 14:19:14 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Boot-time dumping of ftrace fuctiongraph buffer Content-Language: en-US To: Steven Rostedt Cc: linux-trace-kernel@vger.kernel.org, Masami Hiramatsu , "linux-kernel@vger.kernel.org" , Pengutronix Kernel Team References: <20240201204637.2afab2db@gandalf.local.home> From: Ahmad Fatoum In-Reply-To: <20240201204637.2afab2db@gandalf.local.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Hello Steve, On 02.02.24 02:46, Steven Rostedt wrote: > On Thu, 1 Feb 2024 13:21:37 +0100 > Ahmad Fatoum wrote: >> For this to be maximally useful, I need to configure this not only at boot-time, >> but also dump the ftrace buffer at boot time. Probe deferral can hinder the kernel from >> calling init and providing a shell, where I could read /sys/kernel/tracing/trace. > > OK so the driver is built in. Yes. The modules are easy, because I will have an access to shell by then on my systems. >> I found following two mechanisms that looked relevant, but seem not to >> do exactly what I want: >> >> - tp_printk: seems to be related to trace points only and not usable >> for the function graph output >> >> - dump_on_oops: I don't get an Oops if probe deferral times out, but maybe >> one could patch the kernel to check a oops_on_probe_deferral or dump_on_probe_deferral >> kernel command line parameter in deferred_probe_timeout_work_func()? >> >> >> Is there existing support that I am missing? Any input on whether this >> would be a welcome feature to have? > > Well you can start function_graph on the kernel command line and event > filter on a give function > > ftrace=function_graph function_graph_filter=probe_func Ye, that's what I am doing, but I was stuck on actually outputting the log at boot time. > You can add your own ftrace_dump() on some kind of detected error and put > that in the kernel command line. For example RCU has: > > rcupdate.rcu_cpu_stall_ftrace_dump= > > Which will do a ftrace dump when a RCU stall is triggered. Ah, thanks for the pointer. I take this as meaning that there is no builtin way to dump on arbitrary function return. I will see if it's possible with bootconfig before looking into adding a probe deferral specific kernel command-line parameter. Thanks, Ahmad > > -- Steve > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |