public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18
@ 2002-03-15  1:17 Larry Kessler
  2002-03-15  1:49 ` [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18y Alan Cox
  0 siblings, 1 reply; 12+ messages in thread
From: Larry Kessler @ 2002-03-15  1:17 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Brian,

I am responding to your comments in reverse order:

> One thing to remember, is that the really hard and important part of
> logging is not the part that can be legislated, or automated, it is
> making sure that the correct events are reported in a accurate manner

I could not agree more, and there has not really been any guidance for
developers about what correct and accurate events are (nor is it clear
that developers would follow the guidance, anyway).  Our focus,
obviously, has been on whether or not the existing logging capabilities 
facilitate the accurate recording of "correct" events.  I will comment
more on that below.

> I understand about POSIX standards, but POSIX standards are not the
> infallible word of of the diety of computing and sometimes are
> completely bogos.

True, but in this case the POSIX standard is not a standard, but 
currently only a draft, and we (the Linux event logging team) have 
been (and are continuing to be) directly involved it its writing,
editing, and (eventual, we hope) adoption as a standard.  Even so,
balloting could lead it into a direction that is contrary to what
is best for Linux, in which case we would drop the "POSIX compliant"
claims and do what's really needed.  I do not expect that to happen,
but you can never tell.

> Instead of adding
> extra kernel functionality, would it not be possible to define a text
> format to messages and some SIMPLE macros, to allow printk's to generate
> the desired information...
> ...it maye be possible to provide some formating guidelines
> and support to printk and some log analysis tools to provide 99%
> solution.

Ok, I am not conceding that your suggestion is "better" than event
logging, but I do like the concept and we have, in fact, been discussing
how to somehow get more information out of printk without asking kernel
maintainers to use a different API.  Specifically, we thought about 
renaming the printk() function and creating a printk macro.  In the
printk macro you would collect source file name, line number and
function name (and maybe some other useful info), and then call the
renamed printk function with the original message plus the additional
stuff (actually we were thinking call posix_log_write() with the orig.
message+addl. info and call the renamed printk with just the original
message).

Is this the sort of thing you had in mind ?

The problem we found is some code like this...

printk("<1>" "And the answer is... %d\n",
#ifdef ONE
1
#else
2
#endif
);

which the compiler/preprocessor rejects.  

Just casually looking I found at least 3 device drivers that log this
way.
Do you think device driver maintainers would be willing to change  
their code to avoid this problem (and the Linux community be willing to 
abandon this style of coding with printks)?

I don't know if you've had a chance to look at the event filtering,
event
notification, and log management utilities that we have in the user lib,
but these work with text-based events, whether printks forwarded to
event 
logging, or messages logged with our new logging functions.  So the user
lib does have some log analysis/processing features like you've
mentioned. 

Another limitation that printk has is that everything has facility of
LOG_KERN.  Don't you think its useful to be able to define a facility of
"XYZ Ethernet 10/100 Device Driver" (which in event logging generates a 
32-bit CRC that gets stored in the event records, and gets converted
back 
to the facility name by the aforementioned utilities)?

I am absolutely open to suggestions for making printk messages better
and more useful--we just haven't figured-out how yet.

Thanks,
Larry Kessler
http://evlog.sourceforge.net/

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18
@ 2002-03-15 17:57 Larry Kessler
  0 siblings, 0 replies; 12+ messages in thread
From: Larry Kessler @ 2002-03-15 17:57 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: ecki-news2002-02

Bernd wrote...
> Yes, I think it is at least needed to share the ring buffer.

Ideally, you are right.  But messing around with the printk
functionality is risky and could be unpopular in the community,
especially if you are only conserving what really amounts to
a small amount of memory (16,32 or 64K, for printk ring buffer).

> Posix and BSD Auditing events are an example for that. In secure mode
> the
> system must be halted on overflow. a printk replacement will want to
> keep the
> oldest entries and a enterprise event system may want to keep the
> oldest.

So I think what you want is to set a "watch" for certain events and
when those event(s) are written to the buffer (1) trigger some action, 
like halting the machine, and (2) save the last n events leading-up to 
the trigger-action.  You might also want to initiate a crash-dump and 
be able to retrieve the pinned events from the dump.

Am I on the right track ?  Can you give me some idea which information
you would watch for in the events (facility, severity, event_type,
etc.)?  

> And I think a flexible policy will allow everybody to
> be
> happy with your framework. the only way to get it accepted, right?

Its not clear that the sort of requirement you are describing...
...In secure mode the system must be halted on overflow...
is needed by the majority of potential event logging users, so could
what you are asking for be implemented as a kernel module ?

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18
@ 2002-03-14  1:07 Larry Kessler
  2002-03-14  2:32 ` Bernd Eckenfels
  2002-03-14 19:45 ` Brian Beattie
  0 siblings, 2 replies; 12+ messages in thread
From: Larry Kessler @ 2002-03-14  1:07 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: ecki-news2002-02, kessler

> Bernd wrote...
> Of course it is only useful if it is not another framework because this will
> lead to kernel clutter. So do we want to replace netlink and printk?

I checked and there are nearly 41,000 calls to printk in the 2.5.6 
kernel.  Getting every maintainer to change to event logging's write
functions
would be impossible.  Instead we want to provide enhanced logging
features 
for new and updated device drivers and other kernel code--more of a
"slow 
migration over time" approach.  We provided the feature that creates
POSIX
event records from printks so that System Admins, field service,
developers
testing and debugging their code (just to name a few) could still take
advantage of the new tools provided with the user lib (too numerous to
mention, 
but see the spec on the website) for handling printk messages. 

Of course, even with better tools there may still be those who only want
to see
printks in /var/log/messages.  It has even been suggested that events in
the 
event log which did not originate with printk should also be written to
/var/log/messages, for this very reason. 

Another way to "replace" printk is not to replace the function itself,
but
instead combine printk's ring buffer with the event logging buffer, but
still
the end-user would see events in the event log and/or messages in
/var/log/messages.  A proposal like that at this point in time would
probably
be too radical, but is certainly a possibility.

I am sorry, I am not really familiar with netlink.  Please explain why
you 
think netlink could be (or perhaps should be) replaced with event
logging ?      

> Well, depending on the type of events one can even think about a "halt" like
> it is required for audit trail overflow.

I think the point you are making is that there are certain events that
you
never under any circumstances want to miss or discard because of their 
importance.  printk does not address this nor does it report the fact
that
messages in the ring buffer have even been overwritten.  Event logging
is a little better, but it does not prevent the loss of events either.

One scheme we have thought of is to add dynamic event buffer allocation,
so
that if the static event buffer overflows additional dynamic buffering
will
activate until the logging daemon can read-out the events.  Another 
possibility is the "selective" discarding of lower severity events when
the
event buffer reaches a high-water mark.

> What would be nice is a policy for each type of event:
>
> - overwrite old/new/halt
> - rate limit
> - buffer size

>From the beginning our design appoach has been to "write everything"
into the
kernel buffer (or at least try) and apply policies, screening,
filtering, 
etc. only in user-space for both performance reasons and to reduce the 
complexity of the code in the kernel.  Given the relatively low
occurance
of events overruning the buffer; or, evlogd logging daemon not running
and
draining them out, the "per-event type"  policy you seem to be
suggesting 
*I think* would add more complexity than dynamically allocating more
buffer
space when needed.  Please elaborate if you disagree.    

Regards,
Larry Kessler
http://evlog.sourceforge.net/

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18
@ 2002-03-12 22:15 Larry Kessler
  2002-03-12 22:41 ` Dominik Kubla
  2002-03-13  0:33 ` Bernd Eckenfels
  0 siblings, 2 replies; 12+ messages in thread
From: Larry Kessler @ 2002-03-12 22:15 UTC (permalink / raw)
  To: linux-kernel

Please cc: kessler@us.ibm.com with your comments.

Patch for kernel version 2.5.6:
http://prdownloads.sourceforge.net/evlog/evlog-1.3.0_kernel2.5.6.patch
Patch for kernel version 2.4.17, 2.4.18:
http://prdownloads.sourceforge.net/evlog/evlog-1.3.0_kernel2.4.17.patch

This patch, in combination with the event logging and event
notification user library, provides a comprehensive event 
logging package based on the draft POSIX standard 1003.25.
See http://evlog.sourceforge.net/ for details and downloads.

A summary of the kernel patch:
1) A static kernel buffer is implemented for POSIX events logged
   in the kernel.  Size is configurable during kernel build.
2) If the buffer overruns the oldest events are kept, newest
   discarded, and a count of discarded events is reported.
3) Optionally, POSIX events can be created from printk messages
   (printk messages still go to /var/log/messages, as before)
4) Functions are provided for: 
   - logging directly to kernel event buffer (text string or
     binary data which gets formatted outside of the kernel)
   - registering facilities beyond the standard ones in syslog.h
     (device drivers can have facility other than KERN)
5) Events are displayed on the system console as single-line
   summary messages (based on printk's default console logging level).

Please be clear that this is NOT intended to replace printk and
syslog, but to coexist with them and provide additional 
capabilities not available with printk/syslog that are highly 
desirable in large servers and Telecom environments (to name a few).

Larry Kessler

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2002-03-15 17:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-15  1:17 [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18 Larry Kessler
2002-03-15  1:49 ` [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18y Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2002-03-15 17:57 [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18 Larry Kessler
2002-03-14  1:07 Larry Kessler
2002-03-14  2:32 ` Bernd Eckenfels
2002-03-14 19:45 ` Brian Beattie
2002-03-15  1:10   ` Larry Kessler
2002-03-12 22:15 Larry Kessler
2002-03-12 22:41 ` Dominik Kubla
2002-03-12 23:02   ` Larry Kessler
2002-03-13  1:10     ` Bernd Eckenfels
2002-03-13  0:33 ` Bernd Eckenfels

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox