lkml.org 
[lkml]   [2020]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: perf script, libperf: python binding bug (bytearrays vs. strings)
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

\
 
 \ /
  Last update: 2020-09-27 11:20    [W:0.075 / U:1.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site