Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue#104 #111

Closed
wants to merge 9 commits into from
Closed

Conversation

rameezrehman408
Copy link
Contributor

Weird indentation is corrected in all the .rst files.

Extra spaces at the start of the paragraphs are corrected. However, tabs/spaces in the examples (below '::') have been kept unchanged.

Weird indentation is corrected in all the .rst files. 

Extra spaces & tabs in the paragraphs are corrected. However, tabs/spaces in the examples (below '::') have been kept unchanged.

Signed-off-by: Rameez Rehman <[email protected]>
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly OK, apart from some new lines that sneaked in in one file. Thanks!

Once the commit is ready, we'll need to rebase it onto the Linux repository, and submit it to the BPF mailing list. Relevant documentation for submitting include:

Before submitting, we'll need to clean up the commit title and description:

  • Commit title should be prefixed with bpftool:
  • It should describe more precisely what we're doing (weird was good enough for the GitHub issue, but we want something clearer).
  • We should also motivate the change. What we're doing is picking more sensible indentation markers, to have them easier to work with. I think the mix of tabs and spaces is here for historical reason: the first bpftool authors chose tabs because this is what is used in most places in the repo for indentation, and completed with spaces because, if I remember correctly, they wanted the description to align nicely on the first argument after **bpftool in the command description. But this has proved tricky to work with, and text editors typically trip on the syntax.

(Again, I'm happy to help with the submission process.)

Before we do that: I've been thinking more about formatting here. How much more are you willing to work on this? Looking at the description, I note that:

  • You kept tabs for indents, which is OK. But I note that most other RST documentation in the kernel repo are using spaces for indents, and to be honest, spaces look a better choice to me for RST (where indent is sometimes tricky and spaces allow for more flexibility). So maybe we could take this chance to replace tabs with spaces in the whole section.
  • Since we'd touch the whole section anyway, and given the indentation level will likely change, we could just as well re-wrap the body of the descriptions on 80-character wide lines. I did a quick test and it would change the generated man page, but only the wrapping of the paragraphs in its sources, not the result produced with man.
  • I realised that the markup for bold text (**) is in fact not necessary in the lines with the command syntax, in the DESCRIPTION section, we're using RST description lists and rst2man already sets the full line in bold save for the keywords we manually set to italics instead. So we could maybe remove these markers, too.

Apologies for not providing this feedback earlier.

What do you think?

docs/bpftool-prog.rst Outdated Show resolved Hide resolved
docs/bpftool-btf.rst Outdated Show resolved Hide resolved
Indentation and other formatting issues in all .rst files have been improved.

1) 1x Tab is replaced with 4x spaces.
2) Bold text in the command syntax (in Description Section only) is replaced with normal text.
3) Description Body is re-wrapped to 80 character width. It is to be noted that the generated man pages have no effect.
4) In 'bpftool-cgroup.rst' file, content under 'attach type' is spaced vertically with 1x empty line for better readability in generated man page (it was converted into a single block with poor readability therefore the modification is done).

Signed-off-by: Rameez Rehman <[email protected]>
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! Apologies for the delay, I've been on vacations for a few days.

The change look great overall! I've got some minor comments, in particular:

  • Can we make the indent changes in the OPTIONS sections consistent? Let's use spaces there as well, as you did for some pages. See the comments inline below.

  • You have a lot of trailing spaces at the end of lines, can you please clean them up?

  • Regarding the change to the cgroup attach types, can we instead make it a list (prefixing items with - ..., for example:

             *ATTACH_TYPE* can be on of:
    
             - **ingress** ingress path of the inet socket (since 4.10);
             - **egress** egress path of the inet socket (since 4.10);
             - **sock_create** opening of an inet socket (since 4.10);
             ...

    I would maybe make this change a separate commit, to make it easier to track - although you described it well in the commit log so one commit would also be acceptable.

  • Can you rebase your changes on the latest version of the master branch? I've synced with the kernel repo today, and there's some conflict with Daniel's series.

  • Please go through the other comments inline below.

docs/bpftool-gen.rst Outdated Show resolved Hide resolved
docs/bpftool-prog.rst Outdated Show resolved Hide resolved
docs/bpftool-feature.rst Show resolved Hide resolved
docs/bpftool-gen.rst Outdated Show resolved Hide resolved
docs/bpftool-iter.rst Show resolved Hide resolved
docs/bpftool-perf.rst Show resolved Hide resolved
docs/bpftool-prog.rst Outdated Show resolved Hide resolved
docs/bpftool.rst Outdated Show resolved Hide resolved
docs/bpftool-cgroup.rst Outdated Show resolved Hide resolved
docs/bpftool-cgroup.rst Outdated Show resolved Hide resolved
@qmonnet
Copy link
Member

qmonnet commented Aug 29, 2023

Heads up on the next steps, once the PR is ready:

  • We'll have to port it to the kernel repo (there won't be anything changing, other than the paths of the file, under tools/bpf/bpftool/Documentation/ instead of simply docs).
  • We'll need to make sure that the commits are properly split (if we have several ones), and that they are properly formatted. In particular:
    • We want to prefix the title with bpftool: and explain what the commit does, for example: bpftool: simplify indentation in man pages or something like this
    • We want a proper Signed-off-by: tag, but you've got this in order already
    • We want a good description, and you have it; but we'll want to wrap it on something narrower, typically 72 character-wide lines
    • We'll run checkpatch.pl on the commits to make sure that everything else looks in order.
  • Then we'll be able to submit the patches to the mailing list.

@qmonnet
Copy link
Member

qmonnet commented Aug 29, 2023

  • We'll have to port it to the kernel repo (there won't be anything changing

That is, unless other patches are merged in the meantime. https://lore.kernel.org/all/[email protected]/ looks like a good candidate for that.

Indentation improvement for all .rst files. This commit is 2nd for a PR
libbpf#111.

1) Trailing spaces at End of Line removed.
2) Indent improvements in 'OPTIONS' section is also included as in other
sections (1xTab = 4x spaces).
3) The cgroup attach types in 'bpftool-cgroup.rst' file is converted
into a list by adding hyphen '-' before each entry.
4) Incorrect wrapping of a command in 'bpftool-prog.rst' corrected.
5) Examples in 'bpftool-gen.rst' are improved as 1tab/indentation = 2x
spaces.
6) Description/Text is wrapped to 80 characters width. (Main
modification was done in an earlier commit, some remaining text blocks
are corrected here.)

Signed-off-by: Rameez Rehman <[email protected]>
@rameezrehman408
Copy link
Contributor Author

rameezrehman408 commented Sep 26, 2023

I am grateful for your detailed review earlier. I believe all of the suggestions have been included in this 2nd commit.

I am new to the open-source domain and very excited to have commits/PR that may get included upstream into the kernel. I deeply appreciate your time and guidance on this.

I am a bit unsure about submitting the patches and will look into the references you shared earlier.

I also apologize for the huge delay in the requested changes. I have been quite busy since my last commit, in my day job along with back-to-back trainings for security certs (ISMS LA & CISM for now) required by my employer.

Once again thank you for the opportunity and waiting anxiously as well as nervously for your kind review. 😊

Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Examples in 'bpftool-gen.rst' are improved as 1tab/indentation = 2x spaces.

Can we revert this part? I've got nothing against the initial indent at 4 tabs, although if we did it, it should be consistent everywhere. But let's not use 2 spaces for one tab in the C code. The convention in the kernel repo is 8 spaces for one tab, there's no reason to have a different value here. But I'd recommend to just leave the code snippets are they are, it's probably acceptable to have tabs in there, and they're not something people edit often anyway. Same thing for bpftool-iter.rst and bpftool-net.rst where you changed the indent - let's keep the examples for another time?

Looks good otherwise, this is going into the right direction :)

Please find a few minor comments below.

docs/bpftool-btf.rst Outdated Show resolved Hide resolved
docs/bpftool-cgroup.rst Outdated Show resolved Hide resolved
docs/bpftool-cgroup.rst Outdated Show resolved Hide resolved
docs/bpftool.rst Outdated Show resolved Hide resolved
@qmonnet
Copy link
Member

qmonnet commented Sep 28, 2023

I am grateful for your detailed review earlier. I believe all of the suggestions have been included in this 2nd commit.

Yes, thanks, great work!

I am new to the open-source domain and very excited to have commits/PR that may get included upstream into the kernel. I deeply appreciate your time and guidance on this.

You're welcome, thanks for the work and for coming back to this - there's nothing complex in this PR but this is a big one and I do realise that I've been giving you a good amount of changes during the review.

I am a bit unsure about submitting the patches and will look into the references you shared earlier.

Yes please, take a look at the docs. The summary is as I described earlier. But I'm happy to help with the process and check before you send, if it's helpful.

I also apologize for the huge delay in the requested changes. I have been quite busy since my last commit, in my day job along with back-to-back trainings for security certs (ISMS LA & CISM for now) required by my employer.

This is entirely fine. We're all busy with stuff. I perfectly understand you're not 100% focusing on this PR. Neither am I - that's why you get a 2-day long delay for review 🙂. Thanks for working on it and no worries about the time it takes, there's no rush. The most important is to do it well.

Once again thank you for the opportunity and waiting anxiously as well as nervously for your kind review. 😊

Oh dear, please don't feel anxious or nervous, that's not the objective! 🙂 I know the “Changes requested” may feel intimidating or frustrating because GitHub puts it in red, but that's just that really, some changes are necessary but the rest of the PR is great. Again I do realise I've raised a lot of things during the review, but since we're updating all bpftool docs, we should do it well, so I'm trying to be thorough!

We're nearly there, there are just a bunch of minor things to fix this time - aside from reverting the changes on the examples, maybe. I'd also recommend to rebase on the top of the master branch, although we may have more rebasing to do by the time we get the patch ready (there are at least two patch sets in flight with bpftool doc changes on the mailing list - nothing major, thankfully).



Indentation improvement for all .rst files and some minor corrections . This commit is 3rd for a PR libbpf#111.

1) Indentation for Examples in 'bpftool-gen.rst' are reverted back to tab.

2) (i) List based cgroup attach types in 'bpftool-cgroup.rst' needed to be in single line to build successfully.
2) (ii) Additionally, extra blank lines removed.
2) (iii) End of Line punctuations removed.
2) (iv) Typo Correction.

3) Other minor corrections.


Indentation improvement for all .rst files and some minor corrections . This commit is 3rd for a PR libbpf#111.

1) Indentation for Examples in 'bpftool-gen.rst' are reverted back to tab.

2) (i) List based cgroup attach types in 'bpftool-cgroup.rst' needed to be in single line to build successfully.
2) (ii) Additionally, extra blank lines removed.
2) (iii) End of Line punctuations removed.
2) (iv) Typo Correction.

3) Other minor corrections.


Signed-off-by: Rameez Rehman <[email protected]>
Merge remote-tracking branch 'refs/remotes/upstream/master'

Conflicts:
	docs/bpftool-net.rst
Conflict resolved and new content formatted.


Signed-off-by: Rameez Rehman <[email protected]>
@rameezrehman408
Copy link
Contributor Author

Thanks for your review.

I have included the corrections you asked and created a commit 169871f.

I did rebase my local to the rameezrehman408:master before committing. However, I believe you meant to rebase from the libbpf:master, which I believe required synching and was visible under the "sync fork" button (showing the difference in no. of commits between both repos) as below.
image

I have now merged the upstream/master and my master branch. I believe this was the thing that was required.

Requesting for your review.
Thanks a lot.

Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One remaining issue with the list, the rest looks OK.

docs/bpftool-cgroup.rst Show resolved Hide resolved
docs/bpftool-net.rst Outdated Show resolved Hide resolved
@qmonnet
Copy link
Member

qmonnet commented Oct 2, 2023

I did rebase my local to the rameezrehman408:master before committing. However, I believe you meant to rebase from the libbpf:master, which I believe required synching and was visible under the "sync fork" button (showing the difference in no. of commits between both repos) as below.

Yes, I meant rebasing on top of upstream (libbpf/bpftool), sorry if this was unclear.

There's something wrong with your rebase though, it shouldn't change the libbpf version in use (this change). This is why the CI fails to run. Not really an issue because we'll send this patch to the ML anyway, but just so that you know.



Indentation improvement for docs/*.rst files (specially the revised bpftool-cgroup.rst, bpftool-net.rst and bpftool-prog.rst.

1) Revision of the document as per new updates in upstream.
2) Amendment in the formatting of the list and typo correction.

Signed-off-by: Rameez Rehman <[email protected]>
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Changes look good. There's still a conflict in this repo (the updates in the synopsis of the document, see upstream commit).

As it turns out, we're also missing the latest updates from upstream that are not in the bpftool mirror repo yet, such as this commit.

Not sure what's the best workflow here, but we should probably start rebasing your changes against the bpf-next tree anyway. We can do it as a PR on this fork if you want to stay on GitHub for now; or your can rebase your changes, and send a patch over to me with git send-email (or to the mailing list, if you've read through the documentation for the process and are feeling confident about the updates).

What we need now:

  • Rebase on upstream (bpf-next tree): rebase on top of latest changes + edit tools/bpf/bpftool/Documentation/*.rst instead of docs/*.rst in the current repo. This can be either on GitHub as I mentioned earlier, if you want another review, or just locally on your machine.
  • Rework the Git history: split the set into logical commits (ideally: one commit for all whitespace/indent changes, one for everything else such as typo fixes), write relevant commit descriptions
  • Run scripts/checkpatch.pl --strict from Linux repo on the changes, to make sure it doesn't raise any complaint
  • Submit: git send-email to BPF mailing list and relevant reviewers (but feel free to send only to me first, if you want a review).

Let me know if you need more details.
I'm available on Cilium/eBPF Slack or IRC or email or whatever, if necessary

I know this is long and probably frustrating, bpftool is not extremely active but given that we're touching nearly all doc contents, it's super easy to get conflicts everytime someone else touches them. Thanks for bearing with it! :)

@qmonnet
Copy link
Member

qmonnet commented Mar 25, 2024

Hi @rameezrehman408, any news on this PR? I'm seeing upstream contributions with people still tripping over the weird indentation in the file, and I'd like to get this fix out in the coming weeks/days.

Are you still interested in this? If not, would you mind me to pick it up and send it as joint work?

@qmonnet
Copy link
Member

qmonnet commented Mar 27, 2024

I've rebased as the last three commits on this branch, let me know if you're OK with me posting these.

@rameezrehman408
Copy link
Contributor Author

Dear @qmonnet,

I sincerely apologize for the delay, I have caused. I believe this branch is the most optimum way forward. I'd be more than glad to be a part of this contribution.

Thank you for your kind consideration and support.

@qmonnet
Copy link
Member

qmonnet commented Mar 31, 2024

@qmonnet
Copy link
Member

qmonnet commented Apr 2, 2024

Now merged upstream, I'll pull it to the GitHub mirror at the next sync-up. Thanks Rameez!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants