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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48547C433F5 for ; Thu, 26 May 2022 15:25:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233077AbiEZPZl (ORCPT ); Thu, 26 May 2022 11:25:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbiEZPZk (ORCPT ); Thu, 26 May 2022 11:25:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AA29BA9B9; Thu, 26 May 2022 08:25:39 -0700 (PDT) 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 9F03261C41; Thu, 26 May 2022 15:25:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9323BC385A9; Thu, 26 May 2022 15:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653578737; bh=Ku4hdE4QnTkWrQu5yxYySdeI4ksk3o3IHLc7K1VuUA4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sRAE54i401ZllZra/r8Zgo2GnB4Xst/GpO+HfIvYSf0CN+kzlUuuV3GGY8NO2kUbe SWpn4lZoXAO0EKJe137ViutbMO4PjkbqtoqQcnU03XsZxN4tgBkkuOCMpQqvGPTxpW s3NMPF9L1fFvAEMhAM9S8BU9PHskO6geqAn44bMwn2+9KgERXUH8ac+o+BrVVyLAxa OlvZolMTP/JJKHgPUZLIoouVmsENjU63URW5g8RoGaWkEI8BBqRFPBdRKOw3YCiHfs 5N8dxEeTJlss0eTSXkQ8DWZJZ5K4x/Z9r8mQXgOd+tY/PLM/CREuI43gUr1t3RqxLs WJStMBQUSvQhw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 56F644036D; Thu, 26 May 2022 12:25:35 -0300 (-03) Date: Thu, 26 May 2022 12:25:35 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: zhengjun.xing@linux.intel.com, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@intel.com, jolsa@redhat.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, adrian.hunter@intel.com, ak@linux.intel.com, kan.liang@linux.intel.com Subject: Re: [PATCH] perf jevents: Fix event syntax error caused by ExtSel Message-ID: References: <20220525140410.1706851-1-zhengjun.xing@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Em Wed, May 25, 2022 at 07:27:08AM -0700, Ian Rogers escreveu: > On Wed, May 25, 2022 at 7:04 AM wrote: > > > > From: Zhengjun Xing > > > > In the origin code, when "ExtSel" is 1, the eventcode will change to > > "eventcode |= 1 << 21”. For event “UNC_Q_RxL_CREDITS_CONSUMED_VN0.DRS", > > its "ExtSel" is "1", its eventcode will change from 0x1E to 0x20001E, > > but in fact the eventcode should <=0x1FF, so this will cause the parse > > fail: > > > > # perf stat -e "UNC_Q_RxL_CREDITS_CONSUMED_VN0.DRS" -a sleep 0.1 > > event syntax error: '.._RxL_CREDITS_CONSUMED_VN0.DRS' > > \___ value too big for format, maximum is 511 > > > > On the perf kernel side, the kernel assumes the valid bits are continuous. > > It will adjust the 0x100 (bit 8 for perf tool) to bit 21 in HW. > > > > DEFINE_UNCORE_FORMAT_ATTR(event_ext, event, "config:0-7,21"); > > > > So the perf tool follows the kernel side and just set bit8 other than bit21. > > > > Fixes: fedb2b518239 ("perf jevents: Add support for parsing uncore json files") > > Signed-off-by: Zhengjun Xing > > Reviewed-by: Kan Liang > > Acked-by: Ian Rogers Thanks, applied. - Arnaldo