From: "will fitzgerald" <will_m_fitzgerald@yahoo.co.uk>
To: linux-kernel@vger.kernel.org
Subject: printk log problem
Date: Sat, 20 Jul 2002 14:42:35 +0100 (BST) [thread overview]
Message-ID: <20020720134235.65542.qmail@web12903.mail.yahoo.com> (raw)
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
reply other threads:[~2002-07-20 13:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020720134235.65542.qmail@web12903.mail.yahoo.com \
--to=will_m_fitzgerald@yahoo.co.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®