linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Andreas Hollmann <hollmann@in.tum.de>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	"linux-perf-use." <linux-perf-users@vger.kernel.org>
Subject: Re: User defined metrics for perf stat?
Date: Sat, 6 Feb 2016 22:54:48 +0100	[thread overview]
Message-ID: <20160206215448.GA6025@krava.redhat.com> (raw)
In-Reply-To: <CAGz0_-2Rs9DqfRhP2mWm6CQvoQtC385VeE+cYKJnJinx5nkpSQ@mail.gmail.com>

On Fri, Feb 05, 2016 at 03:12:04PM +0100, Andreas Hollmann wrote:
> Jiri, this method does not work when you pipe data to perf script.
> 
> Works with perf.data file:
> 
> ./perf stat -a -I 1000 -e cycles,"cpu/config=0x6530160,name=krava/" record
> 
> /perf script -s test.py
> event krava cpu -1, thread -1, time 1029898211, val 10959, ena
> 81192094638, run 81192094638
> event krava cpu -1, thread -1, time 2043671594, val 10753, ena
> 81094362809, run 81094362809
> 
> does not work when using pipe
> 
> ./perf stat -a -I 1000 -e cycles,"cpu/config=0x6530160,name=krava/"
> record | ./perf script -s test.py
> 
> --- no output
> 
> Here the test.py
> 
> cat test.py
> #!/usr/bin/env python
> 
> def stat__krava(cpu, thread, time, val, ena, run):
>     print "event %s cpu %d, thread %d, time %d, val %d, ena %d, run %d" % \
>           ("krava", cpu, thread, time, val, ena, run)

right, we probably don't transfer the name term through the pipe,
I'll check on that..

jirka

  reply	other threads:[~2016-02-06 21:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-31 16:53 User defined metrics for perf stat? Andreas Hollmann
2016-02-01 17:15 ` Arnaldo Carvalho de Melo
2016-02-01 17:27   ` Jiri Olsa
2016-02-01 23:33     ` Andreas Hollmann
2016-02-02  8:58       ` Jiri Olsa
2016-02-02  9:42         ` Andreas Hollmann
2016-02-02 16:24         ` Andreas Hollmann
2016-02-03  7:48           ` Jiri Olsa
2016-02-03 11:43             ` Andreas Hollmann
2016-02-03 14:09               ` Jiri Olsa
2016-02-03 15:25                 ` Andreas Hollmann
2016-02-05 14:12             ` Andreas Hollmann
2016-02-06 21:54               ` Jiri Olsa [this message]
2016-02-03 12:39         ` Milian Wolff
2016-02-03 14:11           ` Jiri Olsa
2016-02-03 14:18             ` eBPF counters for 'perf stat' e.g.: " Arnaldo Carvalho de Melo
2016-02-04  9:46               ` Wangnan (F)
2016-02-03 14:43             ` Milian Wolff

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=20160206215448.GA6025@krava.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=hollmann@in.tum.de \
    --cc=jolsa@kernel.org \
    --cc=linux-perf-users@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).