Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp49435lqq; Wed, 12 Jun 2024 16:22:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVD9EooUly/NeFb0Umyl9sUyon8v5kd7SkBWLq0muv28t2aHwkrMWaWVvg7kHswk/HXa39HHZWIsnX47sbIIn4YG7xn4O2XvKlozUrKQ== X-Google-Smtp-Source: AGHT+IEKzaQwZUbi4tzYWLNUS6HFNsHujrY6OH+TM2KD6HwSxeTo5E8813h2Qixf46l+Eazg2pog X-Received: by 2002:a17:906:1b55:b0:a6f:51b3:cbbd with SMTP id a640c23a62f3a-a6f51b3cd1cmr73359166b.4.1718234554646; Wed, 12 Jun 2024 16:22:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718234554; cv=pass; d=google.com; s=arc-20160816; b=xR9SDAQkJbV9kGFCmYyG92ilpo0+fO0wjz6ZPbNo3+6EQZ3rY6kvE43wPdAd23MFJk j9LyOEtplbWKPyZp7Yjz7BIs0A+mWpK5tampnYYFdWKFOAKWvRxOArRe/QMzgysFwgsE BhxKr2elT55/lKFxrqTB26prSV9eyKEmeaPuhyKlkeOCnqhe/p0ei01l7N7AFLlMUipm gLXf9/VoBezvjrveISBXxQWri6uWOHFclUZL5Xc/oSgQMPYUB5IWrOOpUS4mkM8Bi+w8 y4f6J7vV1nNuSla/7okscqYK2DRKza3q2lcjRoDsWGnuPIjCpqfpwVbWLgs8YXhmgetU cxJA== 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=0Bu3B2qLRYfBiSKFqAmhnMOX1IMJtzZgYC19ZpT3m5bpNI1c7JWzOa1lquRDOOS8F8 5oDtILfMQA8eWYYN1aPbqq4P3camfTdZuy5RUoAcY2PRrMpOOAUiIYMRLTTUsoSvTK4+ irZ56wATqITN2i239uvq6Sx4HppFrzrrVkQz9v8k0IN0Yk+zumt6E3lfWcY0hhqATLhm Ai9QP4EEQ3yysMnLatGfJ01sUXarwcb2cGvDFrUPhEXMjt86uecAUIrS4Vvmhf9kGsfb /YJ9Bz1I2B6q1q0dD2PRc+DIpXxZNFG2rRbZXd5N0WFeHz2tk7zIpEDqMezGCRW7BnUz cp7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-212372-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212372-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 a640c23a62f3a-a6f56d2141dsi5482666b.49.2024.06.12.16.22.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 16:22:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212372-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-212372-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212372-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 633A91F24327 for ; Wed, 12 Jun 2024 23:22:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C2BD136E1C; Wed, 12 Jun 2024 23:20:12 +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 2971512E1D9; Wed, 12 Jun 2024 23:20:08 +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=1718234408; cv=none; b=ZeB8FV2i/uTTryiU5Svsc5f2C289IMeOcUm+EbM8kuy5hBS9hj2iizpXvXBShBIcg5avJp9lJoA71ZhQ15v6rdPA2R0UT5UDAWl2ZQGnd3h0UABWsrfjdxiflVHPxQuE1plmG3dOzpJJwIpZlUIKb0CaV4AsRszVmzlgb091OT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718234408; c=relaxed/simple; bh=IE1IK2OKn7/pafSQ0ncO+HLzuopsT1q+/33iYZS7wTg=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=K8aZrNvq7aEvGRX6cjPIwCagufoC+EN/x8jaQX2lHIlkVKUD5o728wkUw7btkApCXob4DKVKEROKh92/+9lG2voWATULp9AJf3Trp6GykiwfaSGObWW7rynpXJ3ejgaSH6fBvioDloZ9xB+qzqqLpWUBozIvxDQOkSnbBV3ysRc= 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 04CD1C3277B; Wed, 12 Jun 2024 23:20:08 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sHXGV-00000001dfw-0WOA; Wed, 12 Jun 2024 19:20:27 -0400 Message-ID: <20240612232026.988226055@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 12 Jun 2024 19:19:46 -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 v6 12/13] tracing: Update function tracing output for previous boot buffer References: <20240612231934.608252486@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