From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E752C432BE for ; Tue, 3 Aug 2021 13:24:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D52460F11 for ; Tue, 3 Aug 2021 13:24:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236310AbhHCNYZ (ORCPT ); Tue, 3 Aug 2021 09:24:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:35752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236228AbhHCNYX (ORCPT ); Tue, 3 Aug 2021 09:24:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2A4BC60EB9; Tue, 3 Aug 2021 13:24:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627997052; bh=o3dWD+NtSdOsjF8zTizWlT8Zz2qjfP7d2UK7eV2zcx4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oJoyztAawT1ekxaSi4QoOSf8H2WrU+IKOIlgDS8KtFz3nQ4oUmlWnfqwAcGPOIgRm ixCJbu5S8Xqhh4OAXzLmtnVDiWessoBrsi/L5dQVGv6ki9aYpoPOXy4zSuJA8snbk5 1lLsiIhsj4Ew57bxMAqaPeM+AyyFVYMFZVC3X+9Ajk+W5GErX4ZQhm2Bim2mWdWZdM nhIIz68trv6MAYiVrzQ29JYwY+7/YqP5rQF8L14L3Gd1ITp/PQnA2nN9yuCFvCJX7u 0zC5DlaLeW8MvuXieoV82mrA7aAhyYQx3G1t8tWe8C9UQ8Q3qL0rA5WZYzaHdFYYsC 9dEX8IN7OVnOg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 2F5E9403F2; Tue, 3 Aug 2021 10:24:09 -0300 (-03) Date: Tue, 3 Aug 2021 10:24:09 -0300 From: Arnaldo Carvalho de Melo To: Leo Yan Cc: James Clark , mathieu.poirier@linaro.org, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, suzuki.poulose@arm.com, mike.leach@linaro.org, Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , John Garry , Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH 6/6] perf cs-etm: Add warnings for missing DSOs Message-ID: References: <20210729155805.2830-1-james.clark@arm.com> <20210729155805.2830-7-james.clark@arm.com> <20210802154145.GC148327@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210802154145.GC148327@leoy-ThinkPad-X240s> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Aug 02, 2021 at 11:41:45PM +0800, Leo Yan escreveu: > On Thu, Jul 29, 2021 at 04:58:05PM +0100, James Clark wrote: > > Currently decode will silently fail if no binary data is available for > > the decode. This is made worse if only partial data is available because > > the decode will appear to work, but any trace from that missing DSO will > > silently not be generated. > > > > Add a UI popup once if there is any data missing, and then warn in the > > bottom left for each individual DSO that's missing. > > > > Signed-off-by: James Clark > > --- > > tools/perf/util/cs-etm.c | 10 +++++++++- > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c > > index 32ad92d3e454..e6851260d059 100644 > > --- a/tools/perf/util/cs-etm.c > > +++ b/tools/perf/util/cs-etm.c > > @@ -746,8 +746,16 @@ static u32 cs_etm__mem_access(struct cs_etm_queue *etmq, u8 trace_chan_id, > > > > len = dso__data_read_offset(al.map->dso, machine, offset, buffer, size); > > > > - if (len <= 0) > > + if (len <= 0) { > > + ui__warning_once("CS ETM Trace: Missing DSO. Use 'perf archive' to export data from the traced system.\n"); > > + if (!al.map->dso->auxtrace_warned) { > > + pr_err("CS ETM Trace: Debug data not found for address %#"PRIx64" in %s\n", > > + address, > > + al.map->dso->long_name ? al.map->dso->long_name : "Unknown"); > > + al.map->dso->auxtrace_warned = true; > > + } > > This is very useful. > > Just one comment: in particularly if the perf fails to find the kernel > symbols, the user needs to enable config "CONFIG_PROC_KCORE=y" or > specify option "-k /path/to/vmlinux". In this case, using 'perf > archive' is not helpful. So I think the UI warning can be imporved > like: > > ui__warning_once("CS ETM Trace: Missing DSO. Use 'perf archive' to export data from the traced system.\n" > " Enable CONFIG_PROC_KCORE or use option '-k /path/to/vmlinux' for kernel symbols\n"); one can also use debuginfod-client, which, as time passes, probably will be the main way of finding DSOs now that we have build-ids in PERF_RECORD_MMAP2 and debuginfod servers such as: export DEBUGINFOD_URLS=https://debuginfod.fedoraproject.org/ https://fedoraproject.org/wiki/Debuginfod > With this improvement, the patch looks good to me: > > Reviewed-by: Leo Yan Does this apply to the other 5 patches in this series? - Arnaldo > > return 0; > > + } > > > > return len; > > } > > -- > > 2.28.0 > > -- - Arnaldo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CD78C4338F for ; Tue, 3 Aug 2021 13:36:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1934D60F48 for ; Tue, 3 Aug 2021 13:36:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1934D60F48 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Aw5obOwt7NkvDhi3XLKX/69DnUxlRK6HLHWApCnXXnY=; b=ATAIgT1sCosC85 wmbabW0lQfBV7Tck1gsLxJWgdlloESOcA8mnEo2ekDm1BAQEjJTtIhgY2KwFXAdh80M8FxqJpfGIf ArSMeccM9twZRAe92YZwtoA7XZAJsytUilxGSHf5Ph9zZarTOmdj83/wHpQ8hBwh4714RgCBnlZes L2yNiwwDRp1FtbD/pApckFBzw/BLleL0n2dx93IMotrkDRmvKHiBqzXYKjyDeq2s0x2IS9R2NQLIf J2d+qVFxbkILGjqFhcqpOM9JaQIUt0PvwluUBnl0Sbh14Qmn9IHZgoR8q/Q0lmlUVXuTY0qr+3I9A BzaZAe4AQtVJnk0BBQTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAuZ8-0033mX-6n; Tue, 03 Aug 2021 13:34:43 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAuP1-002zOW-QC for linux-arm-kernel@bombadil.infradead.org; Tue, 03 Aug 2021 13:24:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ftCqUjTqzSACfqUwpluu//LlESOSDcrxXvHSfn6+DpE=; b=MlDGz/n7FahLdMlJXIp5fbAUCJ eNYQoxkLbCbahaJKDkYyCrecZptAevRh5EfEsRt04wA6DA7eBGYA7K39bDvXUU+moSRKVs14uCbbZ xghE7cb11VK/09LvnJAC79J7uDp3c4lu0YaR73811wvX5YUA/7nSZGLmdXP464k/S2aJVM61r7Cjn PtyU7Ob3NQW2VVBYEKRZaGvRmVd52EM3vtvIY9smFE9X52Y9moniwUf3NCrJY9rT0y+h9rVR793BD Dy6F5trLH6gxJjBc4kVJ9zqbIwczvDruHNogG/Y6j1NmIaT+IqAnzjgl3s7BXLroSQjDD21UXWbzA dPPkLNlA==; Received: from [179.97.37.151] (helo=quaco.ghostprotocols.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAuOz-005QCS-HB for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 13:24:14 +0000 Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 2F5E9403F2; Tue, 3 Aug 2021 10:24:09 -0300 (-03) Date: Tue, 3 Aug 2021 10:24:09 -0300 From: Arnaldo Carvalho de Melo To: Leo Yan Cc: James Clark , mathieu.poirier@linaro.org, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, suzuki.poulose@arm.com, mike.leach@linaro.org, Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , John Garry , Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH 6/6] perf cs-etm: Add warnings for missing DSOs Message-ID: References: <20210729155805.2830-1-james.clark@arm.com> <20210729155805.2830-7-james.clark@arm.com> <20210802154145.GC148327@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210802154145.GC148327@leoy-ThinkPad-X240s> X-Url: http://acmel.wordpress.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Em Mon, Aug 02, 2021 at 11:41:45PM +0800, Leo Yan escreveu: > On Thu, Jul 29, 2021 at 04:58:05PM +0100, James Clark wrote: > > Currently decode will silently fail if no binary data is available for > > the decode. This is made worse if only partial data is available because > > the decode will appear to work, but any trace from that missing DSO will > > silently not be generated. > > > > Add a UI popup once if there is any data missing, and then warn in the > > bottom left for each individual DSO that's missing. > > > > Signed-off-by: James Clark > > --- > > tools/perf/util/cs-etm.c | 10 +++++++++- > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c > > index 32ad92d3e454..e6851260d059 100644 > > --- a/tools/perf/util/cs-etm.c > > +++ b/tools/perf/util/cs-etm.c > > @@ -746,8 +746,16 @@ static u32 cs_etm__mem_access(struct cs_etm_queue *etmq, u8 trace_chan_id, > > > > len = dso__data_read_offset(al.map->dso, machine, offset, buffer, size); > > > > - if (len <= 0) > > + if (len <= 0) { > > + ui__warning_once("CS ETM Trace: Missing DSO. Use 'perf archive' to export data from the traced system.\n"); > > + if (!al.map->dso->auxtrace_warned) { > > + pr_err("CS ETM Trace: Debug data not found for address %#"PRIx64" in %s\n", > > + address, > > + al.map->dso->long_name ? al.map->dso->long_name : "Unknown"); > > + al.map->dso->auxtrace_warned = true; > > + } > > This is very useful. > > Just one comment: in particularly if the perf fails to find the kernel > symbols, the user needs to enable config "CONFIG_PROC_KCORE=y" or > specify option "-k /path/to/vmlinux". In this case, using 'perf > archive' is not helpful. So I think the UI warning can be imporved > like: > > ui__warning_once("CS ETM Trace: Missing DSO. Use 'perf archive' to export data from the traced system.\n" > " Enable CONFIG_PROC_KCORE or use option '-k /path/to/vmlinux' for kernel symbols\n"); one can also use debuginfod-client, which, as time passes, probably will be the main way of finding DSOs now that we have build-ids in PERF_RECORD_MMAP2 and debuginfod servers such as: export DEBUGINFOD_URLS=https://debuginfod.fedoraproject.org/ https://fedoraproject.org/wiki/Debuginfod > With this improvement, the patch looks good to me: > > Reviewed-by: Leo Yan Does this apply to the other 5 patches in this series? - Arnaldo > > return 0; > > + } > > > > return len; > > } > > -- > > 2.28.0 > > -- - Arnaldo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel