Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp170780lqp; Tue, 11 Jun 2024 19:38:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUNwz8Kj1zbeXalikEVN0c7fVbU9xXgbnRJrZFaH09hqXxDDqYuXy+mW/Gyw2rNd2ipi0cFO2a9TZAvmdBfGGZup4qrxrN9dhClVoLTeg== X-Google-Smtp-Source: AGHT+IFmD5gXAk3EbFwsY5Ga2zb0j84QYHODdCnxPml0oRpdmEM16+Yr3d/XWVnrWEab3z4coFtM X-Received: by 2002:a17:90b:b06:b0:2bd:8378:af81 with SMTP id 98e67ed59e1d1-2c4a7602018mr671026a91.4.1718159932921; Tue, 11 Jun 2024 19:38:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718159932; cv=pass; d=google.com; s=arc-20160816; b=mGqQNd3iW1UdIvo8qO5pnZCOSaPMYs1KRvRwOqd79CmpXJs2SEOgeF9lQO9TzJ09en XU+HF6UUdugHbny/8eeKGjOYAS/hx3QyxD9eAic8IK1pEkM3uXsLskWBKne+mcvnJqZs dwpQJZNDP4WTTlyuBHLmYaTYNNh1XIyM6iDLCsDTItKpmNPgvSsG+qOToXVDT8srN2Ce fZLPa/Ez73pPj53TEFkfY4NSZTfCUI0vhxr5c4rtlfAam66yv30s1yxmmFWKPNJ342RB jelifUd6SFp/qyHKUGHJ5zSsnZkAsjX9o6f7lQyHyiCLufRYIGdEAoc5nVVMyDk0L0gU fBQA== 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=UVJH6bUlt8JB/EYivzSWWNiS95y8mP57Ec9jh1W8N7zFHuDON7L0W+EqozHn8y7Hna DdTSplaXib6PuN56lrJQPVlzyZivOLDd4z5jrPSWk3c4BtTZYO2GenOZ+BYZOC/WsgUJ 3mnGhocpA7H4NACSdOaGJBD97Mzt/88qMYazwrS23UkbLKTa4hUpEZ6mjNni3DpQq9NY j+t3RKnKHUvLeq83/X6uRrM8uZX5YixQ+yqmt1dX/mNItzjIw3KjpQMw03vRX4duXjbR zgZrwUBo+L9lboORhOl/wE5U9GQmAJJaYifiItVer3qy7PDq0DaYvOFaS8ZS/R9RpenM 7S+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-210812-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210812-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 98e67ed59e1d1-2c4a75fbd3esi493591a91.66.2024.06.11.19.38.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 19:38:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210812-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-210812-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210812-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 C77A72883DB for ; Wed, 12 Jun 2024 02:19:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7DE88537E7; 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 8C51025605; 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=S7qA4EsIXTjb6j/bOONqn7pOQYTbUGobrVxAtf3b/JEbbudA7/elpnZX4/+dmKvfXk0VloeV44dEwL2Xr96EF4rg9V8ByD3gwfXJe8Cznc7jbSzQPj1NBvUAwBaI70UFev9TmAZpMDm9cvplmCuvcwTRwMUKe3duy1zso9RWKBI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718158627; c=relaxed/simple; bh=5vY8upmAWCSCeuI23auVBMfapEFPUJFegpBwQdZuq6o=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=CdlSOHnky92tkG113cPSTUaBR3D9Aw1thCSodiDKPS6q3tUDgfEz7v8ThJRZA0MnKTxnWQljoYkt/+79HxdNO1g57WFPcMudARp44EvhZSuF1zuvcMMlrC2VyzwNgdSxUQlAejMetPi+0jTNHJosciq+DSSlZKW/HRioP7F10C8= 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 3B476C4AF62; Wed, 12 Jun 2024 02:17:07 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sHDYC-00000001XPD-1MxJ; Tue, 11 Jun 2024 22:17:24 -0400 Message-ID: <20240612021724.184338670@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 11 Jun 2024 22:16:55 -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 13/13] tracing: Add last boot delta offset for stack traces 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)" 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