{
/*
* A little unusual, but potentially necessary. While we could use a
- * single NOP sequence of length SDT_NOP_SIZE, we need to consider the
+ * single NOP sequence of length ASM_CALL_SIZE, we need to consider the
* fact that when a SDT probe point is enabled, a single invalid opcode
* is written on the first byte of this NOP sequence. By using a
- * sequence of a 1-byte NOP, followed by a (SDT_NOP_SIZE - 1) byte NOP
+ * sequence of a 1-byte NOP, followed by a (ASM_CALL_SIZE - 1) byte NOP
* sequence, we play it pretty safe.
*/
add_nops(nops, 1);
switch (rval) {
case DTRACE_INVOP_NOPS:
/*
- * Probe points are encoded as a single-byte NOP,
- * followed by a multi-byte NOP. We can therefore
- * safely report this case as equivalent to a single
- * NOP that needs to be emulated. Execution will
- * continue with the multi-byte NOP.
+ * SDT probe points are encoded as either:
+ * - a 1-byte NOP followed by a multi-byte NOP
+ * - a multi-byte code sequence (to set AX to 0),
+ * followed by a multi-byte NOP
+ * In both cases, the total length of the probe point
+ * instruction is ASM_CALL_SITE bytes, so we can safely
+ * skip that number of bytes here.
*/
- rval = DTRACE_INVOP_NOP;
+ dargs->regs->ip += ASM_CALL_SIZE;
+ return NOTIFY_OK | NOTIFY_STOP_MASK;
case DTRACE_INVOP_MOV_RSP_RBP:
case DTRACE_INVOP_NOP:
case DTRACE_INVOP_PUSH_BP:
switch (rval) {
case DTRACE_INVOP_NOPS:
/*
- * Probe points are encoded as a single-byte NOP,
- * followed by a multi-byte NOP. We can therefore
- * safely report this case as equivalent to a single
- * NOP that needs to be emulated. Execution will
- * continue with the multi-byte NOP.
+ * SDT probe points are encoded as either:
+ * - a 1-byte NOP followed by a multi-byte NOP
+ * - a multi-byte code sequence (to set AX to 0),
+ * followed by a multi-byte NOP
+ * In both cases, the total length of the probe point
+ * instruction is ASM_CALL_SITE bytes, so we can safely
+ * skip that number of bytes here.
*/
- rval = DTRACE_INVOP_NOP;
+ dargs->regs->ip += ASM_CALL_SIZE;
+ return NOTIFY_OK | NOTIFY_STOP_MASK;
case DTRACE_INVOP_MOV_RSP_RBP:
case DTRACE_INVOP_NOP:
case DTRACE_INVOP_PUSH_BP: