return 0;
}
+uint64_t fbt_getarg(void *arg, dtrace_id_t id, void *parg, int argno,
+ int aframes)
+{
+ struct pt_regs *regs = this_cpu_core->cpu_dtrace_regs;
+ uint64_t *st;
+ uint64_t val;
+
+ if (regs == NULL)
+ return 0;
+
+ switch (argno) {
+ case 0:
+ return regs->di;
+ case 1:
+ return regs->si;
+ case 2:
+ return regs->dx;
+ case 3:
+ return regs->cx;
+ case 4:
+ return regs->r8;
+ case 5:
+ return regs->r9;
+ }
+
+ ASSERT(argno > 5);
+
+ st = (uint64_t *)regs->sp;
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
+ /*
+ * Skip the topmost slot of the stack because that holds the return
+ * address for the call to the function we are entering. At this point
+ * the BP has not been pushed yet, so we are still working within the
+ * caller's stack frame.
+ */
+ val = st[1 + argno - 6];
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
+
+ return val;
+}
+
void fbt_provide_probe_arch(fbt_probe_t *fbp, int type, int stype)
{
fbp->fbp_patchval = type == FBT_ENTRY ? FBT_ENTRY_PATCHVAL
extern void fbt_destroy_module(void *, struct module *);
extern int _fbt_enable(void *, dtrace_id_t, void *);
extern void _fbt_disable(void *, dtrace_id_t, void *);
+extern uint64_t fbt_getarg(void *, dtrace_id_t, void *, int, int);
extern void fbt_destroy(void *, dtrace_id_t, void *);
extern dtrace_provider_id_t fbt_id;
static DEFINE_SPINLOCK(psinfo_lock);
static dtrace_psinfo_t *psinfo_free_list;
+#ifdef CONFIG_DT_DEBUG
+void dt_debug_probe(uint64_t a0, uint64_t a1, uint64_t a2, uint64_t a3,
+ uint64_t a4, uint64_t a5, uint64_t a6, uint64_t a7)
+{
+ DTRACE_PROBE(test, uint64_t, a0, uint64_t, a1, uint64_t, a2,
+ uint64_t, a3, uint64_t, a4, uint64_t, a5,
+ uint64_t, a6, uint64_t, a7);
+}
+#endif
+
/*
* Work queue handler to clean up psinfo structures for tasks that no longer
* exist.
spin_unlock_irqrestore(&psinfo_lock, flags);
#ifdef CONFIG_DT_DEBUG
- DTRACE_PROBE(test, uint64_t, 10, uint64_t, 20, uint64_t, 30,
- uint64_t, 40, uint64_t, 50, uint64_t, 60,
- uint64_t, 70, uint64_t, 80);
+ dt_debug_probe(10, 20, 30, 40, 50, 60, 70, 80);
#endif
while (psinfo) {