GNU bug report logs - #42227
BPF in linux-libre

Previous Next

Package: guix-patches;

Reported by: Mathieu Othacehe <othacehe <at> gnu.org>

Date: Mon, 6 Jul 2020 13:27:02 UTC

Severity: normal

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42227 in the body.
You can then email your comments to 42227 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#42227; Package guix-patches. (Mon, 06 Jul 2020 13:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mathieu Othacehe <othacehe <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 06 Jul 2020 13:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: John Soo <jsoo1 <at> asu.edu>
Cc: guix-patches <at> gnu.org
Subject: Re: BPF in linux-libre
Date: Mon, 06 Jul 2020 15:26:11 +0200
Hey John,

> I think I tidied up the description to match the Guix situation. What do
> you think now?

Yes it's fine, thanks for the updated serie! I pushed the first patch
and patches two and three squashed together.

> I could see it being a useful default.  BPF seems like a nice technology
> but I am making these patches to experiment with it myself.  Because I
> haven't used it much I can't really speak on the pros of making it
> default.  Other than my gut feeling that seems like something that
> should be opted into rather than opting out of I have no strong feelings
> on including it by default.  The only other downside I see is that
> putting in the default might make the linux definitions less composable.
> The way it is now, one can assemble a (mostly) bpf-capable system from
> the pieces in gnu/packages/linux.scm.

Ok, thanks for explaining. I don't have much experience with BPF
either. For now we can work with a separate linux-libre, and will see
about merging it into the default, when we'll have more perspective.

I'll take more time to review patches 4 and 5. However, while trying
some of the examples packaged by BCC, I have the following error:

--8<---------------cut here---------------start------------->8---
mathieu <at> meru:~/guix-master$ /gnu/store/rv51f9n1w9i92m9qsg9k3ilsy3hyhjf3-bcc-0.15.0/share/bcc/tools/execsnoop
Traceback (most recent call last):
  File "/gnu/store/rv51f9n1w9i92m9qsg9k3ilsy3hyhjf3-bcc-0.15.0/share/bcc/tools/execsnoop", line 21, in <module>
    from bcc import BPF
ModuleNotFoundError: No module named 'bcc'
--8<---------------cut here---------------end--------------->8---

I think an additional wrapping is necessary. Could you please have a
look? I'm also removing help-guix, and opening a proper guix-patches
ticket.

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#42227; Package guix-patches. (Sat, 11 Jul 2020 16:29:01 GMT) Full text and rfc822 format available.

Message #8 received at 42227 <at> debbugs.gnu.org (full text, mbox):

From: John Soo <jsoo1 <at> asu.edu>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 42227 <at> debbugs.gnu.org
Subject: Re: [bug#42227] BPF in linux-libre
Date: Sat, 11 Jul 2020 09:28:19 -0700
[Message part 1 (text/plain, inline)]
Hi Mathieu,

> Hey John,
>
> I'll take more time to review patches 4 and 5. However, while trying
> some of the examples packaged by BCC, I have the following error:
>
> mathieu <at> meru:~/guix-master$ /gnu/store/rv51f9n1w9i92m9qsg9k3ilsy3hyhjf3-bcc-0.15.0/share/bcc/tools/execsnoop
> Traceback (most recent call last):
>   File "/gnu/store/rv51f9n1w9i92m9qsg9k3ilsy3hyhjf3-bcc-0.15.0/share/bcc/tools/execsnoop", line 21, in <module>
>     from bcc import BPF
> ModuleNotFoundError: No module named 'bcc'
>
> I think an additional wrapping is necessary. Could you please have a
> look? I'm also removing help-guix, and opening a proper guix-patches
> ticket.

I wrapped the PYTHONPATH around the various provided python tools.
I also found a spare path that required patching.
I am not sure this fixes every tool but I did get a few to work now.

Thanks for attaching guix-patches.

I also added debugfs as a requirement for a bpf system.  To use it
%bpf-file-systems can be used in place of %base-file-systems in the
operating system definition.

Thanks,

John

[0001-gnu-Add-debugfs-file-system.patch (text/x-patch, attachment)]
[0002-gnu-Add-bpf-file-systems.patch (text/x-patch, attachment)]
[0003-gnu-Add-bcc.patch (text/x-patch, attachment)]
[0004-gnu-Add-bpftrace.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#42227; Package guix-patches. (Thu, 30 Jul 2020 18:50:01 GMT) Full text and rfc822 format available.

Message #11 received at 42227 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: John Soo <jsoo1 <at> asu.edu>
Cc: 42227 <at> debbugs.gnu.org
Subject: Re: [bug#42227] BPF in linux-libre
Date: Thu, 30 Jul 2020 20:48:55 +0200
Hey John,

Thanks for your patience!

> I wrapped the PYTHONPATH around the various provided python tools.
> I also found a spare path that required patching.
> I am not sure this fixes every tool but I did get a few to work now.

Yes, I tested some of them, looks fine :).

> I also added debugfs as a requirement for a bpf system.  To use it
> %bpf-file-systems can be used in place of %base-file-systems in the
> operating system definition.

Actually, I wonder if we could mount debugfs by default, by adding it to
%base-file-systems. Any objections?

In the meantime I pushed the bcc patch with a few edits. Regarding
bpftrace, I'd like to avoid the "-DHAVE_BFD_DISASM=OFF" patching, I
found this ticket which seems related:
https://github.com/iovisor/bpftrace/issues/1106, but didn't make any
significant progress yet.

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#42227; Package guix-patches. (Fri, 31 Jul 2020 02:21:02 GMT) Full text and rfc822 format available.

Message #14 received at 42227 <at> debbugs.gnu.org (full text, mbox):

From: John Soo <jsoo1 <at> asu.edu>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 42227 <at> debbugs.gnu.org
Subject: Re: [bug#42227] BPF in linux-libre
Date: Thu, 30 Jul 2020 19:20:27 -0700
Hi Mathieu!


> Thanks for your patience!

No problem. I'm quite busy too.

>> I also added debugfs as a requirement for a bpf system.  To use it
>> %bpf-file-systems can be used in place of %base-file-systems in the
>> operating system definition.
>
> Actually, I wonder if we could mount debugfs by default, by adding it to
> %base-file-systems. Any objections?

That seems ok. I did find a few questions about debugfs on old irc logs
and mailing lists.  My only concern again is that I would prefer to opt
in to such a thing.  debugfs is much simpler than the bpf kernel flags
though, so maybe it will be ok to remove in the future.

> In the meantime I pushed the bcc patch with a few edits. Regarding
> bpftrace, I'd like to avoid the "-DHAVE_BFD_DISASM=OFF" patching, I
> found this ticket which seems related:
> https://github.com/iovisor/bpftrace/issues/1106, but didn't make any
> significant progress yet.

I have tried every which way I can to make HAVE_BFD_DISASM work.  A kind
persn from the bpftrace irc directed me to this PR:
https://github.com/iovisor/bpftrace/pull/1095

But I cannot see anything guix does differently that would cause it to
fail. My only feeling is perhaps our configure flags for binutils might
be causing the issue.

As is, however, bpftrace does work even with out HAVE_BFD_DISASM and I
even used it to debug a few processes recently.

Thanks again!

- John




Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Fri, 31 Jul 2020 11:06:02 GMT) Full text and rfc822 format available.

Notification sent to Mathieu Othacehe <othacehe <at> gnu.org>:
bug acknowledged by developer. (Fri, 31 Jul 2020 11:06:02 GMT) Full text and rfc822 format available.

Message #19 received at 42227-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: John Soo <jsoo1 <at> asu.edu>
Cc: 42227-done <at> debbugs.gnu.org
Subject: Re: [bug#42227] BPF in linux-libre
Date: Fri, 31 Jul 2020 13:04:47 +0200
Hey,

> That seems ok. I did find a few questions about debugfs on old irc logs
> and mailing lists.  My only concern again is that I would prefer to opt
> in to such a thing.  debugfs is much simpler than the bpf kernel flags
> though, so maybe it will be ok to remove in the future.

Yeah, but I saw that Ubuntu for instance is enabling it by default, so I
guess it could help to have the same behaviour in Guix System. Added it
with: 6bb07e91e1ab9367f636a3a5e9d52a9e0772aa89.

> But I cannot see anything guix does differently that would cause it to
> fail. My only feeling is perhaps our configure flags for binutils might
> be causing the issue.
>
> As is, however, bpftrace does work even with out HAVE_BFD_DISASM and I
> even used it to debug a few processes recently.

Gave it another try and I think if we could get "binutils" to produce a
dynamic version of libbfd.a, that would make the trick. Anyway, let's
proceed without BFD support for now. Pushed bpftrace as
c55acb073248392b1387017378f36a1d378fa7c4.

Closing the serie, thank you!

Mathieu




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 28 Aug 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 214 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.