Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3977752pxy; Mon, 26 Apr 2021 14:35:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmDmPk+hsqXXq7/GSk2Xp97yUXQQMyECyNhEjKfQYEAJqUyiUnxNq/4NSCbh1D/q4piR+M X-Received: by 2002:a65:45c3:: with SMTP id m3mr18480183pgr.179.1619472950086; Mon, 26 Apr 2021 14:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619472950; cv=none; d=google.com; s=arc-20160816; b=UKpGyCDUsmmwNJ6oYHJXpsS9V8J1ianZl7XBieKDXVKq7JA39h4dMtuRX0nrha7wDt Kgn47cFEJL8VYB+L0QX+EplzXVHLVfEjmlBjTOszM+esZdUPnbTq1wotiQpYXdQbq1Ij jBe485+gDbSDJM3tvxoxpK/uj36WF78Fzpen7B++sX53k9n5ZzsmctKPGyU+XnQdAyef rQjs8O+KuHmUieMfa6xjA/JRmsghZQzcYDx0EFgF4c6ysK4YAeD5q90uLjRyDuerEIFb UBGRtm3TH2RPdPTV1S13QC7KKQqMbrXC7kIRjl4zQK2NfqUiO3R8Y9hEIynzpi23PaZ6 ckBQ== 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=03TKKwj7058DR07A93Ekn5vbCIyLZWTmg1O7UnNvmc0=; b=SxBn4Xiwp0YK1TbWpORYujFzaJYj3YIrgMu35d2otWHyCZmomx1xG74sCCxKJHNPoi nZeZOE2C+MbEyn80DPDZGY29Jpe9h00VDGRIWy8PzLH2rH2bnvxVkKE2N68UvCVgX200 hi46IwhbJOJwgUXNrkhznoVSMjV6czoMG8HkJ8Y7ijdO9aiMiabYn74ya2ZrCvmX024s A9A1G0u+TLB4Lc2FRsH3oopKgszrWRAheGfb+Ij3YTb1+EvPqwHioBUAqheL9PlFRF9d itd7V00vnNEgl9cmVX2qhrlyYOYNMA13J5jmayjOLHvm++ojxTu2xXOz8w0c++1O+lL3 OwMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ai4px1Uv; 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 e14si20145124pgu.152.2021.04.26.14.35.36; Mon, 26 Apr 2021 14:35:50 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ai4px1Uv; 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 S234995AbhDZVf3 (ORCPT + 99 others); Mon, 26 Apr 2021 17:35:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30448 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233464AbhDZVf3 (ORCPT ); Mon, 26 Apr 2021 17:35:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619472886; 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=03TKKwj7058DR07A93Ekn5vbCIyLZWTmg1O7UnNvmc0=; b=ai4px1UvzOA4o5Drxa8/+hCuOvNvz0lyLx0UQdzjsOOyWB68cUOv+SZo9zxCYcCDZdXN81 8CzSIpjxsDlGcGffAkMd/od/eHjjCp8TdCRPsRj4KR72x9ZhID2Rc0FP4EH8go1lTNPIny qBg4j1aKXgFwIaQIHTOkhb4wdajHrxE= 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-355--Rs3JjTJOw6jyvQDOGJ0rw-1; Mon, 26 Apr 2021 17:34:42 -0400 X-MC-Unique: -Rs3JjTJOw6jyvQDOGJ0rw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1FFEF83DD22; Mon, 26 Apr 2021 21:34:41 +0000 (UTC) Received: from krava (unknown [10.40.193.34]) by smtp.corp.redhat.com (Postfix) with SMTP id DFCA918BAA; Mon, 26 Apr 2021 21:34:38 +0000 (UTC) Date: Mon, 26 Apr 2021 23:34:37 +0200 From: Jiri Olsa To: "Jin, Yao" Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com Subject: Re: [PATCH v5 12/26] perf parse-events: Support event inside hybrid pmu Message-ID: References: <20210423053541.12521-1-yao.jin@linux.intel.com> <20210423053541.12521-13-yao.jin@linux.intel.com> 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.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 26, 2021 at 08:56:28AM +0800, Jin, Yao wrote: > Hi Jiri, > > On 4/26/2021 12:17 AM, Jiri Olsa wrote: > > On Fri, Apr 23, 2021 at 01:35:27PM +0800, Jin Yao wrote: > > > > SNIP > > > > > +static int parse_events__inside_hybrid_pmu(struct parse_events_state *parse_state, > > > + struct list_head *list, char *name, > > > + struct list_head *head_config) > > > +{ > > > + struct parse_events_term *term; > > > + int ret = -1; > > > + > > > + if (parse_state->fake_pmu || !head_config || list_empty(head_config) || > > > + !perf_pmu__is_hybrid(name)) { > > > + return -1; > > > + } > > > + > > > + /* > > > + * More than one term in list. > > > + */ > > > + if (head_config->next && head_config->next->next != head_config) > > > + return -1; > > > + > > > + term = list_first_entry(head_config, struct parse_events_term, list); > > > + if (term && term->config && strcmp(term->config, "event")) { > > > > so 'event' is set only for HW events, I don't see it being for other > > types.. also should the check be !strcmp ? > > > > For some HW events, such as branch-instructions, branch-misses and other HW > events which are defined under /sys/devices/cpu_core/events, the > term->config is "event". For these events, we don't need to do the second > parsing. So I just use 'strcmp(term->config, "event")' to avoid the second > parsing. ah ok.. I thought it's the other way round > > If we check with !strcmp, the second parsing will be executed but the result > after parsing should be empty. > > > also please add some tests for cache events with pmu syntax > > > > OK, I will add new test case for that. thanks, jirka