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, John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>
Subject: Re: [PATCH v7 bpf-next 1/3] perf: enable branch record for software events
Date: Fri, 10 Sep 2021 21:28:45 +0200	[thread overview]
Message-ID: <20210910192845.GT4323@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20210910183352.3151445-2-songliubraving@fb.com>

On Fri, Sep 10, 2021 at 11:33:50AM -0700, Song Liu wrote:
> The typical way to access branch record (e.g. Intel LBR) is via hardware
> perf_event. For CPUs with FREEZE_LBRS_ON_PMI support, PMI could capture
> reliable LBR. On the other hand, LBR could also be useful in non-PMI
> scenario. For example, in kretprobe or bpf fexit program, LBR could
> provide a lot of information on what happened with the function. Add API
> to use branch record for software use.
> 
> Note that, when the software event triggers, it is necessary to stop the
> branch record hardware asap. Therefore, static_call is used to remove some
> branch instructions in this process.
> 
> Suggested-by: Peter Zijlstra <peterz@infradead.org>
> Acked-by: John Fastabend <john.fastabend@gmail.com>
> Acked-by: Andrii Nakryiko <andrii@kernel.org>
> Signed-off-by: Song Liu <songliubraving@fb.com>

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

  reply	other threads:[~2021-09-10 19:29 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 [this message]
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
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=20210910192845.GT4323@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®