blob: 4803620bf728ca47602782c97824249eb2fcae1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#include "osint_debug.h"
void osThreadProfileStop(void) {
register u32 saveMask;
int i;
OSId id;
u32 now_time = osGetCount();
saveMask = __osDisableInt();
#ifndef NDEBUG
if (__osThprofFlag == 0) {
#if BUILD_VERSION >= VERSION_L
__osRestoreInt(saveMask);
__osError(138, 0);
#else
__osError(138, 0);
__osRestoreInt(saveMask);
#endif
return;
}
#endif
if (__osThprofFunc != NULL) {
id = osGetThreadId(0);
if (id < THPROF_IDMAX) {
thprof[id].time += now_time - __osThprofLastTimer;
} else {
#ifndef NDEBUG
#if BUILD_VERSION >= VERSION_L
__osRestoreInt(saveMask);
#endif
__osError(147, 1, id);
#if BUILD_VERSION >= VERSION_L
saveMask = __osDisableInt();
#endif
#endif
}
}
__osThprofFunc = NULL;
for (i = 0; i < THPROF_IDMAX; i++) {
thprof[i].flag = 0;
}
__osRestoreInt(saveMask);
}
|