site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Rmneec6sx4j3WHg/0xJwQEbJUX2MtcYGaeMdwWvgCt4=; b=CF66Rf5sAV4iMhzpoG8nSglb6nJbB/+cEmIvffH8HfiXMEiYHE5BBIiFLNI0Wo30Uu L4e0OgxvmMoS1bQJt6S7Eb40JQv0ly8loQWVgWIZOm4itfKiJ03Ket3zyUCmjw3zjS1Q TPwYkhNsVqklsMIe63gP+ToMNHLjNxMpOGus4= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=aSdP9G+dbYzzldUinSRBz5xXhNi7V5ylCwoI1SFS2qM9CXn49qO+9Jsyyzek/nwUda 7WUFzoXuMP2lq467URHu4F6s+L6fhfUIIWL6cj149Yex3Njgt/H2IRr1XC5XVeik2wZV gG2r1+Bn+Q7qtviqk6eZK2DAen4+JxFKkmnB4= On Thu, Jun 17, 2010 at 12:55 AM, Terry Lambert <tlambert@apple.com> wrote:
On Jun 16, 2010, at 2:22 AM, Bogdan Harjoc wrote: Generally speaking, the kernel, including any KEXTs you write, exists to provide services for processes. Processes do not exist to provide notifications or events to the kernel.
Makes sense. Since the KEXT already depends on a daemon to filter the events, collecting the events using kqueue would require little extra effort, if it were reliable. But as Wade suggested, I'll just submit an enhancement request for process startup/exit notifications. In the mean time, I'd like to ask is this approach is correct: call proc_find(pid) which takes a reference to the proc_t, and then proc_rele(pid) when the exit notification from kqueue comes. This avoids the race, but will the process exit while I am holding a reference to it ?
The more correct model you should probably be looking at here is to report the activity up to a user space monitoring process, and have user space aggregate that activity with the process lifecycle events for the processes you are monitoring -- in other words, do your work in user space, and only do data gathering in kernel space.
Bogdan _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com