]> sourceware.org Git - systemtap.git/commitdiff
PR15688: Set pragma:vma when dwflpp uses _stp_umodule_relocate
authorJosh Stone <jistone@redhat.com>
Thu, 27 Jun 2013 22:39:19 +0000 (15:39 -0700)
committerJosh Stone <jistone@redhat.com>
Fri, 28 Jun 2013 01:22:26 +0000 (18:22 -0700)
* dwflpp.cxx (dwflpp::emit_address): Use pragma:vma when needed, rather
  than trying to enable_task_finder.  This also leaves the opportunity
  for this generated code to be optimized out, such that vma-tracking
  may not be needed after all.
* elaborate.cxx (embeddedcode_info::visit_embeddedcode): Before enabling
  the vma-tracker, check if runtime=dyninst for PR15052.  This turns an
  ugly pass-4 failure into a nicer pass-2 message.
* session.cxx (systemtap_session::parse_cmdline): Don't force vma here
  for userspace -d modules; dwflpp will add pragma:vma as needed.
* tapsets.cxx (dwarf_atvar_expanding_visitor::visit_atvar_op): Don't
  enable_vma_tracker manually; dwflpp will add pragma:vma as needed.
* testsuite/systemtap.base/sdt_global_var.exp: Clear this setup_kfail.

dwflpp.cxx
elaborate.cxx
session.cxx
tapsets.cxx
testsuite/systemtap.base/sdt_global_var.exp

index cfaf5af136f881a8de2bfce4f99e9a9dcf20b14d..034be8231b18f61298da99cf48ff2da97bbbe051 100644 (file)
@@ -2186,7 +2186,7 @@ dwflpp::emit_address (struct obstack *pool, Dwarf_Addr address)
         }
       else
         {
-          enable_task_finder (sess);
+          obstack_printf (pool, "/* pragma:vma */");
           obstack_printf (pool, "({ unsigned long addr = 0; ");
           obstack_printf (pool, "addr = _stp_umodule_relocate (\"%s\",%#" PRIx64 ", current); ",
                           canonicalize_file_name(module_name.c_str()), address);
index 925bce5c492502648aef0bc4388c7e96da0b4690..d4925c6f9c1ced4109912540181d3a47dc4a8396 100644 (file)
@@ -1461,10 +1461,15 @@ public:
     if (! vma_tracker_enabled(session)
        && c->code.find("/* pragma:vma */") != string::npos)
       {
-       enable_vma_tracker(session);
        if (session.verbose > 2)
           clog << _F("Turning on task_finder vma_tracker, pragma:vma found in %s",
                      current_function->name.c_str()) << endl;
+
+       // PR15052: stapdyn doesn't have VMA-tracking yet.
+       if (session.runtime_usermode_p())
+         throw semantic_error(_("VMA-tracking is only supported by the kernel runtime (PR15052)"), c->tok);
+
+       enable_vma_tracker(session);
       }
 
     if (! session.need_unwind
index c5ce674dd46858b76241bb5fefc9dc1a5fdbdec4..87ba52a3603ada919c8eacc294253865adf0d2ce 100644 (file)
@@ -691,14 +691,8 @@ systemtap_session::parse_cmdline (int argc, char * const argv [])
             if (mpath == NULL) // Must be a kernel module name
               mpath = optarg;
             unwindsym_modules.insert (string (mpath));
-            // PR10228: trigger vma tracker logic early if -d /USER-MODULE/
-            // given. XXX This is actually too early. Having a user module
-            // is a good indicator that something will need vma tracking.
-            // But it is not 100%, this really should only trigger through
-            // a user mode tapset /* pragma:vma */ or a probe doing a
-            // variable lookup through a dynamic module.
-            if (mpath[0] == '/')
-              enable_vma_tracker (*this);
+            // NB: we used to enable_vma_tracker() here for PR10228, but now
+            // we'll leave that to pragma:vma functions which actually use it.
             break;
           }
 
index 05dbd9acc171f7e7c42fbfdd95b9c35df1557079..3b4119e36b270f6a9287d83fc1c32631f5a3141f 100644 (file)
@@ -4276,8 +4276,6 @@ dwarf_atvar_expanding_visitor::visit_atvar_op (atvar_op* e)
       if (result)
         {
           s.unwindsym_modules.insert(module);
-          if (userspace_p && !s.runtime_usermode_p())
-            enable_vma_tracker(s);
 
           if (lvalue)
             {
index e29148c1bf9040639a049e165339274fabce9236..d0ee8a395578b9f2f61e50d27e4f4d0ec3802986 100644 (file)
@@ -26,10 +26,6 @@ proc sdt_stap_run { TEST_NAME TEST_FILE FAIL args } {
            lappend full_test_name "($runtime)"
            set cmd [concat stap --runtime=$runtime $TEST_FILE $args]
        } elseif {[uprobes_p]} {
-            if {[regexp "\-pie" $TEST_NAME]} {
-                setup_kfail 15688 "*-*-*"
-            }
-
            set cmd [concat stap $TEST_FILE $args]
        } else {
            untested $full_test_name
This page took 0.097165 seconds and 5 git commands to generate.