From d43eeac5b61c7e3b9cd1aa8a29690d7864d13636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 30 Jan 2023 19:17:13 +0100 Subject: [PATCH] fixup! coverage: Import most recent version from Zephyr --- dist/tools/coverage/coverage.py | 2 ++ sys/include/coverage.h | 31 +++++++++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/dist/tools/coverage/coverage.py b/dist/tools/coverage/coverage.py index 0995b0ff7c0cd..301a634b0cee2 100755 --- a/dist/tools/coverage/coverage.py +++ b/dist/tools/coverage/coverage.py @@ -14,12 +14,14 @@ import re import sys + def get_input_stream(input_file): if input_file == "-": return sys.stdin else: return open(input_file, 'r') + def retrieve_data(input_file): extracted_coverage_info = {} capture_data = False diff --git a/sys/include/coverage.h b/sys/include/coverage.h index b4ac5c19b80bc..b9c203790bb52 100644 --- a/sys/include/coverage.h +++ b/sys/include/coverage.h @@ -26,8 +26,12 @@ * Which is governed by section 7 of additional permissions. */ -#ifndef _COVERAGE_H_ -#define _COVERAGE_H_ +#ifndef COVERAGE_H +#define COVERAGE_H + +#ifdef __cplusplus +extern "C" { +#endif #if (__GNUC__ >= 10) #define GCOV_COUNTERS 8U @@ -72,8 +76,8 @@ typedef uint64_t gcov_type; * at run-time with the exception of the values array. */ struct gcov_ctr_info { - unsigned int num; /* number of counter values for this type */ - gcov_type *values; /* array of counter values for this type */ + unsigned int num; /**< number of counter values for this type */ + gcov_type *values; /**< array of counter values for this type */ }; /** @@ -102,17 +106,20 @@ struct gcov_fn_info { * at run-time with the exception of the next pointer. */ struct gcov_info { - unsigned int version; /**< Gcov version (same as GCC version) */ - struct gcov_info *next; /**< List head for a singly-linked list */ - unsigned int stamp; /**< Uniquifying time stamp */ + unsigned int version; /**< Gcov version (same as GCC version) */ + struct gcov_info *next; /**< List head for a singly-linked list */ + unsigned int stamp; /**< Uniquifying time stamp */ #ifdef GCOV_12_FORMAT - unsigned int checksum; /**< unique object checksum */ + unsigned int checksum; /**< unique object checksum */ #endif - const char *filename; /**< Name of the associated gcda data file */ - /* merge functions, null for unused*/ - void (*merge[GCOV_COUNTERS])(gcov_type **<, unsigned int); + const char *filename; /**< Name of the associated gcda data file */ + void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int); /**< merge functions, null for unused */ unsigned int n_functions; /**< number of instrumented functions */ struct gcov_fn_info **functions; /**< function information */ }; -#endif /* _COVERAGE_H_ */ +#ifdef __cplusplus +} +#endif + +#endif /* COVERAGE_H */