From 49b33554940d1c5c8c051344b4aec7d64dd96ace Mon Sep 17 00:00:00 2001 From: Kris Van Hees Date: Thu, 4 Jun 2015 10:08:05 -0400 Subject: [PATCH] dtrace: support USDT for 32-bit applications on 64-bit hosts 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 Acked-by: Nick Alcock --- dtrace/dtrace_dev.c | 5 ++++- dtrace/dtrace_probe_ctx.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dtrace/dtrace_dev.c b/dtrace/dtrace_dev.c index 268df6d4bec6..00885ee54857 100644 --- a/dtrace/dtrace_dev.c +++ b/dtrace/dtrace_dev.c @@ -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, }; diff --git a/dtrace/dtrace_probe_ctx.c b/dtrace/dtrace_probe_ctx.c index 85e954b565cf..a38b6eed5b00 100644 --- a/dtrace/dtrace_probe_ctx.c +++ b/dtrace/dtrace_probe_ctx.c @@ -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, -- 2.50.1