public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/18942] New: any script will include all the globals from tapset/argv.stp
@ 2015-09-09 15:40 dsmith at redhat dot com
  2015-09-09 15:49 ` [Bug tapsets/18942] " dsmith at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: dsmith at redhat dot com @ 2015-09-09 15:40 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18942

            Bug ID: 18942
           Summary: any script will include all the globals from
                    tapset/argv.stp
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: dsmith at redhat dot com
  Target Milestone: ---

This is on RHEL7, but most likely happen everywhere:

====
# stap -vp4 -e 'probe syscall.read { printf("%s, %s\n", name, argstr) }'
Pass 1: parsed user script and 113 library script(s) using
214560virt/32056res/2944shr/29492data kb, in 670usr/30sys/707real ms.
Pass 2: analyzed script: 2 probe(s), 5 function(s), 94 embed(s), 33 global(s)
using 250360virt/68808res/3864shr/65292data kb, in 1200usr/140sys/1339real ms.
Pass 3: translated to C into
"/tmp/stapYRq5dD/stap_ec359b719647ca1ded86300ca3d447f0_56028_src.c" using
250360virt/69188res/4244shr/65292data kb, in 30usr/80sys/111real ms.
/home/dsmith/.systemtap/cache/ec/stap_ec359b719647ca1ded86300ca3d447f0_56028.ko
Pass 4: compiled C into "stap_ec359b719647ca1ded86300ca3d447f0_56028.ko" in
11730usr/2230sys/13771real ms.
====

Notice the "Pass 2" line reports the use of 33 globals. Looking at the pass 2
output, here are the global variables it is compiling in:

====
# globals
argv[32]:string [long]
argv_1:string
argv_2:string
argv_3:string
argv_4:string
argv_5:string
argv_6:string
argv_7:string
argv_8:string
argv_9:string
argv_10:string
argv_11:string
argv_12:string
argv_13:string
argv_14:string
argv_15:string
argv_16:string
argv_17:string
argv_18:string
argv_19:string
argv_20:string
argv_21:string
argv_22:string
argv_23:string
argv_24:string
argv_25:string
argv_26:string
argv_27:string
argv_28:string
argv_29:string
argv_30:string
argv_31:string
argv_32:string
====

Since these global variables aren't actually used, they should not be included
in the module.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug tapsets/18942] any script will include all the globals from tapset/argv.stp
  2015-09-09 15:40 [Bug tapsets/18942] New: any script will include all the globals from tapset/argv.stp dsmith at redhat dot com
@ 2015-09-09 15:49 ` dsmith at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: dsmith at redhat dot com @ 2015-09-09 15:49 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18942

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
Josh Stone helped me realize that __count_envp() and __count_compat_envp()
tapset functions from tapset/linux/aux_syscalls.stp have a local variable
called 'argc'. The translator can't tell the difference between this local and
the global, so it pulled the global in.

With the variable names changed in tapset/linux/aux_syscalls.stp, no globals
get pulled into that test script.

Fixed in commit 36aa918. With this change, that same script uses no global
variables:

====
# stap -vp4 -e 'probe syscall.read { printf("%s, %s\n", name, argstr) }'
Pass 1: parsed user script and 113 library script(s) using
214560virt/32056res/2944shr/29492data kb, in 640usr/30sys/673real ms.
Pass 2: analyzed script: 1 probe(s), 5 function(s), 94 embed(s), 0 global(s)
using 250356virt/68776res/3860shr/65288data kb, in 1130usr/160sys/1290real ms.
Pass 3: translated to C into
"/tmp/stapBPUP2p/stap_80a9d5c9c352558521b5742a83e36296_54572_src.c" using
250356virt/69128res/4212shr/65288data kb, in 20usr/80sys/106real ms.
/home/dsmith/.systemtap/cache/80/stap_80a9d5c9c352558521b5742a83e36296_54572.ko
Pass 4: compiled C into "stap_80a9d5c9c352558521b5742a83e36296_54572.ko" in
11250usr/2030sys/13082real ms.
====

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-09 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-09 15:40 [Bug tapsets/18942] New: any script will include all the globals from tapset/argv.stp dsmith at redhat dot com
2015-09-09 15:49 ` [Bug tapsets/18942] " dsmith at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).