Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp164254lqp; Tue, 11 Jun 2024 19:21:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6XyqyPb76jXWp3ey/S1SqR1ZJpCnsvQxEGhxWCEUik7Jzf7u+i9y/ma6+t+0m5Jcwvtk18Ynh8PNP0lxIUZEzcT61MBmbVerOC6mB+w== X-Google-Smtp-Source: AGHT+IF4Lmn0qVltO9QqR79z5gxplo/Q3FuZbr8Mf7RHuk3f4pRYIU6lCBoDuUAj5isx2+YiBoiK X-Received: by 2002:a05:6a00:2d1c:b0:705:a9dc:1bf9 with SMTP id d2e1a72fcca58-705bcee48ccmr635768b3a.31.1718158911634; Tue, 11 Jun 2024 19:21:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718158911; cv=pass; d=google.com; s=arc-20160816; b=gp/3BMdyNUqP4qm4thlhemSwqw4m87ZcWhSZ5FzVivHPa3L190q5rRSt3kNcc7O+sO e/dNdG9K46H+SeePGI6jZudsUekvzdn1NF2GY7lGmAGEbX1oy/5W+6xP/Lj4A4D1Mowt oMw1qrQKaa5HVYb4pR69pATNk3iwTC2SL+cyHji3uXHTDn8VK+7EUn5l3EjI7PUTfM5y a21HIwEuXKJb3Zg3gqx0UZWbP74eAs9uSXgut+eulCYWP0vtwOaYs7yLmmynmdsuQpBD fwqOX/1zD4bcArNA48RSpeHHIAdWd76S9iPCPoLGTC5SKYpQ+JSc14xouF1GQ8sEo5w5 DSaQ== 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=fLOixiyHGNibbgdyG2YKY/jM4gdfnIDMEB5ayaFE2a+xKhiJI9LThZx703Y1L75hvy BZqlXXqAgoc3ll+bhK7bNY3zjxlR1aPog+2OcXgTOrP1p/uRlDEQQYiwIDqn1VNjLQd3 2hsUtreeTecJi78QNEJffMpqrtjwqWN7JBowsRtcMv3qB8T/11UQtykVleZCINc6tGhz 9dBXBYGmJcuA0CognOQZnaiBk6C68gznjcaVWh2fDyeATfxzq/eaZCF8t6qvAjPnLKiO QzN9sz6gZGOfrF1ebftuSsXx8eu4bB7Om/OC/gzrhJH+cSSu+YuE2EJ5braAA7kqHckr GUlQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-210811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210811-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-70420f42c18si6775782b3a.191.2024.06.11.19.21.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 19:21:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210811-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 (google.com: domain of linux-kernel+bounces-210811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210811-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 D88B6B23FC0 for ; Wed, 12 Jun 2024 02:19:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 348584EB23; Wed, 12 Jun 2024 02:17:11 +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 64AEF219E4; Wed, 12 Jun 2024 02:17:07 +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=1718158627; cv=none; b=YbZQScllsJnyDP3pYCxHypF2hyPPlFhzv7UCVU6dskzgDCKoslPUmTtjxpruJV4uQX61+c7YKBV1u01gbwv5u/u+SnPkCwZaHFZzNN8104wXT2jNp0p3nzE0E5XyiuV3oAAw780QQoiKItcbZweQ9XkmSn17+pChBesGnM4w5v0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718158627; c=relaxed/simple; bh=IE1IK2OKn7/pafSQ0ncO+HLzuopsT1q+/33iYZS7wTg=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=Ime2h42TBND9sVvPhV9xLMcHJaxEymszzKeiLvKOgcs0fwGE0ebCSuVI9x/MqM9XmkwK4meDMgWhGcTqgGhEYVbDVyYUzdqGFBM83Waim0a2J0G5x9atK1BGDrMHioRDHw8y3pR3bQif6gfTWXMKrbx+XE3knUGwlva6xAyY/nU= 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 13E06C4AF50; Wed, 12 Jun 2024 02:17:07 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sHDYC-00000001XOh-0gKW; Tue, 11 Jun 2024 22:17:24 -0400 Message-ID: <20240612021724.022660136@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 11 Jun 2024 22:16:54 -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 v5 12/13] tracing: Update function tracing output for previous boot buffer References: <20240612021642.941740855@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