Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6054083rwn; Mon, 12 Sep 2022 20:15:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR6aeAJkkyRJjRtbZmyLQqWrBs8GoQTcxYXTWUh7I6n9QZJOxoUa+e7iX6DZoGYAjRFNsWmZ X-Received: by 2002:aa7:cd49:0:b0:451:e570:8a82 with SMTP id v9-20020aa7cd49000000b00451e5708a82mr5180061edw.369.1663038926367; Mon, 12 Sep 2022 20:15:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663038926; cv=none; d=google.com; s=arc-20160816; b=R30ZB4ld7heGi4LvRvyD2+US6fUVpv2yGb7jqaI61n/KGPBxfcsQko9suQ6onCstQC ycTFTjSePfE4Z+t9W/+B9yInEJEHWHlIXQdB3i/FO3bnR/j0kKHrhuC4K6fhrTsUMfoK jmnqXFi5GQfo+mWNcgzIYVWqDSUvkosFSMUztQ5PvPqO4Lb9IVpsLhHgVtSZIz2yLX8E DUgilaKF9BMCCmq+lMY03jod3Pf+QPT7C+l7cjnjuarwkWJSL1nR8wPE4Is++LuBx1ap oOrhxOL63m114Vnxz2ncsKIpmqOZphRj9bhGa3clNyRoNKDmT7o095bMXt8mtUzWuxgr icBg== 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=mNIi18X3rLwN7bNjOQgmycw3pgOrOB3gKZL4IhqTm0Y=; b=0TOjCUdpQXyg9/LmKcQUP5zEzEkjE+2uW181Xk0SbGy6k1PIBIDdti57Xn3KnJ++P7 tesVxMtJZE3ry53uxH3SSK6M/fJ+BRn5ApUXOAtDLv8lmVEITgmCKMZmsFZals90qIQT LNhMo7w4vfmJaNjTxwQJGorXWvWaAV33AeJzWagrQUWdyd/VKjZry/uAdRpWQLaHdmnk bgeyRvy0+f5CE3KCpiTRDKNzn7MVN8tFnHif97cHuRL6xpYnvMC6dKe5eUlbGKVEez3Q Bd26vnT7z1qaHpwDDGjLUKYax3x7hxJJWnEph0NcT2Gtm6HyAePGTaUzDT30zPUs586f vTVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pkf7liHi; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy1-20020a170906fe0100b0077ea2909878si2973416ejb.416.2022.09.12.20.15.01; Mon, 12 Sep 2022 20:15:26 -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=@linaro.org header.s=google header.b=pkf7liHi; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbiIMCRS (ORCPT + 99 others); Mon, 12 Sep 2022 22:17:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbiIMCRR (ORCPT ); Mon, 12 Sep 2022 22:17:17 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B1CE52DCB for ; Mon, 12 Sep 2022 19:17:14 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id c198so10357350pfc.13 for ; Mon, 12 Sep 2022 19:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=mNIi18X3rLwN7bNjOQgmycw3pgOrOB3gKZL4IhqTm0Y=; b=pkf7liHixkCnKG6153BxNwx5r85qeEvrfDd8Xv+ijxHa4yEP2+nSqEAm+zJ//bD2OL yndpzP6KpxqtWMYB1az234Slh8fmKt3zQBakDMewxqyeujWb0FJlyWaQRjtvFoQFun7B CZ6dNKTWcOa0eC+kjcUj+u6ZjVbd0TJ7y1DQIOfsdtCaeFdlmjyspsQZ92eRhyKd6xOv maOy0LG7ed0vfwMUZ/+pD/5STBRw/Dr7Ew+MIqrimco/pZKKJXAN5lI2V9fObnAI8upu dZHJETVz/Z+rTDcuW9zo06M3xNx2DA5fxpHLkqTpuEYSNBmxG4Whb3X7ESqviPmTqjMP q1lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=mNIi18X3rLwN7bNjOQgmycw3pgOrOB3gKZL4IhqTm0Y=; b=6JDDwLDHjil22E5iqQbT4jmrzd9ZQMrd2XxWrwa215WVnUSH4SMTpBo/sjaYxt7otR aXlaUxAlvkHm7/QkscnP+tgEkJnV/ZU1+vp3Nayucnx+19/8YwkdEwV2ursbq9fMWDP/ st38SMaYSTHB951+so/Yvih925bfeVG7PiYqH0qwshDVcnWEX8I9XAAbl2la5qddELlb NyZRc5TbnRITVIOZ6t++YLH8Hz4ONQczM3bC4Ht5LvVjrYhQw9I17qwc6DTczo7BBB7b z0awlO1ybX6qGBp1w97q6XEv3W+rcXWExzNxjlHX4PrkF4Xkxj9bwR0E7L3eKeWa17Qe Kchg== X-Gm-Message-State: ACgBeo1srseHPXYbX7kBmnDf0G+/uZgT8M3mSNrptpjA6SR7vPoH6oL5 b/jE5W+RBbFGvTsR+ucqmRSn0A== X-Received: by 2002:a63:4816:0:b0:438:aece:3738 with SMTP id v22-20020a634816000000b00438aece3738mr13381201pga.279.1663035433786; Mon, 12 Sep 2022 19:17:13 -0700 (PDT) Received: from leoy-yangtze.lan (173.242.123.178.16clouds.com. [173.242.123.178]) by smtp.gmail.com with ESMTPSA id u16-20020a62d450000000b0053e66f57334sm6341291pfl.112.2022.09.12.19.17.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 19:17:13 -0700 (PDT) Date: Tue, 13 Sep 2022 10:17:08 +0800 From: Leo Yan To: Rob Herring Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , James Clark , linux-perf-users , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] perf: Skip and warn on unknown format 'configN' attrs Message-ID: References: <20220909204509.2169512-1-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, Sep 12, 2022 at 08:55:32AM -0500, Rob Herring wrote: [...] > > If this is the case, > > it's good to add a fixes tag like below? > > > > Fixes: cd82a32e9924 ("perf tools: Add perf pmu object to access pmu format definition") > > Probably not too important given this is from 2012. Which means since 2012 there have no requirement for config3 :) AFAICT, perf tool should be forward compatible, so I think it's good for this patch to be landed on (old) LTS kernels. > > > Signed-off-by: Rob Herring > > > --- > > > v2: > > > - Rework YACC code to handle configN formats in C code > > > - Add a warning when an unknown configN attr is found > > > > > > v1: https://lore.kernel.org/all/20220901184709.2179309-1-robh@kernel.org/ > > > --- > > > tools/perf/util/pmu.c | 6 ++++++ > > > tools/perf/util/pmu.l | 2 -- > > > tools/perf/util/pmu.y | 15 ++++----------- > > > 3 files changed, 10 insertions(+), 13 deletions(-) > > > > > > diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c > > > index 89655d53117a..6757db7d559c 100644 > > > --- a/tools/perf/util/pmu.c > > > +++ b/tools/perf/util/pmu.c > > > @@ -1475,6 +1475,12 @@ int perf_pmu__new_format(struct list_head *list, char *name, > > > { > > > struct perf_pmu_format *format; > > > > > > + if (config > PERF_PMU_FORMAT_VALUE_CONFIG2) { > > > > It's good to add a new macro PERF_PMU_FORMAT_VALUE_CONFIG_END in > > util/pmu.h. Then at here we can check the condition: > > Sure. > > > > > if (config >= PERF_PMU_FORMAT_VALUE_CONFIG_END) { > > > > > + pr_warning("WARNING: format '%s' requires 'config%d' which is not supported by this version of perf!\n", > > > + name, config); > > > > ... so at here we can print log like: > > > > pr_warning("WARNING: format '%s' requires 'config%d' which is not " > > "supported by this version of perf (maximum config%d)!\n", > > name, config, PERF_PMU_FORMAT_VALUE_CONFIG_END - 1); > > I was trying to keep it to one line and given configN isn't expanded > frequently it should be simple enough to figure out what version you > need. It's fine for me. > > The rest of this patch is fine for me. > > > > As a side topic, I know you want to support the SPEv1.2 feature with > > config3, seems to me a complete patch set series should include the > > changes for supporting config3 as well. This can give more clear view > > for how to fix incompatibility issue between old and new kernels, and > > how to support config3 in the latest kernel, but it's fine for me if > > you want to split into two patch sets. > > I've sent out the SPE kernel support separately. I was told by Arnaldo > to split perf tool and kernel side changes. To be clear, it's right to split kernel and userspace parts into two patch set, but for userspace change I cannot find you sent patch to support config3 in perf tool, something in the [1] is missed, otherwise I don't think you provide complete support for config3 (and thus we have no chance to use new event format). Thanks, Leo [1] https://termbin.com/vdph