Skip to content

Commit

Permalink
fixup! coverage: Import most recent version from Zephyr
Browse files Browse the repository at this point in the history
  • Loading branch information
nmeum committed Jan 30, 2023
1 parent fabdfac commit d43eeac
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
2 changes: 2 additions & 0 deletions dist/tools/coverage/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 19 additions & 12 deletions sys/include/coverage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
};

/**
Expand Down Expand Up @@ -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 */

0 comments on commit d43eeac

Please sign in to comment.