On 28/04/26 23:23, Jose E. Marchesi wrote:
External email: Use caution opening links or attachments


On 23/04/26 14:27, Jose E. Marchesi wrote:
External email: Use caution opening links or attachments

Hi all,

Per prior discussions, here is the specification we are proposing for
version 4 of the AutoFDO GCOV profile format. This is a complete re-design
focused around being a backwards-compatible and extensible format which
can be partially read by the compiler.
Could you please send me (off list) a sample data file, as complete
as
possible?  Thanks!

Hi Jose,

Just curious as to why you need an example? No problems with sharing it,
is there any particular part of the design you are interested in taking a
look at? Meaningful profiles are rather unwieldy due to their size.

I intend to review the proposed format by writing a GNU poke pickle for
it, as complete as possible, including constraints etc.  On one hand, it
is a good way to catch potential pitfalls in the designed encoding, data
integrity, etc.  On the other, you get an easy to update pickle for
free, to poke at data, dump to the textual representation, construct
test cases, and the like.

Having a sample binary will help.  It doesn't have to contain large sets
of data, but the more of the spec it exercises, the better.

For reference, you cand find a pickle for gcov streams at
https://cgit.git.savannah.gnu.org/cgit/poke.git/tree/pickles/gcov.pk

Hi Jose,

Apologies for the late reply. I've attached some files to this
mail that try to exhibit most of the features in the format:

- example.c: Simple testcase
- example.gcov: GCOV v3 profile
- example.gcov.v4: GCOV v4 profile
- example.gcov.v4.compact: GCOV v4 compact profile

The testcase was compiled with -O2 -g -fno-omit-frame-pointer.

--
Regards,
Dhruv
__attribute__ ((noinline, noipa)) static void foo_1 () {}
__attribute__ ((noinline, noipa)) static void foo_2 () {}

static void (*foos[]) () = { foo_1, foo_2 };

__attribute__ ((noinline, noipa)) static void bar_1 () { foo_1 (); foo_2 (); }
__attribute__ ((noinline, noipa)) static void bar_2 (int i) { foos[i & 1](); }

inline static void bar_3 (int i) { if (i & 1) foo_1 (); else foo_2 (); }

int
main ()
{
  for (int i = 0; i < 1000000; i++)
    {
      bar_1 ();
      bar_2 (i);
      bar_3 (i);
    }
}

Attachment: example.gcov
Description: Binary data

Attachment: example.gcov.v4
Description: Binary data

Attachment: example.gcov.v4.compact
Description: Binary data

Reply via email to