diff options
Diffstat (limited to 'lib/ultralib/src/debug/threadprofilereadcount.c')
| -rw-r--r-- | lib/ultralib/src/debug/threadprofilereadcount.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/ultralib/src/debug/threadprofilereadcount.c b/lib/ultralib/src/debug/threadprofilereadcount.c new file mode 100644 index 0000000..c12d313 --- /dev/null +++ b/lib/ultralib/src/debug/threadprofilereadcount.c @@ -0,0 +1,31 @@ +#include "osint_debug.h" + +u32 osThreadProfileReadCount(OSId id) { + if (!__osThprofFlag) { + __osError(139, 0); + return 0; + } + + if (id >= THPROF_IDMAX) { + __osError(143, 1, id); + return 0; + } + return thprof[id].count; +} + +u32 osThreadProfileReadCountTh(OSThread* thread) { + OSId id; + + if (!__osThprofFlag) { + __osError(141, 0); + return 0; + } + + id = osGetThreadId(thread); + + if (id >= THPROF_IDMAX) { + __osError(145, 1, id); + return 0; + } + return thprof[id].count; +} |
