STRUCT GCOV_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so welcome to the struct gcov_info(9) page from the Kernel API Manual πŸ’– bestie, we are getting into the profiling-data-per-object-file of it all, and yes it's giving kernel internals but make it cute ✨

🌸 NAME 🌸

struct gcov_info β€” profiling data per object file, periodt πŸ’…

✨ SYNOPSIS ✨

no cap, here's the struct exactly as it is:

       struct gcov_info {
           unsigned int version;
           struct gcov_info *next;
           unsigned int stamp;
         #if (__GNUC__ >= 12);
           unsigned int checksum;
         #endif;
           const char *filename;
           void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int);
           unsigned int n_functions;
           struct gcov_fn_info **functions;
        };

πŸŽ€ Members πŸŽ€

  • version β€” the gcov version magic that says which gcc version was used for compilation πŸ”
  • next β€” the list head for a singly-linked list, walk walk walk πŸšΆβ€β™€οΈ
  • stamp β€” a time stamp whose whole job is uniquifying, and honestly iconic for that
  • checksum β€” a unique object checksum, tucked inside the #if (__GNUC__ >= 12); moment
  • filename β€” the name of the associated gcov data file πŸ—‚οΈ
  • merge β€” merge functions; it's null for an unused counter type, noted 🫢
  • n_functions β€” the number of instrumented functions, literally the count
  • functions β€” a pointer to pointers to function information, pointer-to-pointer realness 😭

🌈 Description 🌈

so the way that this works: this data is generated by gcc during compilation, and it doesn't change at run-time β€” with the one exception of the next pointer. that's the vibe, that's the rule, no extra lore πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹

go peek at the Kernel file ./kernel/gcov/gcc_4_7.c and also these absolute icons: struct gcov_ctr_info(9), struct gcov_fn_info(9), gcov_info_filename(9), gcov_info_version(9), gcov_info_next(9), gcov_info_link(9), gcov_info_unlink(9), gcov_info_within_module(9), gcov_info_reset(9), gcov_info_is_compatible(9), gcov_info_add(9), gcov_info_dup(9), gcov_info_free(9), convert_to_gcda(9) πŸ’–


πŸ’Œ cute little sign-off: this page comes from the ./kernel/gcov source/version situation, dated October 2026, and it is still proudly struct gcov_info(9) πŸŽ€ mwah πŸ’‹
πŸ“¦ where this page comes from