Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp653071lqt; Thu, 6 Jun 2024 14:23:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV0fuPCerfIEdhF8AJOSBz1zLvUPYa5lqfm36RL4hSdNSYb2HO8CtHdQ5y0xEetN/C2xGwOY+n+/3z3stjfiGDMRG2Kse+x4+dOHciRYA== X-Google-Smtp-Source: AGHT+IGZjaqfZhGIgKroq9E0EvYDGysoWdZmruUj+mw7/xk3RBcQFkY9pfFA0Jxp3+slBA4cZ1ew X-Received: by 2002:a05:6a21:197:b0:1b2:5e40:bc63 with SMTP id adf61e73a8af0-1b2f9ac9dcbmr900413637.28.1717708982471; Thu, 06 Jun 2024 14:23:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717708982; cv=pass; d=google.com; s=arc-20160816; b=CBUZ7drdpH2yj2ntIcqwx+oUfjv5hahSEWrsuGv84aBB2sb3r7ZH2rkoqc8x9Fzb3M 8bopNka9noC325Maok33YIaM0CxsjIvFlWv5d1tIqYJmGqSr/c4qqjtRYPGGubfk3x1l 2Gfi7rk70fbV06KUIzYNj0ov6uLkPsaXHWX1LEsak1AwtToMouZVNjhmJYHmKqUgqoJF /dRpElMlHL5phMd+UMmv+sMAfKZlRXg3xkZrKRjioQvs+/E1MGLJH7t0iEpWyqwz7sFP psWJbK09ufx6hau7MjFPzPthRIPrvZvUejPGLwHslmS7fqEQFyJps4stzjhCERoQZqaP OOfg== 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=C4es43N0UnjjpyWzsXGGQ1MS5cBZpVKt+KVqqIhJmOCV9DKGLKeF5+ODLDcp5BRsVD 6N8S7RdSpRNvdZ6dJsKcvY3R3PInjLEdQMXv9xWpzf53E0BoorSXYaslq5Z0N9Iypc/M Ah4jFaZ/tTxn2cNuqmH047H7IPOuQ8Wsu6I5HXfxiS3Y0jhU1+m9Tk0z2/VMGLvbcgfX YFPyKY/kZ8Z/dyeU2NiQ4cZsO0c9lpmEbsvjTG9ZfAw4DOQgCyBG3Pyr0PcxcmGk88Y/ PD8OE3GGK1WtGempH06etgIaW+jyLB+I3dGIktUfBx5Qha8Eqf9Z/KNZFL0Xw44bMX4H 44tQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-205051-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205051-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de275fe660si1744942a12.514.2024.06.06.14.23.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 14:23:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205051-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-205051-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205051-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6AC87284E92 for ; Thu, 6 Jun 2024 21:23:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2034A19AA75; Thu, 6 Jun 2024 21:21:35 +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 C9A051993A2; Thu, 6 Jun 2024 21:21:32 +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=1717708892; cv=none; b=aBcNK1MU5u0smiFbw2Ksg+ZOeIaDPpE48qegnArz/r7sQeoCo8eunZ39CFJj8l+ussslBaV8Cs1Q1WqI58P63q2oMPTL3z4Q7j3doNkS8mWGFAwMZD/DIXRaxjBw/Ylb8T5YE2z/yHmqmEQYi7RTbUGH0HkSmUV+ENcMfCmrHPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717708892; c=relaxed/simple; bh=IE1IK2OKn7/pafSQ0ncO+HLzuopsT1q+/33iYZS7wTg=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=pe200Fh2uCZQFjIMK7q735jwWxX5fqNF3eB8jveacBJC28ny3KfGghBCKZYXEls1e1j3hoWUWVBtONYTMZDh8RXcIbSukBxx8kCppZvj4uxfvyK72d3kEp31dl4vT/bQEQm78p8XSMTvu7UZ3u1bF4sO55SsslZasJqsRp73BWU= 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 B1267C3277B; Thu, 6 Jun 2024 21:21:32 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sFKYE-00000000qNC-0Urt; Thu, 06 Jun 2024 17:21:38 -0400 Message-ID: <20240606212137.979724516@goodmis.org> User-Agent: quilt/0.68 Date: Thu, 06 Jun 2024 17:17:47 -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 v3 12/13] tracing: Update function tracing output for previous boot buffer References: <20240606211735.684785459@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