MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / perf_thread_event2

Function perf_thread_event2

src/utest/perf/context_switch_tc.c:36–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36static void perf_thread_event2(void *parameter)
37{
38 rt_perf_t *perf = (rt_perf_t *)parameter;
39
40 for (rt_uint32_t i = 0; i < RT_UTEST_SYS_PERF_TC_COUNT; i++)
41 {
42 perf->tmp_time = 0;
43 rt_perf_start(perf);
44 rt_sem_take(sem2, RT_WAITING_FOREVER);
45 rt_sem_release(sem2);
46 rt_perf_stop(perf);
47
48 rt_mutex_take(perf->lock,RT_WAITING_FOREVER);
49 perf->count -= 1;
50 perf->tmp_time = perf->real_time;
51 rt_mutex_release(perf->lock);
52
53 rt_perf_start(perf);
54 rt_sem_take(sem2, RT_WAITING_FOREVER);
55 rt_sem_release(sem1);
56 rt_perf_stop(perf);
57 }
58 rt_sem_release(complete_sem);
59}
60
61rt_err_t context_switch_test(rt_perf_t *perf)
62{

Callers

nothing calls this directly

Calls 6

rt_perf_startFunction · 0.85
rt_sem_takeFunction · 0.85
rt_sem_releaseFunction · 0.85
rt_perf_stopFunction · 0.85
rt_mutex_takeFunction · 0.85
rt_mutex_releaseFunction · 0.85

Tested by

no test coverage detected