Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143312562
D40962.id124454.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D40962.id124454.diff
View Options
diff --git a/sys/cddl/dev/kinst/kinst.h b/sys/cddl/dev/kinst/kinst.h
--- a/sys/cddl/dev/kinst/kinst.h
+++ b/sys/cddl/dev/kinst/kinst.h
@@ -35,6 +35,7 @@
kinst_patchval_t kp_patchval;
kinst_patchval_t kp_savedval;
kinst_patchval_t *kp_patchpoint;
+ uint8_t *kp_tramp;
struct kinst_probe_md kp_md;
};
diff --git a/sys/cddl/dev/kinst/trampoline.c b/sys/cddl/dev/kinst/trampoline.c
--- a/sys/cddl/dev/kinst/trampoline.c
+++ b/sys/cddl/dev/kinst/trampoline.c
@@ -49,8 +49,10 @@
TAILQ_HEAD_INITIALIZER(kinst_trampchunks);
static struct sx kinst_tramp_sx;
SX_SYSINIT(kinst_tramp_sx, &kinst_tramp_sx, "kinst tramp");
+#ifdef __amd64__
static eventhandler_tag kinst_thread_ctor_handler;
static eventhandler_tag kinst_thread_dtor_handler;
+#endif
/*
* Fill the trampolines with KINST_TRAMP_FILL_PATTERN so that the kernel will
@@ -220,6 +222,7 @@
sx_xunlock(&kinst_tramp_sx);
}
+#ifdef __amd64__
static void
kinst_thread_ctor(void *arg __unused, struct thread *td)
{
@@ -240,10 +243,12 @@
*/
kinst_trampoline_dealloc(tramp);
}
+#endif
int
kinst_trampoline_init(void)
{
+#ifdef __amd64__
struct proc *p;
struct thread *td;
void *tramp;
@@ -296,12 +301,21 @@
out:
sx_xunlock(&kinst_tramp_sx);
sx_sunlock(&allproc_lock);
+#else
+ int error = 0;
+
+ sx_xlock(&kinst_tramp_sx);
+ TAILQ_INIT(&kinst_trampchunks);
+ sx_xunlock(&kinst_tramp_sx);
+#endif
+
return (error);
}
int
kinst_trampoline_deinit(void)
{
+#ifdef __amd64__
struct trampchunk *chunk, *tmp;
struct proc *p;
struct thread *td;
@@ -324,6 +338,14 @@
TAILQ_FOREACH_SAFE(chunk, &kinst_trampchunks, next, tmp)
kinst_trampchunk_free(chunk);
sx_xunlock(&kinst_tramp_sx);
+#else
+ struct trampchunk *chunk, *tmp;
+
+ sx_xlock(&kinst_tramp_sx);
+ TAILQ_FOREACH_SAFE(chunk, &kinst_trampchunks, next, tmp)
+ kinst_trampchunk_free(chunk);
+ sx_xunlock(&kinst_tramp_sx);
+#endif
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 29, 6:51 PM (4 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28088636
Default Alt Text
D40962.id124454.diff (1 KB)
Attached To
Mode
D40962: kinst: start moving towards per-probe trampolines
Attached
Detach File
Event Timeline
Log In to Comment