]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: support USDT for 32-bit applications on 64-bit hosts
authorKris Van Hees <kris.van.hees@oracle.com>
Thu, 4 Jun 2015 14:08:05 +0000 (10:08 -0400)
committerKris Van Hees <kris.van.hees@oracle.com>
Tue, 21 Jul 2015 06:51:24 +0000 (02:51 -0400)
A 32-bit application on a 64-bit host was not able to register USDT
probes because the helper ioctl interface was not hooked up to the
compat_ioctl file operation.  This has been corrected.

Orabug: 21219315

This commit also provides some minor debugging output cleanup.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
dtrace/dtrace_dev.c
dtrace/dtrace_probe_ctx.c

index 268df6d4bec68152209567684d6659b971a2d86d..00885ee54857546d4552e75c0ad79e36621ce1e4 100644 (file)
@@ -951,7 +951,7 @@ static long dtrace_ioctl(struct file *file,
        }
 
        default:
-               dt_dbg_ioctl("IOCTL *UNKNOWN* (cmd %#x), argp %p\n",
+               dt_dbg_ioctl("IOCTL ??? (cmd %#x), argp %p\n",
                             cmd, argp);
                break;
        }
@@ -1081,6 +1081,8 @@ static long dtrace_helper_ioctl(struct file *file,
 
                return rval;
        default:
+               dt_dbg_ioctl("Helper IOCTL ??? (cmd %#x), argp %p\n",
+                            cmd, argp);
                break;
        }
 
@@ -1102,6 +1104,7 @@ static const struct file_operations dtrace_fops = {
 static const struct file_operations helper_fops = {
        .owner  = THIS_MODULE,
         .unlocked_ioctl = dtrace_helper_ioctl,
+        .compat_ioctl = dtrace_helper_ioctl,
         .open   = dtrace_helper_open,
         .release = dtrace_helper_close,
 };
index 85e954b565cfe80a4fabeba0f12f257ac6cff951..a38b6eed5b00dca4c9d3590eccb206ad15f2e0b9 100644 (file)
@@ -475,7 +475,7 @@ void dtrace_aggregate(dtrace_aggregation_t *agg, dtrace_buffer_t *dbuf,
                 * This is a hit:  we need to apply the aggregator to
                 * the value at this key.
                 */
-               dt_dbg_agg("    Aggregate [accum]: Buf %p, offs %lld, act %d, "
+               dt_dbg_agg("    Aggregate [accum]: Buf %p, offs %d, act %d, "
                           "%lld (%lld, %lld)\n",
                           buf, size,
                           agg->dtag_action.dta_kind - DTRACEACT_AGGREGATION,
@@ -561,7 +561,7 @@ next:
         * Finally, apply the aggregator.
         */
        *((uint64_t *)(key->dtak_data + size)) = agg->dtag_initial;
-       dt_dbg_agg("    Aggregate [initial]: Buf %p, offs %lld, act %d, "
+       dt_dbg_agg("    Aggregate [initial]: Buf %p, offs %d, act %d, "
                   "%lld (%lld, %lld)\n",
                   buf, size,
                   agg->dtag_action.dta_kind - DTRACEACT_AGGREGATION,