Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > The Linux Kernel
Reload this Page Processor time spent on Network stack
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

The Linux Kernel Compiling, theory, programming or other discussion about the linux kernel

Reply
 
Thread Tools Display Modes
Old 05-31-2008   #1 (permalink)
matrixkarthik
Just Joined!
 
Join Date: May 2008
Posts: 1
Processor time spent on Network stack

Dear all,

Can anyone help me out in finding the processor time spent on the kernel network stack ? I have a TCP/IP offload Engine module that bypasses the INET, TCP and IP layers of the linux network stack and directs the incoming packets onto the gigabit ethernet card. Now I have to prove that the time spent by CPU on my module is less than the time spent on the existing kernel stack. The first function of the INET that is called after the BSD socket layer is inet_create( ) [this is in /net/ipv4/af_inet.c] and the last function that the CPU executes is ip_finish_output2( ) [this is in /net/ipv4/ip_output.c]. I require some means to fetch the time at the beginning and then at the end. At the user level time( ) function does it but what about in the kernel level ?

Thank you
karthikmatrix
matrixkarthik is offline   Reply With Quote
Old 05-31-2008   #2 (permalink)
cbogdan
Just Joined!
 
Join Date: Apr 2005
Location: Romania
Posts: 39
Send a message via Yahoo to cbogdan
Hi,

1. Try to run your program with strace:
strace -c -r -T ./program

2.
#include <time.h>
#include <iostream.h>
main() {
clock_t start, stop;
start=clock();
<-Your code here->
stop=clock();
cout<<"Total time:"<< (double)(stop-start)/CLOCK_PER_SEC<<"sec"<<"\n";
return 0;
}

Has Your TOE a packet generator too ?
cbogdan is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 01:20 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0