public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: zhou rui <zhourui.cn@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: profile my proto_hook.function
Date: Tue, 12 Apr 2011 16:03:46 +0200	[thread overview]
Message-ID: <1302617026.3233.49.camel@edumazet-laptop> (raw)
In-Reply-To: <BANLkTi==HczThr66Yr0-Rm-RkEUw44sqrg@mail.gmail.com>

Le mardi 12 avril 2011 à 22:00 +0800, zhou rui a écrit :
> hi
> I used a prot_hook(added via dev_add_pack,protocol=ETH_P_ALL) to
> process packets in kernel part.but the performance was bad
> 
> ksoftirqd used almost 100% cpu on my 1G nic(intel e1000,w/o RSS) XEON
> 5400 hypertown machine.
> 
> looks my  packet processing is too slow. but how to profile this?
> i.e. how many CPU resources used in softirq and normal kernel protocol
> stack(tcp/ip,etc)
> and how many used in my packet processing function?
> 
> and any idea to improve it?how about moving the processing function to driver?

You coud use perf tool, included in kernel sources

# cd ~your_kernel_sources
# cd tools/perf
# make

<run your workload, and record activity :>
# ./perf record -a -g sleep 10

Then later, you can take a look at results

./perf report




      reply	other threads:[~2011-04-12 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 14:00 profile my proto_hook.function zhou rui
2011-04-12 14:03 ` Eric Dumazet [this message]

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=1302617026.3233.49.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=zhourui.cn@gmail.com \
    /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