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

enable ide's etc. to work on the bpf.c files #668

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

likewhatevs
Copy link
Contributor

this makes it so that clangd and ide tools which use clangd can work on the bpf.c code.

nothing should actually be changed outside of that ide/editor environment, all the changes are ifdef'ed on LSP which is set in the added .clangd file.

image

@likewhatevs
Copy link
Contributor Author

I also limited edits to those needed to make this work for mitosis, rusty and layered; but this would work with all of them (tested locally).

.clangd Show resolved Hide resolved
@likewhatevs
Copy link
Contributor Author

will squash when merge -- learned a new thing today (so much nicer than reset soft and push -f repeatedly lol).

@htejun
Copy link
Contributor

htejun commented Sep 20, 2024

Hey, so, I went through some of it and I'm not sure this is a good idea. For rust, enforcing linting makes sense because everyone does that and each of us is likely to use the same tool to format while working on the code anyway. For C, it's just not that way and I don't think the forced uniformity is worth all that much. The language is not that complex. The statements are expected to be shorter and simpler and there are things going on that the compiler can't make sense of.

Copy link
Contributor

@htejun htejun left a comment

Choose a reason for hiding this comment

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

Please see the other comment.

rust/scx_rustland_core/assets/bpf/main.bpf.c Outdated Show resolved Hide resolved
rust/scx_rustland_core/assets/bpf/main.bpf.c Outdated Show resolved Hide resolved
rust/scx_rustland_core/assets/bpf/main.bpf.c Outdated Show resolved Hide resolved
rust/scx_rustland_core/assets/bpf/main.bpf.c Outdated Show resolved Hide resolved
rust/scx_stats/examples/stats_defs.rs.h Outdated Show resolved Hide resolved
rust/scx_stats/examples/stats_defs.rs.h Outdated Show resolved Hide resolved
scheds/include/scx/common.bpf.h Outdated Show resolved Hide resolved
scheds/include/scx/common.bpf.h Outdated Show resolved Hide resolved
scheds/include/scx/ravg_impl.bpf.h Outdated Show resolved Hide resolved
scheds/rust/scx_lavd/src/bpf/intf.h Outdated Show resolved Hide resolved
@likewhatevs likewhatevs force-pushed the make-tools-work-better branch 2 times, most recently from ed5f155 to a54cbb2 Compare September 20, 2024 19:07
@likewhatevs likewhatevs marked this pull request as draft September 20, 2024 19:08
@likewhatevs
Copy link
Contributor Author

Reverted this to what it initially was -- make ide's/lsp work nice on bpf code. An added benefit of this is that we should also get hover docs for comments in functions in common.bpf.h, etc.

Will squash merge once approved instead of soft reset and push -f.

@likewhatevs likewhatevs marked this pull request as ready for review September 20, 2024 19:15
@likewhatevs likewhatevs force-pushed the make-tools-work-better branch 3 times, most recently from 328a28b to 1ea86d2 Compare September 23, 2024 15:54
this makes it so that clangd and ide tools which use clangd
can work on the bpf.c code.

nothing should actually be changed outside of that ide/editor
environment, all the changes are ifdef'ed on LSP which is set
in the added .clangd file.
@likewhatevs likewhatevs merged commit 99d1179 into sched-ext:main Sep 24, 2024
18 of 19 checks passed
likewhatevs added a commit to sched-ext/scx-backports that referenced this pull request Oct 4, 2024
* enable ide's etc. to work on the bpf.c files
this makes it so that clangd and ide tools which use clangd
can work on the bpf.c code.

nothing should actually be changed outside of that ide/editor
environment, all the changes are ifdef'ed on LSP which is set
in the added .clangd file.

* move intf include out of both sides of ifdef toggle
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.

3 participants