Skip to content

Commit

Permalink
cleanup: include/: move misc/gcov.h to debug/gcov.h
Browse files Browse the repository at this point in the history
move misc/gcov.h to debug/gcov.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
  • Loading branch information
nashif committed Jun 28, 2019
1 parent a2fd7d7 commit fa1c600
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
19 changes: 19 additions & 0 deletions include/debug/gcov.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2018 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef ZEPHYR_INCLUDE_DEBUG_GCOV_H_
#define ZEPHYR_INCLUDE_DEBUG_GCOV_H_

#ifdef CONFIG_COVERAGE_GCOV
void gcov_coverage_dump(void);
void gcov_static_init(void);
#else
void gcov_coverage_dump(void) { }
void gcov_static_init(void) { }

#endif /* CONFIG_COVERAGE */

#endif /* ZEPHYR_INCLUDE_DEBUG_GCOV_H_ */
16 changes: 6 additions & 10 deletions include/misc/gcov.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
/*
* Copyright (c) 2018 Intel Corporation
* Copyright (c) 2019 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef ZEPHYR_INCLUDE_MISC_GCOV_H_
#define ZEPHYR_INCLUDE_MISC_GCOV_H_

#ifdef CONFIG_COVERAGE_GCOV
void gcov_coverage_dump(void);
void gcov_static_init(void);
#else
void gcov_coverage_dump(void) { }
void gcov_static_init(void) { }
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <debug/gcov.h> instead."
#endif

#endif /* CONFIG_COVERAGE */
#include <debug/gcov.h>

#endif /* ZEPHYR_INCLUDE_MISC_GCOV_H_ */
#endif /* ZEPHYR_INCLUDE_MISC_GCOV_H_ */
2 changes: 1 addition & 1 deletion kernel/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <logging/log_ctrl.h>
#include <debug/tracing.h>
#include <stdbool.h>
#include <misc/gcov.h>
#include <debug/gcov.h>

#define IDLE_THREAD_NAME "idle"
#define LOG_LEVEL CONFIG_KERNEL_LOG_LEVEL
Expand Down

0 comments on commit fa1c600

Please sign in to comment.