Re: Writing to system.log from within a filesystem kext
Re: Writing to system.log from within a filesystem kext
- Subject: Re: Writing to system.log from within a filesystem kext
- From: Herb Petschauer <email@hidden>
- Date: Tue, 18 Oct 2005 09:32:22 -0700
I think it has been mentioned before but:
USBLog() - which you use in concert with Klog.kext and usblogger (or
USB Prober I think). Very nice, rarely drops text.
If you search the archives for USBLog you will probably find a
reference to "Firelog" - or some such name - which you can also use...
hth,
H.
On 10/17/05, Ron Aldrich <email@hidden> wrote:
> I'd have thought that it was an overflow, except that it always happens on
> certain calls to printf.
>
> As it turns out, the problem was that the string I was printing contains the
> "<" character. For some reason everything between that character and the
> end of the string would be omitted.
>
> I have absolutely no idea why printing a "<" character would cause that - it
> seems pretty brain damaged to me...
>
> I'm sure that eventually I'll be running into problems with buffer overflows
> (I used to work around those with IOSleep calls, but that seems out of the
> question now).
>
> Best Regards,
>
> Ron Aldrich
> Software Architects, Inc.
>
>
> On Oct 17, 2005, at 3:41 PM, Brian Bergstrand wrote:
>
>
> -----BEGIN PGP SIGNED MESSAGE-----
>
> Hash: SHA1
>
>
>
>
> The kernel log buffer has a limited fixed size, and if the system is busy,
> or you are logging a lot of debug info, it will overflow and the behavior
> you describe occurs. IOLog won't help either as it uses the same log
> interface as the rest of the kernel. Pre-Tiger, I used to call logwakeup()
> for debug logs, and it helped sometimes (but not that much), but this has
> been removed from the Tiger KPI.
>
>
>
>
> So, the bad news is there's not anything you can do other than write your
> own logging mechanism. This should actually be fairly simple using the
> kernel control sockets. You could send log packets from your kext to a user
> land process that then logs to a file.
>
>
>
>
> #include <sys/kern_control.h>
>
>
>
>
> On Oct 17, 2005, at 5:01 PM, Ron Aldrich wrote:
>
>
>
>
>
> Folks,
>
>
>
>
> I'm having a bit of a problem writing debugging information to system.log
> from with my filesystem kext.
>
>
>
>
> I'm using printf to write to the system log, and it only works part of the
> time.
>
>
>
>
> Some of the printf statements work correctly, but others only display the
> last character of the string which I'm attempting to print.
>
>
>
>
> In older versions of the OS (10.3 and prior) I was using IOLog (and IOSleep)
> to make sure the string made it to system.log properly, but it doesn't
> appear that I can use IOLog any more because of the new rules for declaring
> KPI dependancies.
>
>
>
>
> Has anyone else run into this kind of problem?
>
>
>
>
> Thanks,
>
>
>
>
> Ron Aldrich
>
> Software Architects, Inc.
>
>
>
>
>
>
>
>
> Brian Bergstrand
>
> <http://www.bergstrand.org/brian/> PGP Key ID: 0xB6C7B6A2
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
>
> Version: GnuPG v1.4.1 (Darwin)
>
>
>
>
> iD8DBQFDVCixedHYW7bHtqIRApzJAJ4tf7InGWp8PZdTO7YCRrqsQvw1sACeOuG4
>
> ml2iXIdNEeE8fyGh72I8WYg=
>
> =9uaT
>
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-kernel mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden