1 /* 2 * Copyright (c) 2018 Intel Corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #ifndef ZEPHYR_INCLUDE_TRACING_TRACING_H_ 7 #define ZEPHYR_INCLUDE_TRACING_TRACING_H_ 8 9 #include <zephyr/kernel.h> 10 11 #include "tracking.h" 12 13 #if defined CONFIG_SEGGER_SYSTEMVIEW 14 #include "tracing_sysview.h" 15 #elif defined CONFIG_TRACING_CTF 16 #include "tracing_ctf.h" 17 #elif defined CONFIG_TRACING_TEST 18 #include "tracing_test.h" 19 #elif defined CONFIG_TRACING_USER 20 #include "tracing_user.h" 21 #else 22 /** 23 * @brief Tracing 24 * 25 * The tracing subsystem provides hooks that permits you to collect data from 26 * your application and allows tools running on a host to visualize the 27 * inner-working of the kernel and various other subsystems. 28 * 29 * @defgroup subsys_tracing Tracing 30 * @ingroup os_services 31 * @{ 32 */ 33 34 /** 35 * @brief Tracing APIs 36 * @defgroup subsys_tracing_apis Tracing APIs 37 * @{ 38 */ 39 40 /** 41 * @brief Thread Tracing APIs 42 * @defgroup subsys_tracing_apis_thread Thread Tracing APIs 43 * @{ 44 */ 45 46 /** 47 * @brief Called when entering a k_thread_foreach call 48 */ 49 #define sys_port_trace_k_thread_foreach_enter() 50 51 /** 52 * @brief Called when exiting a k_thread_foreach call 53 */ 54 #define sys_port_trace_k_thread_foreach_exit() 55 56 /** 57 * @brief Called when entering a k_thread_foreach_unlocked 58 */ 59 #define sys_port_trace_k_thread_foreach_unlocked_enter() 60 61 /** 62 * @brief Called when exiting a k_thread_foreach_unlocked 63 */ 64 #define sys_port_trace_k_thread_foreach_unlocked_exit() 65 66 /** 67 * @brief Trace creating a Thread 68 * @param new_thread Thread object 69 */ 70 #define sys_port_trace_k_thread_create(new_thread) 71 72 /** 73 * @brief Trace Thread entering user mode 74 */ 75 #define sys_port_trace_k_thread_user_mode_enter() 76 77 /** 78 * @brief Called when entering a k_thread_join 79 * @param thread Thread object 80 * @param timeout Timeout period 81 */ 82 #define sys_port_trace_k_thread_join_enter(thread, timeout) 83 84 /** 85 * @brief Called when k_thread_join blocks 86 * @param thread Thread object 87 * @param timeout Timeout period 88 */ 89 #define sys_port_trace_k_thread_join_blocking(thread, timeout) 90 91 /** 92 * @brief Called when exiting k_thread_join 93 * @param thread Thread object 94 * @param timeout Timeout period 95 * @param ret Return value 96 */ 97 #define sys_port_trace_k_thread_join_exit(thread, timeout, ret) 98 99 /** 100 * @brief Called when entering k_thread_sleep 101 * @param timeout Timeout period 102 */ 103 #define sys_port_trace_k_thread_sleep_enter(timeout) 104 105 /** 106 * @brief Called when exiting k_thread_sleep 107 * @param timeout Timeout period 108 * @param ret Return value 109 */ 110 #define sys_port_trace_k_thread_sleep_exit(timeout, ret) 111 112 /** 113 * @brief Called when entering k_thread_msleep 114 * @param ms Duration in milliseconds 115 */ 116 #define sys_port_trace_k_thread_msleep_enter(ms) 117 118 /** 119 * @brief Called when exiting k_thread_msleep 120 * @param ms Duration in milliseconds 121 * @param ret Return value 122 */ 123 #define sys_port_trace_k_thread_msleep_exit(ms, ret) 124 125 /** 126 * @brief Called when entering k_thread_usleep 127 * @param us Duration in microseconds 128 */ 129 #define sys_port_trace_k_thread_usleep_enter(us) 130 131 /** 132 * @brief Called when exiting k_thread_usleep 133 * @param us Duration in microseconds 134 * @param ret Return value 135 */ 136 #define sys_port_trace_k_thread_usleep_exit(us, ret) 137 138 /** 139 * @brief Called when entering k_thread_busy_wait 140 * @param usec_to_wait Duration in microseconds 141 */ 142 #define sys_port_trace_k_thread_busy_wait_enter(usec_to_wait) 143 144 /** 145 * @brief Called when exiting k_thread_busy_wait 146 * @param usec_to_wait Duration in microseconds 147 */ 148 #define sys_port_trace_k_thread_busy_wait_exit(usec_to_wait) 149 150 /** 151 * @brief Called when a thread yields 152 */ 153 #define sys_port_trace_k_thread_yield() 154 155 /** 156 * @brief Called when a thread wakes up 157 * @param thread Thread object 158 */ 159 #define sys_port_trace_k_thread_wakeup(thread) 160 161 /** 162 * @brief Called when a thread is started 163 * @param thread Thread object 164 */ 165 #define sys_port_trace_k_thread_start(thread) 166 167 /** 168 * @brief Called when a thread is being aborted 169 * @param thread Thread object 170 */ 171 #define sys_port_trace_k_thread_abort(thread) 172 173 /** 174 * @brief Called when a thread enters the k_thread_abort routine 175 * @param thread Thread object 176 */ 177 #define sys_port_trace_k_thread_abort_enter(thread) 178 179 /** 180 * @brief Called when a thread exits the k_thread_abort routine 181 * @param thread Thread object 182 */ 183 #define sys_port_trace_k_thread_abort_exit(thread) 184 185 /** 186 * @brief Called when setting priority of a thread 187 * @param thread Thread object 188 */ 189 #define sys_port_trace_k_thread_priority_set(thread) 190 191 /** 192 * @brief Called when a thread enters the k_thread_suspend 193 * function. 194 * @param thread Thread object 195 */ 196 #define sys_port_trace_k_thread_suspend_enter(thread) 197 198 /** 199 * @brief Called when a thread exits the k_thread_suspend 200 * function. 201 * @param thread Thread object 202 */ 203 #define sys_port_trace_k_thread_suspend_exit(thread) 204 205 /** 206 * @brief Called when a thread enters the resume from suspension 207 * function. 208 * @param thread Thread object 209 */ 210 #define sys_port_trace_k_thread_resume_enter(thread) 211 212 /** 213 * @brief Called when a thread exits the resumed from suspension 214 * function. 215 * @param thread Thread object 216 */ 217 #define sys_port_trace_k_thread_resume_exit(thread) 218 219 /** 220 * @brief Called when the thread scheduler is locked 221 */ 222 #define sys_port_trace_k_thread_sched_lock() 223 224 /** 225 * @brief Called when the thread scheduler is unlocked 226 */ 227 #define sys_port_trace_k_thread_sched_unlock() 228 229 /** 230 * @brief Called when a thread name is set 231 * @param thread Thread object 232 * @param ret Return value 233 */ 234 #define sys_port_trace_k_thread_name_set(thread, ret) 235 236 /** 237 * @brief Called before a thread has been selected to run 238 */ 239 #define sys_port_trace_k_thread_switched_out() 240 241 /** 242 * @brief Called after a thread has been selected to run 243 */ 244 #define sys_port_trace_k_thread_switched_in() 245 246 /** 247 * @brief Called when a thread is ready to run 248 * @param thread Thread object 249 */ 250 #define sys_port_trace_k_thread_ready(thread) 251 252 /** 253 * @brief Called when a thread is pending 254 * @param thread Thread object 255 */ 256 #define sys_port_trace_k_thread_pend(thread) 257 258 /** 259 * @brief Provide information about specific thread 260 * @param thread Thread object 261 */ 262 #define sys_port_trace_k_thread_info(thread) 263 264 /** 265 * @brief Trace implicit thread wakeup invocation by the scheduler 266 * @param thread Thread object 267 */ 268 #define sys_port_trace_k_thread_sched_wakeup(thread) 269 270 /** 271 * @brief Trace implicit thread abort invocation by the scheduler 272 * @param thread Thread object 273 */ 274 #define sys_port_trace_k_thread_sched_abort(thread) 275 276 /** 277 * @brief Trace implicit thread set priority invocation by the scheduler 278 * @param thread Thread object 279 * @param prio Thread priority 280 */ 281 #define sys_port_trace_k_thread_sched_priority_set(thread, prio) 282 283 /** 284 * @brief Trace implicit thread ready invocation by the scheduler 285 * @param thread Thread object 286 */ 287 #define sys_port_trace_k_thread_sched_ready(thread) 288 289 /** 290 * @brief Trace implicit thread pend invocation by the scheduler 291 * @param thread Thread object 292 */ 293 #define sys_port_trace_k_thread_sched_pend(thread) 294 295 /** 296 * @brief Trace implicit thread resume invocation by the scheduler 297 * @param thread Thread object 298 */ 299 #define sys_port_trace_k_thread_sched_resume(thread) 300 301 /** 302 * @brief Trace implicit thread suspend invocation by the scheduler 303 * @param thread Thread object 304 */ 305 #define sys_port_trace_k_thread_sched_suspend(thread) 306 307 /** @}c*/ /* end of subsys_tracing_apis_thread */ 308 309 /** 310 * @brief Work Tracing APIs 311 * @defgroup subsys_tracing_apis_work Work Tracing APIs 312 * @{ 313 */ 314 315 /** 316 * @brief Trace initialisation of a Work structure 317 * @param work Work structure 318 */ 319 #define sys_port_trace_k_work_init(work) 320 321 /** 322 * @brief Trace submit work to work queue call entry 323 * @param queue Work queue structure 324 * @param work Work structure 325 */ 326 #define sys_port_trace_k_work_submit_to_queue_enter(queue, work) 327 328 /** 329 * @brief Trace submit work to work queue call exit 330 * @param queue Work queue structure 331 * @param work Work structure 332 * @param ret Return value 333 */ 334 #define sys_port_trace_k_work_submit_to_queue_exit(queue, work, ret) 335 336 /** 337 * @brief Trace submit work to system work queue call entry 338 * @param work Work structure 339 */ 340 #define sys_port_trace_k_work_submit_enter(work) 341 342 /** 343 * @brief Trace submit work to system work queue call exit 344 * @param work Work structure 345 * @param ret Return value 346 */ 347 #define sys_port_trace_k_work_submit_exit(work, ret) 348 349 /** 350 * @brief Trace flush work call entry 351 * @param work Work structure 352 */ 353 #define sys_port_trace_k_work_flush_enter(work) 354 355 /** 356 * @brief Trace flush work call blocking 357 * @param work Work structure 358 * @param timeout Timeout period 359 */ 360 #define sys_port_trace_k_work_flush_blocking(work, timeout) 361 362 /** 363 * @brief Trace flush work call exit 364 * @param work Work structure 365 * @param ret Return value 366 */ 367 #define sys_port_trace_k_work_flush_exit(work, ret) 368 369 /** 370 * @brief Trace cancel work call entry 371 * @param work Work structure 372 */ 373 #define sys_port_trace_k_work_cancel_enter(work) 374 375 /** 376 * @brief Trace cancel work call exit 377 * @param work Work structure 378 * @param ret Return value 379 */ 380 #define sys_port_trace_k_work_cancel_exit(work, ret) 381 382 /** 383 * @brief Trace cancel sync work call entry 384 * @param work Work structure 385 * @param sync Sync object 386 */ 387 #define sys_port_trace_k_work_cancel_sync_enter(work, sync) 388 389 /** 390 * @brief Trace cancel sync work call blocking 391 * @param work Work structure 392 * @param sync Sync object 393 */ 394 #define sys_port_trace_k_work_cancel_sync_blocking(work, sync) 395 396 /** 397 * @brief Trace cancel sync work call exit 398 * @param work Work structure 399 * @param sync Sync object 400 * @param ret Return value 401 */ 402 #define sys_port_trace_k_work_cancel_sync_exit(work, sync, ret) 403 404 /** @} */ /* end of subsys_tracing_apis_work */ 405 406 /** 407 * @brief Work Queue Tracing APIs 408 * @defgroup subsys_tracing_apis_work_q Work Queue Tracing APIs 409 * @{ 410 */ 411 412 /** 413 * @brief Trace initialisation of a Work Queue structure 414 * @param queue Work Queue structure 415 */ 416 #define sys_port_trace_k_work_queue_init(queue) 417 418 /** 419 * @brief Trace start of a Work Queue call entry 420 * @param queue Work Queue structure 421 */ 422 #define sys_port_trace_k_work_queue_start_enter(queue) 423 424 /** 425 * @brief Trace start of a Work Queue call exit 426 * @param queue Work Queue structure 427 */ 428 #define sys_port_trace_k_work_queue_start_exit(queue) 429 430 /** 431 * @brief Trace stop of a Work Queue call entry 432 * @param queue Work Queue structure 433 * @param timeout Timeout period 434 */ 435 #define sys_port_trace_k_work_queue_stop_enter(queue, timeout) 436 437 /** 438 * @brief Trace stop of a Work Queue call blocking 439 * @param queue Work Queue structure 440 * @param timeout Timeout period 441 */ 442 #define sys_port_trace_k_work_queue_stop_blocking(queue, timeout) 443 444 /** 445 * @brief Trace stop of a Work Queue call exit 446 * @param queue Work Queue structure 447 * @param timeout Timeout period 448 * @param ret Return value 449 */ 450 #define sys_port_trace_k_work_queue_stop_exit(queue, timeout, ret) 451 452 /** 453 * @brief Trace Work Queue drain call entry 454 * @param queue Work Queue structure 455 */ 456 #define sys_port_trace_k_work_queue_drain_enter(queue) 457 458 /** 459 * @brief Trace Work Queue drain call exit 460 * @param queue Work Queue structure 461 * @param ret Return value 462 */ 463 #define sys_port_trace_k_work_queue_drain_exit(queue, ret) 464 465 /** 466 * @brief Trace Work Queue unplug call entry 467 * @param queue Work Queue structure 468 */ 469 #define sys_port_trace_k_work_queue_unplug_enter(queue) 470 471 /** 472 * @brief Trace Work Queue unplug call exit 473 * @param queue Work Queue structure 474 * @param ret Return value 475 */ 476 #define sys_port_trace_k_work_queue_unplug_exit(queue, ret) 477 478 /** @} */ /* end of subsys_tracing_apis_work_q */ 479 480 /** 481 * @brief Work Delayable Tracing APIs 482 * @defgroup subsys_tracing_apis_work_delayable Work Delayable Tracing APIs 483 * @{ 484 */ 485 486 /** 487 * @brief Trace initialisation of a Delayable Work structure 488 * @param dwork Delayable Work structure 489 */ 490 #define sys_port_trace_k_work_delayable_init(dwork) 491 492 /** 493 * @brief Trace schedule delayable work for queue enter 494 * @param queue Work Queue structure 495 * @param dwork Delayable Work structure 496 * @param delay Delay period 497 */ 498 #define sys_port_trace_k_work_schedule_for_queue_enter(queue, dwork, delay) 499 500 /** 501 * @brief Trace schedule delayable work for queue exit 502 * @param queue Work Queue structure 503 * @param dwork Delayable Work structure 504 * @param delay Delay period 505 * @param ret Return value 506 */ 507 #define sys_port_trace_k_work_schedule_for_queue_exit(queue, dwork, delay, ret) 508 509 /** 510 * @brief Trace schedule delayable work for system work queue enter 511 * @param dwork Delayable Work structure 512 * @param delay Delay period 513 */ 514 #define sys_port_trace_k_work_schedule_enter(dwork, delay) 515 516 /** 517 * @brief Trace schedule delayable work for system work queue exit 518 * @param dwork Delayable Work structure 519 * @param delay Delay period 520 * @param ret Return value 521 */ 522 #define sys_port_trace_k_work_schedule_exit(dwork, delay, ret) 523 524 /** 525 * @brief Trace reschedule delayable work for queue enter 526 * @param queue Work Queue structure 527 * @param dwork Delayable Work structure 528 * @param delay Delay period 529 */ 530 #define sys_port_trace_k_work_reschedule_for_queue_enter(queue, dwork, delay) 531 532 /** 533 * @brief Trace reschedule delayable work for queue exit 534 * @param queue Work Queue structure 535 * @param dwork Delayable Work structure 536 * @param delay Delay period 537 * @param ret Return value 538 */ 539 #define sys_port_trace_k_work_reschedule_for_queue_exit(queue, dwork, delay, ret) 540 541 /** 542 * @brief Trace reschedule delayable work for system queue enter 543 * @param dwork Delayable Work structure 544 * @param delay Delay period 545 */ 546 #define sys_port_trace_k_work_reschedule_enter(dwork, delay) 547 548 /** 549 * @brief Trace reschedule delayable work for system queue exit 550 * @param dwork Delayable Work structure 551 * @param delay Delay period 552 * @param ret Return value 553 */ 554 #define sys_port_trace_k_work_reschedule_exit(dwork, delay, ret) 555 556 /** 557 * @brief Trace delayable work flush enter 558 * @param dwork Delayable Work structure 559 * @param sync Sync object 560 */ 561 #define sys_port_trace_k_work_flush_delayable_enter(dwork, sync) 562 563 /** 564 * @brief Trace delayable work flush exit 565 * @param dwork Delayable Work structure 566 * @param sync Sync object 567 * @param ret Return value 568 */ 569 #define sys_port_trace_k_work_flush_delayable_exit(dwork, sync, ret) 570 571 /** 572 * @brief Trace delayable work cancel enter 573 * @param dwork Delayable Work structure 574 */ 575 #define sys_port_trace_k_work_cancel_delayable_enter(dwork) 576 577 /** 578 * @brief Trace delayable work cancel enter 579 * @param dwork Delayable Work structure 580 * @param ret Return value 581 */ 582 #define sys_port_trace_k_work_cancel_delayable_exit(dwork, ret) 583 584 /** 585 * @brief Trace delayable work cancel sync enter 586 * @param dwork Delayable Work structure 587 * @param sync Sync object 588 */ 589 #define sys_port_trace_k_work_cancel_delayable_sync_enter(dwork, sync) 590 591 /** 592 * @brief Trace delayable work cancel sync enter 593 * @param dwork Delayable Work structure 594 * @param sync Sync object 595 * @param ret Return value 596 */ 597 #define sys_port_trace_k_work_cancel_delayable_sync_exit(dwork, sync, ret) 598 599 /** @} */ /* end of subsys_tracing_apis_work_delayable */ 600 601 /** 602 * @brief Work Poll Tracing APIs 603 * @defgroup subsys_tracing_apis_work_poll Work Poll Tracing APIs 604 * @{ 605 */ 606 607 /** 608 * @brief Trace initialisation of a Work Poll structure enter 609 * @param work Work structure 610 */ 611 #define sys_port_trace_k_work_poll_init_enter(work) 612 613 /** 614 * @brief Trace initialisation of a Work Poll structure exit 615 * @param work Work structure 616 */ 617 #define sys_port_trace_k_work_poll_init_exit(work) 618 619 /** 620 * @brief Trace work poll submit to queue enter 621 * @param work_q Work queue 622 * @param work Work structure 623 * @param timeout Timeout period 624 */ 625 #define sys_port_trace_k_work_poll_submit_to_queue_enter(work_q, work, timeout) 626 627 /** 628 * @brief Trace work poll submit to queue blocking 629 * @param work_q Work queue 630 * @param work Work structure 631 * @param timeout Timeout period 632 */ 633 #define sys_port_trace_k_work_poll_submit_to_queue_blocking(work_q, work, timeout) 634 635 /** 636 * @brief Trace work poll submit to queue exit 637 * @param work_q Work queue 638 * @param work Work structure 639 * @param timeout Timeout period 640 * @param ret Return value 641 */ 642 #define sys_port_trace_k_work_poll_submit_to_queue_exit(work_q, work, timeout, ret) 643 644 /** 645 * @brief Trace work poll submit to system queue enter 646 * @param work Work structure 647 * @param timeout Timeout period 648 */ 649 #define sys_port_trace_k_work_poll_submit_enter(work, timeout) 650 651 /** 652 * @brief Trace work poll submit to system queue exit 653 * @param work Work structure 654 * @param timeout Timeout period 655 * @param ret Return value 656 */ 657 #define sys_port_trace_k_work_poll_submit_exit(work, timeout, ret) 658 659 /** 660 * @brief Trace work poll cancel enter 661 * @param work Work structure 662 */ 663 #define sys_port_trace_k_work_poll_cancel_enter(work) 664 665 /** 666 * @brief Trace work poll cancel exit 667 * @param work Work structure 668 * @param ret Return value 669 */ 670 #define sys_port_trace_k_work_poll_cancel_exit(work, ret) 671 672 /** @} */ /* end of subsys_tracing_apis_work_poll */ 673 674 /** 675 * @brief Poll Tracing APIs 676 * @defgroup subsys_tracing_apis_poll Poll Tracing APIs 677 * @{ 678 */ 679 680 /** 681 * @brief Trace initialisation of a Poll Event 682 * @param event Poll Event 683 */ 684 #define sys_port_trace_k_poll_api_event_init(event) 685 686 /** 687 * @brief Trace Polling call start 688 * @param events Poll Events 689 */ 690 #define sys_port_trace_k_poll_api_poll_enter(events) 691 692 /** 693 * @brief Trace Polling call outcome 694 * @param events Poll Events 695 * @param ret Return value 696 */ 697 #define sys_port_trace_k_poll_api_poll_exit(events, ret) 698 699 /** 700 * @brief Trace initialisation of a Poll Signal 701 * @param signal Poll Signal 702 */ 703 #define sys_port_trace_k_poll_api_signal_init(signal) 704 705 /** 706 * @brief Trace resetting of Poll Signal 707 * @param signal Poll Signal 708 */ 709 #define sys_port_trace_k_poll_api_signal_reset(signal) 710 711 /** 712 * @brief Trace checking of Poll Signal 713 * @param signal Poll Signal 714 */ 715 #define sys_port_trace_k_poll_api_signal_check(signal) 716 717 /** 718 * @brief Trace raising of Poll Signal 719 * @param signal Poll Signal 720 * @param ret Return value 721 */ 722 #define sys_port_trace_k_poll_api_signal_raise(signal, ret) 723 724 /** @} */ /* end of subsys_tracing_apis_poll */ 725 726 /** 727 * @brief Semaphore Tracing APIs 728 * @defgroup subsys_tracing_apis_sem Semaphore Tracing APIs 729 * @{ 730 */ 731 732 /** 733 * @brief Trace initialisation of a Semaphore 734 * @param sem Semaphore object 735 * @param ret Return value 736 */ 737 #define sys_port_trace_k_sem_init(sem, ret) 738 739 /** 740 * @brief Trace giving a Semaphore entry 741 * @param sem Semaphore object 742 */ 743 #define sys_port_trace_k_sem_give_enter(sem) 744 745 /** 746 * @brief Trace giving a Semaphore exit 747 * @param sem Semaphore object 748 */ 749 #define sys_port_trace_k_sem_give_exit(sem) 750 751 /** 752 * @brief Trace taking a Semaphore attempt start 753 * @param sem Semaphore object 754 * @param timeout Timeout period 755 */ 756 #define sys_port_trace_k_sem_take_enter(sem, timeout) 757 758 /** 759 * @brief Trace taking a Semaphore attempt blocking 760 * @param sem Semaphore object 761 * @param timeout Timeout period 762 */ 763 #define sys_port_trace_k_sem_take_blocking(sem, timeout) 764 765 /** 766 * @brief Trace taking a Semaphore attempt outcome 767 * @param sem Semaphore object 768 * @param timeout Timeout period 769 * @param ret Return value 770 */ 771 #define sys_port_trace_k_sem_take_exit(sem, timeout, ret) 772 773 /** 774 * @brief Trace resetting a Semaphore 775 * @param sem Semaphore object 776 */ 777 #define sys_port_trace_k_sem_reset(sem) 778 779 /** @} */ /* end of subsys_tracing_apis_sem */ 780 781 /** 782 * @brief Mutex Tracing APIs 783 * @defgroup subsys_tracing_apis_mutex Mutex Tracing APIs 784 * @{ 785 */ 786 787 /** 788 * @brief Trace initialization of Mutex 789 * @param mutex Mutex object 790 * @param ret Return value 791 */ 792 #define sys_port_trace_k_mutex_init(mutex, ret) 793 794 /** 795 * @brief Trace Mutex lock attempt start 796 * @param mutex Mutex object 797 * @param timeout Timeout period 798 */ 799 #define sys_port_trace_k_mutex_lock_enter(mutex, timeout) 800 801 /** 802 * @brief Trace Mutex lock attempt blocking 803 * @param mutex Mutex object 804 * @param timeout Timeout period 805 */ 806 #define sys_port_trace_k_mutex_lock_blocking(mutex, timeout) 807 808 /** 809 * @brief Trace Mutex lock attempt outcome 810 * @param mutex Mutex object 811 * @param timeout Timeout period 812 * @param ret Return value 813 */ 814 #define sys_port_trace_k_mutex_lock_exit(mutex, timeout, ret) 815 816 /** 817 * @brief Trace Mutex unlock entry 818 * @param mutex Mutex object 819 */ 820 #define sys_port_trace_k_mutex_unlock_enter(mutex) 821 822 /** 823 * @brief Trace Mutex unlock exit 824 */ 825 #define sys_port_trace_k_mutex_unlock_exit(mutex, ret) 826 827 /** @} */ /* end of subsys_tracing_apis_mutex */ 828 829 /** 830 * @brief Conditional Variable Tracing APIs 831 * @defgroup subsys_tracing_apis_condvar Conditional Variable Tracing APIs 832 * @{ 833 */ 834 835 /** 836 * @brief Trace initialization of Conditional Variable 837 * @param condvar Conditional Variable object 838 * @param ret Return value 839 */ 840 #define sys_port_trace_k_condvar_init(condvar, ret) 841 842 /** 843 * @brief Trace Conditional Variable signaling start 844 * @param condvar Conditional Variable object 845 */ 846 #define sys_port_trace_k_condvar_signal_enter(condvar) 847 848 /** 849 * @brief Trace Conditional Variable signaling blocking 850 * @param condvar Conditional Variable object 851 * @param timeout Timeout period 852 */ 853 #define sys_port_trace_k_condvar_signal_blocking(condvar, timeout) 854 855 /** 856 * @brief Trace Conditional Variable signaling outcome 857 * @param condvar Conditional Variable object 858 * @param ret Return value 859 */ 860 #define sys_port_trace_k_condvar_signal_exit(condvar, ret) 861 862 /** 863 * @brief Trace Conditional Variable broadcast enter 864 * @param condvar Conditional Variable object 865 */ 866 #define sys_port_trace_k_condvar_broadcast_enter(condvar) 867 868 /** 869 * @brief Trace Conditional Variable broadcast exit 870 * @param condvar Conditional Variable object 871 * @param ret Return value 872 */ 873 #define sys_port_trace_k_condvar_broadcast_exit(condvar, ret) 874 875 /** 876 * @brief Trace Conditional Variable wait enter 877 * @param condvar Conditional Variable object 878 */ 879 #define sys_port_trace_k_condvar_wait_enter(condvar) 880 881 /** 882 * @brief Trace Conditional Variable wait exit 883 * @param condvar Conditional Variable object 884 * @param ret Return value 885 */ 886 #define sys_port_trace_k_condvar_wait_exit(condvar, ret) 887 888 /** @} */ /* end of subsys_tracing_apis_condvar */ 889 890 /** 891 * @brief Queue Tracing APIs 892 * @defgroup subsys_tracing_apis_queue Queue Tracing APIs 893 * @{ 894 */ 895 896 /** 897 * @brief Trace initialization of Queue 898 * @param queue Queue object 899 */ 900 #define sys_port_trace_k_queue_init(queue) 901 902 /** 903 * @brief Trace Queue cancel wait 904 * @param queue Queue object 905 */ 906 #define sys_port_trace_k_queue_cancel_wait(queue) 907 908 /** 909 * @brief Trace Queue insert attempt entry 910 * @param queue Queue object 911 * @param alloc Allocation flag 912 */ 913 #define sys_port_trace_k_queue_queue_insert_enter(queue, alloc) 914 915 /** 916 * @brief Trace Queue insert attempt blocking 917 * @param queue Queue object 918 * @param alloc Allocation flag 919 * @param timeout Timeout period 920 */ 921 #define sys_port_trace_k_queue_queue_insert_blocking(queue, alloc, timeout) 922 923 /** 924 * @brief Trace Queue insert attempt outcome 925 * @param queue Queue object 926 * @param alloc Allocation flag 927 * @param ret Return value 928 */ 929 #define sys_port_trace_k_queue_queue_insert_exit(queue, alloc, ret) 930 931 /** 932 * @brief Trace Queue append enter 933 * @param queue Queue object 934 */ 935 #define sys_port_trace_k_queue_append_enter(queue) 936 937 /** 938 * @brief Trace Queue append exit 939 * @param queue Queue object 940 */ 941 #define sys_port_trace_k_queue_append_exit(queue) 942 943 /** 944 * @brief Trace Queue alloc append enter 945 * @param queue Queue object 946 */ 947 #define sys_port_trace_k_queue_alloc_append_enter(queue) 948 949 /** 950 * @brief Trace Queue alloc append exit 951 * @param queue Queue object 952 * @param ret Return value 953 */ 954 #define sys_port_trace_k_queue_alloc_append_exit(queue, ret) 955 956 /** 957 * @brief Trace Queue prepend enter 958 * @param queue Queue object 959 */ 960 #define sys_port_trace_k_queue_prepend_enter(queue) 961 962 /** 963 * @brief Trace Queue prepend exit 964 * @param queue Queue object 965 */ 966 #define sys_port_trace_k_queue_prepend_exit(queue) 967 968 /** 969 * @brief Trace Queue alloc prepend enter 970 * @param queue Queue object 971 */ 972 #define sys_port_trace_k_queue_alloc_prepend_enter(queue) 973 974 /** 975 * @brief Trace Queue alloc prepend exit 976 * @param queue Queue object 977 * @param ret Return value 978 */ 979 #define sys_port_trace_k_queue_alloc_prepend_exit(queue, ret) 980 981 /** 982 * @brief Trace Queue insert attempt entry 983 * @param queue Queue object 984 */ 985 #define sys_port_trace_k_queue_insert_enter(queue) 986 987 /** 988 * @brief Trace Queue insert attempt blocking 989 * @param queue Queue object 990 * @param timeout Timeout period 991 */ 992 #define sys_port_trace_k_queue_insert_blocking(queue, timeout) 993 994 /** 995 * @brief Trace Queue insert attempt exit 996 * @param queue Queue object 997 */ 998 #define sys_port_trace_k_queue_insert_exit(queue) 999 1000 /** 1001 * @brief Trace Queue append list enter 1002 * @param queue Queue object 1003 */ 1004 #define sys_port_trace_k_queue_append_list_enter(queue) 1005 1006 /** 1007 * @brief Trace Queue append list exit 1008 * @param queue Queue object 1009 * @param ret Return value 1010 */ 1011 #define sys_port_trace_k_queue_append_list_exit(queue, ret) 1012 1013 /** 1014 * @brief Trace Queue merge slist enter 1015 * @param queue Queue object 1016 */ 1017 #define sys_port_trace_k_queue_merge_slist_enter(queue) 1018 1019 /** 1020 * @brief Trace Queue merge slist exit 1021 * @param queue Queue object 1022 * @param ret Return value 1023 */ 1024 #define sys_port_trace_k_queue_merge_slist_exit(queue, ret) 1025 1026 /** 1027 * @brief Trace Queue get attempt enter 1028 * @param queue Queue object 1029 * @param timeout Timeout period 1030 */ 1031 #define sys_port_trace_k_queue_get_enter(queue, timeout) 1032 1033 /** 1034 * @brief Trace Queue get attempt blockings 1035 * @param queue Queue object 1036 * @param timeout Timeout period 1037 */ 1038 #define sys_port_trace_k_queue_get_blocking(queue, timeout) 1039 1040 /** 1041 * @brief Trace Queue get attempt outcome 1042 * @param queue Queue object 1043 * @param timeout Timeout period 1044 * @param ret Return value 1045 */ 1046 #define sys_port_trace_k_queue_get_exit(queue, timeout, ret) 1047 1048 /** 1049 * @brief Trace Queue remove enter 1050 * @param queue Queue object 1051 */ 1052 #define sys_port_trace_k_queue_remove_enter(queue) 1053 1054 /** 1055 * @brief Trace Queue remove exit 1056 * @param queue Queue object 1057 * @param ret Return value 1058 */ 1059 #define sys_port_trace_k_queue_remove_exit(queue, ret) 1060 1061 /** 1062 * @brief Trace Queue unique append enter 1063 * @param queue Queue object 1064 */ 1065 #define sys_port_trace_k_queue_unique_append_enter(queue) 1066 1067 /** 1068 * @brief Trace Queue unique append exit 1069 * @param queue Queue object 1070 * 1071 * @param ret Return value 1072 */ 1073 #define sys_port_trace_k_queue_unique_append_exit(queue, ret) 1074 1075 /** 1076 * @brief Trace Queue peek head 1077 * @param queue Queue object 1078 * @param ret Return value 1079 */ 1080 #define sys_port_trace_k_queue_peek_head(queue, ret) 1081 1082 /** 1083 * @brief Trace Queue peek tail 1084 * @param queue Queue object 1085 * @param ret Return value 1086 */ 1087 #define sys_port_trace_k_queue_peek_tail(queue, ret) 1088 1089 /** @} */ /* end of subsys_tracing_apis_queue */ 1090 1091 /** 1092 * @brief FIFO Tracing APIs 1093 * @defgroup subsys_tracing_apis_fifo FIFO Tracing APIs 1094 * @{ 1095 */ 1096 1097 /** 1098 * @brief Trace initialization of FIFO Queue entry 1099 * @param fifo FIFO object 1100 */ 1101 #define sys_port_trace_k_fifo_init_enter(fifo) 1102 1103 /** 1104 * @brief Trace initialization of FIFO Queue exit 1105 * @param fifo FIFO object 1106 */ 1107 #define sys_port_trace_k_fifo_init_exit(fifo) 1108 1109 /** 1110 * @brief Trace FIFO Queue cancel wait entry 1111 * @param fifo FIFO object 1112 */ 1113 #define sys_port_trace_k_fifo_cancel_wait_enter(fifo) 1114 1115 /** 1116 * @brief Trace FIFO Queue cancel wait exit 1117 * @param fifo FIFO object 1118 */ 1119 #define sys_port_trace_k_fifo_cancel_wait_exit(fifo) 1120 1121 /** 1122 * @brief Trace FIFO Queue put entry 1123 * @param fifo FIFO object 1124 * @param data Data item 1125 */ 1126 #define sys_port_trace_k_fifo_put_enter(fifo, data) 1127 1128 /** 1129 * @brief Trace FIFO Queue put exit 1130 * @param fifo FIFO object 1131 * @param data Data item 1132 */ 1133 #define sys_port_trace_k_fifo_put_exit(fifo, data) 1134 1135 /** 1136 * @brief Trace FIFO Queue alloc put entry 1137 * @param fifo FIFO object 1138 * @param data Data item 1139 */ 1140 #define sys_port_trace_k_fifo_alloc_put_enter(fifo, data) 1141 1142 /** 1143 * @brief Trace FIFO Queue alloc put exit 1144 * @param fifo FIFO object 1145 * @param data Data item 1146 * @param ret Return value 1147 */ 1148 #define sys_port_trace_k_fifo_alloc_put_exit(fifo, data, ret) 1149 1150 /** 1151 * @brief Trace FIFO Queue put list entry 1152 * @param fifo FIFO object 1153 * @param head First ll-node 1154 * @param tail Last ll-node 1155 */ 1156 #define sys_port_trace_k_fifo_put_list_enter(fifo, head, tail) 1157 1158 /** 1159 * @brief Trace FIFO Queue put list exit 1160 * @param fifo FIFO object 1161 * @param head First ll-node 1162 * @param tail Last ll-node 1163 */ 1164 #define sys_port_trace_k_fifo_put_list_exit(fifo, head, tail) 1165 1166 /** 1167 * @brief Trace FIFO Queue put slist entry 1168 * @param fifo FIFO object 1169 * @param list Syslist object 1170 */ 1171 #define sys_port_trace_k_fifo_alloc_put_slist_enter(fifo, list) 1172 1173 /** 1174 * @brief Trace FIFO Queue put slist exit 1175 * @param fifo FIFO object 1176 * @param list Syslist object 1177 */ 1178 #define sys_port_trace_k_fifo_alloc_put_slist_exit(fifo, list) 1179 1180 /** 1181 * @brief Trace FIFO Queue get entry 1182 * @param fifo FIFO object 1183 * @param timeout Timeout period 1184 */ 1185 #define sys_port_trace_k_fifo_get_enter(fifo, timeout) 1186 1187 /** 1188 * @brief Trace FIFO Queue get exit 1189 * @param fifo FIFO object 1190 * @param timeout Timeout period 1191 * @param ret Return value 1192 */ 1193 #define sys_port_trace_k_fifo_get_exit(fifo, timeout, ret) 1194 1195 /** 1196 * @brief Trace FIFO Queue peek head entry 1197 * @param fifo FIFO object 1198 */ 1199 #define sys_port_trace_k_fifo_peek_head_enter(fifo) 1200 1201 /** 1202 * @brief Trace FIFO Queue peek head exit 1203 * @param fifo FIFO object 1204 * @param ret Return value 1205 */ 1206 #define sys_port_trace_k_fifo_peek_head_exit(fifo, ret) 1207 1208 /** 1209 * @brief Trace FIFO Queue peek tail entry 1210 * @param fifo FIFO object 1211 */ 1212 #define sys_port_trace_k_fifo_peek_tail_enter(fifo) 1213 1214 /** 1215 * @brief Trace FIFO Queue peek tail exit 1216 * @param fifo FIFO object 1217 * @param ret Return value 1218 */ 1219 #define sys_port_trace_k_fifo_peek_tail_exit(fifo, ret) 1220 1221 /** @} */ /* end of subsys_tracing_apis_fifo */ 1222 1223 /** 1224 * @brief LIFO Tracing APIs 1225 * @defgroup subsys_tracing_apis_lifo LIFO Tracing APIs 1226 * @{ 1227 */ 1228 1229 /** 1230 * @brief Trace initialization of LIFO Queue entry 1231 * @param lifo LIFO object 1232 */ 1233 #define sys_port_trace_k_lifo_init_enter(lifo) 1234 1235 /** 1236 * @brief Trace initialization of LIFO Queue exit 1237 * @param lifo LIFO object 1238 */ 1239 #define sys_port_trace_k_lifo_init_exit(lifo) 1240 1241 /** 1242 * @brief Trace LIFO Queue put entry 1243 * @param lifo LIFO object 1244 * @param data Data item 1245 */ 1246 #define sys_port_trace_k_lifo_put_enter(lifo, data) 1247 1248 /** 1249 * @brief Trace LIFO Queue put exit 1250 * @param lifo LIFO object 1251 * @param data Data item 1252 */ 1253 #define sys_port_trace_k_lifo_put_exit(lifo, data) 1254 1255 /** 1256 * @brief Trace LIFO Queue alloc put entry 1257 * @param lifo LIFO object 1258 * @param data Data item 1259 */ 1260 #define sys_port_trace_k_lifo_alloc_put_enter(lifo, data) 1261 1262 /** 1263 * @brief Trace LIFO Queue alloc put exit 1264 * @param lifo LIFO object 1265 * @param data Data item 1266 * @param ret Return value 1267 */ 1268 #define sys_port_trace_k_lifo_alloc_put_exit(lifo, data, ret) 1269 1270 /** 1271 * @brief Trace LIFO Queue get entry 1272 * @param lifo LIFO object 1273 * @param timeout Timeout period 1274 */ 1275 #define sys_port_trace_k_lifo_get_enter(lifo, timeout) 1276 1277 /** 1278 * @brief Trace LIFO Queue get exit 1279 * @param lifo LIFO object 1280 * @param timeout Timeout period 1281 * @param ret Return value 1282 */ 1283 #define sys_port_trace_k_lifo_get_exit(lifo, timeout, ret) 1284 1285 /** @} */ /* end of subsys_tracing_apis_lifo */ 1286 1287 /** 1288 * @brief Stack Tracing APIs 1289 * @defgroup subsys_tracing_apis_stack Stack Tracing APIs 1290 * @{ 1291 */ 1292 1293 /** 1294 * @brief Trace initialization of Stack 1295 * @param stack Stack object 1296 */ 1297 #define sys_port_trace_k_stack_init(stack) 1298 1299 /** 1300 * @brief Trace Stack alloc init attempt entry 1301 * @param stack Stack object 1302 */ 1303 #define sys_port_trace_k_stack_alloc_init_enter(stack) 1304 1305 /** 1306 * @brief Trace Stack alloc init outcome 1307 * @param stack Stack object 1308 * @param ret Return value 1309 */ 1310 #define sys_port_trace_k_stack_alloc_init_exit(stack, ret) 1311 1312 /** 1313 * @brief Trace Stack cleanup attempt entry 1314 * @param stack Stack object 1315 */ 1316 #define sys_port_trace_k_stack_cleanup_enter(stack) 1317 1318 /** 1319 * @brief Trace Stack cleanup outcome 1320 * @param stack Stack object 1321 * @param ret Return value 1322 */ 1323 #define sys_port_trace_k_stack_cleanup_exit(stack, ret) 1324 1325 /** 1326 * @brief Trace Stack push attempt entry 1327 * @param stack Stack object 1328 */ 1329 #define sys_port_trace_k_stack_push_enter(stack) 1330 1331 /** 1332 * @brief Trace Stack push attempt outcome 1333 * @param stack Stack object 1334 * @param ret Return value 1335 */ 1336 #define sys_port_trace_k_stack_push_exit(stack, ret) 1337 1338 /** 1339 * @brief Trace Stack pop attempt entry 1340 * @param stack Stack object 1341 * @param timeout Timeout period 1342 */ 1343 #define sys_port_trace_k_stack_pop_enter(stack, timeout) 1344 1345 /** 1346 * @brief Trace Stack pop attempt blocking 1347 * @param stack Stack object 1348 * @param timeout Timeout period 1349 */ 1350 #define sys_port_trace_k_stack_pop_blocking(stack, timeout) 1351 1352 /** 1353 * @brief Trace Stack pop attempt outcome 1354 * @param stack Stack object 1355 * @param timeout Timeout period 1356 * @param ret Return value 1357 */ 1358 #define sys_port_trace_k_stack_pop_exit(stack, timeout, ret) 1359 1360 /** @} */ /* end of subsys_tracing_apis_stack */ 1361 1362 /** 1363 * @brief Message Queue Tracing APIs 1364 * @defgroup subsys_tracing_apis_msgq Message Queue Tracing APIs 1365 * @{ 1366 */ 1367 1368 /** 1369 * @brief Trace initialization of Message Queue 1370 * @param msgq Message Queue object 1371 */ 1372 #define sys_port_trace_k_msgq_init(msgq) 1373 1374 /** 1375 * @brief Trace Message Queue alloc init attempt entry 1376 * @param msgq Message Queue object 1377 */ 1378 #define sys_port_trace_k_msgq_alloc_init_enter(msgq) 1379 1380 /** 1381 * @brief Trace Message Queue alloc init attempt outcome 1382 * @param msgq Message Queue object 1383 * @param ret Return value 1384 */ 1385 #define sys_port_trace_k_msgq_alloc_init_exit(msgq, ret) 1386 1387 /** 1388 * @brief Trace Message Queue cleanup attempt entry 1389 * @param msgq Message Queue object 1390 */ 1391 #define sys_port_trace_k_msgq_cleanup_enter(msgq) 1392 1393 /** 1394 * @brief Trace Message Queue cleanup attempt outcome 1395 * @param msgq Message Queue object 1396 * @param ret Return value 1397 */ 1398 #define sys_port_trace_k_msgq_cleanup_exit(msgq, ret) 1399 1400 /** 1401 * @brief Trace Message Queue put attempt entry 1402 * @param msgq Message Queue object 1403 * @param timeout Timeout period 1404 */ 1405 #define sys_port_trace_k_msgq_put_enter(msgq, timeout) 1406 1407 /** 1408 * @brief Trace Message Queue put attempt blocking 1409 * @param msgq Message Queue object 1410 * @param timeout Timeout period 1411 */ 1412 #define sys_port_trace_k_msgq_put_blocking(msgq, timeout) 1413 1414 /** 1415 * @brief Trace Message Queue put attempt outcome 1416 * @param msgq Message Queue object 1417 * @param timeout Timeout period 1418 * @param ret Return value 1419 */ 1420 #define sys_port_trace_k_msgq_put_exit(msgq, timeout, ret) 1421 1422 /** 1423 * @brief Trace Message Queue get attempt entry 1424 * @param msgq Message Queue object 1425 * @param timeout Timeout period 1426 */ 1427 #define sys_port_trace_k_msgq_get_enter(msgq, timeout) 1428 1429 /** 1430 * @brief Trace Message Queue get attempt blockings 1431 * @param msgq Message Queue object 1432 * @param timeout Timeout period 1433 */ 1434 #define sys_port_trace_k_msgq_get_blocking(msgq, timeout) 1435 1436 /** 1437 * @brief Trace Message Queue get attempt outcome 1438 * @param msgq Message Queue object 1439 * @param timeout Timeout period 1440 * @param ret Return value 1441 */ 1442 #define sys_port_trace_k_msgq_get_exit(msgq, timeout, ret) 1443 1444 /** 1445 * @brief Trace Message Queue peek 1446 * @param msgq Message Queue object 1447 * @param ret Return value 1448 */ 1449 #define sys_port_trace_k_msgq_peek(msgq, ret) 1450 1451 /** 1452 * @brief Trace Message Queue purge 1453 * @param msgq Message Queue object 1454 */ 1455 #define sys_port_trace_k_msgq_purge(msgq) 1456 1457 /** @} */ /* end of subsys_tracing_apis_msgq */ 1458 1459 /** 1460 * @brief Mailbox Tracing APIs 1461 * @defgroup subsys_tracing_apis_mbox Mailbox Tracing APIs 1462 * @{ 1463 */ 1464 1465 /** 1466 * @brief Trace initialization of Mailbox 1467 * @param mbox Mailbox object 1468 */ 1469 #define sys_port_trace_k_mbox_init(mbox) 1470 1471 /** 1472 * @brief Trace Mailbox message put attempt entry 1473 * @param mbox Mailbox object 1474 * @param timeout Timeout period 1475 */ 1476 #define sys_port_trace_k_mbox_message_put_enter(mbox, timeout) 1477 1478 /** 1479 * @brief Trace Mailbox message put attempt blocking 1480 * @param mbox Mailbox object 1481 * @param timeout Timeout period 1482 */ 1483 #define sys_port_trace_k_mbox_message_put_blocking(mbox, timeout) 1484 1485 /** 1486 * @brief Trace Mailbox message put attempt outcome 1487 * @param mbox Mailbox object 1488 * @param timeout Timeout period 1489 * @param ret Return value 1490 */ 1491 #define sys_port_trace_k_mbox_message_put_exit(mbox, timeout, ret) 1492 1493 /** 1494 * @brief Trace Mailbox put attempt entry 1495 * @param mbox Mailbox object 1496 * @param timeout Timeout period 1497 */ 1498 #define sys_port_trace_k_mbox_put_enter(mbox, timeout) 1499 1500 /** 1501 * @brief Trace Mailbox put attempt blocking 1502 * @param mbox Mailbox object 1503 * @param timeout Timeout period 1504 * @param ret Return value 1505 */ 1506 #define sys_port_trace_k_mbox_put_exit(mbox, timeout, ret) 1507 1508 /** 1509 * @brief Trace Mailbox async put entry 1510 * @param mbox Mailbox object 1511 * @param sem Semaphore object 1512 */ 1513 #define sys_port_trace_k_mbox_async_put_enter(mbox, sem) 1514 1515 /** 1516 * @brief Trace Mailbox async put exit 1517 * @param mbox Mailbox object 1518 * @param sem Semaphore object 1519 */ 1520 #define sys_port_trace_k_mbox_async_put_exit(mbox, sem) 1521 1522 /** 1523 * @brief Trace Mailbox get attempt entry 1524 * @param mbox Mailbox entry 1525 * @param timeout Timeout period 1526 */ 1527 #define sys_port_trace_k_mbox_get_enter(mbox, timeout) 1528 1529 /** 1530 * @brief Trace Mailbox get attempt blocking 1531 * @param mbox Mailbox entry 1532 * @param timeout Timeout period 1533 */ 1534 #define sys_port_trace_k_mbox_get_blocking(mbox, timeout) 1535 1536 /** 1537 * @brief Trace Mailbox get attempt outcome 1538 * @param mbox Mailbox entry 1539 * @param timeout Timeout period 1540 * @param ret Return value 1541 */ 1542 #define sys_port_trace_k_mbox_get_exit(mbox, timeout, ret) 1543 1544 /** 1545 * @brief Trace Mailbox data get 1546 * @brief rx_msg Receive Message object 1547 */ 1548 #define sys_port_trace_k_mbox_data_get(rx_msg) 1549 1550 /** @} */ /* end of subsys_tracing_apis_mbox */ 1551 1552 /** 1553 * @brief Pipe Tracing APIs 1554 * @defgroup subsys_tracing_apis_pipe Pipe Tracing APIs 1555 * @{ 1556 */ 1557 1558 /** 1559 * @brief Trace initialization of Pipe 1560 * @param pipe Pipe object 1561 */ 1562 #define sys_port_trace_k_pipe_init(pipe) 1563 1564 /** 1565 * @brief Trace Pipe cleanup entry 1566 * @param pipe Pipe object 1567 */ 1568 #define sys_port_trace_k_pipe_cleanup_enter(pipe) 1569 1570 /** 1571 * @brief Trace Pipe cleanup exit 1572 * @param pipe Pipe object 1573 * @param ret Return value 1574 */ 1575 #define sys_port_trace_k_pipe_cleanup_exit(pipe, ret) 1576 1577 /** 1578 * @brief Trace Pipe alloc init entry 1579 * @param pipe Pipe object 1580 */ 1581 #define sys_port_trace_k_pipe_alloc_init_enter(pipe) 1582 1583 /** 1584 * @brief Trace Pipe alloc init exit 1585 * @param pipe Pipe object 1586 * @param ret Return value 1587 */ 1588 #define sys_port_trace_k_pipe_alloc_init_exit(pipe, ret) 1589 1590 /** 1591 * @brief Trace Pipe flush entry 1592 * @param pipe Pipe object 1593 */ 1594 #define sys_port_trace_k_pipe_flush_enter(pipe) 1595 1596 /** 1597 * @brief Trace Pipe flush exit 1598 * @param pipe Pipe object 1599 */ 1600 #define sys_port_trace_k_pipe_flush_exit(pipe) 1601 1602 /** 1603 * @brief Trace Pipe buffer flush entry 1604 * @param pipe Pipe object 1605 */ 1606 #define sys_port_trace_k_pipe_buffer_flush_enter(pipe) 1607 1608 /** 1609 * @brief Trace Pipe buffer flush exit 1610 * @param pipe Pipe object 1611 */ 1612 #define sys_port_trace_k_pipe_buffer_flush_exit(pipe) 1613 1614 /** 1615 * @brief Trace Pipe put attempt entry 1616 * @param pipe Pipe object 1617 * @param timeout Timeout period 1618 */ 1619 #define sys_port_trace_k_pipe_put_enter(pipe, timeout) 1620 1621 /** 1622 * @brief Trace Pipe put attempt blocking 1623 * @param pipe Pipe object 1624 * @param timeout Timeout period 1625 */ 1626 #define sys_port_trace_k_pipe_put_blocking(pipe, timeout) 1627 1628 /** 1629 * @brief Trace Pipe put attempt outcome 1630 * @param pipe Pipe object 1631 * @param timeout Timeout period 1632 * @param ret Return value 1633 */ 1634 #define sys_port_trace_k_pipe_put_exit(pipe, timeout, ret) 1635 1636 /** 1637 * @brief Trace Pipe get attempt entry 1638 * @param pipe Pipe object 1639 * @param timeout Timeout period 1640 */ 1641 #define sys_port_trace_k_pipe_get_enter(pipe, timeout) 1642 1643 /** 1644 * @brief Trace Pipe get attempt blocking 1645 * @param pipe Pipe object 1646 * @param timeout Timeout period 1647 */ 1648 #define sys_port_trace_k_pipe_get_blocking(pipe, timeout) 1649 1650 /** 1651 * @brief Trace Pipe get attempt outcome 1652 * @param pipe Pipe object 1653 * @param timeout Timeout period 1654 * @param ret Return value 1655 */ 1656 #define sys_port_trace_k_pipe_get_exit(pipe, timeout, ret) 1657 1658 /** @} */ /* end of subsys_tracing_apis_pipe */ 1659 1660 /** 1661 * @brief Heap Tracing APIs 1662 * @defgroup subsys_tracing_apis_heap Heap Tracing APIs 1663 * @{ 1664 */ 1665 1666 /** 1667 * @brief Trace initialization of Heap 1668 * @param h Heap object 1669 */ 1670 #define sys_port_trace_k_heap_init(h) 1671 1672 /** 1673 * @brief Trace Heap aligned alloc attempt entry 1674 * @param h Heap object 1675 * @param timeout Timeout period 1676 */ 1677 #define sys_port_trace_k_heap_aligned_alloc_enter(h, timeout) 1678 1679 /** 1680 * @brief Trace Heap align alloc attempt blocking 1681 * @param h Heap object 1682 * @param timeout Timeout period 1683 */ 1684 #define sys_port_trace_k_heap_aligned_alloc_blocking(h, timeout) 1685 1686 /** 1687 * @brief Trace Heap align alloc attempt outcome 1688 * @param h Heap object 1689 * @param timeout Timeout period 1690 * @param ret Return value 1691 */ 1692 #define sys_port_trace_k_heap_aligned_alloc_exit(h, timeout, ret) 1693 1694 /** 1695 * @brief Trace Heap alloc enter 1696 * @param h Heap object 1697 * @param timeout Timeout period 1698 */ 1699 #define sys_port_trace_k_heap_alloc_enter(h, timeout) 1700 1701 /** 1702 * @brief Trace Heap alloc exit 1703 * @param h Heap object 1704 * @param timeout Timeout period 1705 * @param ret Return value 1706 */ 1707 #define sys_port_trace_k_heap_alloc_exit(h, timeout, ret) 1708 1709 /** 1710 * @brief Trace Heap calloc enter 1711 * @param h Heap object 1712 * @param timeout Timeout period 1713 */ 1714 #define sys_port_trace_k_heap_calloc_enter(h, timeout) 1715 1716 /** 1717 * @brief Trace Heap calloc exit 1718 * @param h Heap object 1719 * @param timeout Timeout period 1720 * @param ret Return value 1721 */ 1722 #define sys_port_trace_k_heap_calloc_exit(h, timeout, ret) 1723 1724 /** 1725 * @brief Trace Heap free 1726 * @param h Heap object 1727 */ 1728 #define sys_port_trace_k_heap_free(h) 1729 1730 /** 1731 * @brief Trace Heap realloc enter 1732 * @param h Heap object 1733 * @param ptr Pointer to reallocate 1734 * @param bytes Bytes to reallocate 1735 * @param timeout Timeout period 1736 */ 1737 #define sys_port_trace_k_heap_realloc_enter(h, ptr, bytes, timeout) 1738 1739 /** 1740 * @brief Trace Heap realloc exit 1741 * @param h Heap object 1742 * @param ptr Pointer to reallocate 1743 * @param bytes Bytes to reallocate 1744 * @param timeout Timeout period 1745 * @param ret Return value 1746 */ 1747 #define sys_port_trace_k_heap_realloc_exit(h, ptr, bytes, timeout, ret) 1748 1749 /** 1750 * @brief Trace System Heap aligned alloc enter 1751 * @param heap Heap object 1752 */ 1753 #define sys_port_trace_k_heap_sys_k_aligned_alloc_enter(heap) 1754 1755 /** 1756 * @brief Trace System Heap aligned alloc exit 1757 * @param heap Heap object 1758 * @param ret Return value 1759 */ 1760 #define sys_port_trace_k_heap_sys_k_aligned_alloc_exit(heap, ret) 1761 1762 /** 1763 * @brief Trace System Heap aligned alloc enter 1764 * @param heap Heap object 1765 */ 1766 #define sys_port_trace_k_heap_sys_k_malloc_enter(heap) 1767 1768 /** 1769 * @brief Trace System Heap aligned alloc exit 1770 * @param heap Heap object 1771 * @param ret Return value 1772 */ 1773 #define sys_port_trace_k_heap_sys_k_malloc_exit(heap, ret) 1774 1775 /** 1776 * @brief Trace System Heap free entry 1777 * @param heap Heap object 1778 * @param heap_ref Heap reference 1779 */ 1780 #define sys_port_trace_k_heap_sys_k_free_enter(heap, heap_ref) 1781 1782 /** 1783 * @brief Trace System Heap free exit 1784 * @param heap Heap object 1785 * @param heap_ref Heap reference 1786 */ 1787 #define sys_port_trace_k_heap_sys_k_free_exit(heap, heap_ref) 1788 1789 /** 1790 * @brief Trace System heap calloc enter 1791 * @param heap 1792 */ 1793 #define sys_port_trace_k_heap_sys_k_calloc_enter(heap) 1794 1795 /** 1796 * @brief Trace System heap calloc exit 1797 * @param heap Heap object 1798 * @param ret Return value 1799 */ 1800 #define sys_port_trace_k_heap_sys_k_calloc_exit(heap, ret) 1801 1802 /** 1803 * @brief Trace System heap realloc enter 1804 * @param heap 1805 * @param ptr 1806 */ 1807 #define sys_port_trace_k_heap_sys_k_realloc_enter(heap, ptr) 1808 1809 /** 1810 * @brief Trace System heap realloc exit 1811 * @param heap Heap object 1812 * @param ptr Memory pointer 1813 * @param ret Return value 1814 */ 1815 #define sys_port_trace_k_heap_sys_k_realloc_exit(heap, ptr, ret) 1816 1817 /** @} */ /* end of subsys_tracing_apis_heap */ 1818 1819 /** 1820 * @brief Memory Slab Tracing APIs 1821 * @defgroup subsys_tracing_apis_mslab Memory Slab Tracing APIs 1822 * @{ 1823 */ 1824 1825 /** 1826 * @brief Trace initialization of Memory Slab 1827 * @param slab Memory Slab object 1828 * @param rc Return value 1829 */ 1830 #define sys_port_trace_k_mem_slab_init(slab, rc) 1831 1832 /** 1833 * @brief Trace Memory Slab alloc attempt entry 1834 * @param slab Memory Slab object 1835 * @param timeout Timeout period 1836 */ 1837 #define sys_port_trace_k_mem_slab_alloc_enter(slab, timeout) 1838 1839 /** 1840 * @brief Trace Memory Slab alloc attempt blocking 1841 * @param slab Memory Slab object 1842 * @param timeout Timeout period 1843 */ 1844 #define sys_port_trace_k_mem_slab_alloc_blocking(slab, timeout) 1845 1846 /** 1847 * @brief Trace Memory Slab alloc attempt outcome 1848 * @param slab Memory Slab object 1849 * @param timeout Timeout period 1850 * @param ret Return value 1851 */ 1852 #define sys_port_trace_k_mem_slab_alloc_exit(slab, timeout, ret) 1853 1854 /** 1855 * @brief Trace Memory Slab free entry 1856 * @param slab Memory Slab object 1857 */ 1858 #define sys_port_trace_k_mem_slab_free_enter(slab) 1859 1860 /** 1861 * @brief Trace Memory Slab free exit 1862 * @param slab Memory Slab object 1863 */ 1864 #define sys_port_trace_k_mem_slab_free_exit(slab) 1865 1866 /** @} */ /* end of subsys_tracing_apis_mslab */ 1867 1868 /** 1869 * @brief Timer Tracing APIs 1870 * @defgroup subsys_tracing_apis_timer Timer Tracing APIs 1871 * @{ 1872 */ 1873 1874 /** 1875 * @brief Trace initialization of Timer 1876 * @param timer Timer object 1877 */ 1878 #define sys_port_trace_k_timer_init(timer) 1879 1880 /** 1881 * @brief Trace Timer start 1882 * @param timer Timer object 1883 * @param duration Timer duration 1884 * @param period Timer period 1885 */ 1886 #define sys_port_trace_k_timer_start(timer, duration, period) 1887 1888 /** 1889 * @brief Trace Timer stop 1890 * @param timer Timer object 1891 */ 1892 #define sys_port_trace_k_timer_stop(timer) 1893 1894 /** 1895 * @brief Trace Timer status sync entry 1896 * @param timer Timer object 1897 */ 1898 #define sys_port_trace_k_timer_status_sync_enter(timer) 1899 1900 /** 1901 * @brief Trace Timer Status sync blocking 1902 * @param timer Timer object 1903 * @param timeout Timeout period 1904 */ 1905 #define sys_port_trace_k_timer_status_sync_blocking(timer, timeout) 1906 1907 /** 1908 * @brief Trace Time Status sync outcome 1909 * @param timer Timer object 1910 * @param result Return value 1911 */ 1912 #define sys_port_trace_k_timer_status_sync_exit(timer, result) 1913 1914 /** @} */ /* end of subsys_tracing_apis_timer */ 1915 1916 /** 1917 * @brief Event Tracing APIs 1918 * @defgroup subsys_tracing_apis_event Event Tracing APIs 1919 * @{ 1920 */ 1921 1922 /** 1923 * @brief Trace initialisation of an Event 1924 * @param event Event object 1925 */ 1926 #define sys_port_trace_k_event_init(event) 1927 1928 /** 1929 * @brief Trace posting of an Event call entry 1930 * @param event Event object 1931 * @param events Set of posted events 1932 * @param events_mask Mask to apply against posted events 1933 */ 1934 #define sys_port_trace_k_event_post_enter(event, events, events_mask) 1935 1936 /** 1937 * @brief Trace posting of an Event call exit 1938 * @param event Event object 1939 * @param events Set of posted events 1940 * @param events_mask Mask to apply against posted events 1941 */ 1942 #define sys_port_trace_k_event_post_exit(event, events, events_mask) 1943 1944 /** 1945 * @brief Trace waiting of an Event call entry 1946 * @param event Event object 1947 * @param events Set of events for which to wait 1948 * @param options Event wait options 1949 * @param timeout Timeout period 1950 */ 1951 #define sys_port_trace_k_event_wait_enter(event, events, options, timeout) 1952 1953 /** 1954 * @brief Trace waiting of an Event call exit 1955 * @param event Event object 1956 * @param events Set of events for which to wait 1957 * @param options Event wait options 1958 * @param timeout Timeout period 1959 */ 1960 #define sys_port_trace_k_event_wait_blocking(event, events, options, timeout) 1961 1962 /** 1963 * @brief Trace waiting of an Event call exit 1964 * @param event Event object 1965 * @param events Set of events for which to wait 1966 * @param ret Set of received events 1967 */ 1968 #define sys_port_trace_k_event_wait_exit(event, events, ret) 1969 1970 /** @} */ /* end of subsys_tracing_apis_event */ 1971 1972 /** 1973 * @brief System PM Tracing APIs 1974 * @defgroup subsys_tracing_apis_pm_system System PM Tracing APIs 1975 * @{ 1976 */ 1977 1978 /** 1979 * @brief Trace system suspend call entry. 1980 * @param ticks Ticks. 1981 */ 1982 #define sys_port_trace_pm_system_suspend_enter(ticks) 1983 1984 /** 1985 * @brief Trace system suspend call exit. 1986 * @param ticks Ticks. 1987 * @param state PM state. 1988 */ 1989 #define sys_port_trace_pm_system_suspend_exit(ticks, state) 1990 1991 /** @} */ /* end of subsys_tracing_apis_pm_system */ 1992 1993 /** 1994 * @brief PM Device Runtime Tracing APIs 1995 * @defgroup subsys_tracing_apis_pm_device_runtime PM Device Runtime Tracing APIs 1996 * @{ 1997 */ 1998 1999 /** 2000 * @brief Trace getting a device call entry. 2001 * @param dev Device instance. 2002 */ 2003 #define sys_port_trace_pm_device_runtime_get_enter(dev) 2004 2005 /** 2006 * @brief Trace getting a device call exit. 2007 * @param dev Device instance. 2008 * @param ret Return value. 2009 */ 2010 #define sys_port_trace_pm_device_runtime_get_exit(dev, ret) 2011 2012 /** 2013 * @brief Trace putting a device call entry. 2014 * @param dev Device instance. 2015 */ 2016 #define sys_port_trace_pm_device_runtime_put_enter(dev) 2017 2018 /** 2019 * @brief Trace putting a device call exit. 2020 * @param dev Device instance. 2021 * @param ret Return value. 2022 */ 2023 #define sys_port_trace_pm_device_runtime_put_exit(dev, ret) 2024 2025 /** 2026 * @brief Trace putting a device (asynchronously) call entry. 2027 * @param dev Device instance. 2028 * @param delay Time to delay the operation 2029 */ 2030 #define sys_port_trace_pm_device_runtime_put_async_enter(dev, delay) 2031 2032 /** 2033 * @brief Trace putting a device (asynchronously) call exit. 2034 * @param dev Device instance. 2035 * @param delay Time to delay the operation. 2036 * @param ret Return value. 2037 */ 2038 #define sys_port_trace_pm_device_runtime_put_async_exit(dev, delay, ret) 2039 2040 /** 2041 * @brief Trace enabling device runtime PM call entry. 2042 * @param dev Device instance. 2043 */ 2044 #define sys_port_trace_pm_device_runtime_enable_enter(dev) 2045 2046 /** 2047 * @brief Trace enabling device runtime PM call exit. 2048 * @param dev Device instance. 2049 * @param ret Return value. 2050 */ 2051 #define sys_port_trace_pm_device_runtime_enable_exit(dev, ret) 2052 2053 /** 2054 * @brief Trace disabling device runtime PM call entry. 2055 * @param dev Device instance. 2056 */ 2057 #define sys_port_trace_pm_device_runtime_disable_enter(dev) 2058 2059 /** 2060 * @brief Trace disabling device runtime PM call exit. 2061 * @param dev Device instance. 2062 * @param ret Return value. 2063 */ 2064 #define sys_port_trace_pm_device_runtime_disable_exit(dev, ret) 2065 2066 /** @} */ /* end of subsys_tracing_apis_pm_device_runtime */ 2067 2068 /** 2069 * @brief Network Core Tracing APIs 2070 * @defgroup subsys_tracing_apis_net Network Core Tracing APIs 2071 * @{ 2072 */ 2073 2074 /** 2075 * @brief Trace network data receive 2076 * @param iface Network interface 2077 * @param pkt Received network packet 2078 */ 2079 #define sys_port_trace_net_recv_data_enter(iface, pkt) 2080 2081 /** 2082 * @brief Trace network data receive attempt 2083 * @param iface Network interface 2084 * @param pkt Received network packet 2085 * @param ret Return value 2086 */ 2087 #define sys_port_trace_net_recv_data_exit(iface, pkt, ret) 2088 2089 /** 2090 * @brief Trace network data send 2091 * @param pkt Network packet to send 2092 */ 2093 #define sys_port_trace_net_send_data_enter(pkt) 2094 2095 /** 2096 * @brief Trace network data send attempt 2097 * @param pkt Received network packet 2098 * @param ret Return value 2099 */ 2100 #define sys_port_trace_net_send_data_exit(pkt, ret) 2101 2102 /** 2103 * @brief Trace network data receive time 2104 * @param pkt Received network packet 2105 * @param end_time When the RX processing stopped for this pkt (in ticks) 2106 */ 2107 #define sys_port_trace_net_rx_time(pkt, end_time) 2108 2109 /** 2110 * @brief Trace network data sent time 2111 * @param pkt Sent network packet 2112 * @param end_time When the TX processing stopped for this pkt (in ticks) 2113 */ 2114 #define sys_port_trace_net_tx_time(pkt, end_time) 2115 2116 /** @} */ /* end of subsys_tracing_apis_net */ 2117 2118 /** 2119 * @brief Network Socket Tracing APIs 2120 * @defgroup subsys_tracing_apis_socket Network Socket Tracing APIs 2121 * @{ 2122 */ 2123 2124 /** 2125 * @brief Trace init of network sockets 2126 * @param socket Network socket is returned 2127 * @param family Socket address family 2128 * @param type Socket type 2129 * @param proto Socket protocol 2130 */ 2131 #define sys_port_trace_socket_init(socket, family, type, proto) 2132 2133 /** 2134 * @brief Trace close of network sockets 2135 * @param socket Socket object 2136 */ 2137 #define sys_port_trace_socket_close_enter(socket) 2138 2139 /** 2140 * @brief Trace network socket close attempt 2141 * @param socket Socket object 2142 * @param ret Return value 2143 */ 2144 #define sys_port_trace_socket_close_exit(socket, ret) 2145 2146 /** 2147 * @brief Trace shutdown of network sockets 2148 * @param socket Socket object 2149 * @param how Socket shutdown type 2150 */ 2151 #define sys_port_trace_socket_shutdown_enter(socket, how) 2152 2153 /** 2154 * @brief Trace network socket shutdown attempt 2155 * @param socket Socket object 2156 * @param ret Return value 2157 */ 2158 #define sys_port_trace_socket_shutdown_exit(socket, ret) 2159 2160 /** 2161 * @brief Trace bind of network sockets 2162 * @param socket Socket object 2163 * @param addr Network address to bind 2164 * @param addrlen Address length 2165 */ 2166 #define sys_port_trace_socket_bind_enter(socket, addr, addrlen) 2167 2168 /** 2169 * @brief Trace network socket bind attempt 2170 * @param socket Socket object 2171 * @param ret Return value 2172 */ 2173 #define sys_port_trace_socket_bind_exit(socket, ret) 2174 2175 /** 2176 * @brief Trace connect of network sockets 2177 * @param socket Socket object 2178 * @param addr Network address to bind 2179 * @param addrlen Address length 2180 */ 2181 #define sys_port_trace_socket_connect_enter(socket, addr, addrlen) 2182 2183 /** 2184 * @brief Trace network socket connect attempt 2185 * @param socket Socket object 2186 * @param ret Return value 2187 */ 2188 #define sys_port_trace_socket_connect_exit(socket, ret) 2189 2190 /** 2191 * @brief Trace listen of network sockets 2192 * @param socket Socket object 2193 * @param backlog Socket backlog length 2194 */ 2195 #define sys_port_trace_socket_listen_enter(socket, backlog) 2196 2197 /** 2198 * @brief Trace network socket listen attempt 2199 * @param socket Socket object 2200 * @param ret Return value 2201 */ 2202 #define sys_port_trace_socket_listen_exit(socket, ret) 2203 2204 /** 2205 * @brief Trace accept of network sockets 2206 * @param socket Socket object 2207 */ 2208 #define sys_port_trace_socket_accept_enter(socket) 2209 2210 /** 2211 * @brief Trace network socket accept attempt 2212 * @param socket Socket object 2213 * @param addr Peer network address 2214 * @param addrlen Network address length 2215 * @param ret Return value 2216 */ 2217 #define sys_port_trace_socket_accept_exit(socket, addr, addrlen, ret) 2218 2219 /** 2220 * @brief Trace sendto of network sockets 2221 * @param socket Socket object 2222 * @param len Length of the data to send 2223 * @param flags Flags for this send operation 2224 * @param dest_addr Destination network address 2225 * @param addrlen Network address length 2226 */ 2227 #define sys_port_trace_socket_sendto_enter(socket, len, flags, dest_addr, addrlen) 2228 2229 /** 2230 * @brief Trace network socket sendto attempt 2231 * @param socket Socket object 2232 * @param ret Return value 2233 */ 2234 #define sys_port_trace_socket_sendto_exit(socket, ret) 2235 2236 /** 2237 * @brief Trace sendmsg of network sockets 2238 * @param socket Socket object 2239 * @param msg Data to send 2240 * @param flags Flags for this send operation 2241 */ 2242 #define sys_port_trace_socket_sendmsg_enter(socket, msg, flags) 2243 2244 /** 2245 * @brief Trace network socket sendmsg attempt 2246 * @param socket Socket object 2247 * @param ret Return value 2248 */ 2249 #define sys_port_trace_socket_sendmsg_exit(socket, ret) 2250 2251 /** 2252 * @brief Trace recvfrom of network sockets 2253 * @param socket Socket object 2254 * @param max_len Maximum length of the data we can receive 2255 * @param flags Flags for this receive operation 2256 * @param addr Remote network address 2257 * @param addrlen Network address length 2258 */ 2259 #define sys_port_trace_socket_recvfrom_enter(socket, max_len, flags, addr, addrlen) 2260 2261 /** 2262 * @brief Trace network socket recvfrom attempt 2263 * @param socket Socket object 2264 * @param src_addr Peer network address that send the data 2265 * @param addrlen Length of the network address 2266 * @param ret Return value 2267 */ 2268 #define sys_port_trace_socket_recvfrom_exit(socket, src_addr, addrlen, ret) 2269 2270 /** 2271 * @brief Trace recvmsg of network sockets 2272 * @param socket Socket object 2273 * @param msg Message buffer to receive 2274 * @param flags Flags for this receive operation 2275 */ 2276 #define sys_port_trace_socket_recvmsg_enter(socket, msg, flags) 2277 2278 /** 2279 * @brief Trace network socket recvmsg attempt 2280 * @param socket Socket object 2281 * @param msg Message buffer received 2282 * @param ret Return value 2283 */ 2284 #define sys_port_trace_socket_recvmsg_exit(socket, msg, ret) 2285 2286 /** 2287 * @brief Trace fcntl of network sockets 2288 * @param socket Socket object 2289 * @param cmd Command to set for this socket 2290 * @param flags Flags for this receive operation 2291 */ 2292 #define sys_port_trace_socket_fcntl_enter(socket, cmd, flags) 2293 2294 /** 2295 * @brief Trace network socket fcntl attempt 2296 * @param socket Socket object 2297 * @param ret Return value 2298 */ 2299 #define sys_port_trace_socket_fcntl_exit(socket, ret) 2300 2301 /** 2302 * @brief Trace ioctl of network sockets 2303 * @param socket Socket object 2304 * @param req Request to set for this socket 2305 */ 2306 #define sys_port_trace_socket_ioctl_enter(socket, req) 2307 2308 /** 2309 * @brief Trace network socket ioctl attempt 2310 * @param socket Socket object 2311 * @param ret Return value 2312 */ 2313 #define sys_port_trace_socket_ioctl_exit(socket, ret) 2314 2315 /** 2316 * @brief Trace polling of network sockets 2317 * @param fds Set of socket object 2318 * @param nfds Number of socket objects in the set 2319 * @param timeout Timeout for the poll operation 2320 */ 2321 #define sys_port_trace_socket_poll_enter(fds, nfds, timeout) 2322 2323 /** 2324 * @brief Trace network socket poll attempt 2325 * @param fds Set of socket object 2326 * @param nfds Number of socket objects in the set 2327 * @param ret Return value 2328 */ 2329 #define sys_port_trace_socket_poll_exit(fds, nfds, ret) 2330 2331 /** 2332 * @brief Trace getsockopt of network sockets 2333 * @param socket Socket object 2334 * @param level Option level 2335 * @param optname Option name 2336 */ 2337 #define sys_port_trace_socket_getsockopt_enter(socket, level, optname) 2338 2339 /** 2340 * @brief Trace network socket getsockopt attempt 2341 * @param socket Socket object 2342 * @param level Option level 2343 * @param optname Option name 2344 * @param optval Option value 2345 * @param optlen Option value length 2346 * @param ret Return value 2347 */ 2348 #define sys_port_trace_socket_getsockopt_exit(socket, level, optname, optval, optlen, ret) 2349 2350 /** 2351 * @brief Trace setsockopt of network sockets 2352 * @param socket Socket object 2353 * @param level Option level 2354 * @param optname Option name 2355 * @param optval Option value 2356 * @param optlen Option value length 2357 */ 2358 #define sys_port_trace_socket_setsockopt_enter(socket, level, optname, optval, optlen) 2359 2360 /** 2361 * @brief Trace network socket setsockopt attempt 2362 * @param socket Socket object 2363 * @param ret Return value 2364 */ 2365 #define sys_port_trace_socket_setsockopt_exit(socket, ret) 2366 2367 /** 2368 * @brief Trace getpeername of network sockets 2369 * @param socket Socket object 2370 */ 2371 #define sys_port_trace_socket_getpeername_enter(socket) 2372 2373 /** 2374 * @brief Trace network socket getpeername attempt 2375 * @param socket Socket object 2376 * @param addr Peer socket network address 2377 * @param addrlen Length of the network address 2378 * @param ret Return value 2379 */ 2380 #define sys_port_trace_socket_getpeername_exit(socket, addr, addrlen, ret) 2381 2382 /** 2383 * @brief Trace getsockname of network sockets 2384 * @param socket Socket object 2385 */ 2386 #define sys_port_trace_socket_getsockname_enter(socket) 2387 2388 /** 2389 * @brief Trace network socket getsockname attempt 2390 * @param socket Socket object 2391 * @param addr Local socket network address 2392 * @param addrlen Length of the network address 2393 * @param ret Return value 2394 */ 2395 #define sys_port_trace_socket_getsockname_exit(socket, addr, addrlen, ret) 2396 2397 /** 2398 * @brief Trace socketpair enter call 2399 * @param family Network address family 2400 * @param type Socket type 2401 * @param proto Socket protocol 2402 * @param sv Socketpair buffer 2403 */ 2404 #define sys_port_trace_socket_socketpair_enter(family, type, proto, sv) 2405 2406 /** 2407 * @brief Trace network socketpair open attempt 2408 * @param socket_A Socketpair first socket object 2409 * @param socket_B Socketpair second socket object 2410 * @param ret Return value 2411 */ 2412 #define sys_port_trace_socket_socketpair_exit(socket_A, socket_B, ret) 2413 2414 /** @} */ /* end of subsys_tracing_apis_socket */ 2415 2416 /** 2417 * @brief Named Tracing APIs 2418 * @defgroup subsys_tracing_apis_named Named tracing APIs 2419 * @{ 2420 */ 2421 2422 /* 2423 * @brief Called by user to generate named events 2424 * 2425 * @param name name of event. Tracing subsystems may place a limit on 2426 * the length of this string 2427 * @param arg0 arbitrary user-provided data for this event 2428 * @param arg1 arbitrary user-provided data for this event 2429 */ 2430 #define sys_trace_named_event(name, arg0, arg1) 2431 2432 /** @} */ /* end of subsys_tracing_apis_named */ 2433 2434 /** 2435 * @brief GPIO Tracing APIs 2436 * @defgroup subsys_tracing_apis_gpio GPIO Tracing APIs 2437 * @{ 2438 */ 2439 2440 /** 2441 * @brief Trace GPIO pin interrupt configure enter call 2442 * @param port Pointer to device structure for the driver instance 2443 * @param pin GPIO pin number 2444 * @param flags Interrupt configuration flags as defined by GPIO_INT_* 2445 */ 2446 #define sys_port_trace_gpio_pin_interrupt_configure_enter(port, pin, flags) 2447 2448 /** 2449 * @brief Trace GPIO pin interrupt configure exit call 2450 * @param port Pointer to device structure for the driver instance 2451 * @param pin GPIO pin number 2452 * @param ret Return value 2453 */ 2454 #define sys_port_trace_gpio_pin_interrupt_configure_exit(port, pin, ret) 2455 2456 /** 2457 * @brief Trace GPIO single pin configure enter call 2458 * @param port Pointer to device structure for the driver instance 2459 * @param pin GPIO pin number to configure 2460 * @param flags GPIO pin configuration flags 2461 */ 2462 #define sys_port_trace_gpio_pin_configure_enter(port, pin, flags) 2463 2464 /** 2465 * @brief Trace GPIO single pin configure exit call 2466 * @param port Pointer to device structure for the driver instance 2467 * @param pin GPIO pin number to configure 2468 * @param ret Return value 2469 */ 2470 #define sys_port_trace_gpio_pin_configure_exit(port, pin, ret) 2471 2472 /** 2473 * @brief Trace GPIO port get direction enter call 2474 * @param port Pointer to device structure for the driver instance 2475 * @param map Bitmap of pin directions to query 2476 * @param inputs Pointer to a variable where input directions will be stored 2477 * @param outputs Pointer to a variable where output directions will be stored 2478 */ 2479 #define sys_port_trace_gpio_port_get_direction_enter(port, map, inputs, outputs) 2480 2481 /** 2482 * @brief Trace GPIO port get direction exit call 2483 * @param port Pointer to device structure for the driver instance 2484 * @param ret Return value 2485 */ 2486 #define sys_port_trace_gpio_port_get_direction_exit(port, ret) 2487 2488 /** 2489 * @brief Trace GPIO pin gent config enter call 2490 * @param port Pointer to device structure for the driver instance 2491 * @param pin GPIO pin number to configure 2492 * @param flags GPIO pin configuration flags 2493 */ 2494 #define sys_port_trace_gpio_pin_get_config_enter(port, pin, flags) 2495 2496 /** 2497 * @brief Trace GPIO pin get config exit call 2498 * @param port Pointer to device structure for the driver instance 2499 * @param pin GPIO pin number to configure 2500 * @param ret Return value 2501 */ 2502 #define sys_port_trace_gpio_pin_get_config_exit(port, pin, ret) 2503 2504 /** 2505 * @brief Trace GPIO port get raw enter call 2506 * @param port Pointer to device structure for the driver instance 2507 * @param value Pointer to a variable where the raw value will be stored 2508 */ 2509 #define sys_port_trace_gpio_port_get_raw_enter(port, value) 2510 2511 /** 2512 * @brief Trace GPIO port get raw exit call 2513 * @param port Pointer to device structure for the driver instance 2514 * @param ret Return value 2515 */ 2516 #define sys_port_trace_gpio_port_get_raw_exit(port, ret) 2517 2518 /** 2519 * @brief Trace GPIO port set masked raw enter call 2520 * @param port Pointer to device structure for the driver instance 2521 * @param mask Mask indicating which pins will be modified 2522 * @param value Value to be written to the output pins 2523 */ 2524 #define sys_port_trace_gpio_port_set_masked_raw_enter(port, mask, value) 2525 2526 /** 2527 * @brief Trace GPIO port set masked raw exit call 2528 * @param port Pointer to device structure for the driver instance 2529 * @param ret Return value 2530 */ 2531 #define sys_port_trace_gpio_port_set_masked_raw_exit(port, ret) 2532 2533 /** 2534 * @brief Trace GPIO port set bits raw enter call 2535 * @param port Pointer to device structure for the driver instance 2536 * @param pins Value indicating which pins will be modified 2537 */ 2538 #define sys_port_trace_gpio_port_set_bits_raw_enter(port, pins) 2539 2540 /** 2541 * @brief Trace GPIO port set bits raw exit call 2542 * @param port Pointer to device structure for the driver instance 2543 * @param ret Return value 2544 */ 2545 #define sys_port_trace_gpio_port_set_bits_raw_exit(port, ret) 2546 2547 /** 2548 * @brief Trace GPIO port clear bits raw enter call 2549 * @param port Pointer to device structure for the driver instance 2550 * @param pins Value indicating which pins will be modified 2551 */ 2552 #define sys_port_trace_gpio_port_clear_bits_raw_enter(port, pins) 2553 2554 /** 2555 * @brief Trace GPIO port clear bits raw exit call 2556 * @param port Pointer to device structure for the driver instance 2557 * @param ret Return value 2558 */ 2559 #define sys_port_trace_gpio_port_clear_bits_raw_exit(port, ret) 2560 2561 /** 2562 * @brief Trace GPIO port toggle bits enter call 2563 * @param port Pointer to device structure for the driver instance 2564 * @param pins Value indicating which pins will be modified 2565 */ 2566 #define sys_port_trace_gpio_port_toggle_bits_enter(port, pins) 2567 2568 /** 2569 * @brief Trace GPIO port toggle bits exit call 2570 * @param port Pointer to device structure for the driver instance 2571 * @param ret Return value 2572 */ 2573 #define sys_port_trace_gpio_port_toggle_bits_exit(port, ret) 2574 2575 /** 2576 * @brief Trace GPIO init callback enter call 2577 * @param callback A valid application's callback structure pointer 2578 * @param handler A valid handler function pointer 2579 * @param pin_mask A bit mask of relevant pins for the handler 2580 */ 2581 #define sys_port_trace_gpio_init_callback_enter(callback, handler, pin_mask) 2582 2583 /** 2584 * @brief Trace GPIO init callback exit call 2585 * @param callback A valid application's callback structure pointer 2586 */ 2587 #define sys_port_trace_gpio_init_callback_exit(callback) 2588 2589 /** 2590 * @brief Trace GPIO add callback enter call 2591 * @param port Pointer to device structure for the driver instance 2592 * @param callback A valid application's callback structure pointer 2593 */ 2594 #define sys_port_trace_gpio_add_callback_enter(port, callback) 2595 2596 /** 2597 * @brief Trace GPIO add callback exit call 2598 * @param port Pointer to device structure for the driver instance 2599 * @param ret Return value 2600 */ 2601 #define sys_port_trace_gpio_add_callback_exit(port, ret) 2602 2603 /** 2604 * @brief Trace GPIO remove callback enter call 2605 * @param port Pointer to device structure for the driver instance 2606 * @param callback A valid application's callback structure pointer 2607 */ 2608 #define sys_port_trace_gpio_remove_callback_enter(port, callback) 2609 2610 /** 2611 * @brief Trace GPIO remove callback exit call 2612 * @param port Pointer to device structure for the driver instance 2613 * @param ret Return value 2614 */ 2615 #define sys_port_trace_gpio_remove_callback_exit(port, ret) 2616 2617 /** 2618 * @brief Trace GPIO get pending interrupt enter call 2619 * @param dev Pointer to the device structure for the device instance 2620 */ 2621 #define sys_port_trace_gpio_get_pending_int_enter(dev) 2622 2623 /** 2624 * @brief Trace GPIO get pending interrupt exit call 2625 * @param dev Pointer to the device structure for the device instance 2626 * @param ret Return value 2627 */ 2628 #define sys_port_trace_gpio_get_pending_int_exit(dev, ret) 2629 2630 /** 2631 * @brief 2632 * @param list @ref sys_slist_t representing gpio_callback pointers 2633 * @param port @ref device representing the GPIO port 2634 * @param pins @ref gpio_pin_t representing the pins 2635 */ 2636 #define sys_port_trace_gpio_fire_callbacks_enter(list, port, pins) 2637 2638 /** 2639 * @brief 2640 * @param port @ref device representing the GPIO port 2641 * @param callback @ref gpio_callback a valid Application's callback structure pointer 2642 */ 2643 #define sys_port_trace_gpio_fire_callback(port, callback) 2644 2645 /** @} */ /* end of subsys_tracing_apis_gpio */ 2646 2647 #if defined(CONFIG_PERCEPIO_TRACERECORDER) 2648 #include "tracing_tracerecorder.h" 2649 #else 2650 /** 2651 * @brief Called when entering an ISR 2652 */ 2653 void sys_trace_isr_enter(void); 2654 2655 /** 2656 * @brief Called when exiting an ISR 2657 */ 2658 void sys_trace_isr_exit(void); 2659 2660 /** 2661 * @brief Called when exiting an ISR and switching to scheduler 2662 */ 2663 void sys_trace_isr_exit_to_scheduler(void); 2664 2665 /** 2666 * @brief Called when the cpu enters the idle state 2667 */ 2668 void sys_trace_idle(void); 2669 #endif /* CONFIG_PERCEPIO_TRACERECORDER */ 2670 2671 /** 2672 * @brief Called when entering an init function 2673 */ 2674 #define sys_trace_sys_init_enter(entry, level) 2675 2676 /** 2677 * @brief Called when exiting an init function 2678 */ 2679 #define sys_trace_sys_init_exit(entry, level, result) 2680 2681 /** @} */ /* end of subsys_tracing_apis */ 2682 2683 /** @} */ /* end of subsys_tracing */ 2684 2685 #endif 2686 #endif /* ZEPHYR_INCLUDE_TRACING_TRACING_H_ */ 2687