All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milian Wolff <milian.wolff@kdab.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org,
	Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] perf, tools, script: Allow adding and removing fields
Date: Thu, 08 Jun 2017 14:59:58 +0200	[thread overview]
Message-ID: <4401931.mLE8BEDJl7@milian-kdab2> (raw)
In-Reply-To: <20170602154810.15875-1-andi@firstfloor.org>

[-- Attachment #1: Type: text/plain, Size: 2410 bytes --]

On Friday, June 2, 2017 5:48:10 PM CEST Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> With perf script it is common that we just want to add or remove a field.
> Currently this requires figuring out the long list of default fields and
> specifying them first, and then adding/removing the new field.
> 
> This patch adds a new + - syntax to merely add or remove fields,
> that allows more succint and clearer command lines
> 
> For example to remove the comm field from PMU samples:
> 
> Previously
> 
> perf script -F tid,cpu,time,event,sym,ip,dso,period
> 	    0 [000] 504345.383126:          1 cycles:  ffffffff90060c66
> native_write_msr ([kernel.kallsyms])
> 
> with the new syntax
> 
> perf script -F -comm
> 	    0 [000] 504345.383126:          1 cycles:  ffffffff90060c66
> native_write_msr ([kernel.kallsyms])
> 
> The new syntax cannot be mixed with normal overriding.

Tested-by: Milian Wolff <milian.wolff@kdab.com>

Works a charm.

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 <whatever the defaults are>,cache-misses

While at it, I also think it would be tremendously useful to get wildcard 
matching behavior in all perf tools. Currently, I can do:

perf list "topdown-*"

List of pre-defined events (to be used in -e):

  topdown-fetch-bubbles OR cpu/topdown-fetch-bubbles/ [Kernel PMU event]
  topdown-recovery-bubbles OR cpu/topdown-recovery-bubbles/ [Kernel PMU event]
  topdown-slots-issued OR cpu/topdown-slots-issued/  [Kernel PMU event]
  topdown-slots-retired OR cpu/topdown-slots-retired/ [Kernel PMU event]
  topdown-total-slots OR cpu/topdown-total-slots/    [Kernel PMU event]

But I cannot do:

$ perf record -e "topdown-*" ls
event syntax error: 'topdown-*'
                            \___ parser error
Run 'perf list' for a list of valid events

But of course I'm aware that these are all separate issues. But Andi, you seem 
to be working a lot on polishing perf. I'd really appreciate it if you could 
also implement the above two suggestions. Otherwise I'll try to see when I get 
the time to do it myself.

Cheers

-- 
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

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 3826 bytes --]

  reply	other threads:[~2017-06-08 13:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02 15:48 [PATCH] perf, tools, script: Allow adding and removing fields Andi Kleen
2017-06-08 12:59 ` Milian Wolff [this message]
2017-06-09  2:52   ` Andi Kleen
2017-06-09  9:13     ` Milian Wolff
2017-06-11 19:06       ` Andi Kleen
2017-06-08 14:34 ` Arnaldo Carvalho de Melo
2017-06-20  8:56 ` [tip:perf/core] perf " tip-bot for Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2017-05-09 14:36 [PATCH] perf, tools, " Andi Kleen
2017-05-09 17:05 ` Jiri Olsa
2017-05-08 16:21 Andi Kleen
2017-05-09 12:18 ` Jiri Olsa
2017-05-09 12:29   ` Andi Kleen
2017-05-09 13:45     ` Jiri Olsa
2017-05-09 14:34       ` Andi Kleen
2017-05-01 19:47 Andi Kleen
2017-05-02  6:41 ` Jiri Olsa
2017-05-04 22:26   ` Andi Kleen
2017-05-05  7:57     ` Jiri Olsa
2017-05-05 19:43       ` Andi Kleen
2017-05-07 14:08         ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4401931.mLE8BEDJl7@milian-kdab2 \
    --to=milian.wolff@kdab.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.