Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp653415lqt; Thu, 6 Jun 2024 14:24:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWB8xPDbQMSFEojXSYT0skDsl3jYO7adMqrrPBPzhZ2MIyKLcuf5Vb4tU+wxOPgmmjB4lYJXggTUj8WJCq42+twPyNKSfGlpSkq7/j+MA== X-Google-Smtp-Source: AGHT+IEj/OesVqSbPwehMDOzeCyeaMRKF6ru6FFXyoLhvFp/jl3GOGRdIUuNuiIxkKmYTaCN0x26 X-Received: by 2002:a17:902:c145:b0:1f6:6ad1:fdf9 with SMTP id d9443c01a7336-1f6d039b757mr7131085ad.57.1717709040667; Thu, 06 Jun 2024 14:24:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717709040; cv=pass; d=google.com; s=arc-20160816; b=HpiBHDfeyHDKNH7uKdflJ2BhVlahLGH4sDGPs4Z6imQgFawWs50yHy1DxmWxdOlFzo 81dhzITOz36giQK3CRt7wejrs3p0fjCY2fdd4w7nxpP4m/uAI3GEOgNiAf7D77v2GS4X vzkgMFBvhjwF3pm5+rB+s8FTRpryBic3JUt1hR2vLGKlH9JaFi02RZek+VBxg2CqHdiJ AJSZsdY7sm2sYJwPmcqwc/MjnUpCIO7Eiw1YRVXAhqqnm/tZ4WWvQZEBhF0lvxkh5FS7 77IzdAIx3j9XBxQIkEtnvcktlfo8lLpXdXIc9q2WtQF1PHreMtJN+4cYwUjI3UrY/TWt A13Q== 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=LOpfYHaJiBdCXVhEX4C2/jc5/RcduUrQviah1CbqdQc=; fh=VQi8WXJrSHXxsfwqC9oAfi6LEiQC0Qv/w+aqrHCHJLs=; b=nB7aAnk5I3JSopYLIfMWcBLU1lVhOlmMW2hUA4fFXAu+gyoavf1GUaUJ3j4DmCBkOy 0/+YqNPb3rXAJUb8DhbypQVB2twWqXVnoyJ+vEjX4BcxuN5fAOgVGTSOMCvVbiQU8PgN li1A5eYNiUFGPcdFzlmscDlLcTPY8ucd1pXtkAnJD8hNQtiYXXtICioWmbtWXdeu7QA7 4gOF7NpRuMLbqtS5v9virj5uXL3VIbmrNxJ8GaoEtOd2Fq85PHcPjx1sCI9QPAa0aoKQ PGdDUoGeUIuD0NxS/laNEeGHLmxWig6Z6kgx/elpBzbvCgQXh1yF9wtFitfSkaSDk3FK 9Gmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-205054-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205054-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7e4d79si17782855ad.399.2024.06.06.14.24.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 14:24:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205054-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-205054-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205054-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 4DD0A28769E for ; Thu, 6 Jun 2024 21:24:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E329F19B3FE; Thu, 6 Jun 2024 21:21:36 +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 EF572199E84; 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=1717708893; cv=none; b=LaLnPnOQVYoMzpyX3jzNqXDYUPfJHgNte0KoCrRokyD2roOfOr3ptS77Y7wSL00GPLM0yN4ZFYmHzTpgjyhCYU71mrGbALt31+Y2QvqDDKa+7UmkT9g8NkLtb8Ls3nkbuFaJzvFk6YUl5KUzKOrAbRVXVWMzGEga8Ww+faYfi2Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717708893; c=relaxed/simple; bh=5vY8upmAWCSCeuI23auVBMfapEFPUJFegpBwQdZuq6o=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=D5lqPFXLwnJ4kZ4cGdX73Hub8eyh1o/KInmwi7gX/ZGOJDb72XUQj5xauvHrdf8lZE21ZsAuiy66ff7OeonlFeoDxfHkJ0vvhUbQhCfMksAl3xH2K/Jstcj4zD8DBJsOjJcB/K0CA4W5J6ehadeSuZZ8XjitpVujU9Ge35ZG1CY= 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 D5983C4AF4D; Thu, 6 Jun 2024 21:21:32 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sFKYE-00000000qNi-19yO; Thu, 06 Jun 2024 17:21:38 -0400 Message-ID: <20240606212138.138119709@goodmis.org> User-Agent: quilt/0.68 Date: Thu, 06 Jun 2024 17:17:48 -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 13/13] tracing: Add last boot delta offset for stack traces 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)" The addresses of a stack trace event are relative to the kallsyms. As that can change between boots, when printing the stack trace from a buffer that was from the last boot, it needs all the addresses to be added to the "text_delta" that gives the delta between the addresses of the functions for the current boot compared to the address of the last boot. Then it can be passed to kallsyms to find the function name, otherwise it just shows a useless list of addresses. Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index b9d2c64c0648..48de93598897 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -1233,6 +1233,7 @@ static enum print_line_t trace_stack_print(struct trace_iterator *iter, struct trace_seq *s = &iter->seq; unsigned long *p; unsigned long *end; + long delta = iter->tr->text_delta; trace_assign_type(field, iter->ent); end = (unsigned long *)((long)iter->ent + iter->ent_size); @@ -1245,7 +1246,7 @@ static enum print_line_t trace_stack_print(struct trace_iterator *iter, break; trace_seq_puts(s, " => "); - seq_print_ip_sym(s, *p, flags); + seq_print_ip_sym(s, (*p) + delta, flags); trace_seq_putc(s, '\n'); } -- 2.43.0