public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: smatch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: smatch v1.60 released
Date: Mon, 12 Jan 2015 14:45:15 +0300	[thread overview]
Message-ID: <20150112114515.GC7568@mwanda> (raw)

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

                 reply	other threads:[~2015-01-12 11:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150112114515.GC7568@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=smatch@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox