Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2888083pxb; Sun, 28 Feb 2021 17:22:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAcVdBn0G+k8vLkKH6oqLppXnU7wThu/KFnqazPmiGCMI4CxYW3DD8t1IwRwv80/F1g5cZ X-Received: by 2002:aa7:c907:: with SMTP id b7mr12240768edt.37.1614561776918; Sun, 28 Feb 2021 17:22:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614561776; cv=none; d=google.com; s=arc-20160816; b=LuJnGRFdZVksZ3+x56cA/mHVeVPPnU8aJOLsRmiUAo80E4oOLiY3X1BvukMS94hKOu xvx6/03dONszOSgeNztgQp9iUm7IdLQftjztalmVAKHrrVDkNn9zeaSi0MJqTYrZPPM0 wOEAlYGv38PkX01vVKARJ8rTTbWIRciOedT5gSGcyvJSq12lvGtQTpaOQfTGV/mQd4es fP+BIBbRLQn2b9Rsl81BmBSEPruoaKi5a7RDqoar9PlNOUsnoW37TFCloPwmDXIwp5dn aw+iPKgrYjiCCxoS9AVwBi6FSzTY3SS9t4+12gWG71HmC+C2qJJRiSi4uYRuad0fEfI8 FRYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence: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=gUQp9VSY54BLPizKN7uHESBAZAsiznYhW9JjFvlqES0=; b=m+oufJoXi9mF0npxDKRCXEuu93Cpfh1goSjG/EwSSl0Fx8WT+wX6k0rJBrLwIcx/xV ZsAJyVgS0yFBG2AWbm806ZxPIMdRbs52oDVdP8U/uUSzqiKynBGIQfOSgXphzQQv89Kx GoI3cfKYYh2yTOJ/3zAiNeVHZjnH9hBKsSBf09lJnJulPXA61l5VACnZYrIuh20Ok2U6 Mw8BhWU7zJZ1IVKA7xFbDzORM4yOQ5Ob9t1bVvRaZGab6j0m6bg25o/ZHIjOorLerQQE TbfU1DNhBWx89xwdBudSG4VTJZCm3TbCqZuY3iCDxNzp7Q9pkoLkrrisDRn4TTpNT5UC IGCw== 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 dr14si6485586ejc.470.2021.02.28.17.22.35; Sun, 28 Feb 2021 17:22:56 -0800 (PST) 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 S231575AbhCABN5 (ORCPT + 99 others); Sun, 28 Feb 2021 20:13:57 -0500 Received: from mga03.intel.com ([134.134.136.65]:25851 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231352AbhCABN4 (ORCPT ); Sun, 28 Feb 2021 20:13:56 -0500 IronPort-SDR: gJfO6sHnuTYrrf1zz7jjmLng5rSrZ/TWgE0o43I4c9QPXt3qvKjaB/PMRygBZiUXhOVZrlHdQb o1hlNx/0E6lg== X-IronPort-AV: E=McAfee;i="6000,8403,9909"; a="186379113" X-IronPort-AV: E=Sophos;i="5.81,214,1610438400"; d="scan'208";a="186379113" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2021 17:12:07 -0800 IronPort-SDR: Bdt63Ro/qcWnXbCR5I+U2cpDjnySuBRDp6eLvYNlqOR4GrA2OgxV3b2LoSrLnYI70vbWOt7mZW 2WAxVN6ZDJLA== X-IronPort-AV: E=Sophos;i="5.81,214,1610438400"; d="scan'208";a="366541623" Received: from yjin15-mobl1.ccr.corp.intel.com (HELO [10.238.4.6]) ([10.238.4.6]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2021 17:12:04 -0800 Subject: Re: [drm/i915/gt] 8c3b1ba0e7: perf-sanity-tests.Parse_event_definition_strings.fail To: Jiri Olsa Cc: kernel test robot , Chris Wilson , Arnaldo Carvalho de Melo , Jiri Olsa , Tvrtko Ursulin , Matthew Brost , LKML , lkp@lists.01.org, lkp@intel.com, Andi Kleen , Adrian Hunter , "Liang, Kan" , "Jin, Yao" , "Yi, Ammy" References: <20210224074841.GD6114@xsang-OptiPlex-9020> From: "Jin, Yao" Message-ID: Date: Mon, 1 Mar 2021 09:12:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri, On 2/28/2021 5:33 PM, Jiri Olsa wrote: > On Sat, Feb 27, 2021 at 11:21:25AM +0100, Jiri Olsa wrote: >> On Fri, Feb 26, 2021 at 08:41:26AM +0800, Jin, Yao wrote: >> >> SNIP >> >>>> + SET_SYMBOL(prefix, PMU_EVENT_SYMBOL); >>>> len++; >>>> } >>>> } >>>> } >>>> + >>>> + /* unlikely, but still.. */ >>>> + if (!len) >>>> + goto err; >>>> + perf_pmu_events_list_num = len; >>>> + >>>> qsort(perf_pmu_events_list, len, >>>> sizeof(struct perf_pmu_event_symbol), comp_pmu); >>>> >>> >>> Thanks so much for the patch! It works with my tests. >>> >>> # ./perf test 6 >>> 6: Parse event definition strings : Ok >>> >>> # ./perf stat -e software/r1a/ -a -- sleep 1 >>> >>> Performance counter stats for 'system wide': >>> >>> software/r1a/ >>> >>> 1.000940433 seconds time elapsed >>> >>> In theory, do we also need to check suffix as well? I think returning >>> PMU_EVENT_SYMBOL_SUFFIX may also confuse the parser. But yes, we don't have >>> this case now. >> >> yep, let's wait for use case ;-) you can't have suffix >> without prefix, and that's the one failing, so I think >> we are fine > > actualy this one seems to work as well, could you plz check > > thanks, > jirka > > > --- > diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y > index d5b6aff82f21..d57ac86ce7ca 100644 > --- a/tools/perf/util/parse-events.y > +++ b/tools/perf/util/parse-events.y > @@ -89,6 +89,7 @@ static void inc_group_count(struct list_head *list, > %type PE_EVENT_NAME > %type PE_PMU_EVENT_PRE PE_PMU_EVENT_SUF PE_KERNEL_PMU_EVENT PE_PMU_EVENT_FAKE > %type PE_DRV_CFG_TERM > +%type event_pmu_name > %destructor { free ($$); } > %type event_term > %destructor { parse_events_term__delete ($$); } > @@ -272,8 +273,11 @@ event_def: event_pmu | > event_legacy_raw sep_dc | > event_bpf_file > > +event_pmu_name: > +PE_NAME | PE_PMU_EVENT_PRE > + > event_pmu: > -PE_NAME opt_pmu_config > +event_pmu_name opt_pmu_config > { > struct parse_events_state *parse_state = _parse_state; > struct parse_events_error *error = parse_state->error; > This fix looks good. [root@p-tglr02 perf]# ./perf list | grep i915/software-gt-awake-time/ i915/software-gt-awake-time/ [Kernel PMU event] [root@p-tglr02 perf]# ./perf test 6 6: Parse event definition strings : Ok [root@p-tglr02 perf]# ./perf stat -e software/r1a/ -a -- sleep 1 Performance counter stats for 'system wide': software/r1a/ 1.001379319 seconds time elapsed Thanks Jin Yao