From: Kris Van Hees Date: Fri, 19 Jul 2013 22:14:06 +0000 (-0400) Subject: Add debugging for enablings. X-Git-Tag: v4.1.12-111.0.20170907_2225~3^2~3^2~148 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=89755d585c65f881ff5e1f38d2462890578d50c0;p=users%2Fjedix%2Flinux-maple.git Add debugging for enablings. Added dt_dbg_enable() to support adding debugging statements in the handling of enablings. Signed-off-by: Kris Van Hees --- diff --git a/dtrace/dtrace_debug.h b/dtrace/dtrace_debug.h index a8cd96972f03e..af2cef31cd67f 100644 --- a/dtrace/dtrace_debug.h +++ b/dtrace/dtrace_debug.h @@ -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 @@ -23,31 +25,37 @@ * 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 diff --git a/dtrace/dtrace_enable.c b/dtrace/dtrace_enable.c index 71fb4c17bc82c..33e35ec92b533 100644 --- a/dtrace/dtrace_enable.c +++ b/dtrace/dtrace_enable.c @@ -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;