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

Set BPF Skeleton name to base name of ebpf file #436

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

jalalmostafa
Copy link
Contributor

The current build system sets the name of the generated skeleton directly to the file's name minus the .skel.h suffix.
Passing names of eBPF targets that contain a directory will result in wrong names e.g. bpf/xdp_program.bpf.o will have a skeleton file of the name bpf/xdp_program.skel.h and consequently the program name will be bpf/xdp_program instead of xdp_program. The commit pops out the directory part from the name.

@tohojo
Copy link
Member

tohojo commented Sep 10, 2024

Erm, what bug are you fixing here? We don't actually pass any names with a directory prefix as skeleton names AFAIK?

@jalalmostafa
Copy link
Contributor Author

Not a bug but more of a feature. I use the xdp-tools build system as a scaffold for my libxdp-based programs. If I or someone else wants to have the eBPF programs in a special directory then he needs this.

@tohojo
Copy link
Member

tohojo commented Sep 11, 2024

Hmm, okay, well I guess this doesn't hurt to include. Do note that using the repository like this is not something that's explicitly supported, so I won't promise not to make changes that you'll have to adapt to :)

Copy link
Member

@tohojo tohojo left a comment

Choose a reason for hiding this comment

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

Could you please update the commit message to include the rationale (including the fact that this does not affect anything currently in the repo)?

@jalalmostafa
Copy link
Contributor Author

I just fixed the commit message. I added removing *.ll files in nested directories in the clean target too.

@jalalmostafa jalalmostafa requested a review from tohojo September 16, 2024 09:08
@jalalmostafa jalalmostafa force-pushed the master branch 4 times, most recently from e0f44b0 to cf5ceb1 Compare September 16, 2024 09:20
Copy link
Member

@tohojo tohojo left a comment

Choose a reason for hiding this comment

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

The DCO bot is complaining that the commit author and S-o-b tag; please fix that (you can reset the author with git commit --amend --author=, or just change the S-o-b tag.

@tohojo
Copy link
Member

tohojo commented Sep 19, 2024

Better, but now the commit message disappeared again :(

The current build system sets the name of the generated skeleton directly
to the file's name minus the .skel.h suffix. In case the eBPF program
was in a nested directory, this leads to syntax errors in the skeleton
file. This commit support ebpf programs in nested directory by poping out
the directory part in the eBPF program name without breaking the build
of currently available eBPF program.

Signed-off-by: Jalal Mostafa <[email protected]>
@jalalmostafa
Copy link
Contributor Author

Oops. Sorry.
I just added it.

Copy link
Member

@tohojo tohojo left a comment

Choose a reason for hiding this comment

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

Alright, that's better, thanks! :)

@tohojo tohojo merged commit f8fffe4 into xdp-project:master Sep 19, 2024
19 of 25 checks passed
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