From: Song Liu <songliubraving@fb.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: bpf <bpf@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"acme@kernel.org" <acme@kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"kjain@linux.ibm.com" <kjain@linux.ibm.com>,
Kernel Team <Kernel-team@fb.com>,
Andrii Nakryiko <andrii@kernel.org>,
John Fastabend <john.fastabend@gmail.com>
Subject: Re: [PATCH v7 bpf-next 3/3] selftests/bpf: add test for bpf_get_branch_snapshot
Date: Fri, 10 Sep 2021 19:04:36 +0000 [thread overview]
Message-ID: <931A149F-6CBA-4D4C-8A90-134448AF878F@fb.com> (raw)
In-Reply-To: <20210910185835.GR4323@worktop.programming.kicks-ass.net>
> On Sep 10, 2021, at 11:58 AM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Fri, Sep 10, 2021 at 11:33:52AM -0700, Song Liu wrote:
>> + /* Given we stop LBR in software, we will waste a few entries.
>> + * But we should try to waste as few as possible entries. We are at
>> + * about 7 on x86_64 systems.
>> + * Add a check for < 10 so that we get heads-up when something
>> + * changes and wastes too many entries.
>> + */
>> + ASSERT_LT(skel->bss->wasted_entries, 10, "check_wasted_entries");
>
> It might be worth pointing out that you can easily bust this limit by
> enabling all the various tracepoints that are still in that code, but
> that that isn't a hard error since that's not the expected use case.
>
> For example there's the wrmsr tracepoint that will inject 6 or so
> branches on top of that you now have. And I also think there's a
> tracepoint in local_irq_save() that can trigger.
Right. I did some test with a lot of debug config enabled. We do see a lot
more wasted entries there.
Thanks,
Song
next prev parent reply other threads:[~2021-09-10 19:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 18:33 [PATCH v7 bpf-next 0/3] bpf: introduce bpf_get_branch_snapshot Song Liu
2021-09-10 18:33 ` [PATCH v7 bpf-next 1/3] perf: enable branch record for software events Song Liu
2021-09-10 19:28 ` Peter Zijlstra
2021-09-10 18:33 ` [PATCH v7 bpf-next 2/3] bpf: introduce helper bpf_get_branch_snapshot Song Liu
2021-09-10 18:33 ` [PATCH v7 bpf-next 3/3] selftests/bpf: add test for bpf_get_branch_snapshot Song Liu
2021-09-10 18:58 ` Peter Zijlstra
2021-09-10 19:04 ` Song Liu [this message]
2021-09-10 19:22 ` [PATCH v7 bpf-next 0/3] bpf: introduce bpf_get_branch_snapshot Song Liu
2021-09-13 17:59 ` Alexei Starovoitov
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=931A149F-6CBA-4D4C-8A90-134448AF878F@fb.com \
--to=songliubraving@fb.com \
--cc=Kernel-team@fb.com \
--cc=acme@kernel.org \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kjain@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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 NNTP newsgroup(s).