From 8d0f41e021b3475a411371cf87b81ae4af763eca Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Thu, 4 May 2017 10:23:52 +1000 Subject: 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 [stewart: refactor to dump out whole skiboot area, as gcov data is all over] Signed-off-by: Stewart Smith --- core/gcov-profiling.c | 1 - core/opal.c | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/gcov-profiling.c b/core/gcov-profiling.c index 7070701..136f563 100644 --- a/core/gcov-profiling.c +++ b/core/gcov-profiling.c @@ -89,7 +89,6 @@ void skiboot_gcov_done(void) printf("GCOV: gcov_info_list at 0x%p\n", gcov_info_list); } - void __gcov_merge_add(gcov_type *counters, unsigned int n_counters) { (void)counters; diff --git a/core/opal.c b/core/opal.c index c530528..9bf2ad8 100644 --- a/core/opal.c +++ b/core/opal.c @@ -347,6 +347,10 @@ static void add_opal_firmware_exports_node(struct dt_node *node) dt_add_property_u64s(exports, "symbol_map", sym_start, sym_size); dt_add_property_u64s(exports, "hdat_map", SPIRA_HEAP_BASE, SPIRA_HEAP_SIZE); +#ifdef SKIBOOT_GCOV + dt_add_property_u64s(exports, "gcov", SKIBOOT_BASE, + HEAP_BASE - SKIBOOT_BASE); +#endif } static void add_opal_firmware_node(void) -- cgit v1.1