Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4844076ybl; Sat, 21 Dec 2019 15:28:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwHXckIrMZ95cAo/AqtRx+T+2oC6pHXhGo+xd+V5Ku7aI92cJZd2WWlDGiI4lbDYgx8FsTv X-Received: by 2002:a05:6830:1e30:: with SMTP id t16mr23934474otr.220.1576970931696; Sat, 21 Dec 2019 15:28:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576970931; cv=none; d=google.com; s=arc-20160816; b=U9ueGlsFZRUhKt7rbkwsEhv563vDUPWjLwKRbhpsxv519+9iCCv1Pb9I7g5/TX7zIT RAh8bzWi8H26+rcb9vvZtfOFyjzzqfXEHD4tKOVEjIVBYXQUOzfrlaoSB+xnKYPReqcQ K7xgLyTvzBofR9nX3l8GF1S96IxMxxjCLaoB8Sr7rRwku3dWsfxxAk/MSKt+cOi8xnHM ecQvJtO++6fRm+C5e25F4JcDtaUaZyaQMLF1ysLCYck+tPGWocdmODSrGUIcNP2h9jBm Z5iZZzOK6xIHpcQja8DFoq7QY7uN2iR8zX4a7MD/w660Q6hrnUvB8fysFMr0N/Yl93hv rTHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HEmZZukzj2SW5GPtr7DXQtejZIIVJMFpYqi+rGbIeHc=; b=i4+cGuHd6lAXdLhv5RqwpUwDUYcqGQkmHBUFgb2M40uDaoJZdq2YpAWSdWXZuV9nfq PY8tiZ5KqUjCopPvq8dxuUsYfM8qD6bViQz0azea/XYflPvJtoRnHQIlL2XuNH89dK76 aDveJMhvJd6lF1Psam9HwWfF5Z/DENbZD3aPwyCeVc6/PikRSZD/Mp+x9+CLSyq3hKH3 MbCmHOV3IE9+7GT85Yn1Gphw3rlV02FZGubs7vHPk9AFxsgMMrVFdGMAWKkMO4YCrBbR 4esjwi+WWIGSH80AKQ6NN/IjOqe7UWFwP5WTXk+v5knnAn+YDex++IMpITIawIA7TEYs seDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=qCRXjEvK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 45si4957285oty.188.2019.12.21.15.28.38; Sat, 21 Dec 2019 15:28:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=qCRXjEvK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726521AbfLUX1u (ORCPT + 99 others); Sat, 21 Dec 2019 18:27:50 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:36000 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726024AbfLUX1t (ORCPT ); Sat, 21 Dec 2019 18:27:49 -0500 Received: by mail-pf1-f194.google.com with SMTP id x184so7247664pfb.3 for ; Sat, 21 Dec 2019 15:27:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HEmZZukzj2SW5GPtr7DXQtejZIIVJMFpYqi+rGbIeHc=; b=qCRXjEvK3FW59zErd5qNjoropEEmHyOByBkC6gLLJEKM/tbqmfCDxExpAjsYDuo2cK ZDrYTc1+CvI1vWS0dH5wqQhEgDnkhJUMKyko6t7w9wpbHItBNelMLeA6DsxKfdNz0NWe 9IMtO6GpcvUgZgLyR15gOz068sDit9g+Degp4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HEmZZukzj2SW5GPtr7DXQtejZIIVJMFpYqi+rGbIeHc=; b=cR55TUDIrVdxKEXdnGEqEzve/TL38wqWSzXt3Yy8+A+xYOJMSUqSWp3UuOSFMvOxrt /cgkQ/4UgK8HJP46qFJ0bAzQRm37hU3dnpCFTkdU296wqlim1hLyiA7cNqdYW8rWrkmt 7SykfJSEVS8DKU/pjRgG7UUozX7y9XqWS2P6OVjGy/5eoafDRlJHCp0eJQEx3v+OlLip 4ZOMOyMuEtBGa0xx836ePQcXjBot0WCUoagp1aXNLs28Y65hgt/SOwmjYYwNxYJPwtry RD8+fBgq1ueFGcFAqFbp6YnbwRx37aQOIqLYA8z5dntatjuGhEFI0nIA4RpX6fbczfzl hCxQ== X-Gm-Message-State: APjAAAVwxy8XcC88A/OQbtJOzLIWshBD4tLiS078oNL4QKxJlEiZ4k9U Rr2Zlh2IeTV41GCLTuzWWB5/4A== X-Received: by 2002:a62:8f0d:: with SMTP id n13mr11417163pfd.38.1576970869113; Sat, 21 Dec 2019 15:27:49 -0800 (PST) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id q7sm15456513pjd.3.2019.12.21.15.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 15:27:48 -0800 (PST) Date: Sat, 21 Dec 2019 18:27:46 -0500 From: Joel Fernandes To: Valentin Schneider Cc: Antonio Borneo , Steven Rostedt , Ingo Molnar , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, ambroise.vincent@arm.com Subject: Re: [PATCH] tracing: Fix printing ptrs in preempt/irq enable/disable events Message-ID: <20191221232746.GB67625@google.com> References: <20191127154428.191095-1-antonio.borneo@st.com> <20191204160407.GB17404@google.com> <6b5b74cede87a61d5f04f2a95bc4389830467fe9.camel@st.com> <68b3b7db-d278-6cd2-f2b6-cbba05df6db4@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <68b3b7db-d278-6cd2-f2b6-cbba05df6db4@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 19, 2019 at 06:45:25PM +0000, Valentin Schneider wrote: > On 07/12/2019 00:00, Antonio Borneo wrote: > > At login: > > trace-cmd record -e preemptirq:irq_enable sleep 1 > > trace-cmd report trace.dat | head > > and I incorrectly get only the offsets to _stext: > > cpus=1 > > sleep-197 [000] 280.378022: irq_enable: caller=0x1afaS parent=0xc00091S > > sleep-197 [000] 280.378026: irq_enable: caller=0x54d34S parent=0x78e00000S > > sleep-197 [000] 280.378029: irq_enable: caller=0x1afaS parent=0xc00a84S > > sleep-197 [000] 280.378032: irq_enable: caller=0x263dS parent=0x78e00000S > > ... > > > > With this patch I get the expected/right result: > > cpus=1 > > sleep-210 [000] 525.177583: irq_enable: caller=trace_hardirqs_on_thunk parent=entry_SYSCALL_64_after_hwframe > > sleep-210 [000] 525.177587: irq_enable: caller=__do_page_fault parent=(nil)S > > sleep-210 [000] 525.177590: irq_enable: caller=trace_hardirqs_on_thunk parent=swapgs_restore_regs_and_return_to_usermode > > sleep-210 [000] 525.177593: irq_enable: caller=do_syscall_64 parent=(nil)S > > ... > > FWIW Ambroise (in Cc) and I were staring at some irq enable/disable traces, > and encountered exactly this on a Pixel3 running a mainline kernel. With > Antonio's patch we got the expected result, so you can have: > > Tested-by: Valentin Schneider In BCC, we use the binary trace record of this tracepoint and don't interpret the text output. There we lookup _stext value (I believe from kallsyms) and then apply the offset to that and do another look up for the final symbol. Would it be possible for Ambroise to work more on this patch so that the trace record size is not doubled? > >> I am not comfortable with this patch at the moment, mainly because it will > >> increase the size of this rather high frequency event. But I'm not saying > >> there isn't an issue on 32-bit. Let's discuss more. > >> > > > > Sure, the pressure on the trace buffer will increase on a 64 bit system, but in general it also has more memory than an embedded 32 bit system. > > The key point is, instead, can we feel safe with a 32 bit offset in a 64 bit system? Is there any guarantee a module is loaded within 32 bits offset from _stext? > > > > You're better placed than I to know if and when this is the case, but I > wouldn't use this in a production environment. To me this is more of a > debugging tool (and a really good one at that), so I am less concerned > about the memory overhead. The issue is with poor trace buffer utilization, you could overflow the trace buffer more easily, and lose trace data. The reason I came up with the stext delta approach was precisely to address this and it worked when I was using this tracepoint. Let me find some time this evening to work more on Ambroise's patch. thanks, - Joel