Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751679AbdFIJNd (ORCPT ); Fri, 9 Jun 2017 05:13:33 -0400 Received: from mail.kdab.com ([176.9.126.58]:52902 "EHLO mail.kdab.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751507AbdFIJN3 (ORCPT ); Fri, 9 Jun 2017 05:13:29 -0400 From: Milian Wolff To: Andi Kleen Cc: Andi Kleen , acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf, tools, script: Allow adding and removing fields Date: Fri, 09 Jun 2017 11:13:11 +0200 Message-ID: <1677340.sCCOOhZNxQ@agathebauer> Organization: KDAB (Deutschland) GmbH&Co KG, a KDAB Group company In-Reply-To: <20170609025243.GA28361@tassilo.jf.intel.com> References: <20170602154810.15875-1-andi@firstfloor.org> <4401931.mLE8BEDJl7@milian-kdab2> <20170609025243.GA28361@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2070 Lines: 65 On Freitag, 9. Juni 2017 04:52:43 CEST Andi Kleen wrote: > On Thu, Jun 08, 2017 at 02:59:58PM +0200, Milian Wolff wrote: > > But I notice that this functionality is missing in other places too. Most > > notably, I would like to be able to configure `perf stat` in a similar > > way. > > Such that one could do: > > > > perf stat -e +cache-misses > > > > Instead of > > > > perf stat -e ,cache-misses > > The defaults are not great, so I'm not sure that is super useful. > > It's probably better to assemble reasonable groups, perhaps > with groups of metrics. > > > But I cannot do: > > > > $ perf record -e "topdown-*" ls > > event syntax error: 'topdown-*' > > That's actually good because the current topdown events are not useful to > sample Can you elaborate? I assume it's because you actually want to sample on instructions, and then group it together with the topdown events and potentially other counters like instructions? > Usually you need to have at least some idea about the events you're > collecting, and also for non trivial collections you need groups to get > good results. Yes, sure. But replace `record` with `stat` in the above and my point still stands. > I've been thinking about adding MetricGroups to the json files, that > would allow to assemble reasonable groups. But it still wouldn't be > wildcard. > > For a few things wildcards are useful, e.g. I implemented it recently > for PMUs so that uncore PMUs are easier to handle. I just noticed that I can actually use wildcards for tracepoints: perf trace --no-syscalls --event "ext4:*" And I think the same should be doable for PMU events with perf stat, but currently isn't: $ perf stat -e "topdown*" ls invalid or unsupported event: 'topdown*' $ perf stat -e "branch*" ls invalid or unsupported event: 'branch*' $ perf stat -e "cache*" ls invalid or unsupported event: 'cache*' Bye -- Milian Wolff | milian.wolff@kdab.com | Software Engineer KDAB (Deutschland) GmbH&Co KG, a KDAB Group company Tel: +49-30-521325470 KDAB - The Qt Experts