Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4285911pxf; Tue, 16 Mar 2021 09:43:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrSSUpKWdTD3EZGze/8C46Jtr6OJZUFPrDVNP1JHvFqGQb9X/KY/CAYPamd2Mu9O8zc/Cn X-Received: by 2002:a17:906:a3d1:: with SMTP id ca17mr30892074ejb.92.1615913015336; Tue, 16 Mar 2021 09:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615913015; cv=none; d=google.com; s=arc-20160816; b=sU8OrEEuHdnbodZ47463QEwS5y8k94VONPHyo83AHxo/XNtYRu4LSVUP8o/JgfBqZ5 fqXVhorr49DpUMmNYacwlfxxPbNv81TgXqwuwgVw8LBUFEAC1P8N9ouJZA8tHPAl7HHl mdYok1KCPXT7jIRZ5p+5qRAD7BPUgrArMSO0gz2izbWma7YK9nknOJdI5kK0yXZQDRXT MJMCfV5ZsGnXk0gAOYXn7k6FQYmxbivRCbFHHkqFxTpFgMZOc9Gb7hn+qw9GDkur1hil bIQ4V2kaPmihmakzi6UhZxGPGansc4AS33IbIjS9i30Se3TujkNeZy8pvcNSao4/UyAb 3bVw== 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=m8q3L8+/zK3ar4dlq+Srr+l0sXcIJHT+tnjWAsWT8po=; b=yfGCIuED76iBzLYa36K2BaH0eWoZA7y4AmdkDqp+8vno479zeIPsIg5uX+7nIbQr35 FpGaxSVXpO3Ymej7grIs5ImavPcbg8Xri3GgI4ctjvlLbH+SRPNxrxpRTAutxsuJLOcq hArY3BOca54QtGno6PyfxxsAFDnLGS/gnq53ZQCXcSe9XtIB/CaJ99x/dzOvWNk61hbn qDb5cr6ansQHypIOYYHUX9+NuIShyEGYd45YjiO1vSD4z3GzYuoCs1laAY/Wg4jIt2Ks JI8Y7C8ffsaQuGNTF751aLcmv+KiBzH/gE2yKHX3oZY/Y4W2JnvihMJDij8KKrwMQU2r UqQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si14508097eji.719.2021.03.16.09.43.12; Tue, 16 Mar 2021 09:43:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232664AbhCPP23 (ORCPT + 99 others); Tue, 16 Mar 2021 11:28:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:41034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233595AbhCPP2E (ORCPT ); Tue, 16 Mar 2021 11:28:04 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9CDC9650E4; Tue, 16 Mar 2021 15:28:02 +0000 (UTC) Date: Tue, 16 Mar 2021 11:28:00 -0400 From: Steven Rostedt To: Mark Brown Cc: Sangmoon Kim , Catalin Marinas , Will Deacon , jordan.lim@samsung.com, Ingo Molnar , Dave Martin , Mark Rutland , Dmitry Safonov <0x7f454c46@gmail.com>, Amit Daniel Kachhap , Peter Collingbourne , Gavin Shan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: traps: add tracepoints for unusal exception cases Message-ID: <20210316112800.3617ffd7@gandalf.local.home> In-Reply-To: <20210308133149.GA4656@sirena.org.uk> References: <20210305123635.27492-1-sangmoon.kim@samsung.com> <20210308133149.GA4656@sirena.org.uk> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Mar 2021 13:31:49 +0000 Mark Brown wrote: > > @@ -832,6 +846,7 @@ void __noreturn arm64_serror_panic(struct pt_regs *regs, u32 esr) > > if (regs) > > __show_regs(regs); > > > > + trace_traps_serror_panic_tp(regs, esr); > > nmi_panic(regs, "Asynchronous SError Interrupt"); > > One of the concerns people have with adding tracepoints is that they can > end up defining ABI so if we *are* going to add any then we need to > think carefully about how they're defined. As things currently stand > they'll pass in the full pt_regs struct which includes not only what's > defined by the hardware but also additional software defined information > we store along with it like the stackframe which would be even more of a > problem if it ends up getting used by someone in a way that ends up as > ABI. These are defined as bare tracehooks which does mitigate against > things ending up getting used in ways that cause problems but people are > still going to worry about things ending up getting relied on one way or > another. > > That said it's not clear to me that this will record anything beyond the > pointer directly in the trace buffer so the value might not be useful > for terribly long, that itself feels like it might not be as robust an > interface as it should be. BTW, we are working on an "event probe". That is similar to kprobe event, but attaches to the output of an event to create another event. Thus, if you had a trace event that was like this: trace_regs(pt_regs *regs); Where you save the regs pointer for output: TP_STRUCT__entry( __field(void *, regs ) ), TP_fast_assign( __entry->regs = regs; ) Then you would be able to get access to all the regs for that tracepoint! # echo 'e:pt_regs regs ip=+8(regs):x64' > /sys/kernel/tracing/kprobe_events Where "e:" denotes that this connects to a trace event, "pt_regs" is the event name created under kprobes subsystem, "regs" is the trace event to attach to, "ip=" is what will be printed, and "+8(regs):x64" is a way to dereference the regs pointer at the time of the trace event is executed. That is, it will dereference 8 bytes from the pointer and return a x64 hex number. Thus, trace events like this may be very useful in the near future. -- Steve