coccinelle: api: add kvfree script
Quoted 1 line
Check that alloc and free types of functions match each other.
Further software development challenges are interesting also for such an use case.
Review
Quoted 3 lines
(quoted diff) +3
-0+/// Check that kvmalloc'ed memory is freed by kfree functions, +/// vmalloc'ed by vfree functions and kvmalloc'ed by kvfree +/// functions.
* How do you think about to offer a wording suggestion for subjects of generated patches?
* Will the presented case distinction trigger further improvements for the desired matching?
* Would you like to generalise the safe handling of allocations and corresponding release of system resources?
Quoted 1 line
+// Confidence: High
I suggest to reconsider this information once more.
Review
Quoted 4 lines
(quoted diff) +4
-0+virtual patch +virtual report +virtual org +virtual context
+virtual patch, report, org, context
Is such a SmPL code variant more succinct?
Quoted 1 line
+@choice@
* Can it be that this SmPL rule is not relevant for all operation modes?
* Will additional dependencies matter?
Quoted 1 line
+ E = \(kmalloc@kok\|kzalloc@kok\|krealloc@kok\|kcalloc@kok\|kmalloc_node@kok\|kzalloc_node@kok\|kmalloc_array@kok\|kmalloc_array_node@kok\|kcalloc_node@kok\)(...)
I would prefer an other coding style here.
* Items for such SmPL disjunctions can be specified also on multiple lines.
* The semantic patch language supports further means to handle function name lists in more convenient ways.
Would you like to work with customised constraints?
Review
Quoted 2 lines
(quoted diff) +2
-0+msg = "WARNING: kmalloc is used to allocate this memory at line %s" % (k[0].line) +coccilib.report.print_report(p[0], msg)
* I propose once more omit the extra variable “msg” at similar places. The desired message object can be directly passed as a function parameter.
* I find the diagnostic text insufficient.
* Can the corresponding function category be dynamically determined?
Are you looking for opportunities to avoid unwanted code duplication?
Regards,
Markus
Quoted 9 lines
Quoted 1 line
+ E = \(kmalloc@kok\|kzalloc@kok\|krealloc@kok\|kcalloc@kok\|kmalloc_node@kok\|kzalloc_node@kok\|kmalloc_array@kok\|kmalloc_array_node@kok\|kcalloc_node@kok\)(...)
I would prefer an other coding style here.
* Items for such SmPL disjunctions can be specified also on multiple lines.
* The semantic patch language supports further means to handle function name lists in more convenient ways.
Would you like to work with customised constraints?
Please don't follow this advice. Coccinelle is not able to optimize its search process according to the information in constraints. It will needlessly parse many files.
julia
Quoted 11 lines
Quoted 9 lines
Quoted 1 line
+ E = \(kmalloc@kok\|kzalloc@kok\|krealloc@kok\|kcalloc@kok\|kmalloc_node@kok\|kzalloc_node@kok\|kmalloc_array@kok\|kmalloc_array_node@kok\|kcalloc_node@kok\)(...)
I would prefer an other coding style here.
* Items for such SmPL disjunctions can be specified also on multiple lines.
* The semantic patch language supports further means to handle function name lists in more convenient ways.
Would you like to work with customised constraints?Please don't follow this advice.
I suggest to reconsider such feedback.
Do the previous comments contain helpful information?
Quoted 1 line
Coccinelle is not able to optimize its search process
The software contains some limitations which might be changeable.
Quoted 1 line
according to the information in constraints.
Will related solution ideas become more interesting?
Quoted 1 line
It will needlessly parse many files.
Such an effect would be undesirable.
* Would you like to clarify other software development options any more?
* How will design goals evolve?
Regards,
Markus
Re: Coccinelle: Extending capabilities for source file pre-selection
Quoted 8 lines
Quoted 1 line
Coccinelle is not able to optimize its search process
The software contains some limitations which might be changeable.
Quoted 1 line
according to the information in constraints.
Will related solution ideas become more interesting?
I propose to move parts of the mentioned concerns out of the way.
The software performs a source file pre-selection.
https://github.com/coccinelle/coccinelle/blob/7cf2c23e64066d5249a64a316cc5347831f7a63f/docs/manual/spatch_options.tex#L183
File indexes can become involved according to search tools like “GLIMPSE” and “GNU idutils”.
They can restrict the support for desired queries on file contents.
I got the impression that SmPL constraint variants can be specified in ways which would fit also to such data format restrictions.
Higher level SmPL constraints can be more challenging to map to advanced queries.
How are the chances to improve the software situation here?
Regards,
Markus
Quoted 11 lines
Quoted 9 lines
Quoted 1 line
+ E = \(kmalloc@kok\|kzalloc@kok\|krealloc@kok\|kcalloc@kok\|kmalloc_node@kok\|kzalloc_node@kok\|kmalloc_array@kok\|kmalloc_array_node@kok\|kcalloc_node@kok\)(...)
I would prefer an other coding style here.
* Items for such SmPL disjunctions can be specified also on multiple lines.
* The semantic patch language supports further means to handle function name lists in more convenient ways.
Would you like to work with customised constraints?Please don't follow this advice.
I have got recurring understanding difficulties with such a response. Will quoted patch review issues clarified in any other ways?
Quoted 2 lines
Coccinelle is not able to optimize its search process according to the information in constraints. It will needlessly parse many files.
The software supports also SmPL constraints for some reasons. Why should such functionality be used at all if the immediate reminder is there seem to be more important optimisation aspects to consider before?
Regards,
Markus
Quoted 16 lines · Markus Elfring
Quoted 11 lines
Quoted 9 lines
Quoted 1 line
+ E = \(kmalloc@kok\|kzalloc@kok\|krealloc@kok\|kcalloc@kok\|kmalloc_node@kok\|kzalloc_node@kok\|kmalloc_array@kok\|kmalloc_array_node@kok\|kcalloc_node@kok\)(...)
I would prefer an other coding style here.
* Items for such SmPL disjunctions can be specified also on multiple lines.
* The semantic patch language supports further means to handle function name lists in more convenient ways.
Would you like to work with customised constraints?Please don't follow this advice.
I have got recurring understanding difficulties with such a response. Will quoted patch review issues clarified in any other ways?
Quoted 6 lines
Quoted 2 lines
Coccinelle is not able to optimize its search process according to the information in constraints. It will needlessly parse many files.
The software supports also SmPL constraints for some reasons. Why should such functionality be used at all if the immediate reminder is there seem to be more important optimisation aspects to consider before?
If the number of functions is really large, constraints may be a better idea.
If the names of the functions are not actually known, constraints may be a better idea.
If it is desired to collect some statistics about the matching process, constraints allow that.
If it is desired to reason about values, for example that a constant is greater or less than some value, then constraints allow that.
If it is desired to avoid changing code in a particular function, then constraints allow that.
So there are a lot of reasons why constraints are useful. There are likely even more. But hiding information that could be apparent to the SmPL compiler and could be used to improve the performance of the matching process is not one of them.
julia
Quoted 1 line
So there are a lot of reasons why constraints are useful.
Thanks for such a view.
Thus I dare to point the possibility out to consider their application for mentioned function name lists (besides using SmPL disjunctions). Can coding style concerns be resolved in a more constructive way then?
Quoted 3 lines
But hiding information that could be apparent to the SmPL compiler and could be used to improve the performance of the matching process is not one of them.
Will any software extensions become possible also in this area?
Regards,
Markus
Re: Coccinelle: Improving software components around usage of SmPL disjunctions
Quoted 5 lines
Quoted 3 lines
But hiding information that could be apparent to the SmPL compiler and could be used to improve the performance of the matching process is not one of them.
Will any software extensions become possible also in this area?
You pointed out that SmPL disjunctions can trigger specific consequences according to functionality which is different from SmPL constraints. Both application areas support data processing for function name lists to some degree.
Each element of a SmPL disjunction refers to a fragment of a detailed source code search pattern. We are discussing use cases where a search pattern is occasionally restricted in the way that only identifiers should be found at a specific place.
* Does this detail provide the opportunity to improve the corresponding software any more?
* Can a feature request like “Working with variables for case match identification by SmPL disjunctions” become more interesting?
https://github.com/coccinelle/coccinelle/issues/159
Regards,
Markus