Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178088426
D62153.1795924429.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
921 B
Referenced Files
None
Subscribers
None
D62153.1795924429.diff
View Options
diff --git a/sys/x86/x86/sdt_machdep.c b/sys/x86/x86/sdt_machdep.c
--- a/sys/x86/x86/sdt_machdep.c
+++ b/sys/x86/x86/sdt_machdep.c
@@ -15,6 +15,14 @@
#define SDT_PATCH_SIZE 5
+/*
+ * The instruction that _SDT_ASM_PATCH_INSTR assembles to,
+ * "nopw 0(%rax,%rax,1)".
+ */
+static const uint8_t sdt_nop[SDT_PATCH_SIZE] = {
+ 0x66, 0x0f, 0x1f, 0x04, 0x00
+};
+
/*
* Return true if we can overwrite a nop at "patchpoint" with a jump to the
* target address.
@@ -67,7 +75,6 @@
void
sdt_tracepoint_restore(uintptr_t patchpoint)
{
- uint8_t instr[SDT_PATCH_SIZE];
bool old_wp;
#ifdef __amd64__
@@ -75,10 +82,7 @@
("%s: invalid patchpoint %#lx", __func__, patchpoint));
#endif
- for (int i = 0; i < SDT_PATCH_SIZE; i++)
- instr[i] = 0x90;
-
old_wp = disable_wp();
- memcpy((void *)patchpoint, instr, sizeof(instr));
+ memcpy((void *)patchpoint, sdt_nop, sizeof(sdt_nop));
restore_wp(old_wp);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 29, 3:53 AM (9 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42078269
Default Alt Text
D62153.1795924429.diff (921 B)
Attached To
Mode
D62153: amd64/sdt: Use a single NOP for disabled probes
Attached
Detach File
Event Timeline