Date: Wed, 2 Nov 2005 10:37:02 +0100 From: Viktor Vasilev <viktor.vasilev@stud.tu-darmstadt.de> To: freebsd-hackers@freebsd.org Subject: sysprof, interrupting threads Message-ID: <20051102093702.GB624@ilium.0xdeadc0de.net>
next in thread | raw e-mail | index | archive | help
Hello fellow hackers, I was thinking of porting the linux sysprof kernel and userland tools to FreeBSD. I spent some time studying the code and wrote a skeleton driver that uses the callout mechanism to wake up periodically. That was only to discover, that the context in which the driver awakes is that of the software clock interrupt. The linux sysprof driver uses a timer hook API that was introduced in the 2.6 kernel series. I don't have a profound understanding of the linux kernel but it seems that the hook gets executed in the process context that was currently executing as the tick happened. My question is, is there a better place to plant the code, so that it executes periodically in the context of the current runnging thread? I was also thinking of traversing the list of processes but I'm not sure if I can tell which one was interrupted by the swi. Any suggestions are wellcome. Best regards, Viktor -- I think and think for months and years. Ninety nine times, the conclusion is false. The hundredth time I am right. -- Albert Einstein
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051102093702.GB624>