From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] perf tool: Provide an option to print perf_event_open args and return value
Date: Tue, 12 Nov 2019 08:37:48 -0300 [thread overview]
Message-ID: <20191112113748.GL9365@kernel.org> (raw)
In-Reply-To: <20191112112910.GK9365@kernel.org>
Em Tue, Nov 12, 2019 at 08:29:10AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Nov 08, 2019 at 12:00:09PM +0100, Jiri Olsa escreveu:
> > On Fri, Nov 08, 2019 at 03:11:28PM +0530, Ravi Bangoria wrote:
> > > Perf record with verbose=2 already prints this information along with
> > > whole lot of other traces which requires lot of scrolling. Introduce
> > > an option to print only perf_event_open() arguments and return value.
> > >
> > > Sample o/p:
> > > $ ./perf --debug perf-event-open=1 record -- ls > /dev/null
> > > ------------------------------------------------------------
> > > perf_event_attr:
> > > size 112
> > > { sample_period, sample_freq } 4000
> > > sample_type IP|TID|TIME|PERIOD
> > > read_format ID
> > > disabled 1
> > > inherit 1
> > > exclude_kernel 1
> > > mmap 1
> > > comm 1
> > > freq 1
> > > enable_on_exec 1
> > > task 1
> > > precise_ip 3
> > > sample_id_all 1
> > > exclude_guest 1
> > > mmap2 1
> > > comm_exec 1
> > > ksymbol 1
> > > bpf_event 1
> > > ------------------------------------------------------------
> > > sys_perf_event_open: pid 4308 cpu 0 group_fd -1 flags 0x8 = 4
> > > sys_perf_event_open: pid 4308 cpu 1 group_fd -1 flags 0x8 = 5
> > > sys_perf_event_open: pid 4308 cpu 2 group_fd -1 flags 0x8 = 6
> > > sys_perf_event_open: pid 4308 cpu 3 group_fd -1 flags 0x8 = 8
> > > sys_perf_event_open: pid 4308 cpu 4 group_fd -1 flags 0x8 = 9
> > > sys_perf_event_open: pid 4308 cpu 5 group_fd -1 flags 0x8 = 10
> > > sys_perf_event_open: pid 4308 cpu 6 group_fd -1 flags 0x8 = 11
> > > sys_perf_event_open: pid 4308 cpu 7 group_fd -1 flags 0x8 = 12
> > > ------------------------------------------------------------
> > > perf_event_attr:
> > > type 1
> > > size 112
> > > config 0x9
> > > watermark 1
> > > sample_id_all 1
> > > bpf_event 1
> > > { wakeup_events, wakeup_watermark } 1
> > > ------------------------------------------------------------
> > > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8
> > > sys_perf_event_open failed, error -13
> > > [ perf record: Woken up 1 times to write data ]
> > > [ perf record: Captured and wrote 0.002 MB perf.data (9 samples) ]
> > >
> > > Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
> > > ---
> > > v1->v2:
> > > - man page updates.
> >
> > Acked-by: Jiri Olsa <jolsa@kernel.org>
>
> [root@quaco ~]# perf test -v python
> 18: 'import perf' in python :
> --- start ---
> test child forked, pid 19237
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: /tmp/build/perf/python/perf.so: undefined symbol: debug_peo_args
> test child finished with -1
> ---- end ----
> 'import perf' in python: FAILED!
> [root@quaco ~]#
>
> Please always test your changes using 'perf test', before and after, to
> see if some regression is being added. I'm trying to fix this one.
I added this to fix this issue,
- Thanks,
- Arnaldo
[acme@quaco perf]$ git diff -U5
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 25118605f3f8..83212c65848b 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -63,10 +63,11 @@ struct perf_env perf_env;
/*
* Support debug printing even though util/debug.c is not linked. That means
* implementing 'verbose' and 'eprintf'.
*/
int verbose;
+int debug_peo_args;
int eprintf(int level, int var, const char *fmt, ...);
int eprintf(int level, int var, const char *fmt, ...)
{
[acme@quaco perf]$
next prev parent reply other threads:[~2019-11-12 11:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 3:59 [RFC] perf record: Add option to print perf_event_open args and return value Ravi Bangoria
2019-11-08 8:04 ` Jiri Olsa
2019-11-08 8:35 ` Ravi Bangoria
2019-11-08 9:30 ` [PATCH] perf tool: Provide an " Ravi Bangoria
2019-11-08 9:41 ` [PATCH v2] " Ravi Bangoria
2019-11-08 11:00 ` Jiri Olsa
2019-11-11 13:52 ` Arnaldo Carvalho de Melo
2019-11-12 11:29 ` Arnaldo Carvalho de Melo
2019-11-12 11:37 ` Arnaldo Carvalho de Melo [this message]
2019-11-12 14:00 ` Ravi Bangoria
2019-11-15 7:40 ` [tip: perf/core] " tip-bot2 for Ravi Bangoria
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=20191112113748.GL9365@kernel.org \
--to=arnaldo.melo@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ravi.bangoria@linux.ibm.com \
/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.