Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #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

  2. #2
    Just Joined!
    Join Date
    Apr 2005

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

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

    Has Your TOE a packet generator too ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts