-
Notifications
You must be signed in to change notification settings - Fork 8.2k
subsys: tracing: Add macros for tracking list operations #86801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,9 +70,105 @@ | |
| * @brief Gets node's next element in a object tracking list. | ||
| * | ||
| * @param list Node to get next element from. | ||
| * @return The next item under @p list. | ||
| */ | ||
| #define SYS_PORT_TRACK_NEXT(list)((list)->_obj_track_next) | ||
|
|
||
| /** | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i see macros being added, but I do not see them being used, can you please elaborate on the usage of thos macros and why we need them? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A large number of global variables with names like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's the point being missed here - I don't think that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But if you really need to access them internally, directly referencing the symbols doesn't seem like a sensible approach (although the purpose of accessing the symbols is merely to iterate over them). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the discussion above it really feels like these macros should not be added and would probably be more confusing than anything? It feels like you should maybe consider closing this PR? |
||
| * @brief Gets node's next element in a object tracking list. | ||
| * | ||
| * Example: | ||
| * SYS_PORT_TRACK_FOREACH(k_mutex, m) { | ||
| * ... | ||
| * } | ||
| * | ||
| * @param object Type of tracking object to iterate over. | ||
| * @param var Temporary variable used during iteration. | ||
| */ | ||
| #define SYS_PORT_TRACK_FOR_EACH(object, var) \ | ||
| for (struct object *var = _track_list_##object \ | ||
| ; var != NULL; var++) | ||
|
|
||
|
Check warning on line 91 in include/zephyr/tracing/tracking.h
|
||
| /** | ||
| * @brief Gets node's next element in a k_timer tracking list. | ||
| * | ||
| * @return The next item under list @ref _track_list_k_timer | ||
| */ | ||
rruuaanng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #define SYS_PORT_TRACK_K_TIMER_NEXT() \ | ||
| SYS_PORT_TRACK_NEXT(_track_list_k_timer) | ||
|
|
||
| /** | ||
| * @brief Gets node's next element in a k_mem_slab tracking list. | ||
| * | ||
| * @return The next item under list @ref _track_list_k_mem_slab | ||
| */ | ||
| #define SYS_PORT_TRACK_K_MEM_SLAB_NEXT() \ | ||
| SYS_PORT_TRACK_NEXT(_track_list_k_mem_slab) | ||
|
|
||
| /** | ||
| * @brief Gets node's next element in a k_sem tracking list. | ||
| * | ||
| * @return The next item under list @ref _track_list_k_sem | ||
| */ | ||
| #define SYS_PORT_TRACK_K_SEM_NEXT() \ | ||
| SYS_PORT_TRACK_NEXT(_track_list_k_sem) | ||
|
|
||
| /** | ||
| * @brief Gets node's next element in a k_mutex tracking list. | ||
| * | ||
| * @return The next item under list @ref _track_list_k_mutex | ||
| */ | ||
| #define SYS_PORT_TRACK_K_MUTEX_NEXT() \ | ||
| SYS_PORT_TRACK_NEXT(_track_list_k_mutex) | ||
|
|
||
| /** | ||
| * @brief Gets node's next element in a k_stack tracking list. | ||
| * | ||
| * @return The next item under list @ref _track_list_k_stack | ||
| */ | ||
| #define SYS_PORT_TRACK_K_STACK_NEXT() \ | ||
| SYS_PORT_TRACK_NEXT(_track_list_k_stack) | ||
|
|
||
| /** | ||
| * @brief Gets node's next element in a k_msgq tracking list. | ||
| * | ||
| * @return The next item under list @ref _track_list_k_msgq | ||
| */ | ||
| #define SYS_PORT_TRACK_K_MSGQ_NEXT() \ | ||
| SYS_PORT_TRACK_NEXT(_track_list_k_msgq) | ||
|
|
||
| /** | ||
| * @brief Gets node's next element in a k_mbox tracking list. | ||
| * | ||
| * @return The next item under list @ref _track_list_k_mbox | ||
| */ | ||
| #define SYS_PORT_TRACK_K_MBOX_NEXT() \ | ||
| SYS_PORT_TRACK_NEXT(_track_list_k_mbox) | ||
|
|
||
| /** | ||
| * @brief Gets node's next element in a k_pipe tracking list. | ||
| * | ||
| * @return The next item under list @ref _track_list_k_pipe | ||
| */ | ||
| #define SYS_PORT_TRACK_K_PIPE_NEXT() \ | ||
| SYS_PORT_TRACK_NEXT(_track_list_k_pipe) | ||
|
|
||
| /** | ||
| * @brief Gets node's next element in a k_queue tracking list. | ||
| * | ||
| * @return The next item under list @ref _track_list_k_queue | ||
| */ | ||
| #define SYS_PORT_TRACK_K_QUEUE_NEXT() \ | ||
| SYS_PORT_TRACK_NEXT(_track_list_k_queue) | ||
|
|
||
| /** | ||
| * @brief Gets node's next element in a k_event tracking list. | ||
| * | ||
| * @return The next item under list @ref _track_list_k_event | ||
| */ | ||
| #define SYS_PORT_TRACK_K_EVENT_NEXT() \ | ||
| SYS_PORT_TRACK_NEXT(_track_list_k_event) | ||
|
|
||
| /** @cond INTERNAL_HIDDEN */ | ||
|
|
||
| #define sys_port_track_k_thread_start(thread) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to 4.4