logging by kernel extensions - Aix

This is a discussion on logging by kernel extensions - Aix ; AIX has errsave() to log messages from kernel extensions. But size of errlog is limited to 1 MB. What is the workaround if you want to run your kernel module in debug mode and it gives out thousands of debug ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: logging by kernel extensions

  1. logging by kernel extensions

    AIX has errsave() to log messages from kernel extensions. But size of
    errlog is limited to 1 MB. What is the workaround if you want to run
    your kernel module in debug mode and it gives out thousands of debug
    log messages. In Linux we have /var/log/messages stores all the
    kernel messages and logs can be archived in messages.X files. Anything
    equivalent in AIX?

  2. Re: logging by kernel extensions

    Ashwani schrieb:
    > AIX has errsave() to log messages from kernel extensions. But size of
    > errlog is limited to 1 MB. What is the workaround if you want to run
    > your kernel module in debug mode and it gives out thousands of debug
    > log messages. In Linux we have /var/log/messages stores all the
    > kernel messages and logs can be archived in messages.X files. Anything
    > equivalent in AIX?


    errlog size can be changed, see man errdemon and here the -s flag.
    Sure, AIX has syslog. But you need configure it (see the file
    /etc/syslog.conf), then refresh/restart syslogd. For more info see
    the man page for syslogd too.
    printf/fprintf should work too (kernel stdout/stderr I think is the
    current system console).
    Then there is trace, see the General Programming Guide, chapter
    'Trace Facility'.
    And last but not least KDB (see KDB kernel debugger and kdb command
    in the AIX docu). In case you need to do real debugging.

    Use errlog only for errors (startup, stop messages for some subsystems
    are logged there too).
    To log debug info I hope you'll build a debug version of your extension.
    Means, your debug code is guarded by #ifdef DEBUG (you don't want to
    have thousands of calls to syslog/printf in the production extension).
    The final version may still do some syslog calls (critical messages,
    etc). For a more complete log consider trace (to be able to log the
    flow, parameters, etc). Trace is much less overhead. And even if the
    system crashes, the last trace buffers can be recovered from the dump
    (no info is lost).



+ Reply to Thread