qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/2] qobject: Update coccinelle script to catch Q{INC, DEC}REF
Date: Fri, 9 Jun 2017 10:40:12 -0500	[thread overview]
Message-ID: <f502b8ea-a3b0-1c9c-0c55-5a8b9cdecda6@redhat.com> (raw)
In-Reply-To: <CAJ+F1CJL04MkrYmnhM3rLaSAuEXYo7JsZwyDLeXA35bV6dvqqA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1330 bytes --]

On 06/09/2017 10:28 AM, Marc-André Lureau wrote:

> sadly, coccinelle is unabarebly slow on my machine,

Odd.  It's pretty fast for this series:

$ time spatch --sp-file scripts/coccinelle/qobject.cocci \
  --macro-file scripts/cocci-macro-file.h --dir . --in-place 2>/dev/null

real	0m2.136s
user	0m2.003s
sys	0m0.125s

This is on Fedora 25.  Although I _will_ grant that the time taken is
also dependent on the complexity of the script it is running on (some
scripts are inherently slower than others, and coccinelle takes
shortcuts like grepping for which files to even fully analyze, but not
all scripts are conducive to those shortcuts).

> not easy to grasp, and
> thereby fails to catch a lot of cases..

I agree with the 'not easy to grasp'. As for not catching cases, you
HAVE to use the --macro-file scripts/cocci-macro-file.h to avoid a lot
of skipped files.  But even so, you're probably right that it still
misses some things (although it often catches far more than "grep in
anger" is able to do).

> I am looking at alternative from
> clang tools/lib, by curiosity.

I'll be interested to see if it produces any (easy-to-reproduce) cleanup
results.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  parent reply	other threads:[~2017-06-09 15:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09 15:20 [Qemu-devel] [PATCH 0/2] qobject coccinelle followups Eric Blake
2017-06-09 15:20 ` [Qemu-devel] [PATCH 1/2] qobject: Update coccinelle script to catch Q{INC, DEC}REF Eric Blake
2017-06-09 15:28   ` Marc-André Lureau
2017-06-09 15:31     ` Marc-André Lureau
2017-06-09 15:33     ` Eric Blake
2017-06-09 15:36       ` Marc-André Lureau
2017-06-09 15:40     ` Eric Blake [this message]
2017-06-09 15:20 ` [Qemu-devel] [PATCH 2/2] qobject: Catch another straggler for use of qdict_put_str() Eric Blake
2017-06-11 12:40   ` Max Reitz
2017-06-11 21:28   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2017-07-12 13:35 ` [Qemu-devel] [PATCH 0/2] qobject coccinelle followups Michael Tokarev
2017-07-12 13:56   ` Eric Blake
2017-07-12 15:48     ` Markus Armbruster

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=f502b8ea-a3b0-1c9c-0c55-5a8b9cdecda6@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.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;
as well as URLs for NNTP newsgroup(s).