Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sw/simple_system] Declare
pcount_enable
function as inline
The `pcount_enable` function can be used to selectively enable performance counters only for a specific code segment. For example: ```c pcount_enable(0); pcount_reset(); pcount_enable(1); /* code to be measured */ pcount_enable(0); ``` The `pcount_enable` function consists of a single CSR instruction, so the overhead and thus the impact on the measurement is potentially low. When the function is called, however, many instructions have to be executed in addition to the single CSR instruction, which influences measurements. This commit moves the `pcount_enable` function to the `simple_system_common.h` header file and declares it as `inline` (and `static`, to prevent link-time collisions when the header file is included in multiple compilation units). This helps the compiler inline the function even without LTO. Signed-off-by: Andreas Kurth <[email protected]>
- Loading branch information