From: Hagen Paul Pfeifer <hagen@jauu.net>
To: linux-kernel@vger.kernel.org
Cc: Jiri Olsa <jolsa@kernel.org>, Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: perf script, libperf: python binding bug (bytearrays vs. strings)
Date: Sun, 27 Sep 2020 11:20:08 +0200 [thread overview]
Message-ID: <20200927092008.GB3664097@laniakea> (raw)
In-Reply-To: <20200927074312.GA3664097@laniakea>
Short addendum: even under python2 not everything is perfect. It seems that
the "comm-name-memory-reuse" problem is a general problem - for python3 and
python2.
In the following example the prev_comm name should be chrome only, but is
"chromesandbox", common_comm is correctly "chrome". I believe that the memory
area for prev_comm & next_comm has not been fully memset'ed before
(memset(mem, 0, 16)).
That the string in Python3 is now a bytearray instead of a string is a
second, independent problem.
Python 2 example:
sched__sched_switch 2 563232.889356634 2924848 chrome prev_comm=chromesandbox, prev_pid=2924848, prev_prio=120, prev_state=S, next_comm=swapper/2, next_pid=0, next_prio=120
Sample: {addr=0, cpu=2, datasrc=84410401, datasrc_decode=N/A|SNP N/A|TLB N/A|LCK N/A, ip=18446744072189289569, period=1, phys_addr=0, pid=2924848, tid=2924848, time=563232889356634, transaction=0, values=[(0L, 0L)], weight=0}
Hagen
next prev parent reply other threads:[~2020-09-27 9:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-27 7:43 perf script, libperf: python binding bug (bytearrays vs. strings) Hagen Paul Pfeifer
2020-09-27 9:20 ` Hagen Paul Pfeifer [this message]
2020-09-28 10:08 ` Jiri Olsa
2020-09-28 10:43 ` Hagen Paul Pfeifer
2020-09-28 13:39 ` Jiri Olsa
2020-09-28 19:19 ` Arnaldo Carvalho de Melo
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=20200927092008.GB3664097@laniakea \
--to=hagen@jauu.net \
--cc=acme@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox