]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Bug fix for logic to determine the (inode, offset) pair for uprobes.
authorKris Van Hees <kris.van.hees@oracle.com>
Wed, 14 Aug 2013 12:44:01 +0000 (08:44 -0400)
committerKris Van Hees <kris.van.hees@oracle.com>
Thu, 5 Sep 2013 20:56:49 +0000 (16:56 -0400)
The logic used to determine the (inode, offset) pair needed by uprobes, and
caculated based on an address in a process memory space. was flawed.  This
caused USDT probes in shared libraries to not work correctly.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
dtrace/dtrace_dof.c
dtrace/fasttrap_dev.c

index f9723aeda486f1a4bb6a39327e6ce5b2bbd844df..ee70ded7358df3897ac64ae53a41bf71466ac1ef 100644 (file)
@@ -838,6 +838,10 @@ static int dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, uint64_t ubase)
                                return -1;
                        }
 
+                       dt_dbg_dof("      Relocate 0x%llx + 0x%llx = 0x%llx\n",
+                                  *(uint64_t *)taddr, ubase,
+                                  *(uint64_t *)taddr + ubase);
+
                        *(uint64_t *)taddr += ubase;
                        break;
                default:
@@ -1722,12 +1726,12 @@ static void dtrace_helper_provide_one(dof_helper_t *dhp, dof_sec_t *sec,
         */
        dtrace_dofprov2hprov(&dhpv, prov, strtab);
 
+       dt_dbg_dof("    Creating provider %s for PID %d\n",
+                  strtab + prov->dofpv_name, pid);
+
        if ((parg = mops->dtms_provide_pid(meta->dtm_arg, &dhpv, pid)) == NULL)
                return;
 
-       dt_dbg_dof("    Created provider %s for PID %d\n",
-                  strtab + prov->dofpv_name, pid);
-
        meta->dtm_count++;
 
        /*
@@ -1759,11 +1763,11 @@ static void dtrace_helper_provide_one(dof_helper_t *dhp, dof_sec_t *sec,
                dhpb.dthpb_ntypes = strtab + probe->dofpr_nargv;
                dhpb.dthpb_xtypes = strtab + probe->dofpr_xargv;
 
-               mops->dtms_create_probe(meta->dtm_arg, parg, &dhpb);
-
-               dt_dbg_dof("      Created probe %s:%s:%s:%s\n",
+               dt_dbg_dof("      Creating probe %s:%s:%s:%s\n",
                           strtab + prov->dofpv_name, "", dhpb.dthpb_func,
                           dhpb.dthpb_name);
+
+               mops->dtms_create_probe(meta->dtm_arg, parg, &dhpb);
        }
 }
 
index a1030e79c9865e5219ae03afca566dd3fe58ef3f..5355d811c77ac8ec83275251b8a1598a02798a4e 100644 (file)
@@ -118,10 +118,8 @@ static int fasttrap_pid_probe(fasttrap_machtp_t *mtp, struct pt_regs *regs) {
        fasttrap_id_t           *id;
        int                     is_enabled = 0;
 
-       if (atomic64_read(&tp->ftt_proc->ftpc_acount) == 0) {
-               pr_info("    Ignored (no longer active)\n");
+       if (atomic64_read(&tp->ftt_proc->ftpc_acount) == 0)
                return 0;
-       }
 
        for (id = tp->ftt_ids; id != NULL; id = id->fti_next) {
                fasttrap_probe_t        *ftp = id->fti_probe;
@@ -859,6 +857,9 @@ void fasttrap_meta_create_probe(void *arg, void *parg,
                tp->ftt_pc = dhpb->dthpb_base + dhpb->dthpb_offs[i];
                tp->ftt_pid = provider->ftp_pid;
 
+               dt_dbg_dof("        Tracepoint at 0x%lx (0x%llx + 0x%x)\n",
+                          tp->ftt_pc, dhpb->dthpb_base, dhpb->dthpb_offs[i]);
+
                pp->ftp_tps[i].fit_tp = tp;
                pp->ftp_tps[i].fit_id.fti_probe = pp;
 #ifdef __sparc