Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2452688pxb; Sun, 28 Feb 2021 01:36:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwT2ZXgrvFazTjVTp09asGa24O+9ZyT+Deb4zDl6tu2D4LFTtBYDnYrmiRKgYt12baIocjU X-Received: by 2002:a17:906:d8b2:: with SMTP id qc18mr10837552ejb.306.1614505001796; Sun, 28 Feb 2021 01:36:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614505001; cv=none; d=google.com; s=arc-20160816; b=qOKuFepRiuxyWLJKnv9hOh4dzhvePFIgmk81q0UReUCW2r3B4QD8q+knofgjeRAnqe paPGixXPmIbOeZ6nqGtlHUe8EsAw5CYzAOx1sz7rA6UpCSQ812VTtPv/RPlh5GsR8UPX DuRVlt6NpMd6XeOLi+IdZeVpS5m+iBh8LzdCdHHBqaS6AV8oP0ROLHj2a9UkgnOXQRXF +dYrmdOo5MydZAQ8Yo+U7Ys4PKgkvD6hjmNUQVRtipgZkgHc16cby20a6hz1GcFicvE4 4VAJn3u0bQQi+YxvPEj3bvQVOArYj8hFlgyIVYC4+td1S2f7E7OfjPPrQrL25Lri6RTR FC8Q== 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=MfErU+o2IpTfmX8Bo8uI0qToZvbwIUPvy2u1IZDsMXg=; b=zQ1sUKvcQo6U5A7cQdErrfKsEzQfliqOU92cvTj2bPyOsRDvP7qDKY3/OUj8xNnVh9 tFjy9KQknMzveOX75W5BnKAf7vEk9Rv8Duxzicf52VND61IorHHT2JIVk+ASAEkefKgm GNBx0t7fqgD7GrVCU3Hv0w1Ja5NyUKlCDB9xJQ0tFblELgqXIOyoHyIl9PTooI+KO/iT wvtkLgLPJtUgLl6dg4yX95jNO9z7DKAaHjU0ZVbCJ4GpJl7V53Aq71E+g5pErEm+nWdu cPHQfUnPr37nqJC9UVNFF72jZ9TATMqs/aw0f+HUwLtFsmkTjmPwtlqsdHOZ2O17NUYe eHzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dS7Ohw5g; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k6si9023107edo.113.2021.02.28.01.36.19; Sun, 28 Feb 2021 01:36:41 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dS7Ohw5g; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230416AbhB1Jfm (ORCPT + 99 others); Sun, 28 Feb 2021 04:35:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51253 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbhB1Jfi (ORCPT ); Sun, 28 Feb 2021 04:35:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614504843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MfErU+o2IpTfmX8Bo8uI0qToZvbwIUPvy2u1IZDsMXg=; b=dS7Ohw5g4oHjNKmi8YWVjuEhEtBOdBaPQlGzY9WOTj8kXeve1jqCVbBqxvvFw9b8PhcN31 qkA+A6lPupB1mH5vipYRdRJt+tZ60Gjml3boOlGa/deGh7RerQ1qynglnAN3pynN+fp3Tp xPaq/xBcDgfOI2aYkjrBZ7Nagrxwt9s= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-386-C5aHa_i2NamZLFlHWYaEsg-1; Sun, 28 Feb 2021 04:34:01 -0500 X-MC-Unique: C5aHa_i2NamZLFlHWYaEsg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E38938030C2; Sun, 28 Feb 2021 09:33:58 +0000 (UTC) Received: from krava (unknown [10.40.192.3]) by smtp.corp.redhat.com (Postfix) with SMTP id 1095C5C1BD; Sun, 28 Feb 2021 09:33:53 +0000 (UTC) Date: Sun, 28 Feb 2021 10:33:52 +0100 From: Jiri Olsa To: "Jin, Yao" 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" Subject: Re: [drm/i915/gt] 8c3b1ba0e7: perf-sanity-tests.Parse_event_definition_strings.fail Message-ID: References: <20210224074841.GD6114@xsang-OptiPlex-9020> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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;