Powered by Linux
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: about using smatch in all debian C code — Semantic Matching Tool

Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: about using smatch in all debian C code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's working !
Though the output does't change, but for each .c file, it create a .smatch file, which show me the warn and error.
Can you explain the WLOG command for me?
Other than that, for other similar C projects, do I need to go through the above steps as well?

regards,
Lishu Chang

"Dan Carpenter" <dan.carpenter@xxxxxxxxxx>写道:
> On Wed, Mar 13, 2024 at 02:29:13PM +0800, 李书畅 wrote:
> > As I tried :
> > CHECK="/home/lsc20011130/smatch/smatch --info --file-output",
> > for each .c file, the above three file are created , and there's a lot of information in these files, like:
> > 
> > nty_schedule.c:98 nty_schedule_sched_sleepdown() info: param_mapper 0 => _nty_coroutine_rbtree_sleep_RB_INSERT 1
> > nty_schedule.c:113 nty_schedule_desched_sleepdown() info: param_mapper 0 => _nty_coroutine_rbtree_sleep_RB_REMOVE 1
> > nty_schedule.c:144 nty_schedule_desched_wait() error: we previously assumed 'co' could be null (see line 141)
> > 
> > nty_coroutine.c:58 _save_stack() SQL_caller_info: insert into caller_info values (0x7feb7cc204ad2699, '_save_stack', '__assert_fail', %CALL_ID%, 0, 0, -1, '%call_marker%', 'void(*)(char*, char*, uint, char*)');
> > nty_coroutine.c:58 _save_stack() SQL_caller_info: insert into caller_info values (0x7feb7cc204ad2699, '_save_stack', '__assert_fail', %CALL_ID%, 0, 1001, 0, '$', '8349466724068225024');
> > nty_coroutine.c:58 _save_stack() SQL_caller_info: insert into caller_info values (0x7feb7cc204ad2699, '_save_stack', '__assert_fail', %CALL_ID%, 0, 1001, 1, '$', '5566788581620412416');
> > 
> > nty_coroutine.c:55 _save_stack() SQL: insert into function_type values(0x7feb7cc204ad2699, '_save_stack', 1, 0, 'struct _nty_coroutine*');
> > nty_coroutine.c:55 _save_stack() SQL: insert into parameter_name values(0x7feb7cc204ad2699, '_save_stack', 1, 0, 'co');
> > 
> 
> Excelent.  That's working then.
> 
> WLOG="smatch_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
> 
> Then you can do:
> smatch_data/db/create_db.sh -p=kernel smatch_warns.txt
> 
> That will build the db.
> 
> Then rerun, keeping the --file-output but without the --info.
> 
> regards,
> dan carpenter




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux