Skip to contentSkip to conversation

samples/bpf: Add more instructions to build dependencies and, configuration in README.rst

PATCH In review Anh Tuan Phan 5 participants 13 messages Jul 6, 2023 – Jul 11, 2023 BPF

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 samples/bpf: Add more instructions to build dependencies and, configuration in README.rst

Update the Documentation to mention that some samples require pahole v1.16 and kernel built with CONFIG_DEBUG_INFO_BTF=y

---
 samples/bpf/README.rst | 7 +++++++
 1 file changed, 7 insertions(+)
samples/bpf/README.rst +4 -0
index 57f93edd1957..631592b83d60 100644
@@ -14,6 +14,9 @@ Compiling requires having installed:
 Note that LLVM's tool 'llc' must support target 'bpf', list version
 and supported targets with command: ``llc --version``
 
+Some samples require pahole version 1.16 as a dependency. See
+https://docs.kernel.org/bpf/bpf_devel_QA.html for reference.
+
 Clean and configuration
 -----------------------
 
@@ -28,6 +31,10 @@ Configure kernel, defconfig for instance::
 
  make defconfig
 
+Some samples require support for BPF Type Format (BTF). To enable it,

open the
+generated config file, or use menuconfig (by "make menuconfig") to enable the
+following configs: CONFIG_BPF_SYSCALL and CONFIG_DEBUG_INFO_BTF. +
Kernel headers
--------------

Signature · 1 line
2.34.1
#1 lore raw
Quoted 13 lines · Anh Tuan Phan

Update the Documentation to mention that some samples require pahole v1.16 and kernel built with CONFIG_DEBUG_INFO_BTF=y

---
 samples/bpf/README.rst | 7 +++++++
 1 file changed, 7 insertions(+)
samples/bpf/README.rst +0 -0
index 57f93edd1957..631592b83d60 100644

samples/bpf/README.rst Compiling requires having installed: · line 19

Quoted 6 lines
samples/bpf/README.rst +3 -0
@@ -14,6 +14,9 @@ Compiling requires having installed:
 Note that LLVM's tool 'llc' must support target 'bpf', list version
 and supported targets with command: ``llc --version``
 
+Some samples require pahole version 1.16 as a dependency. See
+https://docs.kernel.org/bpf/bpf_devel_QA.html for reference.
+

Any reason no to add pahole 1.16 to this section above?

Compiling requires having installed:
* clang >= version 3.4.0
* llvm >= version 3.7.1
* pahole >= version 1.16

Although clang 3.4 probably won't get you anywhere these days. The whole README seems a bit outdated :-)

samples/bpf/README.rst

Quoted 13 lines
samples/bpf/README.rst +1 -0
 Clean and configuration
 -----------------------
 
@@ -28,6 +31,10 @@ Configure kernel, defconfig for instance::
 
  make defconfig
 
+Some samples require support for BPF Type Format (BTF). To enable it,

open the
+generated config file, or use menuconfig (by "make menuconfig") to enable the

samples/bpf/README.rst +2 -0
+following configs: CONFIG_BPF_SYSCALL and CONFIG_DEBUG_INFO_BTF.
+

This is usually enabled by default, so why special case it here? Maybe, if you want some hints about the config, we should add a reference to tools/testing/selftests/bpf/config ?

Quoted 5 lines

Kernel headers
--------------

Signature · 1 line
2.34.1
#2 lore raw
Quoted 22 lines · Stanislav Fomichev
Quoted 13 lines · Anh Tuan Phan

Update the Documentation to mention that some samples require pahole v1.16 and kernel built with CONFIG_DEBUG_INFO_BTF=y

---
 samples/bpf/README.rst | 7 +++++++
 1 file changed, 7 insertions(+)
samples/bpf/README.rst +0 -0
index 57f93edd1957..631592b83d60 100644

samples/bpf/README.rst Compiling requires having installed: · line 19

Quoted 6 lines
samples/bpf/README.rst +3 -0
@@ -14,6 +14,9 @@ Compiling requires having installed:
 Note that LLVM's tool 'llc' must support target 'bpf', list version
 and supported targets with command: ``llc --version``
 
+Some samples require pahole version 1.16 as a dependency. See
+https://docs.kernel.org/bpf/bpf_devel_QA.html for reference.
+

Any reason no to add pahole 1.16 to this section above?

Quoted 8 lines
Quoted 1 line

Compiling requires having installed:

* clang >= version 3.4.0
* llvm >= version 3.7.1
* pahole >= version 1.16

Although clang 3.4 probably won't get you anywhere these days. The whole README seems a bit outdated :-)

Put pahole requirement as your idea is better, thanks for suggestion. Will update it and clang version as well. For clang version, I think I can update min version as 11.0.0 (reference from
https://www.kernel.org/doc/html/next/process/changes.html). Do you see any other potential outdated things in this document? I follow the above steps and it help me compile the sample code successfully.

Quoted 7 lines
Quoted 7 lines

Clean and configuration
-----------------------

samples/bpf/README.rst +0 -0
@@ -28,6 +31,10 @@ Configure kernel, defconfig for instance::
 
  make defconfig
 
Quoted 11 lines

samples/bpf/README.rst

Quoted 6 lines
samples/bpf/README.rst +1 -0
+Some samples require support for BPF Type Format (BTF). To enable it,

open the
+generated config file, or use menuconfig (by "make menuconfig") to enable the

samples/bpf/README.rst +2 -0
+following configs: CONFIG_BPF_SYSCALL and CONFIG_DEBUG_INFO_BTF.
+

This is usually enabled by default, so why special case it here? Maybe, if you want some hints about the config, we should add a reference to tools/testing/selftests/bpf/config ?

The config CONFIG_DEBUG_INFO_BTF is disabled for some distros at least for mine. I ran "make defconfig" and it's not enabled by default so I think it worth to mention it here to help novice get started. I'll update it to reference to tools/testing/selftests/bpf/config .

Quoted 5 lines
Quoted 5 lines

Kernel headers
--------------

Signature · 1 line
2.34.1
#3 lore raw
Quoted 34 lines · Anh Tuan Phan
Quoted 22 lines · Stanislav Fomichev
Quoted 13 lines · Anh Tuan Phan

Update the Documentation to mention that some samples require pahole v1.16 and kernel built with CONFIG_DEBUG_INFO_BTF=y

---
 samples/bpf/README.rst | 7 +++++++
 1 file changed, 7 insertions(+)
samples/bpf/README.rst +0 -0
index 57f93edd1957..631592b83d60 100644

samples/bpf/README.rst Compiling requires having installed: · line 19

Quoted 6 lines
samples/bpf/README.rst +3 -0
@@ -14,6 +14,9 @@ Compiling requires having installed:
 Note that LLVM's tool 'llc' must support target 'bpf', list version
 and supported targets with command: ``llc --version``
 
+Some samples require pahole version 1.16 as a dependency. See
+https://docs.kernel.org/bpf/bpf_devel_QA.html for reference.
+

Any reason no to add pahole 1.16 to this section above?

Quoted 8 lines
Quoted 1 line

Compiling requires having installed:

* clang >= version 3.4.0
* llvm >= version 3.7.1
* pahole >= version 1.16

Although clang 3.4 probably won't get you anywhere these days. The whole README seems a bit outdated :-)

Quoted 6 lines

Put pahole requirement as your idea is better, thanks for suggestion. Will update it and clang version as well. For clang version, I think I can update min version as 11.0.0 (reference from
https://www.kernel.org/doc/html/next/process/changes.html). Do you see any other potential outdated things in this document? I follow the above steps and it help me compile the sample code successfully.

Maybe we can reference that doc instead here? Otherwise that copy-pasted 11.0.0 will also get old. Just mention here that we need clang/llvm/pahole to compile the samples and for specific versions put a link to process/changes.rst

Quoted 29 lines
Quoted 7 lines
Quoted 7 lines

Clean and configuration
-----------------------

samples/bpf/README.rst +0 -0
@@ -28,6 +31,10 @@ Configure kernel, defconfig for instance::
 
  make defconfig
 
Quoted 11 lines

samples/bpf/README.rst

Quoted 6 lines
samples/bpf/README.rst +1 -0
+Some samples require support for BPF Type Format (BTF). To enable it,

open the
+generated config file, or use menuconfig (by "make menuconfig") to enable the

samples/bpf/README.rst +2 -0
+following configs: CONFIG_BPF_SYSCALL and CONFIG_DEBUG_INFO_BTF.
+

This is usually enabled by default, so why special case it here? Maybe, if you want some hints about the config, we should add a reference to tools/testing/selftests/bpf/config ?

The config CONFIG_DEBUG_INFO_BTF is disabled for some distros at least for mine. I ran "make defconfig" and it's not enabled by default so I think it worth to mention it here to help novice get started. I'll update it to reference to tools/testing/selftests/bpf/config .

Quoted 5 lines
Quoted 5 lines

Kernel headers
--------------

Signature · 1 line
2.34.1
#4 lore raw

Hi Stanislav,

I have updated the Documentation according to your suggestion. Please see it in the below patch. Thanks!

Quoted 42 lines · Stanislav Fomichev
Quoted 34 lines · Anh Tuan Phan
Quoted 22 lines · Stanislav Fomichev
Quoted 13 lines · Anh Tuan Phan

Update the Documentation to mention that some samples require pahole v1.16 and kernel built with CONFIG_DEBUG_INFO_BTF=y

---
 samples/bpf/README.rst | 7 +++++++
 1 file changed, 7 insertions(+)
samples/bpf/README.rst +0 -0
index 57f93edd1957..631592b83d60 100644

samples/bpf/README.rst Compiling requires having installed: · line 19

Quoted 6 lines
samples/bpf/README.rst +3 -0
@@ -14,6 +14,9 @@ Compiling requires having installed:
 Note that LLVM's tool 'llc' must support target 'bpf', list version
 and supported targets with command: ``llc --version``
 
+Some samples require pahole version 1.16 as a dependency. See
+https://docs.kernel.org/bpf/bpf_devel_QA.html for reference.
+

Any reason no to add pahole 1.16 to this section above?

Quoted 8 lines
Quoted 1 line

Compiling requires having installed:

* clang >= version 3.4.0
* llvm >= version 3.7.1
* pahole >= version 1.16

Although clang 3.4 probably won't get you anywhere these days. The whole README seems a bit outdated :-)

Quoted 6 lines

Put pahole requirement as your idea is better, thanks for suggestion. Will update it and clang version as well. For clang version, I think I can update min version as 11.0.0 (reference from
https://www.kernel.org/doc/html/next/process/changes.html). Do you see any other potential outdated things in this document? I follow the above steps and it help me compile the sample code successfully.

Quoted 34 lines

Maybe we can reference that doc instead here? Otherwise that copy-pasted 11.0.0 will also get old. Just mention here that we need clang/llvm/pahole to compile the samples and for specific versions put a link to process/changes.rst

Quoted 29 lines
Quoted 7 lines
Quoted 7 lines

Clean and configuration
-----------------------

samples/bpf/README.rst +0 -0
@@ -28,6 +31,10 @@ Configure kernel, defconfig for instance::
 
  make defconfig
 
Quoted 11 lines

samples/bpf/README.rst

Quoted 6 lines
samples/bpf/README.rst +1 -0
+Some samples require support for BPF Type Format (BTF). To enable it,

open the
+generated config file, or use menuconfig (by "make menuconfig") to enable the

samples/bpf/README.rst +2 -0
+following configs: CONFIG_BPF_SYSCALL and CONFIG_DEBUG_INFO_BTF.
+

This is usually enabled by default, so why special case it here? Maybe, if you want some hints about the config, we should add a reference to tools/testing/selftests/bpf/config ?

The config CONFIG_DEBUG_INFO_BTF is disabled for some distros at least for mine. I ran "make defconfig" and it's not enabled by default so I think it worth to mention it here to help novice get started. I'll update it to reference to tools/testing/selftests/bpf/config .

Quoted 5 lines
Quoted 5 lines

Kernel headers
--------------

Signature · 1 line
2.34.1

---

Change from the original patch:

- Move pahole to the list installed requirements
- Remove minimal version and link the related doc
- Add a reference of kernel configuration

 samples/bpf/README.rst | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
samples/bpf/README.rst +7 -3
index 57f93edd1957..e18500753ba5 100644
@@ -8,9 +8,12 @@ Build dependencies
 ==================
 
 Compiling requires having installed:
- * clang >= version 3.4.0
- * llvm >= version 3.7.1
+ * clang
+ * llvm
+ * pahole
 
+The minimal version of the above software is referenced in
+https://www.kernel.org/doc/html/next/process/changes.html.
 Note that LLVM's tool 'llc' must support target 'bpf', list version
 and supported targets with command: ``llc --version``
 
@@ -24,7 +27,8 @@ after some changes (on demand)::
  make -C samples/bpf clean
  make clean
 
-Configure kernel, defconfig for instance::
+Configure kernel, defconfig for instance
+(see "tools/testing/selftests/bpf/config" for a reference config)::
 
  make defconfig
 
Signature · 1 line
2.34.1
#5 lore raw

Hi,

Quoted 102 lines · Anh Tuan Phan

Hi Stanislav,

I have updated the Documentation according to your suggestion. Please see it in the below patch. Thanks!

Quoted 42 lines · Stanislav Fomichev
Quoted 34 lines · Anh Tuan Phan
Quoted 22 lines · Stanislav Fomichev
Quoted 13 lines · Anh Tuan Phan

Update the Documentation to mention that some samples require pahole v1.16 and kernel built with CONFIG_DEBUG_INFO_BTF=y

---
 samples/bpf/README.rst | 7 +++++++
 1 file changed, 7 insertions(+)
samples/bpf/README.rst +0 -0
index 57f93edd1957..631592b83d60 100644

samples/bpf/README.rst Compiling requires having installed: · line 19

Quoted 6 lines
samples/bpf/README.rst +3 -0
@@ -14,6 +14,9 @@ Compiling requires having installed:
 Note that LLVM's tool 'llc' must support target 'bpf', list version
 and supported targets with command: ``llc --version``
 
+Some samples require pahole version 1.16 as a dependency. See
+https://docs.kernel.org/bpf/bpf_devel_QA.html for reference.
+

Any reason no to add pahole 1.16 to this section above?

Quoted 8 lines
Quoted 1 line

Compiling requires having installed:

* clang >= version 3.4.0
* llvm >= version 3.7.1
* pahole >= version 1.16

Although clang 3.4 probably won't get you anywhere these days. The whole README seems a bit outdated :-)

Quoted 6 lines

Put pahole requirement as your idea is better, thanks for suggestion. Will update it and clang version as well. For clang version, I think I can update min version as 11.0.0 (reference from
https://www.kernel.org/doc/html/next/process/changes.html). Do you see any other potential outdated things in this document? I follow the above steps and it help me compile the sample code successfully.

Quoted 34 lines

Maybe we can reference that doc instead here? Otherwise that copy-pasted 11.0.0 will also get old. Just mention here that we need clang/llvm/pahole to compile the samples and for specific versions put a link to process/changes.rst

Quoted 29 lines
Quoted 7 lines
Quoted 7 lines

Clean and configuration
-----------------------

samples/bpf/README.rst +0 -0
@@ -28,6 +31,10 @@ Configure kernel, defconfig for instance::
 
  make defconfig
 
Quoted 11 lines

samples/bpf/README.rst

Quoted 6 lines
samples/bpf/README.rst +1 -0
+Some samples require support for BPF Type Format (BTF). To enable it,

open the
+generated config file, or use menuconfig (by "make menuconfig") to enable the

samples/bpf/README.rst +2 -0
+following configs: CONFIG_BPF_SYSCALL and CONFIG_DEBUG_INFO_BTF.
+

This is usually enabled by default, so why special case it here? Maybe, if you want some hints about the config, we should add a reference to tools/testing/selftests/bpf/config ?

The config CONFIG_DEBUG_INFO_BTF is disabled for some distros at least for mine. I ran "make defconfig" and it's not enabled by default so I think it worth to mention it here to help novice get started. I'll update it to reference to tools/testing/selftests/bpf/config .

Quoted 5 lines
Quoted 5 lines

Kernel headers
--------------

--
2.34.1

---

Change from the original patch:

- Move pahole to the list installed requirements
- Remove minimal version and link the related doc
- Add a reference of kernel configuration

 samples/bpf/README.rst | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
samples/bpf/README.rst +0 -0
index 57f93edd1957..e18500753ba5 100644
@@ -8,9 +8,12 @@ Build dependencies
 ==================

samples/bpf/README.rst Build dependencies · line 16

Quoted 10 lines
samples/bpf/README.rst +5 -2
 
 Compiling requires having installed:
- * clang >= version 3.4.0
- * llvm >= version 3.7.1
+ * clang
+ * llvm
+ * pahole
 
+The minimal version of the above software is referenced in
+https://www.kernel.org/doc/html/next/process/changes.html.

I think it is better to not use docs from linux-next as it keeps changing too frequently. How about using the latest documentation's link instead? :)

https://www.kernel.org/doc/html/latest/process/changes.html

However, something to think about is: If future versions of clang, llvm etc do not support compiling our code as it is now, it may become misleading.

Quoted 4 lines
samples/bpf/README.rst +0 -0
 Note that LLVM's tool 'llc' must support target 'bpf', list version
 and supported targets with command: ``llc --version``
 

samples/bpf/README.rst after some changes (on demand)::

Quoted 10 lines
samples/bpf/README.rst +2 -2
@@ -24,7 +27,8 @@ after some changes (on demand)::
  make -C samples/bpf clean
  make clean
 
-Configure kernel, defconfig for instance::
+Configure kernel, defconfig for instance
+(see "tools/testing/selftests/bpf/config" for a reference config)::
 
  make defconfig
 
--

thanks,
-- Khalid Masum
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#6 lore raw
Quoted 2 lines · Khalid Masum

However, something to think about is: If future versions of clang, llvm etc do not support compiling our code as it is now, it may become misleading.

When that happens, the max version can be added in.

Though, it would be an indicator to problems in the code IMO, which would need some updates and fixes.

So nothing to worry about now.

Anh should send v3 instead of replying though. I would also suggest to shorten the commit title if possible.

Thanks,
Siddh

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#7 lore raw
Quoted 9 lines · Siddh Raman Pant
Quoted 2 lines · Khalid Masum

However, something to think about is: If future versions of clang, llvm etc do not support compiling our code as it is now, it may become misleading.

When that happens, the max version can be added in.

Though, it would be an indicator to problems in the code IMO, which would need some updates and fixes.

Quoted 8 lines

So nothing to worry about now.

Anh should send v3 instead of replying though. I would also suggest to shorten the commit title if possible.

Thanks,
Siddh

Thank you! Will send a new version accordingly. But I'd like to admit that the v2 in this patch's title is a mistake. This should be v1 so I'll send a v2 patch for this discussion.
_______________________________________________
Linux-kernel-mentees mailing list [email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#8 lore raw
Quoted 3 lines · Anh Tuan Phan

Thank you! Will send a new version accordingly. But I'd like to admit that the v2 in this patch's title is a mistake. This should be v1 so I'll send a v2 patch for this discussion.

Well, I'd say you should still post a "v3", since inboxes of the maintainers already have this email. Also, you posted two versions of the patch here anyways, so v3 is correct.

Thanks,
Siddh
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#9 lore raw
In reply to Khalid Masum
Quoted 119 lines · Khalid Masum

Hi,

Quoted 102 lines · Anh Tuan Phan

Hi Stanislav,

I have updated the Documentation according to your suggestion. Please see it in the below patch. Thanks!

Quoted 42 lines · Stanislav Fomichev
Quoted 34 lines · Anh Tuan Phan
Quoted 22 lines · Stanislav Fomichev
Quoted 13 lines · Anh Tuan Phan

Update the Documentation to mention that some samples require pahole v1.16 and kernel built with CONFIG_DEBUG_INFO_BTF=y

---
 samples/bpf/README.rst | 7 +++++++
 1 file changed, 7 insertions(+)
samples/bpf/README.rst +0 -0
index 57f93edd1957..631592b83d60 100644

samples/bpf/README.rst Compiling requires having installed: · line 19

Quoted 6 lines
samples/bpf/README.rst +3 -0
@@ -14,6 +14,9 @@ Compiling requires having installed:
 Note that LLVM's tool 'llc' must support target 'bpf', list version
 and supported targets with command: ``llc --version``
 
+Some samples require pahole version 1.16 as a dependency. See
+https://docs.kernel.org/bpf/bpf_devel_QA.html for reference.
+

Any reason no to add pahole 1.16 to this section above?

Quoted 8 lines
Quoted 1 line

Compiling requires having installed:

* clang >= version 3.4.0
* llvm >= version 3.7.1
* pahole >= version 1.16

Although clang 3.4 probably won't get you anywhere these days. The whole README seems a bit outdated :-)

Quoted 6 lines

Put pahole requirement as your idea is better, thanks for suggestion. Will update it and clang version as well. For clang version, I think I can update min version as 11.0.0 (reference from
https://www.kernel.org/doc/html/next/process/changes.html). Do you see any other potential outdated things in this document? I follow the above steps and it help me compile the sample code successfully.

Quoted 34 lines

Maybe we can reference that doc instead here? Otherwise that copy-pasted 11.0.0 will also get old. Just mention here that we need clang/llvm/pahole to compile the samples and for specific versions put a link to process/changes.rst

Quoted 29 lines
Quoted 7 lines
Quoted 7 lines

Clean and configuration
-----------------------

samples/bpf/README.rst +0 -0
@@ -28,6 +31,10 @@ Configure kernel, defconfig for instance::
 
  make defconfig
 
Quoted 11 lines

samples/bpf/README.rst

Quoted 6 lines
samples/bpf/README.rst +1 -0
+Some samples require support for BPF Type Format (BTF). To enable it,

open the
+generated config file, or use menuconfig (by "make menuconfig") to enable the

samples/bpf/README.rst +2 -0
+following configs: CONFIG_BPF_SYSCALL and CONFIG_DEBUG_INFO_BTF.
+

This is usually enabled by default, so why special case it here? Maybe, if you want some hints about the config, we should add a reference to tools/testing/selftests/bpf/config ?

The config CONFIG_DEBUG_INFO_BTF is disabled for some distros at least for mine. I ran "make defconfig" and it's not enabled by default so I think it worth to mention it here to help novice get started. I'll update it to reference to tools/testing/selftests/bpf/config .

Quoted 5 lines
Quoted 5 lines

Kernel headers
--------------

--
2.34.1

---

Change from the original patch:

- Move pahole to the list installed requirements
- Remove minimal version and link the related doc
- Add a reference of kernel configuration

 samples/bpf/README.rst | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
samples/bpf/README.rst +0 -0
index 57f93edd1957..e18500753ba5 100644
@@ -8,9 +8,12 @@ Build dependencies
 ==================

samples/bpf/README.rst Build dependencies · line 16

Quoted 10 lines
samples/bpf/README.rst +5 -2
 
 Compiling requires having installed:
- * clang >= version 3.4.0
- * llvm >= version 3.7.1
+ * clang
+ * llvm
+ * pahole
 
+The minimal version of the above software is referenced in
+https://www.kernel.org/doc/html/next/process/changes.html.

I think it is better to not use docs from linux-next as it keeps changing too frequently. How about using the latest documentation's link instead? :)

Quoted 5 lines

https://www.kernel.org/doc/html/latest/process/changes.html

However, something to think about is: If future versions of clang, llvm etc do not support compiling our code as it is now, it may become misleading.

Thanks, I'll update the documentation's link in the next version.

Quoted 18 lines
Quoted 5 lines
samples/bpf/README.rst +0 -0
 Note that LLVM's tool 'llc' must support target 'bpf', list version
 and supported targets with command: ``llc --version``
 

samples/bpf/README.rst after some changes (on demand)::

Quoted 10 lines
samples/bpf/README.rst +2 -2
@@ -24,7 +27,8 @@ after some changes (on demand)::
  make -C samples/bpf clean
  make clean
 
-Configure kernel, defconfig for instance::
+Configure kernel, defconfig for instance
+(see "tools/testing/selftests/bpf/config" for a reference config)::
 
  make defconfig
 
--

thanks,
-- Khalid Masum

#10 lore raw
In reply to Khalid Masum
Quoted 113 lines · Khalid Masum

Hi,

Quoted 110 lines · Anh Tuan Phan

Hi Stanislav,

I have updated the Documentation according to your suggestion. Please see it in the below patch. Thanks!

Quoted 42 lines · Stanislav Fomichev
Quoted 34 lines · Anh Tuan Phan
Quoted 22 lines · Stanislav Fomichev
Quoted 13 lines · Anh Tuan Phan

Update the Documentation to mention that some samples require pahole v1.16 and kernel built with CONFIG_DEBUG_INFO_BTF=y

---
 samples/bpf/README.rst | 7 +++++++
 1 file changed, 7 insertions(+)
samples/bpf/README.rst +0 -0
index 57f93edd1957..631592b83d60 100644

samples/bpf/README.rst Compiling requires having installed: · line 19

Quoted 6 lines
samples/bpf/README.rst +3 -0
@@ -14,6 +14,9 @@ Compiling requires having installed:
 Note that LLVM's tool 'llc' must support target 'bpf', list version
 and supported targets with command: ``llc --version``
 
+Some samples require pahole version 1.16 as a dependency. See
+https://docs.kernel.org/bpf/bpf_devel_QA.html for reference.
+

Any reason no to add pahole 1.16 to this section above?

Quoted 8 lines
Quoted 1 line

Compiling requires having installed:

* clang >= version 3.4.0
* llvm >= version 3.7.1
* pahole >= version 1.16

Although clang 3.4 probably won't get you anywhere these days. The whole README seems a bit outdated :-)

Quoted 6 lines

Put pahole requirement as your idea is better, thanks for suggestion. Will update it and clang version as well. For clang version, I think I can update min version as 11.0.0 (reference from
https://www.kernel.org/doc/html/next/process/changes.html). Do you see any other potential outdated things in this document? I follow the above steps and it help me compile the sample code successfully.

Quoted 34 lines

Maybe we can reference that doc instead here? Otherwise that copy-pasted 11.0.0 will also get old. Just mention here that we need clang/llvm/pahole to compile the samples and for specific versions put a link to process/changes.rst

Quoted 29 lines
Quoted 7 lines
Quoted 7 lines

Clean and configuration
-----------------------

samples/bpf/README.rst +0 -0
@@ -28,6 +31,10 @@ Configure kernel, defconfig for instance::
 
  make defconfig
 
Quoted 11 lines

samples/bpf/README.rst

Quoted 6 lines
samples/bpf/README.rst +1 -0
+Some samples require support for BPF Type Format (BTF). To enable it,

open the
+generated config file, or use menuconfig (by "make menuconfig") to enable the

samples/bpf/README.rst +2 -0
+following configs: CONFIG_BPF_SYSCALL and CONFIG_DEBUG_INFO_BTF.
+

This is usually enabled by default, so why special case it here? Maybe, if you want some hints about the config, we should add a reference to tools/testing/selftests/bpf/config ?

The config CONFIG_DEBUG_INFO_BTF is disabled for some distros at least for mine. I ran "make defconfig" and it's not enabled by default so I think it worth to mention it here to help novice get started. I'll update it to reference to tools/testing/selftests/bpf/config .

Quoted 5 lines
Quoted 5 lines

Kernel headers
--------------

--
2.34.1

---

Change from the original patch:

- Move pahole to the list installed requirements
- Remove minimal version and link the related doc
- Add a reference of kernel configuration

 samples/bpf/README.rst | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
samples/bpf/README.rst +3 -2
index 57f93edd1957..e18500753ba5 100644
@@ -8,9 +8,12 @@ Build dependencies
 ==================
 
 Compiling requires having installed:
- * clang >= version 3.4.0
- * llvm >= version 3.7.1
+ * clang
+ * llvm
+ * pahole
 
Quoted 7 lines

samples/bpf/README.rst Build dependencies · line 16

Quoted 2 lines
samples/bpf/README.rst +2 -0
+The minimal version of the above software is referenced in
+https://www.kernel.org/doc/html/next/process/changes.html.

I think it is better to not use docs from linux-next as it keeps changing too frequently. How about using the latest documentation's link instead? :)

https://www.kernel.org/doc/html/latest/process/changes.html

+1

We should put Documentation/process/changes.rst here (or whatever the correct path). The tooling that generates html from rst will put a proper link.
_______________________________________________
Linux-kernel-mentees mailing list [email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#11 lore raw
In reply to Anh Tuan Phan
Quoted 5 lines · Anh Tuan Phan

Update the Documentation to mention that some samples require pahole v1.16 and kernel built with CONFIG_DEBUG_INFO_BTF=y

---

Minor nit: you should write what changed since the first version of the patch here, otherwise the changes are pretty hard to follow.

#12 lore raw

Thanks, will do

Quoted 9 lines · Ivan Orlov
Quoted 5 lines · Anh Tuan Phan

Update the Documentation to mention that some samples require pahole v1.16 and kernel built with CONFIG_DEBUG_INFO_BTF=y

---

Minor nit: you should write what changed since the first version of the patch here, otherwise the changes are pretty hard to follow.

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees