Due to our projects is really huge and combined all targets into single compilation + analysis + publish will take much time to finished. So I'd like to running the klocwork analysis in parallel.

Here what I've got right now (split the targets in various sub tasks):

kw-analysis -> kw-analysis-sub-1
   |        -> kw-analysis-sub-2
   |        -> ...
   |        -> kw-analysis-sub-n
   |            |
   |            + the sub-task will handle:
   |                1. compile single target and generate spec: kwinject_<target_name>.out :
   |                   $ export KWWRAP_HOOKS_DIR='/temp/kw/hooks'
   |                   $ export PATH=${KWWRAP_HOOKS_DIR}:$PATH
   |                   $ make <target_name>
   |                   $ kwinject --trace-in "/temp/kw/kwwrap.trace" --output "kwinject_<target_name>.out"
   |                2. trace and anslysis for each target:
   |                   $ kwbuildproject --url "<https://url:port>/<project_name>" [-I] --table-directory kwtable_<target_name> kwinject_<target_name>.out
   |                3. archive kwtable_<target_name> folder
   |
   + leading job will do:
       1. copy all kwtable_<target_name> from sub-analysis jobs (downstream jobs) 
       2. deploy and publish the result into klocwork sever once for all 
          <<<<<< this is the key point of parallel analysis

As I know to publish single kwtable can be:

$ kwadmin --url <https://url:port> load --name <build_name> <project_name> kwtable_<target_name>

However, seems kwadmin neither support multiple kwtabels via:

kwadmin load --name <build_name> ... kwtable_<target_name_1> kwtable_<target_name_2> ...

nor support add additional result in exists build via

$ kwadmin load --name <build_name> ... kwtable_<target_name_1> 
            |                                                          
            + create build first

$ kwadmin "append" --name <build_name> ... kwtable_<target_name_2>
            *
            + append new result in <build_name> for anothers kwtables folder

So, is there any way I can run klocwork analysis in parallel. Btw I'm using the Jenkins as integration tool

1

There are 1 best solutions below

0
On

Running the parallel analysis by breaking the project into multiple pieces may take more time than building it as a single project with Klocwork sometimes. the reason behind this is, Klocwork is going to analyze all the dependent files multiple times as you perform multiple builds/analyses which are actually a part of a single project. (Parallel analysis can be a benefit when you do not have dependencies on different modules/files/pieces that you are building in parallel).

Klocwork can perform incremental/delta analysis when you pass --incremental argument as part kwbuildproject command. This should save the build time.