diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-02-02 07:43:39 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-02-02 07:48:49 +0100 |
commit | 1e483a62ea30e49e9d63ffdd44b14ac4a15f4fe3 (patch) | |
tree | 6723ca753d3a87922e7fc8877244b30df82ddedb /cpukit/include | |
parent | smpschedaffinity04: Fix configuration (diff) | |
download | rtems-1e483a62ea30e49e9d63ffdd44b14ac4a15f4fe3.tar.bz2 |
test: Add rtems_test_busy_cpu_usage()
Diffstat (limited to 'cpukit/include')
-rw-r--r-- | cpukit/include/rtems/test.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cpukit/include/rtems/test.h b/cpukit/include/rtems/test.h index 3dbdb9e32e..fbe8acf909 100644 --- a/cpukit/include/rtems/test.h +++ b/cpukit/include/rtems/test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017 embedded brains GmbH. All rights reserved. + * Copyright (c) 2014, 2018 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Dornierstr. 4 @@ -290,6 +290,19 @@ void rtems_test_parallel( ); /** + * @brief Performs a busy loop for the specified seconds and nanoseconds based + * on the CPU usage of the executing thread. + * + * This function continuously reads the CPU usage of the executing thread. + * This operation may lead to a scheduler instance lock contention in SMP + * configurations. + * + * @param[in] seconds The busy seconds. + * @param[in] nanoseconds The busy nanoseconds. + */ +void rtems_test_busy_cpu_usage(time_t seconds, long nanoseconds); + +/** * @brief Performs a busy loop with the specified iteration count. * * This function is optimized to not perform memory accesses and should have a |