From: "O Mahony, Billy" <billy.o.mahony@intel.com>
To: "systemtap@sourceware.org" <systemtap@sourceware.org>
Subject: reducing cost of user-space probes
Date: Mon, 24 Apr 2017 11:59:00 -0000 [thread overview]
Message-ID: <03135AEA779D444E90975C2703F148DC2F8B6BED@IRSMSX107.ger.corp.intel.com> (raw)
Hi,
I'm new to systemtap and I am using it to add some probes into a user space application.
The probe is pretty simple - it collects one integer argument and presents a histogram every 3 seconds.
The probe is working fine and I'm getting results that are sensible. The application is a packet processing application that is using a user space io library (DPDK) to read batches of network packets directly into user space. The probe is called about 750K times per second (I have 10Gb link with 64B packets which generates 14.8M packets per second - but the batch size (that's the stat I'm tracing) - is about 20 so 750K probe hits per sec.
When the probe is in use I see less performance from the packet processing application - it starts loosing packets at about 90% of it's non-probed throughput.
However, when I run stap I see:
> Pass 4: compiled C into "stap_13723.ko" in 9020usr/980sys/10638real ms
Does this mean that each time the probe is hit that a system call is made to this new .ko module? That would surely mean quite a lot of overhead. If this is correct, can this overhead be avoided for user space probes.
Alternatively is there a way to only execute the script every n times the probe is hit?
Maybe there is a compile time macro that does this or some .stap command that does an early return from the script X% of the time. I searched for 'sample/sampling' in the lang ref but I didn't see anything.
Thanks for any help you can give.
Billy
next reply other threads:[~2017-04-24 11:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 11:59 O Mahony, Billy [this message]
2017-04-24 12:17 ` Arkady
2017-04-24 13:08 ` O Mahony, Billy
2017-04-24 13:22 ` Arkady
2017-04-24 15:50 ` David Smith
2017-04-24 18:37 ` Josh Stone
2017-04-25 9:11 ` O Mahony, Billy
2017-05-08 16:20 ` O Mahony, Billy
2017-05-10 20:08 ` David Smith
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=03135AEA779D444E90975C2703F148DC2F8B6BED@IRSMSX107.ger.corp.intel.com \
--to=billy.o.mahony@intel.com \
--cc=systemtap@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).