BPF List
 help / color / mirror / Atom feed
From: Quentin Monnet <qmo@qmon.net>
To: Keren Kotler <kerenkotlerk@gmail.com>, bpf@vger.kernel.org
Cc: Song Liu <song@kernel.org>
Subject: Re: bpftool CPU profiling support
Date: Thu, 21 Nov 2024 11:15:42 +0000	[thread overview]
Message-ID: <0252e691-18f5-4e54-afff-e18147d2ebd5@qmon.net> (raw)
In-Reply-To: <CAJKOENWotzg5VswWbkCrbP=QgdPAJhXWOvWBGKpvRA+8WUMMhw@mail.gmail.com>

2024-11-19 07:14 UTC+0200 ~ Keren Kotler <kerenkotlerk@gmail.com>
> Hi,
> 
> I saw bpftool profile supports cycles metric via
> PERF_COUNT_HW_CPU_CYCLES event, which is not supported on some
> platforms*. I wondered why there is no support to measure CPU load of
> a (ebpf) program via PERF_COUNT_SW_CPU_CLOCK event - I patched the
> bpftool to support it (as a POC just replaced the attr event def in
> the metric list) and it seems to be working.
> 
> So my questions:
> 1. Is it risky to use it? (Why wasn’t it supported in the first place?)
> 2. Does it make sense to finish the patch and send in order to release it?
> 
> Thanks,
> Keren
> 
> 
> *specifically I tried to run it on Intel(R) Xeon(R) CPU E5-2628 v4 @
> 2.30GHz (Ubuntu 24, kernel 6.8.0-48-generic) using AWS EC2 machine
> (and previously on an Azure machine). I suspect it might not be widely
> supported on cloud providers hardwares, but didn’t research this
> theory.
> 


Hi Keren,

As discussed off-list: I'm not aware of any particular reason blocking
support for this metric in bpftool. I suppose that SW cycles count is
not supported today simply because nobody has needed it to the point
they'd spend the time to implement the feature, so far.

So if you're interested in adding support, yes go ahead, thanks for
working on this!

Quentin

      reply	other threads:[~2024-11-21 11:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19  5:14 bpftool CPU profiling support Keren Kotler
2024-11-21 11:15 ` Quentin Monnet [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=0252e691-18f5-4e54-afff-e18147d2ebd5@qmon.net \
    --to=qmo@qmon.net \
    --cc=bpf@vger.kernel.org \
    --cc=kerenkotlerk@gmail.com \
    --cc=song@kernel.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