mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@fb.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Teng Qin <qinteng@fb.com>, <mingo@redhat.com>,
	<bgregg@netflix.com>, <daniel@iogearbox.net>, <yhs@fb.com>,
	<linux-kernel@vger.kernel.org>, <Kernel-team@fb.com>
Subject: Re: [PATCH tip 0/3] Improvements of scheduler related Tracepoints
Date: Fri, 15 Dec 2017 09:09:51 -0800	[thread overview]
Message-ID: <e3777c2d-f267-b0cc-28ab-6c41e87c4ee7@fb.com> (raw)
In-Reply-To: <20171215073908.myx3wgka7qimcmsg@hirez.programming.kicks-ass.net>

On 12/14/17 11:39 PM, Peter Zijlstra wrote:
> On Thu, Dec 14, 2017 at 07:16:00PM -0800, Alexei Starovoitov wrote:
>> On 12/14/17 12:49 PM, Peter Zijlstra wrote:
>>> On Thu, Dec 14, 2017 at 12:20:41PM -0800, Teng Qin wrote:
>>>> This set of commits attempts to improve three scheduler related
>>>> Tracepoints: sched_switch, sched_process_fork, sched_process_exit.
>>>>
>>>> Firstly, these commit add additional flag values, namely preempt,
>>>> clone_flags and group_dead to these Tracepoints, to make information
>>>> exposed via the Tracepoints more useful and complete.
>>>>
>>>> Secondly, these commits exposes task_struct pointers in these
>>>> Tracepoints. The task_struct pointers are arguments of the Tracepoints
>>>> and currently only used to compute struct field values. But for BPF
>>>> programs attached to these Tracepoints, we may want to read additional
>>>> task information via the task_struct pointers. This is currently either
>>>> impossible, or we have to make assumption of whether the Tracepoint is
>>>> running from previous / parent or next / child, and use current pointer
>>>> instead. Exposing the task_struct pointers explicitly makes such use
>>>> case easier and more reliable.
>>>>
>>>
>>> NAK
>>
>> not sure what is the concern here.
>> Is it first or second part of the above ?
>
> Definitely the second, but also the first. You know I would have ripped
> out all scheduler tracepoints if I could have. They're a pain in the
> arse.
>
> A lot of people want to add to the tracepoints, with the end result that
> they'll end up a big bloated pile of useless crap. The first part is
> just the pieces you want added.
>
> As to the second, that's complete crap; that just makes everything
> slower for bodies benefit. If you register a traceprobe you already get
> access to these things.
>
> I think your problem is that you use perf to get access to the
> tracepoints, which them means you have to do disgusting things like
> this.

yeah. Currently bpf progs are called at the end of
perf_trace_##call()
{
   .. regular tracepoint copy craft
   perf_trace_run_bpf_submit( &copied args )
}

from bpf pov we'd rather get access to raw args passed into
perf_trace_##call.
Sounds like you're suggesting to let bpf side register its
progs directly via tracepoint_probe_register() ?
That would solve the whole thing really nicely indeed.

How such api would look like ?
Something like extending kprobe/uprobe fd-based perf_event_open?
https://www.spinics.net/lists/netdev/msg470567.html
btw could you please apply that set to tip tree
or you want us to route it via bpf-next -> net-next ?

Thanks

  parent reply	other threads:[~2017-12-15 17:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 20:20 Teng Qin
2017-12-14 20:20 ` [PATCH tip 1/3] Improve sched_switch Tracepoint Teng Qin
2017-12-14 20:20 ` [PATCH tip 2/3] Improve sched_process_fork Tracepoint Teng Qin
2017-12-14 20:20 ` [PATCH tip 3/3] Improve sched_process_exit Tracepoint Teng Qin
2017-12-14 20:49 ` [PATCH tip 0/3] Improvements of scheduler related Tracepoints Peter Zijlstra
2017-12-15  3:16   ` Alexei Starovoitov
2017-12-15  7:39     ` Peter Zijlstra
2017-12-15  8:53       ` Teng Qin
2017-12-15  9:53         ` Peter Zijlstra
2017-12-15 17:09       ` Alexei Starovoitov [this message]
2017-12-18  9:11         ` Peter Zijlstra
2017-12-21  2:03           ` tracepoint_probe_register and bpf. Was: " 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=e3777c2d-f267-b0cc-28ab-6c41e87c4ee7@fb.com \
    --to=ast@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=bgregg@netflix.com \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qinteng@fb.com \
    --cc=yhs@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®