All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: David Ahern <dsahern@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Tony Lu <tonylu@linux.alibaba.com>,
	"David S. Miller" <davem@davemloft.net>,
	Ingo Molnar <mingo@redhat.com>,
	Network Development <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: add net namespace inode for all net_dev events
Date: Tue, 9 Mar 2021 12:20:22 -0800	[thread overview]
Message-ID: <CAADnVQLSyH8Kk4g6TDbS0w3zETLyXka917DKDn9Gjha-b5w-dw@mail.gmail.com> (raw)
In-Reply-To: <fffda629-0028-2824-2344-3507b75d9188@gmail.com>

On Tue, Mar 9, 2021 at 12:18 PM David Ahern <dsahern@gmail.com> wrote:
>
> On 3/9/21 1:02 PM, Steven Rostedt wrote:
> > On Tue, 9 Mar 2021 12:53:37 -0700
> > David Ahern <dsahern@gmail.com> wrote:
> >
> >> Changing the order of the fields will impact any bpf programs expecting
> >> the existing format
> >
> > I thought bpf programs were not API. And why are they not parsing this
> > information? They have these offsets hard coded???? Why would they do that!
> > The information to extract the data where ever it is has been there from
> > day 1! Way before BPF ever had access to trace events.
>
> BPF programs attached to a tracepoint are passed a context - a structure
> based on the format for the tracepoint. To take an in-tree example, look
> at samples/bpf/offwaketime_kern.c:
>
> ...
>
> /* taken from /sys/kernel/debug/tracing/events/sched/sched_switch/format */
> struct sched_switch_args {
>         unsigned long long pad;
>         char prev_comm[16];
>         int prev_pid;
>         int prev_prio;
>         long long prev_state;
>         char next_comm[16];
>         int next_pid;
>         int next_prio;
> };
> SEC("tracepoint/sched/sched_switch")
> int oncpu(struct sched_switch_args *ctx)
> {
>
> ...
>
> Production systems do not typically have toolchains installed, so
> dynamic generation of the program based on the 'format' file on the
> running system is not realistic. That means creating the programs on a
> development machine and installing on the production box. Further, there
> is an expectation that a bpf program compiled against version X works on
> version Y.

This is not true.

  reply	other threads:[~2021-03-09 20:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09  4:43 [PATCH] net: add net namespace inode for all net_dev events Tony Lu
2021-03-09 17:40 ` Steven Rostedt
2021-03-09 19:53   ` David Ahern
2021-03-09 20:02     ` Steven Rostedt
2021-03-09 20:17       ` David Ahern
2021-03-09 20:20         ` Alexei Starovoitov [this message]
2021-03-09 20:35         ` Steven Rostedt
2021-03-09 20:39           ` Alexei Starovoitov
2021-03-09 20:18       ` Alexei Starovoitov
2021-03-10  9:03   ` Tony Lu
2021-03-10 16:31     ` Steven Rostedt
2021-03-11  6:39       ` Tony Lu
2021-03-10 16:49     ` Steven Rostedt
2021-03-09 20:12 ` Eric Dumazet
2021-03-10  9:22   ` Lorenz Bauer
2021-03-10 12:01     ` Tony Lu
2021-03-10  9:33   ` Tony Lu

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=CAADnVQLSyH8Kk4g6TDbS0w3zETLyXka917DKDn9Gjha-b5w-dw@mail.gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tonylu@linux.alibaba.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 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.