All of lore.kernel.org
 help / color / mirror / Atom feed
From: Donald Hunter <donald.hunter@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf@vger.kernel.org, linux-doc@vger.kernel.org,
	Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH bpf-next v2 2/2] Add table of BPF program types to libbpf docs
Date: Mon, 29 Aug 2022 09:26:56 +0100	[thread overview]
Message-ID: <m2czcj78vj.fsf@gmail.com> (raw)
In-Reply-To: <CAEf4BzZnsEAGOXY0KGAN6ZcLsHeMYEfRGaO20jEJk_soqLnD7w@mail.gmail.com> (Andrii Nakryiko's message of "Thu, 25 Aug 2022 13:35:40 -0700")

Andrii Nakryiko <andrii.nakryiko@gmail.com> writes:
>
>>  libbpf
>>  ======
>>
>> @@ -9,6 +11,7 @@ libbpf
>>     API Documentation <https://libbpf.readthedocs.io/en/latest/api.html>
>
> I'd put program_types here, it's more relevant and important than
> libbpf naming conventions

Good suggestion, thanks.

>>     libbpf_naming_convention
>>     libbpf_build
>> +   program_types
>>
>>  This is documentation for libbpf, a userspace library for loading and
>>  interacting with bpf programs.
>> diff --git a/Documentation/bpf/libbpf/program_types.rst b/Documentation/bpf/libbpf/program_types.rst
>> new file mode 100644
>> index 000000000000..dc65ede09eef
>> --- /dev/null
>> +++ b/Documentation/bpf/libbpf/program_types.rst
>> @@ -0,0 +1,18 @@
>> +.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
>> +
>> +.. _program_types_and_elf:
>> +
>> +Program Types  and ELF Sections
>
> nit: two spaces?

Ack.

>> +===============================
>> +
>> +The table below lists the program types, their attach types where relevant and the ELF section
>> +names supported by libbpf for them. The ELF section names follow these rules:
>> +
>> +- ``type`` is an exact match, e.g. ``SEC("socket")``
>> +- ``type+`` means it can be either exact ``SEC("type")`` or well-formed ``SEC("type/extras")``
>> +  with a ‘``/``’ separator, e.g. ``SEC("tracepoint/syscalls/sys_enter_open")``
>
> '/' is always going to be a type and "extras" separator, but extra
> section format is not formalized. We have cases where it's all '/'s
> (like tracepoint you mentioned), but newer and more complicated format
> uses ':' as separator, e.g.
> SEC("usdt/<path-to-binary>:<usdt_provide>:<usdt_name>") (let's mention
> the latter as well to not create false impression of only ever having
> '/' as separator)

I will add a more detailed description extras format and include the
USDT example.

>> +
>> +.. csv-table:: Program Types and Their ELF Section Names
>> +   :file: ../../output/program_types.csv
>> +   :widths: 40 30 20 10
>> +   :header-rows: 1
>
> it would be helpful to include a short snippet from generated CSV file
> to give a general idea of the output

Ack.


      reply	other threads:[~2022-08-29  8:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 22:10 [PATCH bpf-next v2 0/2] Add table of BPF program types to docs Donald Hunter
2022-08-24 22:10 ` [PATCH bpf-next v2 1/2] Add subdir support to Documentation makefile Donald Hunter
2022-08-24 22:10 ` [PATCH bpf-next v2 2/2] Add table of BPF program types to libbpf docs Donald Hunter
2022-08-25 20:35   ` Andrii Nakryiko
2022-08-29  8:26     ` Donald Hunter [this message]

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=m2czcj78vj.fsf@gmail.com \
    --to=donald.hunter@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.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.