From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 03/18] Include qapi/error.h exactly where needed
Date: Wed, 31 Jan 2018 08:58:43 +0100 [thread overview]
Message-ID: <877ery793g.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <8bb9095a-93f8-ba14-3296-5a2d03cbf5e4@redhat.com> (Eric Blake's message of "Tue, 30 Jan 2018 10:14:37 -0600")
Eric Blake <eblake@redhat.com> writes:
> On 01/30/2018 04:21 AM, Markus Armbruster wrote:
>> This cleanup makes the number of objects depending on qapi/error.h
>> drop from 1910 (out of 4739) to 1612 in my "build everything" tree.
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>> arch_init.c | 1 +
>> audio/wavcapture.c | 1 +
>> balloon.c | 1 +
>> block.c | 2 ++
>> block/block-backend.c | 1 +
>> block/iscsi.c | 1 +
>> block/qapi.c | 1 +
>
> So several .c files have to use it explicitly,
>
>> fsdev/qemu-fsdev-throttle.h | 1 -
>
>> include/crypto/random.h | 1 -
>> include/crypto/xts.h | 1 -
>> include/hw/ide/internal.h | 1 -
>> include/ui/console.h | 1 -
>
> because they were previously getting it from .h files that don't
> directly emit an error. Makes sense.
>
> Patches like this are easy to test - if it still compiles, you did it
> right ;) Out of curiousity, how are you counting how many files got
> compiled per run? Touch the .h, then pass 'make' output to 'grep -c "^
> CC "'?
The data is up for grabs: in the .d gcc spits out for make. I process
them like this, after fresh build:
$ find bld -name \*.d -exec cat {} + | clean-deps
where clean-deps is this AWK script:
#!/usr/bin/awk -f
/\\$/ {
l = $0
while (sub(/\\$/, "", l) && (getline t))
l = l t
$0 = l
}
NF > 1 {
delete a
for (i = 2; i <= NF; i++) {
n = $i
# ignore system headers and non-headers
if (match(n, /^\/usr/) || !match(n, /\.h$/))
continue
# strip leading ../ from target build running in sub-directory
sub(/^\.\.\//, "", n)
# normalize /../ and /./
while (sub(/[^\/]*\/\.\.\//, "", n)) ;
gsub(/\/\.\//, "/", n)
# absolute -> relative
sub(/\/home\/armbru\/work\//, "/work/armbru/", n)
sub(/\/work\/armbru\/qemu\/(bld\/)?/, "", n)
# ignore dupes
if (n in a)
continue
a[n] = i
h[n]++
}
}
END {
for (i in h)
print i, h[i]
}
My conversion from absolute to relative is specific to my personal
setup. It would have to be generalized before we can put this into
scripts.
> But just to make sure nothing weird is happening, I also read through
> it, and found:
>
>>
>> diff --git a/arch_init.c b/arch_init.c
>> index a0b8ed6167..0fb8093f92 100644
>> --- a/arch_init.c
>> +++ b/arch_init.c
>> @@ -21,6 +21,7 @@
>> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
>> * THE SOFTWARE.
>> */
>> +
>> #include "qemu/osdep.h"
>> #include "qemu-common.h"
>> #include "cpu.h"
>
> Spurious whitespace change. Should this belong in 1/18, even though
> arch_init.c didn't need cleanup there? Or...
>
>> +++ b/block.c
>> @@ -21,6 +21,7 @@
>> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
>> * THE SOFTWARE.
>> */
>> +
>> #include "qemu/osdep.h"
>> #include "block/trace.h"
>> #include "block/block_int.h"
>
> ...since you did it again, do you need a separate patch for ALL of these
> types of whitespace cleanups near osdep.h?
I routinely insert this blank line when I touch includes anyway.
>> +++ b/block/qcow2.c
>> @@ -21,6 +21,7 @@
>> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
>> * THE SOFTWARE.
>> */
>> +
>> #include "qemu/osdep.h"
>> #include "block/block_int.h"
>> #include "sysemu/block-backend.h"
>
> and again
>
>> +++ b/chardev/char-ringbuf.c
>> @@ -21,9 +21,11 @@
>> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
>> * THE SOFTWARE.
>> */
>> +
>> #include "qemu/osdep.h"
>> #include "chardev/char.h"
>> #include "qmp-commands.h"
>> +#include "qapi/error.h"
>> #include "qemu/base64.h"
>>
>> /* Ring buffer chardev */
>
> Here, it's in the same hunk, so a bit more forgivable. But there's
> definitely enough of them that a separate commit might be in order.
>
> At any rate, whether done as one patch (with a better commit message) or
> as two, I see nothing semantically wrong with the cleanups done here, so
I'll amend the commit message.
> Reviewed-by: Eric Blake <eblake@redhat.com>
Thanks!
next prev parent reply other threads:[~2018-01-31 7:58 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 10:21 [Qemu-devel] [PATCH 00/18] Clean up includes to reduce compile time Markus Armbruster
2018-01-30 10:21 ` [Qemu-devel] [PATCH 01/18] Clean up includes Markus Armbruster
2018-01-30 13:22 ` BALATON Zoltan
2018-01-31 7:48 ` Markus Armbruster
2018-01-30 15:23 ` Eric Blake
2018-01-30 10:21 ` [Qemu-devel] [PATCH 02/18] Drop superfluous includes of qapi-types.h Markus Armbruster
2018-01-30 15:46 ` Eric Blake
2018-01-31 7:49 ` Markus Armbruster
2018-01-30 10:21 ` [Qemu-devel] [PATCH 03/18] Include qapi/error.h exactly where needed Markus Armbruster
2018-01-30 16:14 ` Eric Blake
2018-01-31 7:58 ` Markus Armbruster [this message]
2018-01-30 10:21 ` [Qemu-devel] [PATCH 04/18] Drop superfluous includes of qapi/qmp/qerror.h Markus Armbruster
2018-01-30 16:20 ` Eric Blake
2018-01-30 10:21 ` [Qemu-devel] [PATCH 05/18] Include qmp-commands.h exactly where needed Markus Armbruster
2018-01-30 16:43 ` Eric Blake
2018-01-30 10:21 ` [Qemu-devel] [PATCH 06/18] Typedef the subtypes of QObject in qemu/typedefs.h, too Markus Armbruster
2018-01-30 16:50 ` Eric Blake
2018-01-30 10:21 ` [Qemu-devel] [PATCH 07/18] Eliminate qapi/qmp/types.h Markus Armbruster
2018-01-30 16:56 ` Eric Blake
2018-01-30 10:21 ` [Qemu-devel] [PATCH 08/18] qdict qlist: Make most helper macros functions Markus Armbruster
2018-01-30 17:02 ` Eric Blake
2018-01-31 8:11 ` Markus Armbruster
2018-01-30 10:21 ` [Qemu-devel] [PATCH 09/18] Include qapi/qmp/qobject.h exactly where needed Markus Armbruster
2018-01-30 17:03 ` Eric Blake
2018-01-30 10:21 ` [Qemu-devel] [PATCH 10/18] Include qapi/qmp/qlist.h " Markus Armbruster
2018-01-30 17:47 ` Eric Blake
2018-01-30 10:21 ` [Qemu-devel] [PATCH 11/18] Include qapi/qmp/qdict.h " Markus Armbruster
2018-01-30 17:51 ` Eric Blake
2018-01-30 10:21 ` [Qemu-devel] [PATCH 12/18] Include qapi/qmp/qstring.h " Markus Armbruster
2018-01-30 17:55 ` Eric Blake
2018-01-30 10:21 ` [Qemu-devel] [PATCH 13/18] Include qapi/qmp/qbool.h " Markus Armbruster
2018-01-30 17:57 ` Eric Blake
2018-01-30 10:21 ` [Qemu-devel] [PATCH 14/18] Include qapi/qmp/qnum.h " Markus Armbruster
2018-01-30 17:58 ` Eric Blake
2018-01-30 10:21 ` [Qemu-devel] [PATCH 15/18] Include qapi/qmp/qnull.h " Markus Armbruster
2018-01-30 17:59 ` Eric Blake
2018-01-30 10:22 ` [Qemu-devel] [PATCH 16/18] Drop superfluous includes of qapi/qmp/dispatch.h Markus Armbruster
2018-01-30 18:00 ` Eric Blake
2018-01-30 10:22 ` [Qemu-devel] [PATCH 17/18] Drop superfluous includes of qapi/qmp/qjson.h Markus Armbruster
2018-01-30 18:01 ` Eric Blake
2018-01-30 10:22 ` [Qemu-devel] [PATCH 18/18] Move include qemu/option.h from qemu-common.h to actual users Markus Armbruster
2018-01-30 18:08 ` Eric Blake
2018-01-31 8:14 ` Markus Armbruster
2018-01-30 13:39 ` [Qemu-devel] [PATCH 00/18] Clean up includes to reduce compile time no-reply
2018-01-30 18:36 ` Philippe Mathieu-Daudé
2018-01-31 8:31 ` Markus Armbruster
2018-01-31 0:12 ` no-reply
2018-01-31 7:10 ` Thomas Huth
2018-01-31 14:00 ` 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=877ery793g.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@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 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.