From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 2FB4C3858405 for ; Wed, 30 Mar 2022 11:56:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2FB4C3858405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EB85E218EF; Wed, 30 Mar 2022 11:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1648641378; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QTGztnLSHKuFLJreohrwHBZ5jHGUALv3pDh8bjpNjMI=; b=UjSTL7lV1ZTw22R7Vl45jumHZq0S81eevy0eNq1Sg8n1yYXkIj9AwBtza0Qyjo6SNIXjVW 1dhDdYMVz2vXv7eeY5+1bi8Mq96RFdgmVNCpd4iXMpIhjabFcRL/bv85pkQ8ALOW6Pt7Uw 8JlR2Ar85AWRFoGfZ9cX2s8WuexriqQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1648641378; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QTGztnLSHKuFLJreohrwHBZ5jHGUALv3pDh8bjpNjMI=; b=anGXRC1Yh/yfcYRDhXz4ezEwV66C2Kk6vgCqFdHOi4INM+a6bV4V+/o8kPoG18rXDlqfvr wF1ygX0uUOq+MGAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CCCFB13A60; Wed, 30 Mar 2022 11:56:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id pcrkMGJFRGKCJwAAMHmgww (envelope-from ); Wed, 30 Mar 2022 11:56:18 +0000 Message-ID: <4c890c8b-4665-41ab-c584-6f25aac01e04@suse.cz> Date: Wed, 30 Mar 2022 13:56:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] gcov-tool: Allow merging of empty profile lists Content-Language: en-US To: Sebastian Huber , gcc-patches@gcc.gnu.org References: <20220323093404.13225-1-sebastian.huber@embedded-brains.de> <0b4c9c67-0810-4521-2cca-522dbed52bb8@suse.cz> <76777016-d1d4-6e44-59f6-fbe3ff8249ac@embedded-brains.de> <930c7bec-aea5-9491-94cd-a4e8c86f9bfe@suse.cz> <262bfcbc-dfd7-722f-e06a-b7fb7dbbe977@embedded-brains.de> <9b3bc65d-be92-0a99-d5c3-c96b9fec881c@embedded-brains.de> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: <9b3bc65d-be92-0a99-d5c3-c96b9fec881c@embedded-brains.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2022 11:56:22 -0000 On 3/28/22 18:23, Sebastian Huber wrote: > On 24/03/2022 13:03, Martin Liška wrote: >> On 3/24/22 11:51, Sebastian Huber wrote: >>> Maybe we could add the file path into the gcov information stream using a new tag: >>> >>> #define GCOV_TAG_GCDA_FILE_NAME  ((gcov_unsigned_t)0xa5000000) >>> >>> Then the complete gcov information can be dumped using a single base64 encoded stream. We could add some support to the gcov-tool to read this stream and merge it into gcda files. >> >> I would support such patch! > > Ok, good. I work currently on a prototype implementation. My use case would be like this. > Great, the suggested scheme works for me. > Run a test executable which dumps all gcov info objects in a serial data stream. It could be encoded as base64. It could be also compressed. On the host you unpack the encoded data stream and feed it into gcov-tool using the new "merge-stream" subcommand: > > gcov-tool --help > Usage: gcov-tool [OPTION]... SUB_COMMAND [OPTION]... > > Offline tool to handle gcda counts > >   -h, --help                            Print this help, then exit >   -v, --version                         Print version number, then exit >   merge-stream [options] [stream-file]  Merge coverage stream file (or stdin) >                                         and coverage file contents >     -v, --verbose                       Verbose mode >     -w, --weight                 Set weights (float point values) > > Example: > > base64 -d log.txt | gcov-tool merge-stream > > The gcov-tool uses a new tag which contains the filename of the associated gcov info file: > > gcov-dump b-xilinx_zynq_a9_qemu/init.gcda > b-xilinx_zynq_a9_qemu/init.gcda:data:magic `gcda':version `B20 ' > b-xilinx_zynq_a9_qemu/init.gcda:stamp 3496756572 > b-xilinx_zynq_a9_qemu/init.gcda:checksum 137326246 > b-xilinx_zynq_a9_qemu/init.gcda:  a5000000:  62:FILENAME `/home/EB/sebastian_h/src/lwip/b-xilinx_zynq_a9_qemu/init.gcda' > b-xilinx_zynq_a9_qemu/init.gcda:  a1000000:   8:OBJECT_SUMMARY runs=0, sum_max=0 > b-xilinx_zynq_a9_qemu/init.gcda:  01000000:  12:FUNCTION ident=1016818396, lineno_checksum=0xd31791e7, cfg_checksum=0x4529789a > b-xilinx_zynq_a9_qemu/init.gcda:    01a10000: 232:COUNTERS arcs 29 counts > > Should I generate this filename tag to all configurations or just in case inhibit_libc is defined? I would emit it unconditionally. Btw. why do you need the tag? Cheers, Martin > > Advantage: > > * No dependency on the GCC configuration > > Disadvantages: > > * Bigger files > * Actual filename and the filename of the tag differ if file is moved > * Potential information leak > > In any case, I would add the support for the (optional) filename tag to all readers. >