Page MenuHomeFreeBSD

D43450.id132739.diff
No OneTemporary

D43450.id132739.diff

diff --git a/sys/kern/kern_condvar.c b/sys/kern/kern_condvar.c
--- a/sys/kern/kern_condvar.c
+++ b/sys/kern/kern_condvar.c
@@ -43,8 +43,9 @@
#include <sys/sleepqueue.h>
#include <sys/resourcevar.h>
#ifdef KTRACE
-#include <sys/uio.h>
#include <sys/ktrace.h>
+#include <sys/uio.h>
+#include <sys/user.h>
#endif
/*
@@ -107,6 +108,9 @@
_cv_wait(struct cv *cvp, struct lock_object *lock)
{
WITNESS_SAVE_DECL(lock_witness);
+#ifdef KTRACE
+ char wmesg[WMESGLEN + 1];
+#endif
struct lock_class *class;
struct thread *td;
uintptr_t lock_state;
@@ -114,8 +118,12 @@
td = curthread;
lock_state = 0;
#ifdef KTRACE
- if (KTRPOINT(td, KTR_CSW))
- ktrcsw(1, 0, cv_wmesg(cvp));
+ if (KTRPOINT(td, KTR_CSW)) {
+ strlcpy(wmesg, cv_wmesg(cvp), sizeof(wmesg));
+ ktrcsw(1, 0, wmesg);
+ } else {
+ wmesg[0] = '\0';
+ }
#endif
CV_ASSERT(cvp, lock, td);
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock,
@@ -145,7 +153,7 @@
#ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
- ktrcsw(0, 0, cv_wmesg(cvp));
+ ktrcsw(0, 0, wmesg);
#endif
PICKUP_GIANT();
if (lock != &Giant.lock_object) {

File Metadata

Mime Type
text/plain
Expires
Fri, May 15, 10:15 AM (13 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33080224
Default Alt Text
D43450.id132739.diff (1 KB)

Event Timeline