Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp2673373rdb; Wed, 6 Sep 2023 11:15:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGSBJTr3qcwiwiY1A36pVcp9xQswDsDusnG2B0ZoZwXpXhR2S/7QMeQahXSXJO6UaR18fMd X-Received: by 2002:adf:f74c:0:b0:314:10d8:b482 with SMTP id z12-20020adff74c000000b0031410d8b482mr3116283wrp.65.1694024109046; Wed, 06 Sep 2023 11:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694024109; cv=none; d=google.com; s=arc-20160816; b=HlnkG5xURYz+5ZpySLEsNPfN2oy4rTMQPiz12Y4+mJcxv8EhLHI3sCtZAiHXtexxOP bEJGrsKCElF+3ucEz1JXV45iEmj8Xkro+GDipeN00Av36tMlH+dgLG3wH5qfqRe5bS+f P8mhjwzl9rqI29YE0fxWyXPaNSYiSzApBdwKx1+RdggRCc9tiWCJURIBKtr63056BE07 VeIfYijNBxBb6y8KvJd7rVxsdg9/8shhIX4A5pqsVkl/mcM+Ut2QwaPRYP3NmGj3UK99 hedwcLgoeupCPzVBkzAoXp9RqoKaRcVh7qKz4aiyLnc5Gde2tP/aVjMSN9QAhBqesGjg 2a9Q== 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=Wig2yU7ncm7JNqeT0SohUFBTiFPVCjHLLVhmVux/TvA=; fh=k4+3jNj7676Btuql/EL+VUg2QOkBxfxDNF/TLxKk5cM=; b=V7QyqIvG/0G/XGx7N0uQpPtOFMnmeMk7zQVMHiPPzt+K4eE5KwFdIAVcbLUpwVanbL sATCCgOBwHzF2HUxJ7F0eiwVn1Ig4VRJ7YHqiUXXTK9Uc9cGV7x9zaCC6tbZcKCsBSup Mdibr/VcbgHDgl9DZqITuOwDfM6eADMusSLLDswh0OGh+xj/eTE28GMKmGLqAEl5RotU oo9k14RGfYiav7YNIva5l1HSNpLM8fsuJrFba0Epj/wglDpxOu0CZVpc1niJUqi8lKUL KRtmUtyO10z5hLXQvnvktM0sB/w3y7ynsS8dPkRhZFyRvGa+XZpEsjsH/YSlLUZQMRp5 9VNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AE6XxU75; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u19-20020a056402065300b0052a1d9c8216si9282773edx.564.2023.09.06.11.14.39; Wed, 06 Sep 2023 11:15:09 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=AE6XxU75; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242637AbjIFPv2 (ORCPT + 99 others); Wed, 6 Sep 2023 11:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbjIFPvZ (ORCPT ); Wed, 6 Sep 2023 11:51:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 989DABC; Wed, 6 Sep 2023 08:51:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F39CC433C7; Wed, 6 Sep 2023 15:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694015481; bh=ZTx1V9SBRgyay3CMxakat22dukdFU6Xt0g57zO9x/g0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AE6XxU75ThI9ffjE9QXI6OKjbmc8MOfOmxyKEa3H2p9X3yplkfiFWbcn9AF90eQan Xitp8bSAAmwb1owUCyv4Yj8h+fz0NEx906OwuOp5QHYSkcWAaQYXBGc9QCS0EtJZYB MR0IZ0hwu2ttSCZg4APmxRb7DMO53Ty3Gb1CV78dVsqL1ZPvjbbIAhgz/yLVOKEb1p DTzZxOdYa3L3ot3LraQIwz2r72kX3sx7yddrOAkigZQNWssO9/6J58qjB0pFZtSVgE uKIsbJUOTmnSb3suYrm5tqZ3UvkNYUnQ4K4M9Y6hQvrB8uaMnaJzC9Gy5hHKmNP30g kZ4fNwCPAS17w== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 5A5F6403F4; Wed, 6 Sep 2023 12:51:18 -0300 (-03) Date: Wed, 6 Sep 2023 12:51:18 -0300 From: Arnaldo Carvalho de Melo To: James Clark Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Kan Liang , Rob Herring , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/6] perf parse-events: Fixes relating to no_value terms Message-ID: References: <20230901233949.2930562-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 Em Tue, Sep 05, 2023 at 10:39:38AM +0100, James Clark escreveu: > > > On 02/09/2023 00:39, Ian Rogers wrote: > > A term may have no value in which case it is assumed to have a value > > of 1. It doesn't just apply to alias/event terms so change the > > parse_events_term__to_strbuf assert. > > > > Commit 99e7138eb789 ("perf tools: Fail on using multiple bits long > > terms without value") made it so that no_value terms could only be for > > a single bit. Prior to commit 64199ae4b8a3 ("perf parse-events: Fix > > propagation of term's no_value when cloning") this missed a test case > > where config1 had no_value. > > > > Fixes: 64199ae4b8a3 ("perf parse-events: Fix propagation of term's no_value when cloning") > > Signed-off-by: Ian Rogers > > For the whole set: > > Reviewed-by: James Clark Thanks, applied. - Arnaldo > > --- > > tools/perf/tests/parse-events.c | 2 +- > > tools/perf/util/parse-events.c | 2 +- > > tools/perf/util/parse-events.h | 4 ++-- > > 3 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c > > index d86076d575ed..d47f1f871164 100644 > > --- a/tools/perf/tests/parse-events.c > > +++ b/tools/perf/tests/parse-events.c > > @@ -2170,7 +2170,7 @@ static const struct evlist_test test__events[] = { > > > > static const struct evlist_test test__events_pmu[] = { > > { > > - .name = "cpu/config=10,config1,config2=3,period=1000/u", > > + .name = "cpu/config=10,config1=1,config2=3,period=1000/u", > > .valid = test__pmu_cpu_valid, > > .check = test__checkevent_pmu, > > /* 0 */ > > diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c > > index 68fe2c4ff49f..65608a3cba81 100644 > > --- a/tools/perf/util/parse-events.c > > +++ b/tools/perf/util/parse-events.c > > @@ -2607,7 +2607,7 @@ int parse_events_term__to_strbuf(struct list_head *term_list, struct strbuf *sb) > > > > if (term->type_val == PARSE_EVENTS__TERM_TYPE_NUM) > > if (term->no_value) { > > - assert(term->type_term == PARSE_EVENTS__TERM_TYPE_USER); > > + assert(term->val.num == 1); > > ret = strbuf_addf(sb, "%s", term->config); > > } else > > ret = strbuf_addf(sb, "%s=%#"PRIx64, term->config, term->val.num); > > diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h > > index 855b0725c5d4..594e5d2dc67f 100644 > > --- a/tools/perf/util/parse-events.h > > +++ b/tools/perf/util/parse-events.h > > @@ -124,8 +124,8 @@ struct parse_events_term { > > */ > > bool weak; > > /** > > - * @no_value: Is there no value. TODO: this should really be part of > > - * type_val. > > + * @no_value: Is there no value. If a numeric term has no value then the > > + * value is assumed to be 1. An event name also has no value. > > */ > > bool no_value; > > }; -- - Arnaldo