Re: [XEN PATCH] automation/eclair: reorganize pipelines

2024-04-26 Thread Luca Fancellu



> On 25 Apr 2024, at 14:32, Nicola Vetrini  wrote:
> 
> On 2024-04-25 11:40, Federico Serafini wrote:
>> On 25/04/24 02:06, Stefano Stabellini wrote:
>>> On Tue, 23 Apr 2024, Federico Serafini wrote:
 From: Simone Ballarin 
 Introduce accepted_guidelines.sh: a script to autogenerate the
 configuration file accepted.ecl from docs/misra/rules.rst which enables
 all accepted guidelines.
 Introduce monitored.ecl: a manual selection of accepted guidelines
 which are clean or almost clean, it is intended to be used for the
 analyses triggered by commits.
 Reorganize tagging.ecl:
   -Remove "accepted" tags: keeping track of accepted guidelines tagging
them as "accepted" in the configuration file tagging.ecl is no
longer needed since docs/rules.rst is keeping track of them.
   -Tag more guidelines as clean.
 Reorganize eclair pipelines:
   - Set1, Set2, Set3 are now obsolete: remove the corresponding
 pipelines and ecl files.
   - Amend scheduled eclair pipeline to use accepted.ecl.
   - Amend triggered eclair pipeline to use monitored.ecl.
 Rename and improve action_check_clean_regressions.sh to print a
 diagnostic in case a commit introduces a violation of a clean guideline.
 An example of diagnostic is the following:
 Failure: 13 regressions found for clean guidelines
   service MC3R1.R8.2: (required) Function types shall be in prototype form 
 with named parameters:
violation: 13
 Signed-off-by: Simone Ballarin 
 Signed-off-by: Federico Serafini 
 Signed-off-by: Alessandro Zucchelli 
>>> Fantastic work, thank you!
>>> Reviewed-by: Stefano Stabellini 
>>> Is this patch safe to commit now? Or would it cause gitlab-ci breakage?
>> Yes, it is safe because the ECLAIR analysis is still allowed to fail.
>> Committing this patch wouldn't break the CI but it will highlight some 
>> regressions with the orange badge and the following messages:
>> arm:
>> Failure: 5 regressions found for clean guidelines
>>  service MC3R1.R1.1: (required) The program shall contain no violations of 
>> the standard C syntax and constraints, and shall not exceed the 
>> implementation's translation limits:
>>   violation: 5
> 

Hi Nicola,

> +Cc ARM maintainers, Luca Fancellu
> 
> after some investigation on these regressions on R1.1, there are some 
> concerns with the current code:
> 2209c1e35b479dff8ed3d3161001ffdefa0a704e introduced the struct
> 
> struct membanks {
>unsigned int nr_banks;
>unsigned int max_banks;
>struct membank bank[];
> };
> 
> with a flexible array member at the end; this is well-defined in C99, but 
> what is non-standard (a GNU extension) is having this struct as a member to 
> another struct/union in a position other than the last.
> 
> This is still supported by GNU (albeit reliance on this is undocumented for 
> Xen), but what is concerning here is the following (taken from [1]):
> 
> "A structure containing a C99 flexible array member, or a union containing 
> such a structure, is not the last field of another structure, for example:
> 
> struct flex  { int length; char data[]; };
> 
> struct mid_flex { int m; struct flex flex_data; int n; };
> 
> In the above, accessing a member of the array mid_flex.flex_data.data[] might 
> have undefined behavior. Compilers do not handle such a case consistently. 
> Any code relying on this case should be modified to ensure that flexible 
> array members only end up at the ends of structures.
> Please use the warning option -Wflex-array-member-not-at-end to identify all 
> such cases in the source code and modify them. This extension is now 
> deprecated."
> 
> It looks like this option, and the corresponding deprecation of the 
> extension, will be available starting from GCC 14, so this might impact 
> future compiler updates for Xen builds.
> 
> Linux is also concerned about this (see [2]), so I think the changes in 
> struct layout introduced by the series [3] should be reviewed to determine 
> whether this change was deliberate or happened as a byproduct. If this is 
> determined not to be a legitimate concern, then this can be documented as an 
> use of the GNU extension.

Thanks for letting us know, so the change was deliberate, the effect probably 
not, I guess we need to find a way to fix this in order to use this interface.

Cheers,
Luca





Re: [XEN PATCH] automation/eclair: reorganize pipelines

2024-04-25 Thread Stefano Stabellini
On Thu, 25 Apr 2024, Federico Serafini wrote:
> On 25/04/24 02:06, Stefano Stabellini wrote:
> > On Tue, 23 Apr 2024, Federico Serafini wrote:
> > > From: Simone Ballarin 
> > > 
> > > Introduce accepted_guidelines.sh: a script to autogenerate the
> > > configuration file accepted.ecl from docs/misra/rules.rst which enables
> > > all accepted guidelines.
> > > 
> > > Introduce monitored.ecl: a manual selection of accepted guidelines
> > > which are clean or almost clean, it is intended to be used for the
> > > analyses triggered by commits.
> > > 
> > > Reorganize tagging.ecl:
> > >-Remove "accepted" tags: keeping track of accepted guidelines tagging
> > > them as "accepted" in the configuration file tagging.ecl is no
> > > longer needed since docs/rules.rst is keeping track of them.
> > >-Tag more guidelines as clean.
> > > 
> > > Reorganize eclair pipelines:
> > >- Set1, Set2, Set3 are now obsolete: remove the corresponding
> > >  pipelines and ecl files.
> > >- Amend scheduled eclair pipeline to use accepted.ecl.
> > >- Amend triggered eclair pipeline to use monitored.ecl.
> > > 
> > > Rename and improve action_check_clean_regressions.sh to print a
> > > diagnostic in case a commit introduces a violation of a clean guideline.
> > > 
> > > An example of diagnostic is the following:
> > > 
> > > Failure: 13 regressions found for clean guidelines
> > >service MC3R1.R8.2: (required) Function types shall be in prototype
> > > form with named parameters:
> > > violation: 13
> > > 
> > > Signed-off-by: Simone Ballarin 
> > > Signed-off-by: Federico Serafini 
> > > Signed-off-by: Alessandro Zucchelli 
> > 
> > Fantastic work, thank you!
> > 
> > Reviewed-by: Stefano Stabellini 
> > 
> > Is this patch safe to commit now? Or would it cause gitlab-ci breakage?
> 
> Yes, it is safe because the ECLAIR analysis is still allowed to fail.
> Committing this patch wouldn't break the CI but it will highlight some
> regressions with the orange badge and the following messages:

OK thanks, I'll commit it


> arm:
> 
> Failure: 5 regressions found for clean guidelines
>   service MC3R1.R1.1: (required) The program shall contain no violations of
> the standard C syntax and constraints, and shall not exceed the
> implementation's translation limits:
>violation: 5
> 
> x86:
> 
> Failure: 2 regressions found for clean guidelines
>   service MC3R1.R8.2: (required) Function types shall be in prototype form
> with named parameters:
>violation: 2
> 
> (George just sent a patch to address the regressions of Rule 8.2.)

As soon as we solve these two issues, I think we should remove the
allow_failure: true from the two ECLAIR jobs scanning clean
guidelines. More on this below.


> > 
> > One question below.
> > 
> > 
> > > -
> > >   
> > >   # Clean guidelines #
> > >   
> > > -doc_begin="Clean guidelines: new violations for these guidelines are
> > > not accepted."
> > > 
> > > --service_selector={clean_guidelines_common,"MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R2.2||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R5.6||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R8.1||MC3R1.R8.2||MC3R1.R8.5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R9.2||MC3R1.R9.4||MC3R1.R9.5||MC3R1.R12.5||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6"
> > > +-service_selector={clean_guidelines_common,"MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R11.7||MC3R1.R11.9||MC3R1.R12.5||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R14.1||MC3R1.R16.7||MC3R1.R17.1||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.5||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R20.4||MC3R1.R20.9||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R2.2||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6||MC3R1.R2.6||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R5.6||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R7.4||MC3R1.R8.1||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R8.2||MC3R1.R8.5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R9.2||MC3R1.R9.3||MC3R1.R9.4||MC3R1.R9.5"
> > >   }
> > 
> > Is this list different from monitored.ecl? If so, why? If not, maybe we
> > don't need to repeat the list here as well?
> 
> Quick answer: this list is different from monitored.ecl and the two
> lists must coexist.
> 
> Here, we are "tagging" some guidelines as "clean":
> this list is crucial and will be (manually) updated every time a new
> guideline reaches 0 violations, it shall not be removed because this tag
> allows ECLAIR to print a diagnostic and fail in case unjustified
> violations are found for the tagged guidelines.
> 
> The monitored.ecl is the list of guidelines which are analyzed at each
> commit: the list shall include all the 

Re: [XEN PATCH] automation/eclair: reorganize pipelines

2024-04-25 Thread Nicola Vetrini

On 2024-04-25 11:40, Federico Serafini wrote:

On 25/04/24 02:06, Stefano Stabellini wrote:

On Tue, 23 Apr 2024, Federico Serafini wrote:

From: Simone Ballarin 

Introduce accepted_guidelines.sh: a script to autogenerate the
configuration file accepted.ecl from docs/misra/rules.rst which 
enables

all accepted guidelines.

Introduce monitored.ecl: a manual selection of accepted guidelines
which are clean or almost clean, it is intended to be used for the
analyses triggered by commits.

Reorganize tagging.ecl:
   -Remove "accepted" tags: keeping track of accepted guidelines 
tagging

them as "accepted" in the configuration file tagging.ecl is no
longer needed since docs/rules.rst is keeping track of them.
   -Tag more guidelines as clean.

Reorganize eclair pipelines:
   - Set1, Set2, Set3 are now obsolete: remove the corresponding
 pipelines and ecl files.
   - Amend scheduled eclair pipeline to use accepted.ecl.
   - Amend triggered eclair pipeline to use monitored.ecl.

Rename and improve action_check_clean_regressions.sh to print a
diagnostic in case a commit introduces a violation of a clean 
guideline.


An example of diagnostic is the following:

Failure: 13 regressions found for clean guidelines
   service MC3R1.R8.2: (required) Function types shall be in 
prototype form with named parameters:

violation: 13

Signed-off-by: Simone Ballarin 
Signed-off-by: Federico Serafini 
Signed-off-by: Alessandro Zucchelli 



Fantastic work, thank you!

Reviewed-by: Stefano Stabellini 

Is this patch safe to commit now? Or would it cause gitlab-ci 
breakage?


Yes, it is safe because the ECLAIR analysis is still allowed to fail.
Committing this patch wouldn't break the CI but it will highlight some 
regressions with the orange badge and the following messages:


arm:

Failure: 5 regressions found for clean guidelines
  service MC3R1.R1.1: (required) The program shall contain no 
violations of the standard C syntax and constraints, and shall not 
exceed the implementation's translation limits:

   violation: 5



+Cc ARM maintainers, Luca Fancellu

after some investigation on these regressions on R1.1, there are some 
concerns with the current code:

2209c1e35b479dff8ed3d3161001ffdefa0a704e introduced the struct

struct membanks {
unsigned int nr_banks;
unsigned int max_banks;
struct membank bank[];
};

with a flexible array member at the end; this is well-defined in C99, 
but what is non-standard (a GNU extension) is having this struct as a 
member to another struct/union in a position other than the last.


This is still supported by GNU (albeit reliance on this is undocumented 
for Xen), but what is concerning here is the following (taken from [1]):


"A structure containing a C99 flexible array member, or a union 
containing such a structure, is not the last field of another structure, 
for example:


struct flex  { int length; char data[]; };

struct mid_flex { int m; struct flex flex_data; int n; };

In the above, accessing a member of the array mid_flex.flex_data.data[] 
might have undefined behavior. Compilers do not handle such a case 
consistently. Any code relying on this case should be modified to ensure 
that flexible array members only end up at the ends of structures.
Please use the warning option -Wflex-array-member-not-at-end to identify 
all such cases in the source code and modify them. This extension is now 
deprecated."


It looks like this option, and the corresponding deprecation of the 
extension, will be available starting from GCC 14, so this might impact 
future compiler updates for Xen builds.


Linux is also concerned about this (see [2]), so I think the changes in 
struct layout introduced by the series [3] should be reviewed to 
determine whether this change was deliberate or happened as a byproduct. 
If this is determined not to be a legitimate concern, then this can be 
documented as an use of the GNU extension.


See [4] for the findings.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://lkml.org/lkml/2024/4/11/1293
[3] 
https://lore.kernel.org/xen-devel/20240418073652.3622828-1-luca.fance...@arm.com/
[4] 
https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/xen/ECLAIR_normal/staging/ARM64/6713015426/PROJECT.ecd;/by_service/MC3R1.R1.1.html


Thanks,
  Nicola


x86:

Failure: 2 regressions found for clean guidelines
  service MC3R1.R8.2: (required) Function types shall be in prototype 
form with named parameters:

   violation: 2

(George just sent a patch to address the regressions of Rule 8.2.)



--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)



Re: [XEN PATCH] automation/eclair: reorganize pipelines

2024-04-25 Thread Federico Serafini

On 25/04/24 02:06, Stefano Stabellini wrote:

On Tue, 23 Apr 2024, Federico Serafini wrote:

From: Simone Ballarin 

Introduce accepted_guidelines.sh: a script to autogenerate the
configuration file accepted.ecl from docs/misra/rules.rst which enables
all accepted guidelines.

Introduce monitored.ecl: a manual selection of accepted guidelines
which are clean or almost clean, it is intended to be used for the
analyses triggered by commits.

Reorganize tagging.ecl:
   -Remove "accepted" tags: keeping track of accepted guidelines tagging
them as "accepted" in the configuration file tagging.ecl is no
longer needed since docs/rules.rst is keeping track of them.
   -Tag more guidelines as clean.

Reorganize eclair pipelines:
   - Set1, Set2, Set3 are now obsolete: remove the corresponding
 pipelines and ecl files.
   - Amend scheduled eclair pipeline to use accepted.ecl.
   - Amend triggered eclair pipeline to use monitored.ecl.

Rename and improve action_check_clean_regressions.sh to print a
diagnostic in case a commit introduces a violation of a clean guideline.

An example of diagnostic is the following:

Failure: 13 regressions found for clean guidelines
   service MC3R1.R8.2: (required) Function types shall be in prototype form 
with named parameters:
violation: 13

Signed-off-by: Simone Ballarin 
Signed-off-by: Federico Serafini 
Signed-off-by: Alessandro Zucchelli 


Fantastic work, thank you!

Reviewed-by: Stefano Stabellini 

Is this patch safe to commit now? Or would it cause gitlab-ci breakage?


Yes, it is safe because the ECLAIR analysis is still allowed to fail.
Committing this patch wouldn't break the CI but it will highlight some 
regressions with the orange badge and the following messages:


arm:

Failure: 5 regressions found for clean guidelines
  service MC3R1.R1.1: (required) The program shall contain no 
violations of the standard C syntax and constraints, and shall not 
exceed the implementation's translation limits:

   violation: 5

x86:

Failure: 2 regressions found for clean guidelines
  service MC3R1.R8.2: (required) Function types shall be in prototype 
form with named parameters:

   violation: 2

(George just sent a patch to address the regressions of Rule 8.2.)



One question below.



-
  
  # Clean guidelines #
  
  
  -doc_begin="Clean guidelines: new violations for these guidelines are not accepted."
  
--service_selector={clean_guidelines_common,"MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R2.2||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R5.6||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R8.1||MC3R1.R8.2||MC3R1.R8.5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R9.2||MC3R1.R9.4||MC3R1.R9.5||MC3R1.R12.5||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6"

+-service_selector={clean_guidelines_common,"MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R11.7||MC3R1.R11.9||MC3R1.R12.5||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R14.1||MC3R1.R16.7||MC3R1.R17.1||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.5||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R20.4||MC3R1.R20.9||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R2.2||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6||MC3R1.R2.6||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R5.6||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R7.4||MC3R1.R8.1||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R8.2||MC3R1.R8.5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R9.2||MC3R1.R9.3||MC3R1.R9.4||MC3R1.R9.5"
  }


Is this list different from monitored.ecl? If so, why? If not, maybe we
don't need to repeat the list here as well?


Quick answer: this list is different from monitored.ecl and the two
lists must coexist.

Here, we are "tagging" some guidelines as "clean":
this list is crucial and will be (manually) updated every time a new
guideline reaches 0 violations, it shall not be removed because this tag
allows ECLAIR to print a diagnostic and fail in case unjustified
violations are found for the tagged guidelines.

The monitored.ecl is the list of guidelines which are analyzed at each
commit: the list shall include all the guidelines tagged as "clean"
(to do the proper regressions checks) but the monitored list can also
include some accepted guidelines for which it may be interesting to see
the number of violations at each commit, for example, we put there some
almost-clean guidelines (guidelines with few violations left but not yet
tagged as clean yet).
Introducing new violations of monitored but not-clean guidelines will
not cause a failure.

--
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)



Re: [XEN PATCH] automation/eclair: reorganize pipelines

2024-04-24 Thread Stefano Stabellini
On Tue, 23 Apr 2024, Federico Serafini wrote:
> From: Simone Ballarin 
> 
> Introduce accepted_guidelines.sh: a script to autogenerate the
> configuration file accepted.ecl from docs/misra/rules.rst which enables
> all accepted guidelines.
> 
> Introduce monitored.ecl: a manual selection of accepted guidelines
> which are clean or almost clean, it is intended to be used for the
> analyses triggered by commits.
> 
> Reorganize tagging.ecl:
>   -Remove "accepted" tags: keeping track of accepted guidelines tagging
>them as "accepted" in the configuration file tagging.ecl is no
>longer needed since docs/rules.rst is keeping track of them.
>   -Tag more guidelines as clean.
> 
> Reorganize eclair pipelines:
>   - Set1, Set2, Set3 are now obsolete: remove the corresponding
> pipelines and ecl files.
>   - Amend scheduled eclair pipeline to use accepted.ecl.
>   - Amend triggered eclair pipeline to use monitored.ecl.
> 
> Rename and improve action_check_clean_regressions.sh to print a
> diagnostic in case a commit introduces a violation of a clean guideline.
> 
> An example of diagnostic is the following:
> 
> Failure: 13 regressions found for clean guidelines
>   service MC3R1.R8.2: (required) Function types shall be in prototype form 
> with named parameters:
>violation: 13
> 
> Signed-off-by: Simone Ballarin 
> Signed-off-by: Federico Serafini 
> Signed-off-by: Alessandro Zucchelli 

Fantastic work, thank you!

Reviewed-by: Stefano Stabellini 

Is this patch safe to commit now? Or would it cause gitlab-ci breakage?

One question below.


> ---
>  automation/eclair_analysis/ECLAIR/Set2.ecl| 25 ---
>  automation/eclair_analysis/ECLAIR/Set3.ecl| 67 ---
>  .../ECLAIR/accepted_guidelines.sh | 13 
>  .../eclair_analysis/ECLAIR/action.helpers |  3 +-
>  .../eclair_analysis/ECLAIR/action.settings|  1 +
>  .../ECLAIR/action_check_clean_regressions.sh  | 38 +++
>  .../ECLAIR/action_clean_added.sh  | 36 --
>  automation/eclair_analysis/ECLAIR/analyze.sh  |  2 +-
>  .../eclair_analysis/ECLAIR/generate_ecl.sh|  4 ++
>  .../ECLAIR/{Set1.ecl => monitored.ecl}| 57 +++-
>  automation/eclair_analysis/ECLAIR/tagging.ecl | 15 +
>  automation/gitlab-ci/analyze.yaml | 48 ++---
>  automation/scripts/eclair |  8 +--
>  13 files changed, 108 insertions(+), 209 deletions(-)
>  delete mode 100644 automation/eclair_analysis/ECLAIR/Set2.ecl
>  delete mode 100644 automation/eclair_analysis/ECLAIR/Set3.ecl
>  create mode 100755 automation/eclair_analysis/ECLAIR/accepted_guidelines.sh
>  create mode 100755 
> automation/eclair_analysis/ECLAIR/action_check_clean_regressions.sh
>  delete mode 100755 automation/eclair_analysis/ECLAIR/action_clean_added.sh
>  rename automation/eclair_analysis/ECLAIR/{Set1.ecl => monitored.ecl} (67%)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/Set2.ecl 
> b/automation/eclair_analysis/ECLAIR/Set2.ecl
> deleted file mode 100644
> index 7608335cf4..00
> --- a/automation/eclair_analysis/ECLAIR/Set2.ecl
> +++ /dev/null
> @@ -1,25 +0,0 @@
> --doc_begin="Set 2 of Xen MISRA C guidelines"
> --enable=MC3R1.R10.1
> --enable=MC3R1.R10.2
> --enable=MC3R1.R10.3
> --enable=MC3R1.R10.4
> --enable=MC3R1.R10.6
> --enable=MC3R1.R10.7
> --enable=MC3R1.R10.8
> --enable=MC3R1.R11.1
> --enable=MC3R1.R11.2
> --enable=MC3R1.R11.3
> --enable=MC3R1.R11.6
> --enable=MC3R1.R11.7
> --enable=MC3R1.R11.8
> --enable=MC3R1.R11.9
> --enable=MC3R1.R12.2
> --enable=MC3R1.R13.1
> --enable=MC3R1.R13.2
> --enable=MC3R1.R13.5
> --enable=MC3R1.R13.6
> --enable=MC3R1.R14.1
> --enable=MC3R1.R14.2
> --enable=MC3R1.R14.3
> --enable=MC3R1.R14.4
> --doc_end
> diff --git a/automation/eclair_analysis/ECLAIR/Set3.ecl 
> b/automation/eclair_analysis/ECLAIR/Set3.ecl
> deleted file mode 100644
> index d2c2c4b21f..00
> --- a/automation/eclair_analysis/ECLAIR/Set3.ecl
> +++ /dev/null
> @@ -1,67 +0,0 @@
> --doc_begin="Set 3 of Xen MISRA C guidelines"
> --enable=MC3R1.D4.12
> --enable=MC3R1.R5.5
> --enable=MC3R1.R5.7
> --enable=MC3R1.R5.8
> --enable=MC3R1.R15.2
> --enable=MC3R1.R15.3
> --enable=MC3R1.R15.6
> --enable=MC3R1.R15.7
> --enable=MC3R1.R16.1
> --enable=MC3R1.R16.2
> --enable=MC3R1.R16.3
> --enable=MC3R1.R16.4
> --enable=MC3R1.R16.5
> --enable=MC3R1.R16.6
> --enable=MC3R1.R16.7
> --enable=MC3R1.R17.1
> --enable=MC3R1.R17.2
> --enable=MC3R1.R17.5
> --enable=MC3R1.R17.7
> --enable=MC3R1.R18.1
> --enable=MC3R1.R18.2
> --enable=MC3R1.R18.3
> --enable=MC3R1.R18.6
> --enable=MC3R1.R18.7
> --enable=MC3R1.R18.8
> --enable=MC3R1.R20.2
> --enable=MC3R1.R20.3
> --enable=MC3R1.R20.4
> --enable=MC3R1.R20.6
> --enable=MC3R1.R20.7
> --enable=MC3R1.R20.8
> --enable=MC3R1.R20.9
> --enable=MC3R1.R20.11
> --enable=MC3R1.R20.12
> --enable=MC3R1.R20.13
> --enable=MC3R1.R20.14
> --enable=MC3R1.R21.1
> --enable=MC3R1.R21.2
> --enable=MC3R1.R21.3
> --enable=MC3R1.R21.4
> --enable=MC3R1.R21.5
> 

[XEN PATCH] automation/eclair: reorganize pipelines

2024-04-23 Thread Federico Serafini
From: Simone Ballarin 

Introduce accepted_guidelines.sh: a script to autogenerate the
configuration file accepted.ecl from docs/misra/rules.rst which enables
all accepted guidelines.

Introduce monitored.ecl: a manual selection of accepted guidelines
which are clean or almost clean, it is intended to be used for the
analyses triggered by commits.

Reorganize tagging.ecl:
  -Remove "accepted" tags: keeping track of accepted guidelines tagging
   them as "accepted" in the configuration file tagging.ecl is no
   longer needed since docs/rules.rst is keeping track of them.
  -Tag more guidelines as clean.

Reorganize eclair pipelines:
  - Set1, Set2, Set3 are now obsolete: remove the corresponding
pipelines and ecl files.
  - Amend scheduled eclair pipeline to use accepted.ecl.
  - Amend triggered eclair pipeline to use monitored.ecl.

Rename and improve action_check_clean_regressions.sh to print a
diagnostic in case a commit introduces a violation of a clean guideline.

An example of diagnostic is the following:

Failure: 13 regressions found for clean guidelines
  service MC3R1.R8.2: (required) Function types shall be in prototype form with 
named parameters:
   violation: 13

Signed-off-by: Simone Ballarin 
Signed-off-by: Federico Serafini 
Signed-off-by: Alessandro Zucchelli 
---
 automation/eclair_analysis/ECLAIR/Set2.ecl| 25 ---
 automation/eclair_analysis/ECLAIR/Set3.ecl| 67 ---
 .../ECLAIR/accepted_guidelines.sh | 13 
 .../eclair_analysis/ECLAIR/action.helpers |  3 +-
 .../eclair_analysis/ECLAIR/action.settings|  1 +
 .../ECLAIR/action_check_clean_regressions.sh  | 38 +++
 .../ECLAIR/action_clean_added.sh  | 36 --
 automation/eclair_analysis/ECLAIR/analyze.sh  |  2 +-
 .../eclair_analysis/ECLAIR/generate_ecl.sh|  4 ++
 .../ECLAIR/{Set1.ecl => monitored.ecl}| 57 +++-
 automation/eclair_analysis/ECLAIR/tagging.ecl | 15 +
 automation/gitlab-ci/analyze.yaml | 48 ++---
 automation/scripts/eclair |  8 +--
 13 files changed, 108 insertions(+), 209 deletions(-)
 delete mode 100644 automation/eclair_analysis/ECLAIR/Set2.ecl
 delete mode 100644 automation/eclair_analysis/ECLAIR/Set3.ecl
 create mode 100755 automation/eclair_analysis/ECLAIR/accepted_guidelines.sh
 create mode 100755 
automation/eclair_analysis/ECLAIR/action_check_clean_regressions.sh
 delete mode 100755 automation/eclair_analysis/ECLAIR/action_clean_added.sh
 rename automation/eclair_analysis/ECLAIR/{Set1.ecl => monitored.ecl} (67%)

diff --git a/automation/eclair_analysis/ECLAIR/Set2.ecl 
b/automation/eclair_analysis/ECLAIR/Set2.ecl
deleted file mode 100644
index 7608335cf4..00
--- a/automation/eclair_analysis/ECLAIR/Set2.ecl
+++ /dev/null
@@ -1,25 +0,0 @@
--doc_begin="Set 2 of Xen MISRA C guidelines"
--enable=MC3R1.R10.1
--enable=MC3R1.R10.2
--enable=MC3R1.R10.3
--enable=MC3R1.R10.4
--enable=MC3R1.R10.6
--enable=MC3R1.R10.7
--enable=MC3R1.R10.8
--enable=MC3R1.R11.1
--enable=MC3R1.R11.2
--enable=MC3R1.R11.3
--enable=MC3R1.R11.6
--enable=MC3R1.R11.7
--enable=MC3R1.R11.8
--enable=MC3R1.R11.9
--enable=MC3R1.R12.2
--enable=MC3R1.R13.1
--enable=MC3R1.R13.2
--enable=MC3R1.R13.5
--enable=MC3R1.R13.6
--enable=MC3R1.R14.1
--enable=MC3R1.R14.2
--enable=MC3R1.R14.3
--enable=MC3R1.R14.4
--doc_end
diff --git a/automation/eclair_analysis/ECLAIR/Set3.ecl 
b/automation/eclair_analysis/ECLAIR/Set3.ecl
deleted file mode 100644
index d2c2c4b21f..00
--- a/automation/eclair_analysis/ECLAIR/Set3.ecl
+++ /dev/null
@@ -1,67 +0,0 @@
--doc_begin="Set 3 of Xen MISRA C guidelines"
--enable=MC3R1.D4.12
--enable=MC3R1.R5.5
--enable=MC3R1.R5.7
--enable=MC3R1.R5.8
--enable=MC3R1.R15.2
--enable=MC3R1.R15.3
--enable=MC3R1.R15.6
--enable=MC3R1.R15.7
--enable=MC3R1.R16.1
--enable=MC3R1.R16.2
--enable=MC3R1.R16.3
--enable=MC3R1.R16.4
--enable=MC3R1.R16.5
--enable=MC3R1.R16.6
--enable=MC3R1.R16.7
--enable=MC3R1.R17.1
--enable=MC3R1.R17.2
--enable=MC3R1.R17.5
--enable=MC3R1.R17.7
--enable=MC3R1.R18.1
--enable=MC3R1.R18.2
--enable=MC3R1.R18.3
--enable=MC3R1.R18.6
--enable=MC3R1.R18.7
--enable=MC3R1.R18.8
--enable=MC3R1.R20.2
--enable=MC3R1.R20.3
--enable=MC3R1.R20.4
--enable=MC3R1.R20.6
--enable=MC3R1.R20.7
--enable=MC3R1.R20.8
--enable=MC3R1.R20.9
--enable=MC3R1.R20.11
--enable=MC3R1.R20.12
--enable=MC3R1.R20.13
--enable=MC3R1.R20.14
--enable=MC3R1.R21.1
--enable=MC3R1.R21.2
--enable=MC3R1.R21.3
--enable=MC3R1.R21.4
--enable=MC3R1.R21.5
--enable=MC3R1.R21.6
--enable=MC3R1.R21.7
--enable=MC3R1.R21.8
--enable=MC3R1.R21.9
--enable=MC3R1.R21.10
--enable=MC3R1.R21.12
--enable=MC3R1.R21.14
--enable=MC3R1.R21.15
--enable=MC3R1.R21.16
--enable=MC3R1.R22.1
--enable=MC3R1.R22.3
--enable=MC3R1.R22.7
--enable=MC3R1.R22.8
--enable=MC3R1.R22.9
--enable=MC3R1.R22.10
--enable=MC3R1.R2.6
--enable=MC3R1.R4.2
--doc_end
-
--doc_begin="Guidelines added with Xen MISRA C Task (a): Xen Coding Guidelines 
v1.1, June 1, 2023"