From: Song Liu <songliubraving@fb.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
"Quentin Monnet" <quentin@isovalent.com>,
Kernel Team <Kernel-team@fb.com>,
"ast@kernel.org" <ast@kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"arnaldo.melo@gmail.com" <arnaldo.melo@gmail.com>,
"jolsa@kernel.org" <jolsa@kernel.org>
Subject: Re: [PATCH v4 bpf-next 1/4] bpftool: introduce "prog profile" command
Date: Thu, 5 Mar 2020 20:03:02 +0000 [thread overview]
Message-ID: <5BAF92A4-6CE4-4578-8481-96678D4E1201@fb.com> (raw)
In-Reply-To: <20200304203825.GC168640@krava>
> On Mar 4, 2020, at 12:38 PM, Jiri Olsa <jolsa@redhat.com> wrote:
>
> On Wed, Mar 04, 2020 at 10:07:07AM -0800, Song Liu wrote:
>
> SNIP
>
>> +
>> +#include "profiler.skel.h"
>> +
>> +#define SAMPLE_PERIOD 0x7fffffffffffffffULL
>> +struct profile_metric {
>> + const char *name;
>> + struct bpf_perf_event_value val;
>> + struct perf_event_attr attr;
>> + bool selected;
>> +
>> + /* calculate ratios like instructions per cycle */
>> + const int ratio_metric; /* 0 for N/A, 1 for index 0 (cycles) */
>> + const char *ratio_desc;
>> + const float ratio_mul;
>> +} metrics[] = {
>> + {
>> + .name = "cycles",
>> + .attr = {
>> + .sample_period = SAMPLE_PERIOD,
>
> I don't think you need to set sample_period for counting.. why?
>
>> + .type = PERF_TYPE_HARDWARE,
>> + .config = PERF_COUNT_HW_CPU_CYCLES,
>
> you could also add .exclude_user = 1
Fixed this in v5. Thanks!
Song
next prev parent reply other threads:[~2020-03-05 20:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 18:07 [PATCH v4 bpf-next 0/4] bpftool: introduce prog profile Song Liu
2020-03-04 18:07 ` [PATCH v4 bpf-next 1/4] bpftool: introduce "prog profile" command Song Liu
2020-03-04 19:21 ` Jiri Olsa
2020-03-04 21:17 ` Song Liu
2020-03-04 20:38 ` Jiri Olsa
2020-03-05 20:03 ` Song Liu [this message]
2020-03-04 18:07 ` [PATCH v4 bpf-next 2/4] bpftool: Documentation for bpftool prog profile Song Liu
2020-03-04 18:07 ` [PATCH v4 bpf-next 3/4] bpftool: bash completion for "bpftool prog profile" Song Liu
2020-03-04 18:07 ` [PATCH v4 bpf-next 4/4] bpftool: fix typo in bash-completion Song Liu
2020-03-04 19:08 ` [PATCH v4 bpf-next 0/4] bpftool: introduce prog profile Jiri Olsa
2020-03-04 20:41 ` Jiri Olsa
2020-03-04 21:16 ` Song Liu
2020-03-04 21:29 ` Jiri Olsa
2020-03-04 21:39 ` Song Liu
2020-03-05 20:03 ` Song Liu
2020-03-06 8:51 ` Jiri Olsa
2020-03-09 18:04 ` Quentin Monnet
2020-03-09 18:24 ` Song Liu
2020-03-09 19:30 ` Jiri Olsa
2020-03-04 19:13 ` Quentin Monnet
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=5BAF92A4-6CE4-4578-8481-96678D4E1201@fb.com \
--to=songliubraving@fb.com \
--cc=Kernel-team@fb.com \
--cc=arnaldo.melo@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=jolsa@kernel.org \
--cc=jolsa@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=quentin@isovalent.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;
as well as URLs for NNTP newsgroup(s).