Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4186993pxb; Mon, 21 Feb 2022 14:18:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWpPMN0ygEXiFZrXWHx62tgEG5bfq5dHjq3VpkYBsUvFLfSXV9jhZla5SbVaW/xdwLdkZ4 X-Received: by 2002:a17:906:2a97:b0:6b4:143f:37c6 with SMTP id l23-20020a1709062a9700b006b4143f37c6mr17823192eje.133.1645481888449; Mon, 21 Feb 2022 14:18:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645481888; cv=none; d=google.com; s=arc-20160816; b=Q7safS0BJGvoTgCAbv9BP0TikQhnPaP9yVIcfLAjOOlBWKHrjr9PmFy3cUKWn4lIS2 sGHBaqCV3PlMd22yzEI5j4JhVa5OkeCpQ8OVHTMRVNkdx4w2wIOnwzbf9LTLI2OPakOs tT55Pr4IFUPeVtlAfCJRNg+eqQMxlxa3eQPMXBloHLP079wRPOLVULE9oN8ikQ0xXE79 6DfOBlvj1iy9IoxheK/KGFS13ICUpXznd1i9qWm2S9oElP7O13ixCX9hdte77JqJe3G1 JE1jqvhBkxUaEYKBAt2VYRBU4GflYjdyPVFXBySYQQ6njKwKBpM44Ueur6hIX/HJ/IiN 9L6w== 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=qhLO7zpU6Ok1BEkgLsF/1jPyZK2Xr++VMNkWs/naTT0=; b=onxWbgePrVE9tBhxgYeegwWkmGJrw2TE4QvVUeBgga8wzfVmu6tsFXHUN1zZupaLWK ry82udhwDW8R5ZfFbCSPEOn0mucxz7/tbWvk63W2K9QoQRdBRnMJS5n0ztpa0DLvWnuS sB8QWjRDjzMyHyKXktTKyYA0QcHyJtf7xOXI8tkEr/6QLgtwljDdoqr99HWMRXje3n6P IApT1Ifxlzo2XK6XClJaZdP9+z7a63zTccBuPgjhplaZ2CluY3D5uePycEampkBuYlBD rFLXFwZ0ddhKqnvcNOSxAu4oXW6fwbEq14XbBEa2YiHASe6M2mOsaoKnKb93OYDbvXVF VxyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GuFOY9zO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my3si9604130ejc.849.2022.02.21.14.17.46; Mon, 21 Feb 2022 14:18:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GuFOY9zO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233105AbiBUTrD (ORCPT + 99 others); Mon, 21 Feb 2022 14:47:03 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230088AbiBUTrC (ORCPT ); Mon, 21 Feb 2022 14:47:02 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EAFC2250E; Mon, 21 Feb 2022 11:46:37 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id x5so31445021edd.11; Mon, 21 Feb 2022 11:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qhLO7zpU6Ok1BEkgLsF/1jPyZK2Xr++VMNkWs/naTT0=; b=GuFOY9zOpmwiZ6qsWzV3Ob4Q2vJx6q8tyl62PY7KwZ1u/rFrzPOsNXu0nSEzzGajxy B2vLVHRCnvb+4R/qGo0rKWFBlgQXUIC460Hc3Z++P67Mv9L8httjzBTCOX+ND3srXtDQ OF5HJdURvvhpCFLwztlIsGFBewSiT5bh7BGoQXR1zW7XNh8eDKZUjTXbybTQkLFHOKbs IcrFRrwPspSNfTkDsP9Z/Nk/mr2gRgiWJyp2/g2VQa9GAM0JZtX9w9YeUGKBb9pQaUdi l4MHL88sTGORywWH51uSGjnyua70UxlZ1ECuDOPVjwKioyK2a2pzuHSeF9JEMK/v8KPh 2M3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qhLO7zpU6Ok1BEkgLsF/1jPyZK2Xr++VMNkWs/naTT0=; b=51AhXKp+hxtQROzLRd7MSHX2dxsyRQpDTcQn85Sfx+RKrAPSAVwtlKSUJCjZruysNg zrY/6efvwXAVdQ3oXlFpwDzaQRJPRtmffSprI7B53qj/0H7/E2Y4czCiFssuDUjgPyhB kkzdqlc5CbT3V4kpvvgvXZ2Ck7r3U+j4Y4jfAetoomnuAn6dWKL0u1QB2htBsdeAQlFn TsFIpQ3UjtPdnuvO1Bv7ndKqi9hpILm0rUo4RwNHyUYWqkIoac+cshlW2mAo+pEj9Pxl ZBEX3mOf7Stvg7gcPsmc73wPI+7rGI8qEiIU/iF0OIpHHyFN8/fim+YyahjJuveXr2re L5Wg== X-Gm-Message-State: AOAM531oQ0iLFpbQrlJx1g0nWs2ljPGjE/J1HyUECR0Hu8/nERB8gr5W EFJWMXd91rCSLWYL9q4uHrdf8gap6LSJow== X-Received: by 2002:a05:6402:2805:b0:405:f6a8:f74 with SMTP id h5-20020a056402280500b00405f6a80f74mr22516090ede.241.1645472795822; Mon, 21 Feb 2022 11:46:35 -0800 (PST) Received: from krava ([2a00:102a:500a:4c07:3c4e:83d8:8cd9:974f]) by smtp.gmail.com with ESMTPSA id nc40sm3198715ejc.127.2022.02.21.11.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 11:46:35 -0800 (PST) Date: Mon, 21 Feb 2022 20:46:32 +0100 From: Jiri Olsa To: German Gomez Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org, Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim Subject: Re: [PATCH] perf script: Fix error when printing 'weight' field Message-ID: References: <20220221171707.62960-1-german.gomez@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220221171707.62960-1-german.gomez@arm.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 21, 2022 at 05:17:06PM +0000, German Gomez wrote: > In SPE traces the 'weight' field can't be printed in perf-script because > the 'dummy:u' event doesn't have the WEIGHT attribute set. > > Use evsel__do_check_stype(..) to check this field, as it's done with > other fields such as "phys_addr". > > Before: > > $ perf record -e arm_spe_0// -- sleep 1 > $ perf script -F event,ip,weight > Samples for 'dummy:u' event do not have WEIGHT attribute set. Cannot print 'weight' field. > > After: > > $ perf script -F event,ip,weight > l1d-access: 12 ffffaf629d4cb320 > tlb-access: 12 ffffaf629d4cb320 > memory: 12 ffffaf629d4cb320 > > Fixes: b0fde9c6e291 ("perf arm-spe: Add SPE total latency as PERF_SAMPLE_WEIGHT") > Signed-off-by: German Gomez Acked-by: Jiri Olsa thanks, jirka > --- > 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 9e032343f..6ce581067 100644 > --- a/tools/perf/builtin-script.c > +++ b/tools/perf/builtin-script.c > @@ -463,7 +463,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session) > return -EINVAL; > > if (PRINT_FIELD(WEIGHT) && > - evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT_TYPE, "WEIGHT", PERF_OUTPUT_WEIGHT)) > + evsel__do_check_stype(evsel, PERF_SAMPLE_WEIGHT_TYPE, "WEIGHT", PERF_OUTPUT_WEIGHT, allow_user_set)) > return -EINVAL; > > if (PRINT_FIELD(SYM) && > -- > 2.25.1 >