qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/2] qobject: Update coccinelle s


From: Eric Blake
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/2] qobject: Update coccinelle script to catch Q{INC, DEC}REF
Date: Fri, 9 Jun 2017 10:40:12 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

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: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]