Received: by 10.223.185.116 with SMTP id b49csp2999368wrg; Mon, 5 Mar 2018 12:12:13 -0800 (PST) X-Google-Smtp-Source: AG47ELv8JVBd1/4Lb0GI+EkYn/pUFCcUiWr1VgY7B5h2DrEykcmvWuykbYYl2vRBz2oa39B3jBFc X-Received: by 10.98.225.2 with SMTP id q2mr16304825pfh.23.1520280733176; Mon, 05 Mar 2018 12:12:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520280733; cv=none; d=google.com; s=arc-20160816; b=ghT48ZKeIzYt6chr4SYndjO5NHqe1kbqlA5/cmqI8OZyPEcm8vikrLHBC/3Dgu2AYi cHfLwRo5nOtEcO98IWNqHKunPD+2NGcYft9PBZ4kVaivKuZ96AavW1PRlT2eaOGJtjIf Te9Dul44eP30T4jH4mlDc4seMCtGMxIFlJKI3Dpinj2AdD6ZqB5v7Z9WXBbdxoI1m1za xtHYSDyvlwip7KX1wF+qlkblNaqYAcA6drK0+EbH7yNpiefeXKrXmqPpnyyQhx/RzJNE yfKtPWX04NgH8iipBXNFxWHzRu0MZOgymcNbZU3fuDVuKAuXBg26ZmbXX7IXM/icSAvX Fe/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=Ud6oGUm2m1NDJ9fMi+uKlmY0tq7DEZqyN0LY2YLDxRc=; b=jqX/rHJT9h4FjruznZjugrQn5vwf4KAXqWXEFIQ2S48RAKxFVjVALYD7HU246n/4p0 5d+JzVNV5JNyTNbMdin4x57hNNnIcNv/EPJkT+Bu6y4/fRJ3yx2Dm1AdM+FzBcYROfIx jaknQGppSK5aOoCRIk4wkkgN9ebM26/K+8qHnx8tGfCz7WPGDZByg69+RQzZP7VCLfzL 6+kT6fSOIxBgCfLt+64PM46GfeNcZpZm/ALY3pjt+lc7Z4/Io0hdL2dcCjZQVgL1co95 N+WcDSzxE3Vep2tA3woS2gFuRESDe0KAS4cxZbXodDoPWRuwtIZxkjal0nI+4mB1hb9K TgnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=B07ktJvk; dkim=pass header.i=@codeaurora.org header.s=default header.b=i++02u4H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si8745046pge.307.2018.03.05.12.11.58; Mon, 05 Mar 2018 12:12:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=B07ktJvk; dkim=pass header.i=@codeaurora.org header.s=default header.b=i++02u4H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752950AbeCEUKq (ORCPT + 99 others); Mon, 5 Mar 2018 15:10:46 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:33724 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752154AbeCEUKo (ORCPT ); Mon, 5 Mar 2018 15:10:44 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 04EE860807; Mon, 5 Mar 2018 20:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520280644; bh=sRggOeKCPOclTGYAQAOToseqMLy71OMUtBsPHHzG77Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=B07ktJvkkc32FcYg2kjJXWAWQY46CrjJdZvBuJmoEHxI8E65Q38aNpWb2xRqOhWyC EIXKPSuAkEhWyvpYDXtW6UtaqkpAMZ2kV3GupZ7cqagbYesTenyl7PP3szBp89W+sg 2ZPbED7iVARcWBMzf/bif9483eSNqOVf1LnNaFvk= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 2B27A6043F; Mon, 5 Mar 2018 20:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520280643; bh=sRggOeKCPOclTGYAQAOToseqMLy71OMUtBsPHHzG77Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=i++02u4Hy2xjXfoRdEwGpzTYeW8fytAQGYtaXPv0H5osKFuS0TNbrD/OSaq38Mmvm 9kpLxam0WmCuiI4CqRCe2LE02MhOsrh1ofGzpa18WPBoR7fTFH2JSdu81uStTvQRi+ kTYDdvESc9oOwjJFkg/dELplhM43RU+BK8w0J1L0= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 05 Mar 2018 15:10:43 -0500 From: Agustin Vega-Frias To: Jiri Olsa Cc: Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Namhyung Kim , timur@codeaurora.org Subject: Re: [RFC V2 1/3] perf, tools: Support wildcards on pmu name in dynamic pmu events In-Reply-To: <20180305190937.GA31349@krava> References: <1520034092-35275-1-git-send-email-agustinv@codeaurora.org> <1520034092-35275-2-git-send-email-agustinv@codeaurora.org> <20180303143436.GA14563@krava> <20180304171245.GB25017@tassilo.jf.intel.com> <20180304181010.GA7030@krava> <1ddac3f4900267b0c9a69ef4c598be51@codeaurora.org> <20180305190937.GA31349@krava> Message-ID: <94ecc9b1337d15fe4634da56cb428738@codeaurora.org> X-Sender: agustinv@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-03-05 14:09, Jiri Olsa wrote: > On Mon, Mar 05, 2018 at 10:08:18AM -0500, Agustin Vega-Frias wrote: >> On 2018-03-04 13:10, Jiri Olsa wrote: >> > On Sun, Mar 04, 2018 at 09:12:45AM -0800, Andi Kleen wrote: >> > > > > +#include >> > > > > #include >> > > > > #include >> > > > > #include >> > > > > @@ -241,7 +242,7 @@ PE_NAME opt_event_config >> > > > > if (!strncmp(name, "uncore_", 7) && >> > > > > strncmp($1, "uncore_", 7)) >> > > > > name += 7; >> > > > > - if (!strncmp($1, name, strlen($1))) { >> > > > > + if (!strncmp($1, name, strlen($1)) || !fnmatch($1, name, 0)) { >> > > > >> > > > could we now get rid of the strncmp in here and keep the >> > > > glob matching only? >> > > >> > > That would break existing command lines. Not a good idea. >> > >> > I hoped that only you guys are using this and would rewrite your scripts >> > ;-) >> > >> > I had no idea there's fnmatch func before.. too bad, ok >> > >> > jirka >> >> An option to keep backward compatibility and consistency would be >> to wrap the pattern/string passed in *'s, that way we can just use >> fnmatch and have all the examples Jiri brought up work the same. >> With that in place we can actually also drop the explicit ignoring >> of the uncore_ prefix since the globbing would take care of that. > > I don't mind the strcmp as such, I wanted to get rid of the wildcard > matching without using '*' ... but as Andi said it's been out > there and it's been a while, so let's keep it > > but if there's a way to make it simpler, let's go for it > > thanks, > jirka Sounds good. I have a new version ready (see sample output below). But I wanted to ping about the other two patches before submitting. Any feedback on those? Thanks, Agustín PS: Sample output: $ ./perf stat -a -e imc/umask=0x3,event=0x4/ --no-merge ls -l > /dev/null Performance counter stats for 'system wide': 2,613 uncore_imc_0/umask=0x3,event=0x4/ 2,736 uncore_imc_1/umask=0x3,event=0x4/ 2,671 uncore_imc_2/umask=0x3,event=0x4/ 2,508 uncore_imc_3/umask=0x3,event=0x4/ 2,439 uncore_imc_4/umask=0x3,event=0x4/ 2,465 uncore_imc_5/umask=0x3,event=0x4/ 0.004159243 seconds time elapsed $ ./perf stat -a -e *imc/umask=0x3,event=0x4/ --no-merge ls -l > /dev/null Performance counter stats for 'system wide': 2,704 uncore_imc_0/umask=0x3,event=0x4/ 2,601 uncore_imc_1/umask=0x3,event=0x4/ 2,625 uncore_imc_2/umask=0x3,event=0x4/ 2,370 uncore_imc_3/umask=0x3,event=0x4/ 2,485 uncore_imc_4/umask=0x3,event=0x4/ 2,431 uncore_imc_5/umask=0x3,event=0x4/ 0.002716763 seconds time elapsed $ ./perf stat -a -e imc*/umask=0x3,event=0x4/ --no-merge ls -l > /dev/null Performance counter stats for 'system wide': 1,294 uncore_imc_0/umask=0x3,event=0x4/ 1,303 uncore_imc_1/umask=0x3,event=0x4/ 1,242 uncore_imc_2/umask=0x3,event=0x4/ 1,125 uncore_imc_3/umask=0x3,event=0x4/ 1,137 uncore_imc_4/umask=0x3,event=0x4/ 1,159 uncore_imc_5/umask=0x3,event=0x4/ 0.002790441 seconds time elapsed $ ./perf stat -a -e *imc*/umask=0x3,event=0x4/ --no-merge ls -l > /dev/null Performance counter stats for 'system wide': 1,524 uncore_imc_0/umask=0x3,event=0x4/ 1,508 uncore_imc_1/umask=0x3,event=0x4/ 1,501 uncore_imc_2/umask=0x3,event=0x4/ 1,405 uncore_imc_3/umask=0x3,event=0x4/ 1,427 uncore_imc_4/umask=0x3,event=0x4/ 1,450 uncore_imc_5/umask=0x3,event=0x4/ 0.002720907 seconds time elapsed -- Qualcomm Datacenter Technologies, Inc. on behalf of the Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.