All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: "Sebastião Santos Boavida Amaro" <sebastiao.amaro@tecnico.ulisboa.pt>
Cc: bpf@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	linux-trace-kernel@vger.kernel.org
Subject: Re: uprobe overhead when specifying a pid
Date: Thu, 14 Nov 2024 10:08:41 +0100	[thread overview]
Message-ID: <ZzW-GWh7Iqp-AxGA@krava> (raw)
In-Reply-To: <66ba4183c94d28f7020c118029d45650@tecnico.ulisboa.pt>

On Wed, Nov 13, 2024 at 11:33:01PM +0000, Sebastião Santos Boavida Amaro wrote:
> Hi,
> I am using:
> libbpf-cargo = "0.24.6"
> libbpf-rs = "0.24.6"
> libbpf-sys = "1.4.3"
> On kernel 6.8.0-47-generic.
> I contacted the libbpf-rs guys, and they told me this belonged here.
> I am attaching 252 uprobes to a system, these symbols are not regularly
> called (90ish times over 9 minutes), however, when I specify a pid the
> throughput drops 3 times from 12k ops/sec to 4k ops/sec. When I do not
> specify a PID, and simply pass -1 the throughput remains the same (as it
> should, since 90 times is not significant to affect overhead I would say).
> It looks as if we are switching from userspace to kernel space without
> triggering the uprobe.
> Do not know if this is a known issue, it does not look like an intended
> behavior.

hi,
thanks for the report, I cc-ed some other folks and trace list

I'm not aware about such slowdown, I think with pid filter in place
there should be less work to do

could you please provide more details?
  - do you know which uprobe interface you are using
    uprobe over perf event or uprobe_multi (likely uprobe_multi,
    because you said above you attach 250 probes)
  - more details on the workload, like is the threads/processes,
    how many and I guess you trigger bpf program
  - do you filter out single pid or more
  - could you profile the workload with perf

thanks,
jirka

  reply	other threads:[~2024-11-14  9:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13 23:33 uprobe overhead when specifying a pid Sebastião Santos Boavida Amaro
2024-11-14  9:08 ` Jiri Olsa [this message]
2024-11-19 13:30   ` Sebastião Santos Boavida Amaro

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=ZzW-GWh7Iqp-AxGA@krava \
    --to=olsajiri@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=oleg@redhat.com \
    --cc=sebastiao.amaro@tecnico.ulisboa.pt \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.