aboutsummaryrefslogtreecommitdiff
path: root/extract-gcov.c
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-05-25 18:30:35 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-05-25 18:33:18 +1000
commit35c65cf4e97c76fae58ba3f997f9667c10c3871d (patch)
tree852fbfc46b28a9116b5488d80c59ab3526898b25 /extract-gcov.c
parent23dcbc3adee2c6ea4e6c1149ef9fc6b59de581fa (diff)
downloadskiboot-35c65cf4e97c76fae58ba3f997f9667c10c3871d.zip
skiboot-35c65cf4e97c76fae58ba3f997f9667c10c3871d.tar.gz
skiboot-35c65cf4e97c76fae58ba3f997f9667c10c3871d.tar.bz2
make extract-gcov usable with math from skiboot.map
No longer need to parse the skiboot log to find out where data structures are. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'extract-gcov.c')
-rw-r--r--extract-gcov.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/extract-gcov.c b/extract-gcov.c
index dfbc961..f178166 100644
--- a/extract-gcov.c
+++ b/extract-gcov.c
@@ -127,7 +127,7 @@ static void write_gcda(char *addr, struct gcov_info* gi)
write_u32(fd, be32toh(gi->version));
write_u32(fd, be32toh(gi->stamp));
- printf("nfunctions: %d \n", be32toh(gi->n_functions));
+ //printf("nfunctions: %d \n", be32toh(gi->n_functions));
for(fn = 0; fn < be32toh(gi->n_functions); fn++) {
functions = (struct gcov_fn_info**)
@@ -151,13 +151,14 @@ static void write_gcda(char *addr, struct gcov_info* gi)
write_u32(fd, (GCOV_TAG_FOR_COUNTER(ctr)));
write_u32(fd, be32toh(ctr_info->num)*2);
- printf(" ctr %d gcov_ctr_info->num %u\n",
- ctr, be32toh(ctr_info->num));
+ /* printf(" ctr %d gcov_ctr_info->num %u\n",
+ * ctr, be32toh(ctr_info->num));
+ */
for(cv = 0; cv < be32toh(ctr_info->num); cv++) {
gcov_type *ctrv = (gcov_type *)
SKIBOOT_ADDR(addr, ctr_info->values);
- printf("%lx\n", be64toh(ctrv[cv]));
+ //printf("%lx\n", be64toh(ctrv[cv]));
write_u64(fd, be64toh(ctrv[cv]));
}
ctr_info++;
@@ -203,6 +204,8 @@ int main(int argc, char *argv[])
(void*)SKIBOOT_OFFSET, (void*)SKIBOOT_OFFSET+sb.st_size);
gcov_list_addr = strtoll(argv[2], NULL, 0);
+ gcov_list_addr = (u64)(addr + (gcov_list_addr - SKIBOOT_OFFSET));
+ gcov_list_addr = be64toh(*(u64*)gcov_list_addr);
printf("Skiboot gcov_info_list at %p\n", (void*)gcov_list_addr);