]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Add debugging for enablings.
authorKris Van Hees <kris.van.hees@oracle.com>
Fri, 19 Jul 2013 22:14:06 +0000 (18:14 -0400)
committerKris Van Hees <kris.van.hees@oracle.com>
Fri, 19 Jul 2013 22:14:06 +0000 (18:14 -0400)
Added dt_dbg_enable() to support adding debugging statements in the handling
of enablings.

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

index a8cd96972f03ef120656ea69ee59f29bad445199..af2cef31cd67f9820c502f3e42a077ad5b3a0233 100644 (file)
@@ -6,6 +6,7 @@
 # undef DT_DBG_AGG
 # undef DT_DBG_BUF
 # undef DT_DBG_DOF
+# undef DT_DBG_ENABLE
 # undef DT_DBG_IOCTL
 # undef DT_DBG_PROBE
 
@@ -14,6 +15,7 @@
 # undef DT_DBG_AGG
 # undef DT_DBG_BUF
 # undef DT_DBG_DOF
+# undef DT_DBG_ENABLE
 # undef DT_DBG_IOCTL
 # undef DT_DBG_PROBE
 
  * Here are the actual actions for the various debug cases.
  */
 #ifdef DT_DBG_AGG
-# define dt_dbg_agg(fmt, ...)  pr_info(fmt, ## __VA_ARGS__)
+# define dt_dbg_agg(fmt, ...)          pr_info(fmt, ## __VA_ARGS__)
 #else
 # define dt_dbg_agg(fmt, ...)
 #endif
 
 #ifdef DT_DBG_BUF
-# define dt_dbg_buf(fmt, ...)  pr_info(fmt, ## __VA_ARGS__)
+# define dt_dbg_buf(fmt, ...)          pr_info(fmt, ## __VA_ARGS__)
 #else
 # define dt_dbg_buf(fmt, ...)
 #endif
 
 #ifdef DT_DBG_DOF
-# define dt_dbg_dof(fmt, ...)  pr_info(fmt, ## __VA_ARGS__)
+# define dt_dbg_dof(fmt, ...)          pr_info(fmt, ## __VA_ARGS__)
 #else
 # define dt_dbg_dof(fmt, ...)
 #endif
 
+#ifdef DT_DBG_ENABLE
+# define dt_dbg_enable(fmt, ...)       pr_info(fmt, ## __VA_ARGS__)
+#else
+# define dt_dbg_enable(fmt, ...)
+#endif
+
 #ifdef DT_DBG_IOCTL
-# define dt_dbg_ioctl(fmt, ...)        pr_info(fmt, ## __VA_ARGS__)
+# define dt_dbg_ioctl(fmt, ...)                pr_info(fmt, ## __VA_ARGS__)
 #else
 # define dt_dbg_ioctl(fmt, ...)
 #endif
 
 #ifdef DT_DBG_PROBE
-# define dt_dbg_probe(fmt, ...)        pr_info(fmt, ## __VA_ARGS__)
+# define dt_dbg_probe(fmt, ...)                pr_info(fmt, ## __VA_ARGS__)
 #else
 # define dt_dbg_probe(fmt, ...)
 #endif
index 71fb4c17bc82c553a9a3f71d4fc91074e2850a49..33e35ec92b5335de343b3808b9514184da13c269 100644 (file)
@@ -320,8 +320,21 @@ int dtrace_enabling_match(dtrace_enabling_t *enab, int *nmatched)
                enab->dten_current = ep;
                enab->dten_error = 0;
 
-               if ((matched = dtrace_probe_enable(&ep->dted_probe, enab)) < 0)
+               dt_dbg_enable("  Matching enabling %p[%d] for %s:%s:%s:%s\n",
+                             enab, i, ep->dted_probe.dtpd_provider,
+                             ep->dted_probe.dtpd_mod,
+                             ep->dted_probe.dtpd_func,
+                             ep->dted_probe.dtpd_name);
+
+               if ((matched = dtrace_probe_enable(&ep->dted_probe, enab))
+                   < 0) {
+                       dt_dbg_enable("  Matching enabling %p[%d] failed: "
+                                     "busy\n", enab, i);
                        return -EBUSY;
+               }
+
+               dt_dbg_enable("  Matching enabling %p[%d] found %d matches.\n",
+                             enab, i, matched);
 
                total_matched += matched;