On Mon, Jun 23, 2025 at 04:04:23PM +0000, Miguel Luis wrote:
> >>>> 
> >>>> make clean && make CHECK="../smatch/smatch -p=kernel --info 
> >>>> --file-output" C=1 -j $(nproc) Image || make -j $(nproc) Image
> >>>> export WLOG="warns.txt"
> >>>> find -name *.c.smatch -exec cat {} \; -exec rm {} \; > $WLOG
> >>>> find -name *.c.smatch.sql -exec cat {} \; -exec rm {} \; > $WLOG.sql
> >>>> find -name *.c.smatch.caller_info -exec cat {} \; -exec rm {} \; > 
> >>>> $WLOG.caller_info
> >>>> 
> >>> 
> >>> 
> >>> s/>/>>
> >>> 
> >>> To append to file instead.
> >>> 
> >> 
> >> Those files are only used once...  Keeping the old data seems like it
> >> might cause a problem.
> 
> Now I get it, whether one removes $WLOG* or keep them and use ā€˜>’ will get 
> the same result.
> 

Huh...  I'm surprised by that, actually.  To be honest, I'm not sure I
understand what you're doing.  I assume you're either building part of
the kernel tree only to save time and then adding more files to it
later.  Or maybe you're updating Smatch an rebuilding the database based
on the new code.

If you're building new kernel modules, then this should work.  But if
you're rebuilding stuff then you'd want to delete the old information
from the DB before loading the new stuff.

> > 
> > I agree and based on that this is the script I’m using:
> 
> .. however, I still get the same number of $((`cat smatch_warns.txt | wc -l` 
> - `cat smatch_warns.txt | uniq | wc -l`)) duplicates.
> 

I'm totally confused what you're saying here, sorry.  :P  The SQL
is mostly pulled into smatch_warns.txt.sql and smatch_warns.txt.call_info.

regards,
dan carpenter


Reply via email to