public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Event logging vs enhancing printk
@ 2002-04-10 15:55 Larry Kessler
  0 siblings, 0 replies; 31+ messages in thread
From: Larry Kessler @ 2002-04-10 15:55 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Michael Holzheu wrote...
> I think it would be important to have both options:
> feed printk messages into posix event logging (this does
> the current patch as far as I know) 

The current patch forks the message to evlog inside the printk
function.  This thread is proposing that the printk function be
wrapped inside a macro so you could easily capture 
file/funcname/lineno of the calling function along with the
original printk message
(plus the other stuff stored in the evlog record header).
 
> AND feed events
> which are written with the new posix event APIs into the
> traditional syslogd logging.

This would be done in user-space, not in the kernel.  This is on
our enhancements list for event logging.

^ permalink raw reply	[flat|nested] 31+ messages in thread
[parent not found: <Pine.LNX.4.33.0204111358000.20722-100000@coffee.psychology.mcmaster.ca>]
* Re: Event logging vs enhancing printk
@ 2002-04-10 19:43 Larry Kessler
  0 siblings, 0 replies; 31+ messages in thread
From: Larry Kessler @ 2002-04-10 19:43 UTC (permalink / raw)
  To: linux-kernel mailing-list

Francois-Xavier Kowalski wrote:

> I am currently working in the Telecom area (signalling), on systems that
> usually process several tenths of thousands of telephone calls per
> second, during years. So I am the kind of guy interrested in having
> enhancements to the Linux logging sub-systems

You did not say what Linux distribution(s) you "favor", but MontaVista
has announced that Event Logging, Linux Trace Toolkit, and some other
features you probably want will be included in their Carrier Grade
Edition, Version 2.1.  

See http://www.mvista.com/dswp/MVLCGE.pdf for details.

^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: Event logging vs enhancing printk
@ 2002-04-10 17:13 Francois-Xavier Kowalski
  0 siblings, 0 replies; 31+ messages in thread
From: Francois-Xavier Kowalski @ 2002-04-10 17:13 UTC (permalink / raw)
  To: linux-kernel mailing-list; +Cc: Larry Kessler, evlog-developers Mailing-List

Hello,

Michel Dagenais <michel.dagenais@polymtl.ca> writes

>> People want to be able to get better debug information, with more detail
>> than is currently possible with printk, hence the Event logging project.
>
>I would like to emphasize that point; logging and tracing is of prime 
>importance in several areas:
>
>- Telecom and Security. Logging and auditing is a requirement in Telecom 
>  applications. It is for instance one of the important features of the 
>  Distributed Security Infrastructure proposed by Ericsson Research and to 
>  be presented in a couple of months at the Ottawa Linux Symposium.
>  The OSDL "Carrier Grade Linux" is certainly no different.
>

I am currently working in the Telecom area (signalling), on systems that 
usually process several tenths of thousands of telephone calls per 
second, during years. So I am the kind of guy interrested in having 
enhancements to the Linux logging sub-systems, to:

   1. Make my life easier when something goes wrong on my user's sites &
      I am supposed to gather the information from the logs.
   2. Make my user's life easier, to detect that something is going
      wrong on my machines (among hunderds of other ones), so that he
      can (try to) join me.
   3. Make my developer's life easier, not forcing me to code yet
      another log parser dedicated to one system & use open standard
      instead.
   4. Not make my Linux desktop system an intensive disk & CPU consume r
      for logging-only purpose (this is more a personal view than a
      professional constraint... :-)

I have been following the work done by evlog team since a few monthes 
now, so I can say now - as an evlog user - that it provides support for 
every requirements listed above, the following ways:

    * Evlog can be configured to flag log messages as part of a
      functional area (facilty) so that they can be logged in separated
      log files, regardless of the source of the log: kernel or
      userland. Take the case of a telecom protocol stack running partly
      in kernel space (device driver and/or protocol module) and partly
      in userland (application). Evlog can be configured a way so that
      logs coming from the telecom functional area are consolidated at
      the same place. If something goes wrong in kernel space, the logs
      of the whole telecom sub-system are placed together showing
      (mostly) the appropriated order of failure. This considerably
      helps troubleshooting a failure (my trouble-shooting life).
    *  From the telecom network supervision/management perspective (my
      user's life), the ability of evlog to have registered call-backs
      (in user-land) on specified (configured) events permits to:
          o Take automatic corrective actions if possible
          o Raise network alarms, so that the operators can log on the
            system & trouble-shoot it (or at least apply a corrective
            procedure & call a help-desk)
    * Evlog is a proposed standard to POSIX. I do hope that it will be
      accepted (as well as in the LSB, but this is probably another
      story...), so that the telecom stack & network supervision work
      can be re-used from one system to another.
    * Evlog can be totally optimized away at kernel configuration time
      (like any other CONFIG_XXX component, after all), or have no
      noticeable no cost when compiled-in & powered-off. (my day-to-day
      Linux desktop user life).

For the reasons listed above, I strongly support integrating evlog in 
the Linux kernel.

FiX

-- 
Francois-Xavier "FiX" KOWALSKI     /_ __    Tel: +33 (0)4 76 14 63 27
Telecom Infrastructure Division   / //_/    Fax: +33 (0)4 76 14 43 23
SigTech eXpert                      /       HP Telnet: 779-6327
                               i n v e n t  http://www.hp.com/go/opencall




^ permalink raw reply	[flat|nested] 31+ messages in thread
[parent not found: <OF58E93BB4.1862769F-ON85256B97.0047811A@pok.ibm.com>]
* Re: Event logging vs enhancing printk
@ 2002-04-10 13:08 Michael Holzheu
  0 siblings, 0 replies; 31+ messages in thread
From: Michael Holzheu @ 2002-04-10 13:08 UTC (permalink / raw)
  To: linux-kernel


Hi,

I am currently working in the Linux/390 (mainframe) team. Our
customers usually have really large installations with dozens
of Linux images. In those scenarios it is very important to
have a good logging mechanism to do service and support system
operators in their daily work.

I tried out posix event logging (kernel and userspace) on Linux/390.
In my eyes the main benefits of posix event logging compared to the
current printk/syslog solution are:

- Additional event data is automatically logged: PID,PGRP,UID,GID,etc.
- Appropriate user space API to get this additional event data
- Better event classification: It is possible to define multiple
  facilities and event types. E.g. write out an event with
  facility=scsi and event type = 4711 (hardware malfunction)
- Event registration:
  E.g. it is possible to register callbacks to all events with
  severity=critical, facility=scsi, data contains "xyz" etc.
  If a matching log entry is written the callback is triggered.

--> Automatic processing of events is much easier than with
    the existing printk/syslog mechanism

In my last project (before Linux/390) we tried to add Unix
support to an already existing automation software on OS/390.
This software basically is an automated operator, where you
can define rules what should be done, when message xyz is written
to the event log. On OS/390 there exist APIs for event
registration and getting additional event data.
With the existing syslogd solution it was really hard or
nearly impossible to get all the required information.
If we had something like posix event in those days,
logging things would have been much easier.

Because there probably exist a lot of linux installations
which rely on syslogd and perhaps do automatic parsing of
var/log/messages in order to find out that e.g. driver x
has problems and the operator should be informed etc.,
I think it would be important to have both options:
feed printk messages into posix event logging (this does
the current patch as far as I know) AND feed events
which are written with the new posix event APIs into the
traditional syslogd logging. Perhaps this could be
configurable via kernel parameters. So nobody would be
forced to use the new functions, the printk API remains
in the kernel, operators have the choice between syslogd
and posix event logging (at least for some transitional
period)

Best Regards

       Michael

------------------------------------------------------------------------
Linux for E-Server Development
Phone: +49-7031-16-2360,  Bld 71032-03-U09
Email: holzheu@de.ibm.com



^ permalink raw reply	[flat|nested] 31+ messages in thread
[parent not found: <OF7FF94B66.91DD315B-ON88256B95.00811EF0@boulder.ibm.com>]
* Event logging vs enhancing printk
@ 2002-04-08 23:18 Martin J. Bligh
  2002-04-08 22:38 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Martin J. Bligh @ 2002-04-08 23:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: Tony.P.Lee, kessler, alan, Dave Jones


Sorry to drag up an old thread again, but Larry Kessler and I have been 
having some conversations about this subject over the last week, and I 
said I'd post the conclusions we came to. There's a reference to the more
general plans for Event Logging at: http://evlog.sourceforge.net/


1. Making any significant changes to the way we call existing printk subsystem 
is going to be extremely unpopular - the sheer bulk of changes needed to
make this kind of update, the mindshift for future developers, and the number
of patches that aren't yet in the mainline kernel that we'd break makes this
unfeasible.

2. Making any significant changes to the way we log existing messages into
/var/log/messages et al via syslog is going to be extremely unpopular - it
will break sysadmin's setups and log parsing scripts.

3. People want to be able to get better debug information, with more detail
than is currently possible with printk, hence the Event logging project. 
It's unrealistic to expect wholesale conversion to the new event logging
calls, though some drivers and kernel areas could be converted. 

Given these constraints, it seems like it may be best to leave the printk
subsystem more or less "as is", add the evlog subsystem as a seperate
entity, whilst adding hooks to printk to capture messages into the evlog
subsystem as well. This could be reasonably easily implemented by
renaming the existing printk call to printk_raw, and creating a new printk
macro along the lines of:

# ifdef CONFIG_EVLOG
	#define printk printk_evlog
# else
	#define printk printk_raw
# endif.

where printk_evlog calls printk_raw, then logs an "enhanced" version of
the printk message to the *event logging* subsystem (not /var/log/messages),
including process PID (0 or -1 if in_interrupt() ), file, line number, function,
cpu number, accurate time stamp, etc, etc.

Some people were worried about buffer usage, I'd suggest these enhanced
messages go into the evlog buffer, rather than the existing printk buffer,
which should avoid overflow problems.

Some printk's are not "line atomic" (5845 cases) - ie they do something like this:
"for (i=0; i<10; i++) { printk ("%d ", i); } printk("\n");" - this causes two problems:

1. There seems to me to be a race within the current SMP code (with or without
the event logging stuff). It seems that segments of the line could get interspersed 
with segments of another line (or a whole other line) generated by another cpu ... 
is this correct?

2. If we have event logging enabled we don't want to log a heavyweight message 
for each little piece of the printk - we really want to have one per "event". 

Unfortunately, I can't see how to designate an "event" under the existing infrastructure
of printk, but we can get close by breaking things up per line of output.
The solution would be similar for both problems mentioned above: we need to 
buffer  per line until we have a complete line, then flush the buffer out with the 
normal calls. The question is then where to store the buffer, or rather how many 
buffers to create. As we potentially have a pre-emptible kernel, I think we need 
to make a per task buffer (potentially just on the task's kernel stack?). The only 
case I can think of where this might go wrong is during an interrupt handler ... 
as long as we cannot get preempted during an interrupt handler, I think we're OK 
here too.

There are apparently about 20 cases where we do something like this:

   printk("generic options"
# ifdef AUTOPROBE_IRQ
	"AUTOPROBE_IRQ"
# else
	"AUTOSENSE"
# endif
	);

I'd propose we just unwrap these to:

# ifdef AUTOPROBE_IRQ
   printk("generic options"	 "AUTOPROBE_IRQ");
# else
   printk("generic options"	"AUTOSENSE");
# endif

which seems simple enough.

Hopefully this all makes sense, I know much of this has been stated before,
but it seems useful to pull together the current set of thoughts in one summary.

M.





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

end of thread, other threads:[~2002-04-12 18:08 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-10 15:55 Event logging vs enhancing printk Larry Kessler
     [not found] <Pine.LNX.4.33.0204111358000.20722-100000@coffee.psychology.mcmaster.ca>
2002-04-12  9:30 ` Zoltan Menyhart
2002-04-12 12:41   ` Mark Hahn
2002-04-12 14:38     ` Martin J. Bligh
2002-04-12 18:04       ` Karim Yaghmour
  -- strict thread matches above, loose matches on Subject: below --
2002-04-10 19:43 Larry Kessler
2002-04-10 17:13 Francois-Xavier Kowalski
     [not found] <OF58E93BB4.1862769F-ON85256B97.0047811A@pok.ibm.com>
2002-04-10 14:19 ` sullivan
2002-04-10 13:08 Michael Holzheu
     [not found] <OF7FF94B66.91DD315B-ON88256B95.00811EF0@boulder.ibm.com>
2002-04-10  8:21 ` Zoltan Menyhart
2002-04-08 23:18 Martin J. Bligh
2002-04-08 22:38 ` Andrew Morton
2002-04-08 23:54   ` Martin J. Bligh
2002-04-08 23:07     ` Andrew Morton
2002-04-09  2:14       ` Martin J. Bligh
2002-04-10  1:23         ` Andrea Arcangeli
2002-04-10  5:28           ` Martin J. Bligh
2002-04-11  0:15             ` Andrea Arcangeli
2002-04-09 14:34     ` Bill Davidsen
2002-04-09 14:50       ` Martin J. Bligh
2002-04-09 13:24 ` Denis Vlasenko
2002-04-09 14:42   ` Martin J. Bligh
2002-04-09 18:17     ` John Alvord
2002-04-09 14:21 ` Michel Dagenais
2002-04-09 20:49   ` Brian Beattie
2002-04-09 21:16     ` Martin J. Bligh
2002-04-09 22:28       ` Brian Beattie
2002-04-10  0:29         ` Brian Beattie
2002-04-10  1:17         ` Martin J. Bligh
2002-04-10 11:24     ` Denis Vlasenko
2002-04-11 15:11     ` Michel Dagenais

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