Skip to content

Commit 8d0f41e

Browse files
m-browstewartsmith
authored andcommitted
gcov: Add gcov data struct to sysfs
Extracting the skiboot gcov data is currently a tedious process which involves taking a mem dump of skiboot and searching for the gcov_info struct. This patch adds the gcov struct to sysfs under /opal/exports. Allowing the data to be copied directly into userspace and processed. Signed-off-by: Matt Brown <[email protected]> [stewart: refactor to dump out whole skiboot area, as gcov data is all over] Signed-off-by: Stewart Smith <[email protected]>
1 parent 84186ef commit 8d0f41e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

core/gcov-profiling.c

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ void skiboot_gcov_done(void)
8989
printf("GCOV: gcov_info_list at 0x%p\n", gcov_info_list);
9090
}
9191

92-
9392
void __gcov_merge_add(gcov_type *counters, unsigned int n_counters)
9493
{
9594
(void)counters;

core/opal.c

+4
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ static void add_opal_firmware_exports_node(struct dt_node *node)
347347
dt_add_property_u64s(exports, "symbol_map", sym_start, sym_size);
348348
dt_add_property_u64s(exports, "hdat_map", SPIRA_HEAP_BASE,
349349
SPIRA_HEAP_SIZE);
350+
#ifdef SKIBOOT_GCOV
351+
dt_add_property_u64s(exports, "gcov", SKIBOOT_BASE,
352+
HEAP_BASE - SKIBOOT_BASE);
353+
#endif
350354
}
351355

352356
static void add_opal_firmware_node(void)

0 commit comments

Comments
 (0)