1 | SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause |
---|
2 | copyrights: |
---|
3 | - Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) |
---|
4 | enabled-by: RTEMS_SMP |
---|
5 | limits: {} |
---|
6 | links: |
---|
7 | - role: requirement-refinement |
---|
8 | uid: perf-runtime |
---|
9 | - role: runtime-measurement-request |
---|
10 | uid: ../val/perf |
---|
11 | non-functional-type: performance-runtime |
---|
12 | params: {} |
---|
13 | rationale: null |
---|
14 | references: [] |
---|
15 | requirement-type: non-functional |
---|
16 | test-body: |
---|
17 | brief: | |
---|
18 | Send a message. |
---|
19 | code: | |
---|
20 | uint64_t message; |
---|
21 | |
---|
22 | ctx->begin = T_tick(); |
---|
23 | ctx->status = rtems_message_queue_send( |
---|
24 | ctx->queue_id, |
---|
25 | &message, |
---|
26 | sizeof( message ) |
---|
27 | ); |
---|
28 | description: null |
---|
29 | test-cleanup: |
---|
30 | brief: | |
---|
31 | Move worker to scheduler A. |
---|
32 | code: | |
---|
33 | SetScheduler( ctx->worker_id, SCHEDULER_A_ID, PRIO_HIGH ); |
---|
34 | description: null |
---|
35 | test-prepare: |
---|
36 | brief: | |
---|
37 | Move worker to scheduler B. |
---|
38 | code: | |
---|
39 | SetScheduler( ctx->worker_id, SCHEDULER_B_ID, PRIO_NORMAL ); |
---|
40 | description: null |
---|
41 | test-setup: |
---|
42 | brief: | |
---|
43 | Let the worker wait on the message queue. |
---|
44 | code: | |
---|
45 | Send( ctx, EVENT_RECEIVE | EVENT_RECEIVE_END ); |
---|
46 | WaitForNextTask( 1, ctx->worker_id ); |
---|
47 | description: null |
---|
48 | test-teardown: |
---|
49 | brief: | |
---|
50 | Set the measured runtime. Make sure the worker waits for the next event. |
---|
51 | Discard samples interrupted by a clock tick. |
---|
52 | code: | |
---|
53 | T_quiet_rsc_success( ctx->status ); |
---|
54 | |
---|
55 | *delta = ctx->end - ctx->begin; |
---|
56 | WaitForNextTask( 1, ctx->worker_id ); |
---|
57 | |
---|
58 | return tic == toc; |
---|
59 | description: null |
---|
60 | text: | |
---|
61 | Let ``U` and `V`` be two tasks with distinct home schedulers. Let :math:`B` |
---|
62 | be a time point measured by ``U`` right before a call to ${../if/send:/name} |
---|
63 | which unblocks the waiting task ``V`` which is scheduled on another |
---|
64 | processor. Let :math:`E` be a time point measured by ``V`` right after the |
---|
65 | first context switch after :math:`B`. |
---|
66 | |
---|
67 | While the execution environment is ${.:/environment}, while a message queue |
---|
68 | is empty, while only task ``V`` waits on the message queue, while the |
---|
69 | measurement sample is :math:`E - B`, when exactly |
---|
70 | ${../val/perf:/params/sample-count} samples are collected, the |
---|
71 | ${.:/limit-kind} shall be ${.:/limit-condition}. |
---|
72 | type: requirement |
---|