summaryrefslogtreecommitdiffstats
path: root/testsuites/validation/tc-message-performance.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testsuites/validation/tc-message-performance.c124
1 files changed, 92 insertions, 32 deletions
diff --git a/testsuites/validation/tc-message-performance.c b/testsuites/validation/tc-message-performance.c
index 162c094078..c01570b772 100644
--- a/testsuites/validation/tc-message-performance.c
+++ b/testsuites/validation/tc-message-performance.c
@@ -3,11 +3,11 @@
/**
* @file
*
- * @ingroup RTEMSTestCaseRtemsMessageValPerf
+ * @ingroup RtemsMessageValPerf
*/
/*
- * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2021 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -59,9 +59,9 @@
#include <rtems/test.h>
/**
- * @defgroup RTEMSTestCaseRtemsMessageValPerf spec:/rtems/message/val/perf
+ * @defgroup RtemsMessageValPerf spec:/rtems/message/val/perf
*
- * @ingroup RTEMSTestSuiteTestsuitesPerformanceNoClock0
+ * @ingroup TestsuitesPerformanceNoClock0
*
* @brief This test case provides a context to run @ref RTEMSAPIClassicMessage
* performance tests.
@@ -79,6 +79,11 @@ typedef struct {
rtems_id queue_id;
/**
+ * @brief This member provides a message to send.
+ */
+ long message;
+
+ /**
* @brief This member provides a worker identifier.
*/
rtems_id worker_id;
@@ -116,15 +121,17 @@ static RtemsMessageValPerf_Context
#define MAXIMUM_MESSAGE_SIZE 8
-typedef RtemsMessageValPerf_Context Context;
+#define EVENT_END RTEMS_EVENT_0
+
+#define EVENT_SEND RTEMS_EVENT_1
-typedef enum {
- EVENT_END = RTEMS_EVENT_0,
- EVENT_SEND = RTEMS_EVENT_1,
- EVENT_SEND_END = RTEMS_EVENT_2,
- EVENT_RECEIVE = RTEMS_EVENT_3,
- EVENT_RECEIVE_END = RTEMS_EVENT_4
-} Event;
+#define EVENT_SEND_END RTEMS_EVENT_2
+
+#define EVENT_RECEIVE RTEMS_EVENT_3
+
+#define EVENT_RECEIVE_END RTEMS_EVENT_4
+
+typedef RtemsMessageValPerf_Context Context;
static RTEMS_MESSAGE_QUEUE_BUFFER( MAXIMUM_MESSAGE_SIZE )
storage_area[ MAXIMUM_PENDING_MESSAGES ];
@@ -152,7 +159,6 @@ static void Worker( rtems_task_argument arg )
rtems_event_set events;
rtems_status_code sc;
T_ticks ticks;
- uint64_t message;
sc = rtems_event_receive(
RTEMS_ALL_EVENTS,
@@ -168,11 +174,10 @@ static void Worker( rtems_task_argument arg )
}
if ( ( events & EVENT_SEND ) != 0 ) {
- message = 0;
sc = rtems_message_queue_send(
ctx->queue_id,
- &message,
- sizeof( message )
+ &ctx->message,
+ sizeof( ctx->message )
);
ticks = T_tick();
T_quiet_rsc_success( sc );
@@ -183,6 +188,7 @@ static void Worker( rtems_task_argument arg )
}
if ( ( events & EVENT_RECEIVE ) != 0 ) {
+ long message;
size_t size;
sc = rtems_message_queue_receive(
@@ -273,6 +279,13 @@ static T_fixture RtemsMessageValPerf_Fixture = {
};
/**
+ * @defgroup RtemsMessageReqPerfReceiveTry \
+ * spec:/rtems/message/req/perf-receive-try
+ *
+ * @{
+ */
+
+/**
* @brief Try to receive a message.
*/
static void RtemsMessageReqPerfReceiveTry_Body(
@@ -329,6 +342,15 @@ static bool RtemsMessageReqPerfReceiveTry_Teardown_Wrap(
return RtemsMessageReqPerfReceiveTry_Teardown( ctx, delta, tic, toc, retry );
}
+/** @} */
+
+/**
+ * @defgroup RtemsMessageReqPerfReceiveWaitForever \
+ * spec:/rtems/message/req/perf-receive-wait-forever
+ *
+ * @{
+ */
+
/**
* @brief Schedule a message send.
*/
@@ -416,6 +438,15 @@ static bool RtemsMessageReqPerfReceiveWaitForever_Teardown_Wrap(
);
}
+/** @} */
+
+/**
+ * @defgroup RtemsMessageReqPerfReceiveWaitTimed \
+ * spec:/rtems/message/req/perf-receive-wait-timed
+ *
+ * @{
+ */
+
/**
* @brief Schedule a message send.
*/
@@ -503,17 +534,23 @@ static bool RtemsMessageReqPerfReceiveWaitTimed_Teardown_Wrap(
);
}
+/** @} */
+
+/**
+ * @defgroup RtemsMessageReqPerfSend spec:/rtems/message/req/perf-send
+ *
+ * @{
+ */
+
/**
* @brief Send a message.
*/
static void RtemsMessageReqPerfSend_Body( RtemsMessageValPerf_Context *ctx )
{
- uint64_t message;
-
ctx->status = rtems_message_queue_send(
ctx->queue_id,
- &message,
- sizeof( message )
+ &ctx->message,
+ sizeof( ctx->message )
);
}
@@ -563,6 +600,15 @@ static bool RtemsMessageReqPerfSend_Teardown_Wrap(
return RtemsMessageReqPerfSend_Teardown( ctx, delta, tic, toc, retry );
}
+/** @} */
+
+/**
+ * @defgroup RtemsMessageReqPerfSendOther \
+ * spec:/rtems/message/req/perf-send-other
+ *
+ * @{
+ */
+
/**
* @brief Let the worker wait on the message queue.
*/
@@ -589,12 +635,10 @@ static void RtemsMessageReqPerfSendOther_Body(
RtemsMessageValPerf_Context *ctx
)
{
- uint64_t message;
-
ctx->status = rtems_message_queue_send(
ctx->queue_id,
- &message,
- sizeof( message )
+ &ctx->message,
+ sizeof( ctx->message )
);
}
@@ -639,8 +683,17 @@ static bool RtemsMessageReqPerfSendOther_Teardown_Wrap(
return RtemsMessageReqPerfSendOther_Teardown( ctx, delta, tic, toc, retry );
}
+/** @} */
+
#if defined(RTEMS_SMP)
/**
+ * @defgroup RtemsMessageReqPerfSendOtherCpu \
+ * spec:/rtems/message/req/perf-send-other-cpu
+ *
+ * @{
+ */
+
+/**
* @brief Move worker to scheduler B.
*/
static void RtemsMessageReqPerfSendOtherCpu_Prepare(
@@ -676,13 +729,11 @@ static void RtemsMessageReqPerfSendOtherCpu_Body(
RtemsMessageValPerf_Context *ctx
)
{
- uint64_t message;
-
ctx->begin = T_tick();
ctx->status = rtems_message_queue_send(
ctx->queue_id,
- &message,
- sizeof( message )
+ &ctx->message,
+ sizeof( ctx->message )
);
}
@@ -743,9 +794,18 @@ static void RtemsMessageReqPerfSendOtherCpu_Cleanup(
{
SetScheduler( ctx->worker_id, SCHEDULER_A_ID, PRIO_HIGH );
}
+
+/** @} */
#endif
/**
+ * @defgroup RtemsMessageReqPerfSendPreempt \
+ * spec:/rtems/message/req/perf-send-preempt
+ *
+ * @{
+ */
+
+/**
* @brief Let the worker wait on the message queue.
*/
static void RtemsMessageReqPerfSendPreempt_Setup(
@@ -770,13 +830,11 @@ static void RtemsMessageReqPerfSendPreempt_Body(
RtemsMessageValPerf_Context *ctx
)
{
- uint64_t message;
-
ctx->begin = T_tick();
ctx->status = rtems_message_queue_send(
ctx->queue_id,
- &message,
- sizeof( message )
+ &ctx->message,
+ sizeof( ctx->message )
);
}
@@ -827,6 +885,8 @@ static bool RtemsMessageReqPerfSendPreempt_Teardown_Wrap(
);
}
+/** @} */
+
/**
* @fn void T_case_body_RtemsMessageValPerf( void )
*/