(no subject)

From: william fitzgerald (will_m2_fitzgerald@yahoo.co.uk)
Date: Sat Jul 20 2002 - 08:40:33 EST


hi all,

i have a printk formating question.

in my /var/log/trace file i have kernel debug messages
being logged there.

it is in the format of: (for example)

 jul 20 13:50 homer kernel: >2 <7> 1 <7> 2
<7>4 and so on.

on the next line i have jul 20 13:50 homer kernel:
>3000 <7> 3500 <7> 2070 <7>2500 and so on.

what i'm printing to this file is an an array of
buffered printk's of trace points in the
kernel that prints a functions id and its time.

 my problem is how do you get rid of the "jul 20 13:50
homer kernel:" part. i need to analysis the file later
on and using the fseek(fp,offset,SEEK_SET)
command i can bypass the first "jul 20 13:50 homer
kernel:" but not the second or third and so on.

 what i do is open the the trace file after i pump
packets trough router (linux) (which triggers
certain net funtions in which contain my function to
buffer up printk's until array is full.)

 next i want to take out all the function id's and
times from the trace file and insert them back into a
new array (in user space, which i have being doing) so
i can calculate what time each function took to work
on an inoming packet.

 i use fseek to bypass the "jul 20 13:50 homer
kernel:" and write the
remainder ">2 <7> 1 <7> 2 <7>4" to a new file.

from here i open this new file and use :

 while ((fscanf(fpnew," %s %d",c,&d))!=EOF){

 b[i]=d; // stores the numbers not the <7>

i++;
}

so my array would be now :
 2 1 2 4 3000 3500 2070 2500
(2,1,2,4 are function id's such as 2 = ip_forward
entry, 1 = ip_forward exit and so on and the rest of
the array is the correspong times)

from here i have no problem working on these results
using stacks etc.

 all this is fine, if i could get my results on one
line in the original trace file but as i found out
this is not the case.

so how can i turn off printing
"jul 20 13:50 homer kernel:" entirely or solve the
repeated "jul 20 13:50 homer kernel:" print outs?

is it to do with the printk.c file or syslog.c or
klog.c files? (i can't find syslog.c or klog.c files,
i
assumed the existed as something runs syslogd and
klogd)

many thanks in advance,
william

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html



This archive was generated by hypermail 2b29 : Tue Jul 23 2002 - 22:00:01 EST