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/12407] New: optimizer fails to remove unreferenced probe that accesses global variable


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

           Summary: optimizer fails to remove unreferenced probe that
                    accesses global variable
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap@sources.redhat.com
        ReportedBy: dsmith@redhat.com


The rpc.stp tapset file contains a global variable '__rpc_create_args' used to
help get arguments for rpc_new_client().  However, this code gets pulled in
even when unused by a script.  The following test script uses a function from
rpc.stp (that doesn't reference __rpc_create_args).  Notice how the
"rpc_create" probes get pulled in.

----
# uname -r
2.6.35.10-74.fc14.x86_64
# stap -p2 -e 'probe begin {printf("%d\n", addr_from_rqst(0))}'
# global embedded code
%{
// Includes everything needed for __rpc_prot_from_protocol().
#include <linux/sunrpc/clnt.h>
%}
%{
/* For AF_INET */
#include <linux/socket.h>
%}
%{
#include <linux/version.h>
#include <linux/file.h>
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)
#include <linux/fdtable.h>
#endif
#ifndef STAPCONF_TASK_UID
#include <linux/cred.h>
#endif
%}
%{
#include <linux/skbuff.h>
%}
# globals
__rpc_create_args:long [long]
# functions
AF_INET:long ()
_dwarf_cast_get_cast_13:long (pointer:long)
_dwarf_cast_get_cast_14:long (pointer:long)
_dwarf_cast_get_cast_15:long (pointer:long)
_dwarf_tvar_get_args_0:long ()
addr_from_rqst:long (rqstp:long)
  # locals
  addr:long
tid:long ()
# probes
begin /* <- begin */
module("sunrpc").function("rpc_create@net/sunrpc/clnt.c:282")? /*
pc=.text+0x1fce */ /* <-
kernel.function("rpc_create")!,module("sunrpc").function("rpc_create")? */
module("sunrpc").function("rpc_create@net/sunrpc/clnt.c:282").return? /*
pc=.text+0x1fce */ /* <-
kernel.function("rpc_create").return!,module("sunrpc").function("rpc_create").return?
*/
----

If the translator can't be taught to discard these probes, a possible
workaround could be to move all the code that references the global variable to
its own tapset file.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


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