summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-03-30 09:17:46 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2019-03-30 09:17:46 +0100
commit4f0bfe0fb8dc608a94fe429c5ddb12e58997e1ce (patch)
treefc81407d959370278dfdb53da69c5ab8b3fef55c /sys/include
parentac3147a9c58f339f9b978ab087464912c16bc8f8 (diff)
dtracy: avoid dmachlock() race
between being commited to a machno and having acquired the lock, the scheduler could come in an schedule us on a different processor. the solution is to have dtmachlock() take a special -1 argument to mean "current mach" and return the actual mach number after the lock has been acquired and interrupts being disabled.
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/dtracy.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/include/dtracy.h b/sys/include/dtracy.h
index 438a8d1e7..92f458657 100644
--- a/sys/include/dtracy.h
+++ b/sys/include/dtracy.h
@@ -241,7 +241,7 @@ void dtsync(void);
DTProbe *dtpnew(char *, DTProvider *, void *aux);
int dtpmatch(char *, DTProbe ***);
int dtplist(DTProbe ***);
-void dtptrigger(DTProbe *, int, DTTrigInfo *);
+void dtptrigger(DTProbe *, DTTrigInfo *);
/* expression functions */
int dteverify(DTExpr *);
@@ -285,7 +285,7 @@ uvlong dttime(void); /* return current timestamp */
void *dtrealloc(void *, ulong);
void dtfree(void *);
void *dtmalloc(ulong);
-void dtmachlock(int); /* lock the per-cpu lock */
+int dtmachlock(int); /* lock the per-cpu lock */
void dtmachunlock(int); /* unlock the per-cpu lock */
void dtcoherence(void); /* memory barrier */
uvlong dtgetvar(int); /* return the value of a variable */