Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Dec 1995 13:22:49 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@freefall.freebsd.org, davidg@Root.COM
Cc:        CVS-committers@freefall.freebsd.org, cvs-sys@freefall.freebsd.org
Subject:   Re: cvs commit: src/sys/kern subr_prof.c
Message-ID:  <199512260222.NAA14941@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>  efficiency is recovered.  However, addupc() may be broken on plain
>>  i386's since it doesn't check for write permission like copyout().

>   Are you going to fix this? By replacing the use of it with addupc_task?

I wasn't sure that it's actually broken.  The profile buffer could be
validated in profil() (it should be in user space and writable).  Then
I think it could only be invalidated by a weird mmap() that makes it
readonly.  However, no up front validation is done.  pr_size could be
4G.

The whole NetBSD implementation should be copied but that's more than
I want to do right now.

BTW, I'd like to be able to statistically profile processes that don't
have profiling built into them.  The interface should be like ktrace's.
The main difficulty is mapping in the profiling buffer for another
process.  The addupc_intr()/addupc_task() interface should be able to
handle this (slowly) simply by switching to the other process.  However,
the process arg to these functions is bogus - these functions call
copyout() and other functions that only work if p == curproc.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512260222.NAA14941>