All of lore.kernel.org
 help / color / mirror / Atom feed
* smatch v1.60 released
@ 2015-01-12 11:45 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-01-12 11:45 UTC (permalink / raw)
  To: smatch; +Cc: linux-kernel

Intro:

Smatch is a C static checker with a lot of kernel specific checks.  You
can download it from:  http://repo.or.cz/w/smatch.git.

Notes:

It has been a year and a half since the last release so there have been
a lot of changes everywhere.  The main thing continues to be tracking
values across function calls.

One warning I'm particularly proud of resulted in this patch:
https://lkml.org/lkml/2015/1/6/1034
To make that work, then Smatch traced the data down three normal
calls and across a function pointer call and returned that one of the
function pointers didn't initialize *count.  Smatch is the only open
source project trying to do this level of cross function analysis.

The cross function database is so useful on it's own if you are trying
to understand a new subsystem.  Just build the database and then you
can run `smdb.py function_name` to see how it's called and which values
are passed.  Maybe it's called as a function pointer so using grep and
cscope doesn't work.  Or maybe you wanted to see where the family in
(struct net_proto_family)->family is set you could run
`smdb.py where net_proto_family family`.

Quickstart Guide:

The command to set up the database is:
~/path/to/smatch/smatch_scripts/build_kernel_data.sh
This command takes 2-3 hours to complete.  You can skip this step if you
want.

To run smatch on the kernel source:
~/path/to/smatch/smatch_scripts/test_kernel.sh
This creates a warns.txt file with the warnings.

To test a specific file:
~/path/to/smatch/smatch_scripts/kchecker drivers/file.c

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-12 11:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-12 11:45 smatch v1.60 released Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.