Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp137925rdb; Thu, 1 Feb 2024 04:39:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJr3EWGcQZRzbX4Ham0WOPYVQYV+hh+SYeDVqMgqCvAY0yhafJj2KWwoE0RyNCnyV93jmz X-Received: by 2002:a05:6830:1401:b0:6dc:854a:3d91 with SMTP id v1-20020a056830140100b006dc854a3d91mr2330467otp.30.1706791154990; Thu, 01 Feb 2024 04:39:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706791154; cv=pass; d=google.com; s=arc-20160816; b=ej5+9FAtKarnlasfEisJb4DAh6e2eKGQAYmR/USll8DcpxNsrdFwW7ve2F9mn5RWLQ 5aZPj8XFGnkofFRbbkIEllWLpaVwD2C74ua+/TQrH6agxD1ku5WfTUbqD3mkmimC9mpn f69DwlAYup/x9k+XboTOyCf3v6rcuZnxdz023fN9UPWO80OX7RU2dtDKB/lHByTnh+dH 0oMietzkgtkYXwCm4aWwH8wUuz2gEsmMM2tlx2sKMQvvBj7h5OEAXjicTcOcNPfYVdYv l88pxyK18/qlA0RpCgm+dcDTGt6iiuGSDigTUcgekGlRRKghbU8breIUobWepDSuLGHK WF/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:content-language :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id; bh=fKk3aa8gwwnd9ib/8RtqDVuGOCKLQ5WJUUfWACGZvuc=; fh=mbOgPEjgJn66BEZFr7mQkV9MOfLTrShMtADlw/tf1XA=; b=KgWKgKllC+iEVsjgr5IFqpE0CtzEJ4gTWCw812LSnMmxsHSat7w7RYOvbRVS22GgW4 dnuH2YC9UwuFJidAmfstVeck3uJfJml+8/H7/agFLctgLVMnw6HtDMCK3GuYozTJggDX Pv2NDhGo8DO1t+ur4R8ujLzrXT5v79tH6xpC9AxR0yCk0Dmu7TRGdiUytyRXz1e1sMxc o8O8Znsj0hrSiZLPQvix59WB56NGERdObp3xTKEbbjxwLj/WyKB7U9eKD4m28j1wuQp4 w1Mlce+iYaQ7G+SaNjn9EmfzGZRmiFqacE3tKl9J/8Vl5lY/y74cZsS+iSv6snaWLDc1 fEWQ==; 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-48107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48107-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUvmh7ElyvHNHUC/1X06LDYCUL+M8oA8ZLzhQhZsNK4uL3FoeqKukC8uJu5LnGbVZA//PCtSz4N6s3S0b8lrQOJ6OP0dixWzWBgpyAjDQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id by1-20020a056a02058100b005ce016cce2bsi12308339pgb.190.2024.02.01.04.39.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 04:39:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-48107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48107-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9754CB24A79 for ; Thu, 1 Feb 2024 12:21:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5BC4D15DBC7; Thu, 1 Feb 2024 12:21:48 +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 9926E15AAB9 for ; Thu, 1 Feb 2024 12:21:45 +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=1706790107; cv=none; b=Ti1yIjdU8uv0a2OXyzy+lTtnOXG/dtTOy8IrKBiqAwIDByw8EMANv1SvTPynFCDLj7IF/UQgTvO3rfkQQLjluRUmko2ALQPgPZuyx8pz95q3Mahqf8P6Gk4jj9mDDJyqhdfHTBafeQTG1sERBikKySm7T3MOqN8yO1qOkuhC9TA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706790107; c=relaxed/simple; bh=vaLdbaLRwXVHsBkr/tc4RRKyddRu3QROiEgFWWQ1wcs=; h=Message-ID:Date:MIME-Version:From:To:Cc:Subject:Content-Type; b=p3qZXTHCg8QQgdWLORiPkyuLYzTzR3oM3Ykm2DlEzF9TM1EX8hRCiR+4ehtyGguMTtzywATduh9jg+/fsQ9zErxok8Chy0yFpRX3qK8Pta/tQ1EiKz2w+yef8tNccZOMAHVc0HXsVxA4xdV3+JSFs3aQqmyfKck/g3vLi+x2uEM= 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 1rVW4X-0000w9-Vf; Thu, 01 Feb 2024 13:21:38 +0100 Message-ID: Date: Thu, 1 Feb 2024 13:21:37 +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 Content-Language: en-US From: Ahmad Fatoum To: linux-trace-kernel@vger.kernel.org, Masami Hiramatsu Cc: "linux-kernel@vger.kernel.org" , Pengutronix Kernel Team Subject: Boot-time dumping of ftrace fuctiongraph buffer 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, I semi-regularly debug probe failures. For drivers that use dev_err_probe rigorously, this is a quick matter: The probe function records a deferral reason and if the deferral persists, deferred_probe_timeout_work_func() will print the collected reasons, even if PID 1 is never started. For drivers that don't call dev_err_probe, I find myself sometimes doing printf debugging inside the probe function. I would like to replace this with the function graph tracer: - record the probe function, configured over kernel command line (The device indefinitely deferring probe is printed to the console, so I know what I am looking for on the next boot) - Dump the function graph trace - See if the last call before (non-devm) cleanup is getting a clock, a GPIO, a regulator or w/e. 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. 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? Thanks! Cheers, Ahmad -- 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 |