Commit 7121f19
committed
scripts/coccinelle/generation: add example generation script
To do complicated tasks it is sometimes a bit difficult to write
a coccinelle rule. Such is the case when you want to use the iterator,
which can be used to help check for nested set of calls.
An example use case of this is when we want to check if a routine
may call an atomic context, or if a routine is calling any known
existing sleep routines.
This adds some initial examples we can go and try to enhance over
time with some very specific specialized tasks. What we see is
it is even hard to have code generate code (cocci python code)
which we can easily maintain.
Fortunately AI does *grok* this. So no shame, *different* gen AI agents
helped me get these to where they are. I suspect we'll need gen AIs
agents to continue to maintain them as well and enhance them.
What we should do is once we have high confidence is start using it
for tests to ensure we respect some golden rules. These all take
a long time to run because of the nested stuff. Its complicated.
I wrote these try to help with a bug we're trying to fix upstream [0]
on determining if __find_get_block_slow() really can't block and ...
determining exactly *why*.
[0] https://lore.kernel.org/all/[email protected]/
Signed-off-by: Luis Chamberlain <[email protected]>1 parent f301c9a commit 7121f19
File tree
2 files changed
+1121
-0
lines changed- scripts/coccinelle/generation
2 files changed
+1121
-0
lines changed
0 commit comments