1 /* 2 * Percepio Trace Recorder for Tracealyzer v4.6.6 3 * Copyright 2021 Percepio AB 4 * www.percepio.com 5 * 6 * SPDX-License-Identifier: Apache-2.0 7 */ 8 9 /** 10 * @file 11 * 12 * @brief Public trace event APIs. 13 */ 14 15 #ifndef TRC_EVENT_H 16 #define TRC_EVENT_H 17 18 #if (TRC_USE_TRACEALYZER_RECORDER == 1) 19 20 #if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) 21 22 #include <trcTypes.h> 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 /** 29 * @defgroup trace_event_apis Trace Event APIs 30 * @ingroup trace_recorder_apis 31 * @{ 32 */ 33 34 /** 35 * @internal Macro helper for setting trace event parameter count. 36 */ 37 #define TRC_EVENT_SET_PARAM_COUNT(id, n) (((uint16_t)(id)) | ((((uint16_t)(n)) & 0xF) << 12)) 38 39 /** 40 * @internal Macro helper for getting trace event parameter count. 41 */ 42 #define TRC_EVENT_GET_PARAM_COUNT(id) (((id) >> 12) & 0xF) 43 44 #if (TRC_CFG_CORE_COUNT > 1) 45 #define TRC_EVENT_SET_EVENT_COUNT(c) (((TRC_CFG_GET_CURRENT_CORE() & 0xF) << 12) | ((uint16_t)(c) & 0xFFF)) 46 #else 47 #define TRC_EVENT_SET_EVENT_COUNT(c) (uint16_t)(c) 48 #endif 49 50 /** 51 * @internal Macro helpder for setting base event data. 52 */ 53 #define SET_BASE_EVENT_DATA(pxEvent, eventId, paramCount, eventCount) \ 54 ( \ 55 (pxEvent)->EventID = TRC_EVENT_SET_PARAM_COUNT(eventId, paramCount), \ 56 (pxEvent)->EventCount = TRC_EVENT_SET_EVENT_COUNT(eventCount), \ 57 xTraceTimestampGet(&(pxEvent)->TS) \ 58 ) 59 60 /** 61 * @internal Macro helper for resetting trace event data. 62 */ 63 #define RESET_EVENT_DATA(p) \ 64 ( \ 65 (p)->pvBlob = 0, \ 66 (p)->size = 0, \ 67 (p)->offset = 0 \ 68 ) 69 70 /** 71 * @internal Macro optimization for getting trace event size. 72 */ 73 #define TRC_EVENT_GET_SIZE(pvAddress, puiSize) (*(uint32_t*)(puiSize) = sizeof(TraceBaseEvent_t) + (TRC_EVENT_GET_PARAM_COUNT(((TraceBaseEvent_t*)(pvAddress))->EventID)) * sizeof(uint32_t), TRC_SUCCESS) 74 75 /** 76 * @internal Macro optimization for getting trace event data pointer with an offset. 77 */ 78 #define TRC_EVENT_GET_RAW_DATA(xEventHandle, uiOffset, uiSize, ppvData) ((void)(uiSize), *(void**)(ppvData) = (void*)&((uint8_t*)((TraceEventData_t*)(xEventHandle))->pvBlob)[uiOffset], TRC_SUCCESS) 79 80 /** 81 * @internal Macro optimization for getting trace event payload pointer with an offset. 82 */ 83 #define TRC_EVENT_GET_PAYLOAD(xEventHandle, uiOffset, uiSize, ppvData) ((void)(uiSize), *(void**)(ppvData) = (void*)&((uint8_t*)((TraceEventData_t*)(xEventHandle))->pvBlob)[sizeof(TraceBaseEvent_t) + (uiOffset)], TRC_SUCCESS) 84 85 /** 86 * @internal Macro optimization for getting trace event remaining payload size. 87 */ 88 #define TRC_EVENT_PAYLOAD_REMAINING(xEventHandle, puiValue) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(uint32_t*)(puiValue) = ((TraceEventData_t*)(xEventHandle))->size - ((TraceEventData_t*)(xEventHandle))->offset, TRC_SUCCESS) 89 90 /** 91 * @internal Macro optimization for getting trace event used payload size. 92 */ 93 #define TRC_EVENT_PAYLOAD_USED(xEventHandle, puiValue) (*(uint32_t*)(puiValue) = ((TraceEventData_t*)(xEventHandle))->offset - sizeof(TraceBaseEvent_t), TRC_SUCCESS) 94 95 /** 96 * @internal Macro optimization getting trace event payload size. 97 */ 98 #define TRC_EVENT_PAYLOAD_SIZE(xEventHandle, puiValue) (*(uint32_t*)(puiValue) = ((TraceEventData_t*)(xEventHandle))->size - sizeof(TraceBaseEvent_t), TRC_SUCCESS) 99 100 /** 101 * @internal Macro optimization for adding a pointer address to trace event. 102 */ 103 #define TRC_EVENT_ADD_POINTER(xEventHandle, value) \ 104 TRC_COMMA_EXPR_TO_STATEMENT_EXPR_3( \ 105 ((void**)((TraceEventData_t*)(xEventHandle))->pvBlob)[((TraceEventData_t*)(xEventHandle))->offset / sizeof(void*)] = (value), \ 106 ((TraceEventData_t*)(xEventHandle))->offset += sizeof(void*), \ 107 TRC_SUCCESS \ 108 ) 109 110 /** 111 * @internal Macro optimization for adding a unsigned base type to trace event. 112 */ 113 #define TRC_EVENT_ADD_UNSIGNED_BASE_TYPE(xEventHandle, value) \ 114 TRC_COMMA_EXPR_TO_STATEMENT_EXPR_3( \ 115 ((TraceUnsignedBaseType_t*)((TraceEventData_t*)(xEventHandle))->pvBlob)[((TraceEventData_t*)(xEventHandle))->offset / sizeof(TraceUnsignedBaseType_t)] = (value), \ 116 ((TraceEventData_t*)(xEventHandle))->offset += sizeof(TraceUnsignedBaseType_t), \ 117 TRC_SUCCESS \ 118 ) 119 120 /** 121 * @internal Macro optimization for adding a 32-bit value to trace event. 122 */ 123 #define TRC_EVENT_ADD_32(xEventHandle, value) \ 124 TRC_COMMA_EXPR_TO_STATEMENT_EXPR_3( \ 125 ((uint32_t*)((TraceEventData_t*)(xEventHandle))->pvBlob)[((TraceEventData_t*)(xEventHandle))->offset / sizeof(uint32_t)] = (value), \ 126 ((TraceEventData_t*)(xEventHandle))->offset += sizeof(uint32_t), \ 127 TRC_SUCCESS \ 128 ) 129 130 /** 131 * @internal Macro optimization for adding a 16-bit value to trace event. 132 */ 133 #define TRC_EVENT_ADD_16(xEventHandle, value) \ 134 TRC_COMMA_EXPR_TO_STATEMENT_EXPR_3( \ 135 ((uint16_t*)((TraceEventData_t*)(xEventHandle))->pvBlob)[((TraceEventData_t*)(xEventHandle))->offset / sizeof(uint16_t)] = (value), \ 136 ((TraceEventData_t*)(xEventHandle))->offset += sizeof(uint16_t), \ 137 TRC_SUCCESS \ 138 ) 139 140 /** 141 * @internal Macro optimization for adding a 8-bit value to trace event. 142 */ 143 #define TRC_EVENT_ADD_8(xEventHandle, value) \ 144 TRC_COMMA_EXPR_TO_STATEMENT_EXPR_3( \ 145 ((uint8_t*)((TraceEventData_t*)(xEventHandle))->pvBlob)[((TraceEventData_t*)(xEventHandle))->offset / sizeof(uint8_t)] = (value), \ 146 ((TraceEventData_t*)(xEventHandle))->offset += sizeof(uint8_t), \ 147 TRC_SUCCESS \ 148 ) 149 150 /** 151 * @internal Macro optimization for beginning an offline trace event. 152 */ 153 #define TRC_EVENT_BEGIN_OFFLINE(uiEventCode, uiPayloadSize, pxEventHandle) \ 154 ( \ 155 (xTraceEventBeginRawOffline(sizeof(TraceBaseEvent_t) + (uiPayloadSize), pxEventHandle)) == TRC_SUCCESS ? \ 156 ( \ 157 pxTraceEventDataTable->coreEventData[TRC_CFG_GET_CURRENT_CORE()].eventCounter++, \ 158 SET_BASE_EVENT_DATA((TraceBaseEvent_t*)(((TraceEventData_t*)*(pxEventHandle))->pvBlob), \ 159 uiEventCode, \ 160 (((TraceEventData_t*)*(pxEventHandle))->size - sizeof(TraceBaseEvent_t)) / sizeof(uint32_t), \ 161 pxTraceEventDataTable->coreEventData[TRC_CFG_GET_CURRENT_CORE()].eventCounter), \ 162 ((TraceEventData_t*)*(pxEventHandle))->offset += sizeof(TraceBaseEvent_t), \ 163 TRC_SUCCESS \ 164 ) : TRC_FAIL \ 165 ) 166 167 /** 168 * @internal Macro optimization for ending an offline trace event. 169 */ 170 #define TRC_EVENT_END_OFFLINE(xEventHandle) \ 171 TRC_COMMA_EXPR_TO_STATEMENT_EXPR_4( \ 172 xTraceStreamPortCommit(((TraceEventData_t*)(xEventHandle))->pvBlob, \ 173 ((TraceEventData_t*)(xEventHandle))->size, &DUMMY_iTraceBytesCommitted), \ 174 RESET_EVENT_DATA((TraceEventData_t*)(xEventHandle)), \ 175 TRC_SUCCESS \ 176 ) 177 178 /** 179 * @internal Trace Base Event Structure 180 */ 181 typedef struct { 182 uint16_t EventID; /**< */ 183 uint16_t EventCount; /**< */ 184 uint32_t TS; /**< */ 185 } TraceBaseEvent_t; 186 187 /** 188 * @internal Trace Event Data Structure 189 */ 190 typedef struct TraceEventData 191 { 192 void* pvBlob; /**< */ 193 uint32_t size; /**< */ 194 uint32_t offset; /**< */ 195 } TraceEventData_t; 196 197 /** 198 * @internal Trace Core Event Data Structure 199 */ 200 typedef struct TraceCoreEventData 201 { 202 TraceEventData_t eventData[(TRC_CFG_MAX_ISR_NESTING)+1]; /**< */ 203 uint32_t eventCounter; /**< */ 204 TRACE_ALLOC_CRITICAL_SECTION() 205 } TraceCoreEventData_t; 206 207 /** 208 * @internal Trace Event Data Table Structure. 209 */ 210 typedef struct TraceEventDataTable 211 { 212 TraceCoreEventData_t coreEventData[TRC_CFG_CORE_COUNT]; /**< Holds data about current event for each core/isr depth */ 213 } TraceEventDataTable_t; 214 215 #define TRC_EVENT_DATA_BUFFER_SIZE (sizeof(TraceEventDataTable_t)) 216 217 /** 218 * @internal Trace Event Data Buffer Structure. 219 */ 220 typedef struct TraceEventDataBuffer 221 { 222 uint8_t buffer[TRC_EVENT_DATA_BUFFER_SIZE]; /**< */ 223 } TraceEventDataBuffer_t; 224 225 extern TraceEventDataTable_t* pxTraceEventDataTable; 226 227 /** 228 * @internal Initialize event trace system. 229 * 230 * @param[in] pxBuffer Pointer to memory that will be used by the event 231 * trace system. 232 * 233 * @retval TRC_FAIL Failure 234 * @retval TRC_SUCCESS Success 235 */ 236 traceResult xTraceEventInitialize(TraceEventDataBuffer_t* pxBuffer); 237 238 /** 239 * @brief Gets trace event size. 240 * 241 * @param[in] pvAddress Pointer to initialized trace event. 242 * @param[out] puiSize Size. 243 * 244 * @retval TRC_FAIL Failure 245 * @retval TRC_SUCCESS Success 246 */ 247 traceResult xTraceEventGetSize(void* pvAddress, uint32_t* puiSize); 248 249 /** 250 * @internal Begins a raw trace event offline. 251 * 252 * This routine begins a trace event with specified size. Must call xTraceEventEnd() 253 * to finalize event creation. Does not care about RecorderEnabled. 254 * 255 * @param[in] uiSize Size. 256 * @param[in] pxEventHandle Pointer to initialized trace event. 257 * 258 * @retval TRC_FAIL Failure 259 * @retval TRC_SUCCESS Success 260 */ 261 traceResult xTraceEventBeginRawOffline(uint32_t uiSize, TraceEventHandle_t* pxEventHandle); 262 263 /** 264 * @internal Begins a blocking trace event offline. 265 * 266 * This routine begins a trace event with specified size. Must call xTraceEventEnd() 267 * to finalize event creation. Does not care about RecorderEnabled. 268 * 269 * @param[in] uiSize Size. 270 * @param[in] pxEventHandle Pointer to initialized trace event. 271 * 272 * @retval TRC_FAIL Failure 273 * @retval TRC_SUCCESS Success 274 */ 275 traceResult xTraceEventBeginRawOfflineBlocking(uint32_t uiSize, TraceEventHandle_t* pxEventHandle); 276 277 /** 278 * @internal Begins a trace event offline. 279 * 280 * This routine begins a trace event with specified size. Must call xTraceEventEnd() 281 * to finalize event creation. Does not care about RecorderEnabled. 282 * 283 * @param[in] uiSize Size. 284 * @param[in] pxEventHandle Pointer to initialized trace event. 285 * 286 * @retval TRC_FAIL Failure 287 * @retval TRC_SUCCESS Success 288 */ 289 #define xTraceEventBeginOffline TRC_EVENT_BEGIN_OFFLINE 290 291 /** 292 * @brief Begins a trace event. 293 * 294 * This routine begins a trace event with specified size. Must call xTraceEventEnd() 295 * to finalize event creation. Does not care about RecorderEnabled. 296 * 297 * @param[in] uiSize Size. 298 * @param[in] pxEventHandle Pointer to initialized trace event. 299 * 300 * @retval TRC_FAIL Failure 301 * @retval TRC_SUCCESS Success 302 */ 303 #define xTraceEventBegin(uiEventCode, uiTotalPayloadSize, pxEventHandle) \ 304 (xTraceIsRecorderEnabled() ? xTraceEventBeginOffline(uiEventCode, uiTotalPayloadSize, pxEventHandle) : TRC_FAIL) 305 306 /** 307 * @internal Ends a trace event offline. 308 * 309 * This routine ends the event that was begun by calling on xTraceEventBegin(). 310 * Does not care about uiRecorderEnabled. 311 * 312 * @param[in] xEventHandle Pointer to initialized trace event. 313 * 314 * @retval TRC_FAIL Failure 315 * @retval TRC_SUCCESS Success 316 */ 317 traceResult xTraceEventEndOffline(TraceEventHandle_t xEventHandle); 318 319 /** 320 * @internal Ends a blocking event offline. 321 * 322 * Ends the event that was begun by calling on xTraceEventBegin() 323 * 324 * @param[in] xEventHandle Pointer to initialized trace event. 325 * 326 * @retval TRC_FAIL Failure 327 * @retval TRC_SUCCESS Success 328 */ 329 traceResult xTraceEventEndOfflineBlocking(TraceEventHandle_t xEventHandle); 330 331 /** 332 * @brief Ends a trace event. 333 * 334 * This routine ends the event that was begun by calling on xTraceEventBegin(). 335 * Does not care about uiRecorderEnabled. 336 * 337 * @param[in] xEventHandle Pointer to initialized trace event. 338 * 339 * @retval TRC_FAIL Failure 340 * @retval TRC_SUCCESS Success 341 */ 342 #define xTraceEventEnd(xEventHandle) \ 343 (xTraceIsRecorderEnabled() == 0 ? TRC_FAIL : xTraceEventEndOffline(xEventHandle)) 344 345 /** 346 * @brief Adds data to event payload. 347 * 348 * @param[in] xEventHandle Pointer to initialized trace event. 349 * @param[in] pvData Pointer to data. 350 * @param[in] uiSize Size. 351 * 352 * @retval TRC_FAIL Failure 353 * @retval TRC_SUCCESS Success 354 */ 355 traceResult xTraceEventAddData(TraceEventHandle_t xEventHandle, void* pvData, uint32_t uiSize); 356 357 #if ((TRC_CFG_USE_TRACE_ASSERT) == 1) 358 359 /** 360 * @brief Gets trace event data pointer with an offset. 361 * 362 * This routine gets a trace event data pointer with an offset. It also verfies 363 * that the size so it won't go outside its buffer. 364 * 365 * @param[in] xEventHandle Pointer to initialized trace event. 366 * @param[in] uiOffset Offset. 367 * @param[in] uiSize Size. 368 * @param[out] ppvData Data. 369 * 370 * @retval TRC_FAIL Failure 371 * @retval TRC_SUCCESS Success 372 */ 373 traceResult xTraceEventGetRawData(TraceEventHandle_t xEventHandle, uint32_t uiOffset, uint32_t uiSize, void** ppvData); 374 375 /** 376 * @brief Gets trace event payload pointer with an offset. 377 * 378 * This routine gets a trace event payload pointer with an offset. It also verifies 379 * that the size so it won't go outside its payload buffer. 380 * 381 * @param[in] xEventHandle Pointer to initialized trace event. 382 * @param[in] uiOffset Offset. 383 * @param[in] uiSize Size. 384 * @param[out] ppvData Data. 385 * 386 * @retval TRC_FAIL Failure 387 * @retval TRC_SUCCESS Success 388 */ 389 traceResult xTraceEventGetPayload(TraceEventHandle_t xEventHandle, uint32_t uiOffset, uint32_t uiSize, void** ppvData); 390 391 /** 392 * @brief Gets the amount of remaining trace event payload. 393 * 394 * @param[in] xEventHandle Pointer to initialized trace event. 395 * @param[out] puiValue Value. 396 * 397 * @retval TRC_FAIL Failure 398 * @retval TRC_SUCCESS Success 399 */ 400 traceResult xTraceEventPayloadRemaining(TraceEventHandle_t xEventHandle, uint32_t* puiValue); 401 402 /** 403 * @brief Gets the amount of used trace event payload. 404 * 405 * @param[in] xEventHandle Pointer to initialized trace event. 406 * @param[out] puiValue Value 407 * 408 * @retval TRC_FAIL Failure 409 * @retval TRC_SUCCESS Success 410 */ 411 traceResult xTraceEventPayloadUsed(TraceEventHandle_t xEventHandle, uint32_t* puiValue); 412 413 /** 414 * @brief Gets trace event payload size. 415 * 416 * @param[in] xEventHandle Pointer to initialized trace event. 417 * @param[out] puiValue Value 418 * 419 * @retval TRC_FAIL Failure 420 * @retval TRC_SUCCESS Success 421 */ 422 traceResult xTraceEventPayloadSize(TraceEventHandle_t xEventHandle, uint32_t* puiValue); 423 424 /** 425 * @brief Adds an unsigned base type value as trace event payload 426 * 427 * @param[in] xEventHandle Pointer to initialized trace event. 428 * @param[in] uxValue Value. 429 * 430 * @retval TRC_FAIL Failure 431 * @retval TRC_SUCCESS Success 432 */ 433 traceResult xTraceEventAddUnsignedBaseType(TraceEventHandle_t xEventHandle, TraceUnsignedBaseType_t uxValue); 434 435 /** 436 * @brief Adds a pointer address as trace event payload 437 * 438 * @param[in] xEventHandle Pointer to initialized trace event. 439 * @param[in] pvAddress Address. 440 * 441 * @retval TRC_FAIL Failure 442 * @retval TRC_SUCCESS Success 443 */ 444 traceResult xTraceEventAddPointer(TraceEventHandle_t xEventHandle, void *pvAddress); 445 446 /** 447 * @brief Adds an uint32_t as trace event payload 448 * 449 * @param[in] xEventHandle Pointer to initialized trace event. 450 * @param[in] value Value. 451 * 452 * @retval TRC_FAIL Failure 453 * @retval TRC_SUCCESS Success 454 */ 455 traceResult xTraceEventAdd32(TraceEventHandle_t xEventHandle, uint32_t value); 456 457 /** 458 * @brief Adds an uint16_t as trace event payload 459 * 460 * @param[in] xEventHandle Pointer to initialized trace event. 461 * @param[in] value Value. 462 * 463 * @retval TRC_FAIL Failure 464 * @retval TRC_SUCCESS Success 465 */ 466 traceResult xTraceEventAdd16(TraceEventHandle_t xEventHandle, uint16_t value); 467 468 /** 469 * @brief Adds an uint8_t as trace event payload. 470 * 471 * @param[in] xEventHandle Pointer to initialized trace event. 472 * @param[in] value Value. 473 * 474 * @retval TRC_FAIL Failure 475 * @retval TRC_SUCCESS Success 476 */ 477 traceResult xTraceEventAdd8(TraceEventHandle_t xEventHandle, uint8_t value); 478 479 #else /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */ 480 481 /** 482 * @brief Gets trace event size. 483 * 484 * @param[in] pvAddress Pointer to initialized trace event. 485 * @param[out] puiSize Size. 486 * 487 * @retval TRC_FAIL Failure 488 * @retval TRC_SUCCESS Success 489 */ 490 #define xTraceEventGetSize(pvAddress, puiSize) (*(uint32_t*)(puiSize) = sizeof(TraceBaseEvent_t) + (TRC_EVENT_GET_PARAM_COUNT(((TraceBaseEvent_t*)(pvAddress))->EventID)) * sizeof(uint32_t), TRC_SUCCESS) 491 492 /** 493 * @brief Gets trace event data pointer with an offset. 494 * 495 * This routine gets a trace event data pointer with an offset. It also verfies 496 * that the size so it won't go outside its buffer. 497 * 498 * @param[in] xEventHandle Pointer to initialized trace event. 499 * @param[in] uiOffset Offset. 500 * @param[in] uiSize Size. 501 * @param[out] ppvData Data. 502 * 503 * @retval TRC_FAIL Failure 504 * @retval TRC_SUCCESS Success 505 */ 506 #define xTraceEventGetRawData TRC_EVENT_GET_RAW_DATA 507 508 /** 509 * @brief Gets trace event payload pointer with an offset. 510 * 511 * This routine gets a trace event payload pointer with an offset. It also verifies 512 * that the size so it won't go outside its payload buffer. 513 * 514 * @param[in] xEventHandle Pointer to initialized trace event. 515 * @param[in] uiOffset Offset. 516 * @param[in] uiSize Size. 517 * @param[out] ppvData Data. 518 * 519 * @retval TRC_FAIL Failure 520 * @retval TRC_SUCCESS Success 521 */ 522 #define xTraceEventGetPayload TRC_EVENT_GET_PAYLOAD 523 524 /** 525 * @brief Gets the amount of remaining trace event payload. 526 * 527 * @param[in] xEventHandle Pointer to initialized trace event. 528 * @param[out] puiValue Value. 529 * 530 * @retval TRC_FAIL Failure 531 * @retval TRC_SUCCESS Success 532 */ 533 #define xTraceEventPayloadRemaining TRC_EVENT_PAYLOAD_REMAINING 534 535 /** 536 * @brief Gets the amount of used trace event payload. 537 * 538 * @param[in] xEventHandle Pointer to initialized trace event. 539 * @param[out] puiValue Value 540 * 541 * @retval TRC_FAIL Failure 542 * @retval TRC_SUCCESS Success 543 */ 544 #define xTraceEventPayloadUsed TRC_EVENT_PAYLOAD_USED 545 546 /** 547 * @brief Gets trace event payload size. 548 * 549 * @param[in] xEventHandle Pointer to initialized trace event. 550 * @param[out] puiValue Value 551 * 552 * @retval TRC_FAIL Failure 553 * @retval TRC_SUCCESS Success 554 */ 555 #define xTraceEventPayloadSize TRC_EVENT_PAYLOAD_SIZE 556 557 /* Adds a pointer as event payload with no errors checks */ 558 #define xTraceEventAddPointer TRC_EVENT_ADD_POINTER 559 560 /** 561 * @brief Adds an unsigned base type value as trace event payload 562 * 563 * @param[in] xEventHandle Pointer to initialized trace event. 564 * @param[in] uxValue Value. 565 * 566 * @retval TRC_FAIL Failure 567 * @retval TRC_SUCCESS Success 568 */ 569 #define xTraceEventAddUnsignedBaseType TRC_EVENT_ADD_UNSIGNED_BASE_TYPE 570 571 /** 572 * @brief Adds an uint32_t as trace event payload 573 * 574 * @param[in] xEventHandle Pointer to initialized trace event. 575 * @param[in] value Value. 576 * 577 * @retval TRC_FAIL Failure 578 * @retval TRC_SUCCESS Success 579 */ 580 #define xTraceEventAdd32 TRC_EVENT_ADD_32 581 582 /** 583 * @brief Adds an uint16_t as trace event payload 584 * 585 * @param[in] xEventHandle Pointer to initialized trace event. 586 * @param[in] value Value. 587 * 588 * @retval TRC_FAIL Failure 589 * @retval TRC_SUCCESS Success 590 */ 591 #define xTraceEventAdd16 TRC_EVENT_ADD_16 592 593 /** 594 * @brief Adds an uint8_t as trace event payload. 595 * 596 * @param[in] xEventHandle Pointer to initialized trace event. 597 * @param[in] value Value. 598 * 599 * @retval TRC_FAIL Failure 600 * @retval TRC_SUCCESS Success 601 */ 602 #define xTraceEventAdd8 TRC_EVENT_ADD_8 603 604 #endif /* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */ 605 606 /** @} */ 607 608 #ifdef __cplusplus 609 } 610 #endif 611 612 #endif /* (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING) */ 613 614 #endif /* (TRC_USE_TRACEALYZER_RECORDER == 1) */ 615 616 #endif /* TRC_EVENT_H */ 617