mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Song Liu <songliubraving@fb.com>
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	acme@kernel.org, mingo@redhat.com, kjain@linux.ibm.com,
	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 20:58:35 +0200	[thread overview]
Message-ID: <20210910185835.GR4323@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20210910183352.3151445-4-songliubraving@fb.com>

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.

  reply	other threads:[~2021-09-10 18:59 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 [this message]
2021-09-10 19:04     ` Song Liu
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=20210910185835.GR4323@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=kjain@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=songliubraving@fb.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

all inboxes | Powered by JetHome®