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]

[Bug translator/10568] New: translator issue with tapsets


According to the stap man page, when describing pass 2, it says the following:

       References to variables, functions, and probe aliases  that
       are unresolved internally are satisfied by searching through the parsed
       tapset scripts.  If any tapset script is selected because it defines an
       unresolved  symbol,  then  the  entirety of that script is added to the
       translator?s resolution queue.

The "entirety of that script" may be "added to the translator's resolution
queue", but the translator seems to throw away portions of the tapset script,
even in unoptimized mode.  Here are some examples:

(1) test 1 setup:

== test/test.stp ==
probe tapset_test.foo { }
====

== test/t1/tapset_test.stp ==
global _reads

probe tapset_test.foo = never { }

probe kernel.function("sys_read") { _reads++ }

probe timer.s(5) { printf("%d\n", _reads) }
====

# stap -p2 -v -I t1 test.stp
Pass 1: parsed user script and 60 library script(s) in 160usr/30sys/190real ms.
WARNING: side-effect-free probe 'probe_1809': identifier 'tapset_test' at
test.stp:1:7
 source: probe tapset_test.foo { }
               ^
# probes
never /* <- tapset_test.foo = never <- tapset_test.foo */
;
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0 global(s) in
0usr/0sys/13real ms.

Even though the tapset_test.stp tapset file was included (to satisfy the
'tapset_test.foo' reference), the other probes in that file were not included in
the pass 2 output.

Note that turning off the optimizer causes the 'side-effect-free probe' warning
to go away, but still the other probes in that file are not included.

# stap -u -p2 -v -I t1 test.stp
Pass 1: parsed user script and 60 library script(s) in 130usr/40sys/176real ms.
# probes
never /* <- tapset_test.foo = never <- tapset_test.foo */
{
{
}
{
}
}
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0 global(s) in
10usr/0sys/10real ms.

The translator is discarding the kernel.function() probe and the timer probe.
Note that you can substitute a 'begin' probe for the 'never' probe in
tapset_test.stp and see the same problem.

Note that you can workaround this particular problem (in both optimized and
unoptimized form) by adding a dummy reference to '_reads' in the
'tapset_test.foo' probe.

== test/t1/tapset_test.stp ==
global _reads

probe tapset_test.foo = never { _reads = 0 }

probe kernel.function("sys_read") { _reads++ }

probe timer.s(5) { printf("%d\n", _reads) }
====

# stap -p2 -v -I t1 test.stp
Pass 1: parsed user script and 60 library script(s) in 140usr/40sys/177real ms.
# globals
_reads:long
# probes
never /* <- tapset_test.foo = never <- tapset_test.foo */
(_reads) = (0)
kernel.function("sys_read@fs/read_write.c:372") /* pc=_stext+0xccbb6 */ /* <-
kernel.function("sys_read") */
(_reads)++
timer.s(5) /* <- timer.s(5) */
printf("%d\\n", _reads)
Pass 2: analyzed script: 3 probe(s), 0 function(s), 0 embed(s), 1 global(s) in
380usr/40sys/429real ms.

(2) test 2 setup:

== test/test.stp ==
probe tapset_test.foo { }
====

This file is unchanged.

== test/t2/tapset_test.stp ==
probe tapset_test.foo = never { _reads = 0 }

probe kernel.function("sys_read") { _reads++ }

probe timer.s(5) { printf("%d\n", _reads) }
====

== test/t2/vars.stp ==
global _reads
====

I've moved the 'global _vars' statement from tapset_test.stp to tapset_vars.stp.
 Notice I'm using the workaround mentioned in (1) of a dummy reference to
'_reads' in the tapset_test.foo probe.

# stap -p2 -v -I t2 test.stp
Pass 1: parsed user script and 61 library script(s) in 150usr/30sys/183real ms.
# globals
_reads:long
# probes
never /* <- tapset_test.foo = never <- tapset_test.foo */
(_reads) = (0)
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 1 global(s) in
10usr/0sys/7real ms.

# stap -u -p2 -v -I t2 test.stp
Pass 1: parsed user script and 61 library script(s) in 130usr/40sys/169real ms.
# globals
_reads:long
# probes
never /* <- tapset_test.foo = never <- tapset_test.foo */
{
{
(_reads) = (0)
}
{
}
}
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 1 global(s) in
0usr/0sys/9real ms.

Once again, in both optimized and unoptimized modes, the translator is
discarding the kernel.function() probe and the timer probes.

I have not found a workaround for this variant of the problem.

-- 
           Summary: translator issue with tapsets
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: dsmith at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=10568

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


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