Received: by 2002:a05:7208:c250:b0:86:f851:443 with SMTP id w16csp45855rbd; Tue, 11 Jun 2024 12:31:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMz40uxSkid6/5jJERvpLfcUdPAIJZqvRzUNbdIKnXj6KUeTAiN70GXDArk9I1F5WQ1QFOxqJCACdoKWwmLuH9Fjtifihh8jwqHlAVDg== X-Google-Smtp-Source: AGHT+IG0FVTw69YWpvGNSn4E9Pye5xgCOfXpLnFzxgSnsQzEG0l9Z4GsuW8UIWaWVY6PWFOcofiq X-Received: by 2002:a05:651c:c3:b0:2eb:eb82:4112 with SMTP id 38308e7fff4ca-2ebeb824186mr41646121fa.17.1718134293167; Tue, 11 Jun 2024 12:31:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718134293; cv=pass; d=google.com; s=arc-20160816; b=YEIIDTzcd3jSO7NSBs+Cix5RzyY2PIbHhnbTxk/0ER8A1eSaqWItWpdq3NB6sM9jKc FkPxpnvYhwgvMJZGEb7fIarV6Vr2Dp2FmS4hcZKKu1cYGod4UOC54UTbny7oDxiQbFrP RN+WfKxoGx3208z49wvvxzzYpyM6cHvLkKi8Q3ZiR1jlGCoBbwuLpqf8Diisrv70kFY2 DY43S3KF3si5Gmj/JaEM9r1BFvNmxjRWdCHT5xoY9RUSc01UqLzVrmoJnR26OilGQQxp SeHdFE8phfutdfIwojUVcaUId/aLDurZNhpr9/rvP/kW3jGn1lVr0DoL6zdD7vlIQjUi nAnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=f//Q524jGjuxvwj2NLO2lp4Q1vuOE/IwHHI6iQXX2lU=; fh=VQi8WXJrSHXxsfwqC9oAfi6LEiQC0Qv/w+aqrHCHJLs=; b=CbKJhyFkC1EhXCpTqoq/h5I+5vEO7bzrBmg6DwQdVOZuRUK2mtcvy2zpkFFFFr6Wf2 3oNjjCeuqBkQnOUuycJ3bYysVFwFAoR0aAfB43D9NbqJWzGlf0oggb9nkuO3wKKniSIr HTw+19g9ViBsJ9hvuzZgqajkhH9pkop+EGhQnkKLoMZiszh1lr53pDsJ6r+5MTJSVeRk AtiRbyiCClbLAT3RvnbzYX0UQSYPC5bKkNdpXjKIqcrueDUAyORsvW+tCQ3sjVm1FyOB 5kdRHMfHMmwizqSr0Hr/I2iXCt3BsB7yxceNiOKU4T8Waw8cLXLVbvaZAnlW8uHHzXZt 8zRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-210510-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210510-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c70ac42a2si3725291a12.488.2024.06.11.12.31.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 12:31:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210510-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-210510-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210510-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 E2AC81F246E5 for ; Tue, 11 Jun 2024 19:31:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9BE4155CBE; Tue, 11 Jun 2024 19:28:56 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 112421527A3; Tue, 11 Jun 2024 19:28:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718134133; cv=none; b=u9dx9MxpkT0MGYBQzf5LTp53i80f9PwC+ui26aNxce3fKGQ3lTvT2O8R08dUeC6UYfOPjuauL699FuIEESE9w6LLl62Wg/S4H5bDjAQqJMptneD0AQyie7cMkVpCgzI1NetUsc3huENup3wXoI51Hyjb4eVtGnZpHd9xex/YJq8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718134133; c=relaxed/simple; bh=IE1IK2OKn7/pafSQ0ncO+HLzuopsT1q+/33iYZS7wTg=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=uvBk+aqTisYvCtLEyzbHNiZ32JR0hdU3TzISUzn2pqJRND2fRcCsrp5LHbHi4H4vtgPx4qGnZcnhtFAduaPiwqnEQJiBfOd/Jcn5lZhCfHuNcKlloxwqziUZJH3G21d8HDrT6oLWZeSzJueO8GLwud6Dcg1n/Qco3aoffedS+N0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0AE6C4DDEE; Tue, 11 Jun 2024 19:28:52 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sH7B7-00000001TvR-1Dpl; Tue, 11 Jun 2024 15:29:09 -0400 Message-ID: <20240611192909.150400552@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 11 Jun 2024 15:28:40 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Vincent Donnefort , Joel Fernandes , Daniel Bristot de Oliveira , Ingo Molnar , Peter Zijlstra , suleiman@google.com, Thomas Gleixner , Vineeth Pillai , Youssef Esmat , Beau Belgrave , Alexander Graf , Baoquan He , Borislav Petkov , "Paul E. McKenney" , David Howells , Mike Rapoport , Dave Hansen , Tony Luck , Guenter Roeck , Ross Zwisler , Kees Cook Subject: [PATCH v4 12/13] tracing: Update function tracing output for previous boot buffer References: <20240611192828.691638177@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 From: "Steven Rostedt (Google)" For a persistent ring buffer that is saved across boots, if function tracing was performed in the previous boot, it only saves the address of the functions and uses "%pS" to print their names. But the current boot, those functions may be in different locations. The persistent meta-data saves the text delta between the two boots and can be used to find the address of the saved function of where it is located in the current boot. Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_output.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index d8b302d01083..b9d2c64c0648 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -990,8 +990,11 @@ enum print_line_t trace_nop_print(struct trace_iterator *iter, int flags, } static void print_fn_trace(struct trace_seq *s, unsigned long ip, - unsigned long parent_ip, int flags) + unsigned long parent_ip, long delta, int flags) { + ip += delta; + parent_ip += delta; + seq_print_ip_sym(s, ip, flags); if ((flags & TRACE_ITER_PRINT_PARENT) && parent_ip) { @@ -1009,7 +1012,7 @@ static enum print_line_t trace_fn_trace(struct trace_iterator *iter, int flags, trace_assign_type(field, iter->ent); - print_fn_trace(s, field->ip, field->parent_ip, flags); + print_fn_trace(s, field->ip, field->parent_ip, iter->tr->text_delta, flags); trace_seq_putc(s, '\n'); return trace_handle_return(s); @@ -1674,7 +1677,7 @@ trace_func_repeats_print(struct trace_iterator *iter, int flags, trace_assign_type(field, iter->ent); - print_fn_trace(s, field->ip, field->parent_ip, flags); + print_fn_trace(s, field->ip, field->parent_ip, iter->tr->text_delta, flags); trace_seq_printf(s, " (repeats: %u, last_ts:", field->count); trace_print_time(s, iter, iter->ts - FUNC_REPEATS_GET_DELTA_TS(field)); -- 2.43.0