summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_prof.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2001-09-01 05:47:58 +0000
committerdillon <dillon@FreeBSD.org>2001-09-01 05:47:58 +0000
commitb781e73eb6405fe86caeec452205004bffdcea5b (patch)
treeb7aa248569b224dc69ea56ec3af0521cfaf9fe65 /sys/kern/subr_prof.c
parent8e06415e8af8c1f858276393c287d1470ddc50b1 (diff)
downloadFreeBSD-src-b781e73eb6405fe86caeec452205004bffdcea5b.zip
FreeBSD-src-b781e73eb6405fe86caeec452205004bffdcea5b.tar.gz
Pushdown Giant for: profil(), ntp_adjtime(), ogethostname(),
osethostname(), ogethostid(), osethostid()
Diffstat (limited to 'sys/kern/subr_prof.c')
-rw-r--r--sys/kern/subr_prof.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c
index 015f666..e177065 100644
--- a/sys/kern/subr_prof.c
+++ b/sys/kern/subr_prof.c
@@ -351,6 +351,9 @@ struct profil_args {
u_int scale;
};
#endif
+/*
+ * MPSAFE
+ */
/* ARGSUSED */
int
profil(p, uap)
@@ -359,12 +362,17 @@ profil(p, uap)
{
register struct uprof *upp;
int s;
+ int error = 0;
+
+ mtx_lock(&Giant);
- if (uap->scale > (1 << 16))
- return (EINVAL);
+ if (uap->scale > (1 << 16)) {
+ error = EINVAL;
+ goto done2;
+ }
if (uap->scale == 0) {
stopprofclock(p);
- return (0);
+ goto done2;
}
upp = &p->p_stats->p_prof;
@@ -377,7 +385,9 @@ profil(p, uap)
startprofclock(p);
splx(s);
- return (0);
+done2:
+ mtx_unlock(&Giant);
+ return (error);
}
/*
OpenPOWER on IntegriCloud