Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[darwin-drivers] Hint: More Logging from the IOKit



Hello List,

while I was debugging my driver, I found out that you can raise the verbosity of the IOKit. As I  did not find this tip documented anywhere on the Web, I thought I share it with you.

Many parts of the IOKit check the variable gIOKitDebug for certain bits, and log accordingly.

You can easily set the variable at run time:

sysctl debug.iokit=VALUE

Alternatively, you can set it in the boot args

sudo nvram boot-args="io=VALUE"

And if you boot in various operating systems on the same machine regularly, you may find it worth your while to set this in the com.apple.Boot.plist with the Kernel Flags key.

See http://developer.apple.com/documentation/DeviceDrivers/Conceptual/WritingDeviceDriver/UBDeviceDriver/chapter_10_section_8.html for details.

As to the flags, they are listed in $XNU_ROOT/iokit/IOKit/IOKitDebug.h :

enum {
// loggage
    kIOLogAttach = 0x00000001ULL,
    kIOLogProbe = 0x00000002ULL,
    kIOLogStart = 0x00000004ULL,
    kIOLogRegister = 0x00000008ULL,
    kIOLogMatch = 0x00000010ULL,
    kIOLogConfig = 0x00000020ULL,
    kIOLogYield = 0x00000040ULL,
    kIOLogPower = 0x00000080ULL,
    kIOLogMapping = 0x00000100ULL,
    kIOLogCatalogue = 0x00000200ULL,
    kIOLogTracePower = 0x00000400ULL,

    kIOLogServiceTree = 0x00001000ULL,
    kIOLogDTree = 0x00002000ULL,
    kIOLogMemory = 0x00004000ULL,
    // available = 0x00008000ULL,
    kOSLogRegistryMods  = 0x00010000ULL, // Log attempts to modify registry collections

// debug aids - change behaviour
    kIONoFreeObjects = 0x00100000ULL,
    kIOLogSynchronous   = 0x00200000ULL, // IOLog completes synchrounsly
};

Things like kIOLogConfig or kIOLogMapping may be of interest for some of you.

At runtime, you can check the value of the gIOKitDebug variable with

sysctl debug.iokit

I thought it would be a good hint. That said, please let me know if this falls under the "DON'T TRY THIS AT HOME!" category.

Alex

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.