All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	 Andrew Melnychenko <andrew@daynix.com>,
	 qemu-devel <qemu-devel@nongnu.org>
Subject: Re: ebpf/rss.bpf.skeleton.h generated by what?
Date: Mon, 09 May 2022 07:27:55 +0200	[thread overview]
Message-ID: <87bkw7e0mc.fsf@pond.sub.org> (raw)
In-Reply-To: <CACGkMEuPQr0TQtkMZr2zeJYGMy69EXN-fhdRTq6JUkWw3KmvMw@mail.gmail.com> (Jason Wang's message of "Sat, 7 May 2022 15:08:00 +0800")

Jason Wang <jasowang@redhat.com> writes:

> On Sat, May 7, 2022 at 2:58 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On 5/7/22 08:53, Jason Wang wrote:
>> > On Sat, May 7, 2022 at 2:46 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>> >>
>> >> On 5/7/22 07:05, Jason Wang wrote:
>> >>>> If it was generated by something in the tree, it should not be committed
>> >>>> to git.  Doesn't look like it is.
>> >>> Andrew may know more.
>> >>>
>> >>> I remember it was generated by libbpf.
>> >>
>> >> What is the source?
>> >
>> > It's tools/ebpf/rss.bpf.c.

Aha:

    $ cat tools/ebpf/Makefile.ebpf
    [...]
    $(OBJS):  %.o:%.c
            $(CLANG) $(INC_FLAGS) \
                    -D__KERNEL__ -D__ASM_SYSREG_H \
                    -I../include $(LINUXINCLUDE) \
                    $(EXTRA_CFLAGS) -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@
            bpftool gen skeleton rss.bpf.o > rss.bpf.skeleton.h
--->        cp rss.bpf.skeleton.h ../../ebpf/

and

    $ cat docs/devel/ebpf_rss.rst
    [...]
    RSS eBPF program
    ----------------

    RSS program located in ebpf/rss.bpf.skeleton.h generated by bpftool.
    So the program is part of the qemu binary.
    Initially, the eBPF program was compiled by clang and source code located at tools/ebpf/rss.bpf.c.
    Prerequisites to recompile the eBPF program (regenerate ebpf/rss.bpf.skeleton.h):

            llvm, clang, kernel source tree, bpftool
            Adjust Makefile.ebpf to reflect the location of the kernel source tree

            $ cd tools/ebpf
            $ make -f Makefile.ebpf
    [...]

Together, this answers my "what" question.  It doesn't answer my next
question: why?  That one gets answered ...

>> Thanks, maybe we can reuse some of the support for cross compilation
>> that will be introduced soon.
>
> That would be better.

... here:

>                       The reason we don't auto generate during make is
> to avoid adding new dependencies (where libbpf/bpftool is not popular
> at that time).

Always, always, *always* document your reasons for doing stuff right in
the commit message, unless they are blindingly obvious.  I understand
reasons can be obvious enough to the author.  Document them anyway if
there is any chance they are not obvious to others.



  reply	other threads:[~2022-05-09  5:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06 12:25 ebpf/rss.bpf.skeleton.h generated by what? Markus Armbruster
2022-05-07  5:05 ` Jason Wang
2022-05-07  6:46   ` Paolo Bonzini
2022-05-07  6:53     ` Jason Wang
2022-05-07  6:58       ` Paolo Bonzini
2022-05-07  7:08         ` Jason Wang
2022-05-09  5:27           ` Markus Armbruster [this message]
2022-05-09  6:52             ` Jason Wang
2022-05-09  8:41             ` Peter Maydell
2022-05-09  9:35               ` Jason Wang
2022-05-10 12:15                 ` Andrew Melnichenko
2022-05-11  8:53                   ` Jason Wang
2022-05-11 12:46                     ` Markus Armbruster

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=87bkw7e0mc.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=andrew@daynix.com \
    --cc=jasowang@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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.