This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Phase 2 takes too much time to complete


2009/2/11 Mark Wielaard <mjw@redhat.com>:
>> Second, this code uses "endl" a lot, which can result in premature
>> buffer flush syscalls.  If your strace is showing a lot of small
>> individual writes when producing this data, then it's worth trying to
>> replace '<< endl' with '<< "\n"' throughout this function.
>
> That seems an easy change to make and might indeed make sense for the
> inner loops. I'll time some things and see if it makes a difference for
> me.
>

Hi,
in the previous mail, I mistakenly wrote "phase 2" instead of "phase
3". Compile time clearly improved
after substitution of "endl" with "\n" (2552835 vs 119837 real ms).
Moreover, it seems that caching
stap-symbols.h does not significantly affect compile time (120789 real ms).
The results are:

WITH "endl":
$ stap -c df -e 'probe syscall.* { if (target()==pid()) log(name."
".argstr) }' -v
Pass 1: parsed user script and 47 library script(s) in 500usr/10sys/555real ms.
Pass 2: analyzed script: 317 probe(s), 120 function(s), 14 embed(s), 1
global(s) in 5570usr/2160sys/10397real ms.
Pass 3: translated to C into
"/tmp/stapLcLRff/stap_1a0900c4b393841ad08f615f866d76cd_206544.c" in
1190usr/5260sys/2552835real ms.
Pass 4: compiled C into
"stap_1a0900c4b393841ad08f615f866d76cd_206544.ko" in
13680usr/1830sys/63733real ms.
Pass 5: starting run.

WITH "\n":
$ stap -c df -e 'probe syscall.* { if (target()==pid()) log(name."
".argstr) }' -v
Pass 1: parsed user script and 47 library script(s) in 480usr/20sys/531real ms.
Pass 2: analyzed script: 317 probe(s), 120 function(s), 14 embed(s), 1
global(s) in 5640usr/2450sys/12262real ms.
Pass 3: translated to C into
"/tmp/stapRobpPy/stap_0659fff5e2f372ad6e3c2e0101921c0a_206861.c" in
230usr/180sys/119837real ms.
Pass 4: compiled C into
"stap_0659fff5e2f372ad6e3c2e0101921c0a_206861.ko" in
13420usr/1850sys/63929real ms.
Pass 5: starting run.

WITH stap-symbols.h CACHED:
$ stap -c df -e 'probe syscall.* { if (target()==pid()) log(name."
".argstr) }' -v
Pass 1: parsed user script and 47 library script(s) in 480usr/30sys/528real ms.
Pass 2: analyzed script: 317 probe(s), 120 function(s), 14 embed(s), 1
global(s) in 5690usr/2380sys/12149real ms.
Pass 3: translated to C into
"/tmp/stapzgskoZ/stap_14f519a25c02081dbd15de7aed797287_207178.c" in
160usr/180sys/120789real ms.
Pass 4: compiled C into
"stap_14f519a25c02081dbd15de7aed797287_207178.ko" in
13380usr/2030sys/62858real ms.
Pass 5: starting run.

Thank you for your suggestion
Roberto Natella


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]