All of lore.kernel.org
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "bpf@vger.kernel.org" <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>,
	John Fastabend <john.fastabend@gmail.com>,
	"Andrii Nakryiko" <andrii@kernel.org>
Subject: Re: [PATCH v6 bpf-next 1/3] perf: enable branch record for software events
Date: Fri, 10 Sep 2021 18:51:37 +0000	[thread overview]
Message-ID: <BFA439C7-31F8-42DE-901B-E64E93F29238@fb.com> (raw)
In-Reply-To: <20210910184027.GQ4323@worktop.programming.kicks-ass.net>



> On Sep 10, 2021, at 11:40 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> 
> On Fri, Sep 10, 2021 at 06:27:36PM +0000, Song Liu wrote:
> 
>> This works great and saves 3 entries! We have the following now:
> 
> Yay!
> 
>> ID: 0 from bpf_get_branch_snapshot+18 to intel_pmu_snapshot_branch_stack+0
> 
> is unavoidable, we need to end up in intel_pmu_snapshot_branch_stack()
> eventually.
> 
>> ID: 1 from __brk_limit+477143934 to bpf_get_branch_snapshot+0
> 
> could be elided by having the JIT emit the call to
> intel_pmu_snapshot_branch_stack directly, instead of laundering it
> through that helper I suppose.

Yep, some JIT magic could save one entry here. 

> 
>> ID: 2 from __brk_limit+477192263 to __brk_limit+477143880  # trampoline 
>> ID: 3 from __bpf_prog_enter+34 to __brk_limit+477192251
> 
> -ENOCLUE
> 
>> ID: 4 from migrate_disable+60 to __bpf_prog_enter+9
>> ID: 5 from __bpf_prog_enter+4 to migrate_disable+0
> 
> I suppose we can reduce that to a single branch if we inline
> migrate_disable() here, that thing unfortunately needs one branch
> itself.

To inline migrate_disable, we may need expose this_rq() in include/, or 
use some other alternatives. I am planning to optimize that after this
set gets in.

Thanks,
Song

> 
>> ID: 6 from bpf_testmod_loop_test+20 to __bpf_prog_enter+0
> 
> And this is the first branch out of the test program, giving 7 entries
> now, of which we can remove at least 2 more with a bit of elbow greace,
> right?
> 
>> ID: 7 from bpf_testmod_loop_test+20 to bpf_testmod_loop_test+13
>> ID: 8 from bpf_testmod_loop_test+20 to bpf_testmod_loop_test+13
>> 
>> I will fold this in and send v7. 
> 
> Excellent.


  parent reply	other threads:[~2021-09-10 18:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 20:27 [PATCH v6 bpf-next 0/3] bpf: introduce bpf_get_branch_snapshot Song Liu
2021-09-07 20:28 ` [PATCH v6 bpf-next 1/3] perf: enable branch record for software events Song Liu
2021-09-10 10:40   ` Peter Zijlstra
2021-09-10 13:54     ` Peter Zijlstra
2021-09-10 18:27       ` Song Liu
2021-09-10 18:40         ` Peter Zijlstra
2021-09-10 18:50           ` Peter Zijlstra
2021-09-10 19:00             ` Song Liu
2021-09-10 19:08               ` Peter Zijlstra
2021-09-10 19:11                 ` Song Liu
2021-09-10 18:51           ` Song Liu [this message]
2021-09-07 20:28 ` [PATCH v6 bpf-next 2/3] bpf: introduce helper bpf_get_branch_snapshot Song Liu
2021-09-07 20:28 ` [PATCH v6 bpf-next 3/3] selftests/bpf: add test for bpf_get_branch_snapshot Song Liu
2021-09-07 20:29 ` [PATCH v6 bpf-next 0/3] bpf: introduce bpf_get_branch_snapshot Song Liu
2021-09-07 20:58   ` Andrii Nakryiko
2021-09-09 21:53   ` Song Liu

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=BFA439C7-31F8-42DE-901B-E64E93F29238@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.