]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: improve probe execution debugging
authorKris Van Hees <kris.van.hees@oracle.com>
Tue, 16 May 2017 13:38:04 +0000 (09:38 -0400)
committerKris Van Hees <kris.van.hees@oracle.com>
Tue, 23 May 2017 13:36:06 +0000 (09:36 -0400)
The debugging code for probe execution had a few cases were the start
of execution was logged in debugging output but the completion was not
because of early termination conditions.  Now all forms of completion
should be covered in debugging output.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Tomas Jedlicka <tomas.jedlicka@oracle.com>
Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
dtrace/dtrace_probe.c

index 0dac1e6283d1bf9031a15f32d5960b383cd10051..08d23e87fc3f87794b56a3727534f45e51f51dcf 100644 (file)
@@ -677,8 +677,11 @@ void dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1,
                        if ((ecb->dte_cond & DTRACE_COND_USERMODE) &&
                            prov->dtpv_pops.dtps_usermode(
                                prov->dtpv_arg, probe->dtpr_id, probe->dtpr_arg
-                           ) == 0)
+                           ) == 0) {
+                               dt_dbg_probe("Probe (ID %d EPID %d) Skipped\n",
+                                            id, ecb->dte_epid);
                                continue;
+                       }
 
                        /*
                         * This is more subtle than it looks. We have to be
@@ -705,8 +708,12 @@ void dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1,
                                    !uid_eq(s_cr->euid, cr->suid) ||
                                    !gid_eq(s_cr->egid, cr->egid) ||
                                    !gid_eq(s_cr->egid, cr->gid) ||
-                                   !gid_eq(s_cr->egid, cr->sgid))
+                                   !gid_eq(s_cr->egid, cr->sgid)) {
+                                       dt_dbg_probe("Probe (ID %d EPID %d) "
+                                                    "Skipped\n",
+                                                    id, ecb->dte_epid);
                                        continue;
+                               }
                        }
                }
 
@@ -732,14 +739,19 @@ void dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1,
                                } while (cmpxchg(activity, curr,
                                         DTRACE_ACTIVITY_KILLED) != curr);
 
+                               dt_dbg_probe("Probe (ID %d EPID %d) Skipped\n",
+                                            id, ecb->dte_epid);
                                continue;
                        }
                }
 
                if ((offs = dtrace_buffer_reserve(buf, ecb->dte_needed,
                                                  ecb->dte_alignment, state,
-                                                 &mstate)) < 0)
+                                                 &mstate)) < 0) {
+                       dt_dbg_probe("Probe (ID %d EPID %d) Skipped\n",
+                                    id, ecb->dte_epid);
                        continue;
+               }
 
                tomax = buf->dtb_tomax;
                ASSERT(tomax != NULL);
@@ -782,6 +794,8 @@ void dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1,
 
                                dt_dbg_probe("  Predicate not met (%d)\n",
                                             rval);
+                               dt_dbg_probe("Probe (ID %d EPID %d) Done\n",
+                                            id, ecb->dte_epid);
                                continue;
                        }