public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Sebastião Santos Boavida Amaro" <sebastiao.amaro@tecnico.ulisboa.pt>
To: Jiri Olsa <olsajiri@gmail.com>
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: Tue, 19 Nov 2024 13:30:47 +0000	[thread overview]
Message-ID: <dfdb91b06c3987e22a5f252324b55a4d@tecnico.ulisboa.pt> (raw)
In-Reply-To: <ZzW-GWh7Iqp-AxGA@krava>

I am using a normal SEC(uprobe) in the eBPF code. The workload is ycsb 
(with 1 thread) running against a cluster of 3 Redis nodes, I filter the 
uprobes for 3 pids (the Redis nodes).
When I profiled the machine with perf, I could not see glaring 
differences. Should I repeat this and send the .data here?
Best Regards,
Sebastião

A 2024-11-14 09:08, Jiri Olsa escreveu:
> 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-19 13:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <66ba4183c94d28f7020c118029d45650@tecnico.ulisboa.pt>
2024-11-14  9:08 ` uprobe overhead when specifying a pid Jiri Olsa
2024-11-19 13:30   ` Sebastião Santos Boavida Amaro [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=dfdb91b06c3987e22a5f252324b55a4d@tecnico.ulisboa.pt \
    --to=sebastiao.amaro@tecnico.ulisboa.pt \
    --cc=bpf@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=oleg@redhat.com \
    --cc=olsajiri@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