Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2529300pxb; Sun, 23 Jan 2022 07:33:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyptURU4/bVgFaSR/jBIFnCJgh+ooPKzFHcQuftFMGJLOWetve7edrGvIgiTqUoKO3OGEAx X-Received: by 2002:a63:2c47:: with SMTP id s68mr9048505pgs.97.1642952011078; Sun, 23 Jan 2022 07:33:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642952011; cv=none; d=google.com; s=arc-20160816; b=eFqzVuYZ3Mhd3F5R4vSsJg5yZhhHYhK/meC49NZGuD62RX3Acm0JsTsHrxWmEIlzcN dPi7dLeqPu/JCe6f1KBptub33yMsPHVpyWmmQQANwhvPV3vSpIDiIQ7Y1aLna9hyr9Jj y/WY0aTeY0btaSQMKi6NAKh5/Qcf8fYJ1pHwNWSsnOwNUBmeD/5Ca1me0fOvQl2JlXfY /dBGWD+x+D+23F5ySUxX2i+N8ftMHvljkTC5gUBrkvZNjbI6JGhRzd1fjlMT1U/ieRCH S6ID92afUGmks4/fauXKM+8a81K9230Rnb/B6bxHaFnzG12cBWwsSLpgHMZf87ZzT99R I5ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8yCfG568I9uh9ZuBOitVxeip3OObCwlb9vER6veohd4=; b=Wk7c02CkAXUj/M6uszyXIgLX0SjozYrPnx/uP14eTJW2byLtzjHH4cHySt0TqeM59c 3lm2Mf3Y13yR0pcQyKA9LyhxdyMS6nUh7NPPPwmcyEzredMc7V37dfzc6zbxvFmCRJLU eTBNJG2zDb138B+e5XlvvIZ2w4yl0tCNgqLoMfhcCmUiBckSh42+sgk3PJSK+sRxdLyq /5iyzSstlVY7GKyqkG8JsKnS8edoq+k/Cd+Lr3qbdLv+IrUalAsSnEY9h1gKU9uNqHgr 722rtmHL334PMJi5ekYGkW27qd0NlCmHhFrjr/bFgTbRcNz7iS8qjqDFtOF4ol+BcG/C m/vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VIfyIMbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k8si11840412pgc.268.2022.01.23.07.33.19; Sun, 23 Jan 2022 07:33:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VIfyIMbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229883AbiAVUGL (ORCPT + 99 others); Sat, 22 Jan 2022 15:06:11 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:37292 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiAVUGK (ORCPT ); Sat, 22 Jan 2022 15:06:10 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D5FAE60EC1; Sat, 22 Jan 2022 20:06:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15B36C004E1; Sat, 22 Jan 2022 20:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642881969; bh=TzlIuH0eohtwYq5erGMyQFRL/wM3ys8GwJ+OKgjQoKY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VIfyIMbGswf/HxetoMXm5oUp/m83n4NHiWrQ0ynZ8c+CgEYnpu41HojHOrWBslhDD iYXmMuVTyMeZ7hdCxSOtKuTGGx0G2hNRXGYbwkUK3qeNZfQXd2sfbDt84Wuwx4srgm DHA1Q7jnykzgLsUz3JC8bofeK6NRn+xgbvfNnOJN/P1V/UJVZ/sRj69pDQbsQPLRuK 3B5ihGXSC2Ct/WDJDrIYaQkDtZhSnAbEDkvIBs9z6lq2vXxc8Ymml9hIVEkt52c+JI kaLtpC/2lKANLA7VVWS/l4eF1XW7OGk/1xiSwR/tT09aee/iZ925nZ81LmzyLMOkDz O5R21SnU9MrVg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 6C21340C99; Sat, 22 Jan 2022 17:04:07 -0300 (-03) Date: Sat, 22 Jan 2022 17:04:07 -0300 From: Arnaldo Carvalho de Melo To: German Gomez Cc: Wei Li , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Peter Zijlstra , Ingo Molnar , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, guohanjun@huawei.com, jinyao5@huawei.com Subject: Re: [PATCH] perf script: Fix printing 'phys_addr' failure issue Message-ID: References: <20220121065954.2121900-1-liwei391@huawei.com> <1c38c70b-d165-acf9-1c98-eeb234fbbe99@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1c38c70b-d165-acf9-1c98-eeb234fbbe99@arm.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jan 21, 2022 at 11:24:57AM +0000, German Gomez escreveu: > Hi Wei, > > This looks good to me. As a followup we could also fix the 'weight' > field, which was introduced recently. > > On 21/01/2022 06:59, Wei Li wrote: > > From: Yao Jin > > > > Perf script was failed to print the phys_addr for SPE profiling. > > One 'dummy' event is added by SPE profiling but it doesn't have PHYS_ADDR > > attribute set, perf script then exits with error. > > > > Now referring to 'addr', use evsel__do_check_stype() to check the type. > > > > Before: > > > > # perf record -e arm_spe_0/branch_filter=0,ts_enable=1,pa_enable=1,load_filter=1,jitter=0,\ > > store_filter=0,min_latency=0,event_filter=2/ -p 4064384 -- sleep 3 > > # perf script -F pid,tid,addr,phys_addr > > Samples for 'dummy:u' event do not have PHYS_ADDR attribute set. Cannot print 'phys_addr' field. > > > > After: > > > > # perf record -e arm_spe_0/branch_filter=0,ts_enable=1,pa_enable=1,load_filter=1,jitter=0,\ > > store_filter=0,min_latency=0,event_filter=2/ -p 4064384 -- sleep 3 > > # perf script -F pid,tid,addr,phys_addr > > 4064384/4064384 ffff802f921be0d0 2f921be0d0 > > 4064384/4064384 ffff802f921be0d0 2f921be0d0 > > > > Signed-off-by: Yao Jin > > Signed-off-by: Wei Li > > Reviewed-by: German Gomez > > Also it looks like the SPE samples are also missing the PHYS_ADDR flag. > I think we'll need to fix the consistency of the flags. Thanks, applied. - Arnaldo > Many thanks, > German > > > --- > > tools/perf/builtin-script.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c > > index ecd4f99a6c14..abae8184e171 100644 > > --- a/tools/perf/builtin-script.c > > +++ b/tools/perf/builtin-script.c > > @@ -515,7 +515,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session) > > return -EINVAL; > > > > if (PRINT_FIELD(PHYS_ADDR) && > > - evsel__check_stype(evsel, PERF_SAMPLE_PHYS_ADDR, "PHYS_ADDR", PERF_OUTPUT_PHYS_ADDR)) > > + evsel__do_check_stype(evsel, PERF_SAMPLE_PHYS_ADDR, "PHYS_ADDR", PERF_OUTPUT_PHYS_ADDR, allow_user_set)) > > return -EINVAL; > > > > if (PRINT_FIELD(DATA_PAGE_SIZE) && -- - Arnaldo