Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This introduces pretty minimal GCOV support. The hypervisor does not need to understand much of that. It just needs to call the init functions to gather the addresses of the gcov related data structures. These are just linked together so something outside the hypervisor can look at them later. Signed-off-by: Henning Schild <henning.schild@siemens.com> Tested-by: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de> [Jan: Remove .gcno clean-files rule - done by kbuild] Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
- Loading branch information
1 parent
1f9d184
commit 6bd02b7
Showing
9 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Jailhouse, a Linux-based partitioning hypervisor | ||
* | ||
* Copyright (c) Siemens AG, 2017 | ||
* | ||
* Authors: | ||
* Henning Schild <henning.schild@siemens.com> | ||
* | ||
* This work is licensed under the terms of the GNU GPL, version 2. See | ||
* the COPYING file in the top-level directory. | ||
*/ | ||
#include <jailhouse/entry.h> | ||
#include <jailhouse/gcov.h> | ||
|
||
extern unsigned long __init_array_start[], __init_array_end[]; | ||
|
||
/* the actual data structure is bigger but we just need to know the version | ||
* independent beginning to link the elements to a list */ | ||
struct gcov_min_info { | ||
unsigned int version; | ||
struct gcov_min_info *next; | ||
}; | ||
|
||
void gcov_init(void) { | ||
unsigned long *iarray = __init_array_start; | ||
unsigned long *iarray_end = __init_array_end; | ||
void (*__init_func)(void); | ||
|
||
while (iarray < iarray_end) { | ||
__init_func = (void(*)(void))iarray[0]; | ||
iarray++; | ||
__init_func(); | ||
} | ||
} | ||
|
||
void __gcov_init(struct gcov_min_info *info); | ||
void __gcov_merge_add(void *counters, unsigned int n_counters); | ||
|
||
/* just link them all together and leave the head in the header | ||
* where a processing tool can find it */ | ||
void __gcov_init(struct gcov_min_info *info) | ||
{ | ||
info->next = (struct gcov_min_info *)hypervisor_header.gcov_info_head; | ||
hypervisor_header.gcov_info_head = info; | ||
} | ||
|
||
/* Satisfy the linker, never called */ | ||
void __gcov_merge_add(void *counters, unsigned int n_counters) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Jailhouse, a Linux-based partitioning hypervisor | ||
* | ||
* Copyright (c) Siemens AG, 2017 | ||
* | ||
* Authors: | ||
* Henning Schild <henning.schild@siemens.com> | ||
* | ||
* This work is licensed under the terms of the GNU GPL, version 2. See | ||
* the COPYING file in the top-level directory. | ||
*/ | ||
|
||
#ifdef CONFIG_JAILHOUSE_GCOV | ||
void gcov_init(void); | ||
#else | ||
static inline void gcov_init(void) {} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters