Re: Logging from kernel
Re: Logging from kernel
- Subject: Re: Logging from kernel
- From: Thulli <email@hidden>
- Date: Mon, 30 Oct 2006 06:18:17 +0530
>> the other is syslog()
really ? I assume you are refering to "Kernel.framework/Headers/sys/
syslog.h"
After including the header <sys/syslog.h> i tried using the following
calls in my kext.
void logpri(int);
void log(int, const char *, ...);
My kext has the following dependencies.
<key>com.apple.kpi.mach</key>
<string>8.0.0</string>
<key>com.apple.kpi.libkern</key>
<string>8.0.0</string>
<key>com.apple.kpi.bsd</key>
<string>8.0.0</string>
Now kextload fails, saying..
kextload: extension ./MyKext.kext appears to be valid
kld(): Undefined symbols:
_log
_logpri
Changing the dependency to a more generic "com.apple.kernel" version
8.8.1 solves the kextload problem.
Looks like log() and logpri() of syslog.h are unsupported ? b'coz i
could trace the dependency of log() to "com.apple.kpi.unsupported"
logpri() is there only in the header.
thanks,
Thulli.
On 26-Oct-06, at 7:57 PM, Justin C. Walker wrote:
On Oct 26, 2006, at 24:42 , Thulli wrote:
Can somebody advise on the best method for logging from a kext.
Considered the following.
1. printf and IOLog. I couldn't catch the logs just before my kext
caused panic :)
These are two choices; the other is syslog(). They all are pretty
much the same (i.e., they are wrappers around the same code),
although IOLog is designed for IOKit components.
2. Custom event logging: This method is very heavy. I don't want
to write a user land tool, just for logging purpose.
Not really a solution, for the same reasons the above aren't perfect.
3. asl looks very good. Is this available for a kext ?
Well, the header file is in /usr/include, which is a great
indicator for kernel use: can't (or shouldn't) be used in the kernel.
Your basic problem is that, if a panic occurs, the system grinds to
a halt and therefore, any scheme that makes use of system
mechanisms will halt along with it.
There is not a very good way to deal with this in the field, due to
the above.
Andrew's suggestion is about the best that I'm aware of. The
ability to send a kernel dump to a (local) dump server might be of
some help, depending on how your customers are set up.
Justin
--
Justin C. Walker, Curmudgeon at Large
Institute for the Absorption of Federal Funds
-----------
I'm beginning to like the cut of his jibberish.
-----------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden