public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Serhei Makarov <me@serhei.io>
To: systemtap@sourceware.org
Subject: Re: stap/eBPF language features brainstorm
Date: Thu, 19 Jul 2018 17:32:00 -0000	[thread overview]
Message-ID: <1532021547.3025234.1446386960.12364D48@webmail.messagingengine.com> (raw)
In-Reply-To: <01c4f735-68b0-7d0b-11bf-0c89523839ca@redhat.com>

On Thu, Jul 19, 2018, at 11:27 AM, William Cohen wrote:
> probe timer.ms(5000) {
>   /* write out data */
>   /* clear data */
>   delete io_stat
>   delete device
>   read_bytes = 0
>   write_bytes = 0  
> }
> 
> Is there some way to clear out all the previous entries in the bpf map 
> from the timer probe?
> 
> -Will

The only ways I can think of to 'clear out' a map from eBPF kernel space are fairly contrived.

However, in the case of scripts like iotop.stp, there is no reason to run that 5-second timer in kernel-space. I don't see why it would require perf-like precision, so it could be handled by the userspace eBPF interpreter, where such operations are easier to support by iterating through the map elements.

Last time we discussed this, Aaron mentioned some plans to implement support for userspace stapBPF timer probes. I'm not sure what the best option would be for specifying which timer probes should run in userspace and which ones should be handled in the kernel. Perhaps it could be decided automatically depending on whether userspace-only operations such as foreach or map_clear are detected in the probe body.

All the best,
      Serhei

  reply	other threads:[~2018-07-19 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 20:13 Serhei Makarov
2018-07-12 15:47 ` Serhei Makarov
2018-07-19 15:27 ` William Cohen
2018-07-19 17:32   ` Serhei Makarov [this message]
2018-07-19 17:56     ` William Cohen

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=1532021547.3025234.1446386960.12364D48@webmail.messagingengine.com \
    --to=me@serhei.io \
    --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).