Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1560411ybz; Thu, 23 Apr 2020 00:54:16 -0700 (PDT) X-Google-Smtp-Source: APiQypLElVHj469IjMcJ8oKmiMjU2N8IMCmJ956EK1CtF5jPA+SzKvssVLtDT0+wsf1UI5bs0vQH X-Received: by 2002:a17:906:8152:: with SMTP id z18mr1568701ejw.4.1587628456298; Thu, 23 Apr 2020 00:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587628456; cv=none; d=google.com; s=arc-20160816; b=Ec36UtjooLhhiKVgaiPoCoX0BcQ76kYzl3H2fo6JgGgBo50cJNhjSULyz4WZnN1Ntq m9VAbljSlvG4rib1fbb5Jx+eZ70KD3R1Iw08dtOMs+GLPHEYuM9mf98gg4mDAtabnnJy rBBNT+MARwfdmUu3xMWs1Qh0r6++OziicGcoon4yTeQZHro8/WQTL3k3WknnLNQ5xf2U LuiQgP4eRxNo/AMLpmUIGz7yfDj1TAYne4oFHtZtcby0JJGaVS6jbFio26iFQpG+G9EG zSqVDim3EUL+kco7y1bg7ReoIv8FPckOPgbsnba1wBKgfg1N8km4M562e3oMXhkVWhNd 489A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=ybzRe/SN/Gp4jKOHBiTZenRb6tDpmpxYU90XEX2fHwI=; b=0WJQg7aYZkKRVgjP4JKOKxpwVcAAJuwT7TZcjZN5PRHOrQLT97A/3+cD3ChALlelLL FPrjn1PpTQLJt0CH5hasTVrCxh1iCbGCYtOyZjfwNrngWN417GP6M2E0w+PntqpSOS3U zzk5G5akzV1i0dDHmD3EdIX37JTKYKQGbwAt6iFFvD2FbO2uHfo7NGmEPSiag40bEctL XXZ3cKePCNsIqiTvBLWuXpNrQTc9HtClUJtHjfDIJhht9I5deXOsXACFQoGYQTqMh/6k qx9XmP0BOLqG9Jt91mD5LB9ca7j/Z3hxXDG5ObME4hQ/9zib7dViA1rkAIpb8cKhtq3z NdIA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si727148edm.43.2020.04.23.00.53.53; Thu, 23 Apr 2020 00:54:16 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727875AbgDWHv3 (ORCPT + 99 others); Thu, 23 Apr 2020 03:51:29 -0400 Received: from mga14.intel.com ([192.55.52.115]:15587 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727850AbgDWHvZ (ORCPT ); Thu, 23 Apr 2020 03:51:25 -0400 IronPort-SDR: zfJQnbgWlJ9P/yHgngSLguC0w6uAKYh6VJR8ts/mrx8n2b3uoxppx8nIiwq36irAsc+/dFBmLR XtF/6hdy7E7Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2020 00:51:24 -0700 IronPort-SDR: VZJ3h40CylMLMY4yzOF4dRiVGNw6kRdB1xKBOyS/9OL5eXseuoUuNTl2pA+bAdWCUxoG/qWyb1 stSML4Hfoe5A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,306,1583222400"; d="scan'208";a="365930195" Received: from yjin15-mobl1.ccr.corp.intel.com (HELO [10.238.4.151]) ([10.238.4.151]) by fmsmga001.fm.intel.com with ESMTP; 23 Apr 2020 00:51:19 -0700 Subject: Re: [PATCH 2/8] perf metrics: fix parse errors in cascade lake metrics To: Ian Rogers Cc: Andi Kleen , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Kan Liang , Haiyan Song , Ravi Bangoria , John Garry , Leo Yan , Adrian Hunter , LKML , linux-perf-users , Stephane Eranian References: <20200422074809.160248-1-irogers@google.com> <20200422074809.160248-3-irogers@google.com> <20200422143840.GJ608746@tassilo.jf.intel.com> <46e803f3-80a4-0d37-9d39-b625b947ac7f@linux.intel.com> From: "Jin, Yao" Message-ID: Date: Thu, 23 Apr 2020 15:51:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ian, On 4/23/2020 2:09 PM, Ian Rogers wrote: > On Wed, Apr 22, 2020 at 10:54 PM Jin, Yao wrote: >> >> Hi Jiri, >> >> Bisected to this commit which introduced the regression. >> >> 26226a97724d ("perf expr: Move expr lexer to flex") >> >> Would you like to look at that? > > Hi Jin, > > that commit breaks parsing of things like ','. See fixes in this patch > set such as: > https://lore.kernel.org/lkml/20200422220430.254014-5-irogers@google.com/ > Fixing the lex issues then exposes other bugs that need to be > corrected in the json. I've added Fixes to the commit message of: > https://lore.kernel.org/lkml/20200422220430.254014-3-irogers@google.com/ > https://lore.kernel.org/lkml/20200422220430.254014-4-irogers@google.com/ > and would be glad of a review. If we can land: > https://lore.kernel.org/lkml/20200422220430.254014-12-irogers@google.com/ > then expr as the source of parse errors can go away :-) The next > problem is the parse events code, but some of that logic is dependent > on the machine it is running on. It'd be good to add a test that > parsed events code can handle the events in metrics too, filtering out > things like duration_time that are special to metrics. > > Thanks, > Ian > Only with the fix "https://lore.kernel.org/lkml/20200422220430.254014-5-irogers@google.com/" (without other json modifications), the issue was still there. localhost:~ # perf stat -M DRAM_Read_Latency event syntax error: '../event=0x36,,umask=0x21/,cha/event=0x35,cha_0/event=0x0/}:W,duration_time' \___ parser error Usage: perf stat [] [] -M, --metrics monitor specified metrics or metric groups (separated by ,) So you added other commits which changed the json to let the parse work. But I don't know if we have to do with this way because it should be a regression issue. In my opinion, we'd better fix the issue in 26226a97724d ("perf expr: Move expr lexer to flex") and try not to change the json if possible. Thanks Jin Yao >> Thanks >> Jin Yao >> >> On 4/23/2020 9:08 AM, Jin, Yao wrote: >>> >>> >>> On 4/23/2020 12:18 AM, Ian Rogers wrote: >>>> On Wed, Apr 22, 2020 at 8:34 AM Ian Rogers wrote: >>>>> >>>>> On Wed, Apr 22, 2020 at 7:38 AM Andi Kleen wrote: >>>>>> >>>>>> On Wed, Apr 22, 2020 at 12:48:03AM -0700, Ian Rogers wrote: >>>>>>> Remove over escaping with \\. >>>>>>> Remove extraneous if 1 if 0 == 1 else 0 else 0. >>>>>> >>>>>> So where do these parse errors happen exactly? Some earlier >>>>>> patches introduced them as regressions? >>>>> >>>>> I'll work to track down a Fixes tag. I can repro the Skylakex errors >>>>> without the test in this series, by doing: >>>>> >>>>> $ perf stat -M DRAM_Read_Latency sleep 1 >>>>> Error: >>>>> The sys_perf_event_open() syscall returned with 22 (Invalid argument) >>>>> for event (cha/event=0x36\,uma >>>>> sk=0x21/). >>>>> /bin/dmesg | grep -i perf may provide additional information. >>>>> >>> >>> I also think some patches introduced this regression. When we rollback >>> to commit 61ec07f5917e (perf vendor events intel: Update all the Intel >>> JSON metrics from TMAM 3.6.), there is no this error on CLX. >>> >>> Thanks >>> Jin Yao >>> >>>>> This was just the escaping issue. I'm less clear on the other cascade >>>>> lake issue, and it is a bit more work for me to test on cascade lake. >>>>> What is "if 1 if 0 == 1 else 0 else 0" trying to do? Perhaps hunting >>>>> for the Fixes will let me know, but it looks like a copy-paste error. >>>>> >>>>>> The original metrics worked without parse errors as far as I know. >>>>> >>>>> The skylake issue above repros on 5.2.17 and so it seems like it is >>>>> broken for a while. The test in this series will prevent this in the >>>>> future, but without this patch that test fails. >>>> >>>> The parse errors were introduced with the metrics, so they've never >>>> worked: >>>> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=fd5500989c8f3c3944ac0a144be04bae2506f7ba >>>> >>>> >>>> I will send out a v2 with Fixes in the commit message but wanted to >>>> wait in case there was any more feedback. In particular the fixes to >>>> the new test and expr parser lex code. The lex code wasn't broken at >>>> the time the metrics were added and should be working again after this >>>> patch set. >>>> >>>> Thanks, >>>> Ian >>>> >>>>>> If it fixes something earlier it would need Fixes: tags. >>>>> >>>>> Working on it. Thanks for the input! >>>>> >>>>> Ian >>>>> >>>>>> -Andi