2001-11-13 12:02:58

by william fitzgerald

[permalink] [raw]
Subject: printk performance logging without syslogd for router

hi all,

(perforamnce logging of network stack through a
linux router)

the main question:

is there a way i can buffer or record the printk
statements and print them to disk after my
packets have gone through the router?

my understanding of printk is that each time it
is encountered it is written to disk by syslogd
as i have been told by Erik .so for a lot of
packets there will be alot of writes,therefore
slowing the system and producing false results.

so lets cut out syslogd and just use the -f
option on klogd.
does this decrease the huge slow down of
writting printk's?

basically is there a way i can buffer or record
the printk statements and print them to disk
after my packets have gone through the router?
do i edit the printk.c file and change the
line:

static char buf[1024];
and increase the size of the array?

or do i edit the klogd.c program and change
something in there?

i'm still at a loose end!

many thanks in advance,
will.





Beer Mail, brought to you by your friends at beer.com.


2001-11-13 12:16:09

by Peter Wächtler

[permalink] [raw]
Subject: Re: printk performance logging without syslogd for router

william fitzgerald wrote:
>
> hi all,
>
> (perforamnce logging of network stack through a
> linux router)
>
> the main question:
>
> is there a way i can buffer or record the printk
> statements and print them to disk after my
> packets have gone through the router?
>

there is an option in syslogd to prevent immediatly
writing to the logfile:

prefix the log with a dash:

kern.* -/var/log/kernelmessages

2001-11-13 12:28:41

by william fitzgerald

[permalink] [raw]
Subject: Re: Re: printk performance logging without syslogd for router


---- Begin Original Message ----
From: Peter W?chtler <[email protected]>
Sent: Tue, 13 Nov 2001 13:15:45 +0100
To: william fitzgerald
<[email protected]>
CC: [email protected]
Subject: Re: printk performance logging without
syslogd for router


william fitzgerald wrote:
>
> hi all,
>
> (perforamnce logging of network stack through a
> linux router)
>
> the main question:
>
> is there a way i can buffer or record the
printk
> statements and print them to disk after my
> packets have gone through the router?
>

there is an option in syslogd to prevent
immediatly
writing to the logfile:

prefix the log with a dash:

kern.* -/var/log/kernelmessages

---- End Original Message ----

what does klogd do?

i thought klogd writes to disk if you turn off
syslogd.that way you only have one over head.




Beer Mail, brought to you by your friends at beer.com.

2001-11-13 12:35:39

by Peter Wächtler

[permalink] [raw]
Subject: Re: printk performance logging without syslogd for router

william fitzgerald wrote:
>
> ---- Begin Original Message ----
> From: Peter W?chtler <[email protected]>
> Sent: Tue, 13 Nov 2001 13:15:45 +0100
> To: william fitzgerald
> <[email protected]>
> CC: [email protected]
> Subject: Re: printk performance logging without
> syslogd for router
>
> william fitzgerald wrote:
> >
> > hi all,
> >
> > (perforamnce logging of network stack through a
> > linux router)
> >
> > the main question:
> >
> > is there a way i can buffer or record the
> printk
> > statements and print them to disk after my
> > packets have gone through the router?
> >
>
> there is an option in syslogd to prevent
> immediatly
> writing to the logfile:
>
> prefix the log with a dash:
>
> kern.* -/var/log/kernelmessages
>
> ---- End Original Message ----
>
> what does klogd do?
>
> i thought klogd writes to disk if you turn off
> syslogd.that way you only have one over head.
>

OK, normally klogd pushes the messages to syslog.
Then syslogd decides where and how to write to disk.

If you use "klogd -f /tmp/logfile" I don't know how
to prevent immediate write()s to disk. The source code
of klogd will tell you :-)