public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: fche@redhat.com (Frank Ch. Eigler)
To: Arkady <arkady.miasnikov@gmail.com>
Cc: David Smith <dsmith@redhat.com>,  systemtap <systemtap@sourceware.org>
Subject: Re: Unsafe mode for probes
Date: Thu, 09 Aug 2018 20:07:00 -0000	[thread overview]
Message-ID: <87h8k3tibs.fsf@redhat.com> (raw)
In-Reply-To: <CANA-60owZN-ksNwHRNc4BwesinQBqyxn2R20g8OuHwgBP7hADQ@mail.gmail.com>	(Arkady's message of "Tue, 7 Aug 2018 12:19:59 +0300")


arkady.miasnikov wrote:

> My typical probe looks like this
>
> probe syscall.accept4.return ?
> {
>     %{HIT_MAP_INC(HIT_MAP_SYSCALL_ACCEPT4_RETURN)%}
>     send_incident_result(%{INCDENT_TYPE_SYSCALL_ACCEPT4%}, $return);
> }
> [...]

> The actual assembler of the probe will contain quite a bit of code
> handling local variables, call to lock, etc
> For short probes I can shave about 20% of CPU cycles.

A blanket "unsafe" probe cannot make do with no checks at all, e.g.
a proper context structure allocation for temporary values, etc. 
It's a matter of detail - which checks particularly should one skip?

It is not unlikely that some of that initialization / lock business in
the probe prologue could be elided entirely with some more cleverness
during translation.  Like a new pragma for embedded-C functions that
skip the context-struct based api, which in turn could make it
unnecessary to have a context struct at all for that probe.  Stuff
like that - but it takes analysis to figure out which is needed
and which is not.  stap -p3 ftw.

- FChE

  reply	other threads:[~2018-08-09 20:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-05 10:14 Arkady
2018-08-06 17:37 ` David Smith
2018-08-07  9:20   ` Arkady
2018-08-09 20:07     ` Frank Ch. Eigler [this message]
2018-08-11  4:06       ` Arkady
2018-08-11 15:37         ` Frank Ch. Eigler
2018-08-12 15:16           ` Arkady

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=87h8k3tibs.fsf@redhat.com \
    --to=fche@redhat.com \
    --cc=arkady.miasnikov@gmail.com \
    --cc=dsmith@redhat.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).