-
Notifications
You must be signed in to change notification settings - Fork 319
rpmsg/rpmsg_virtio: support set trace callback to trace buffer status #632
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?
Conversation
| option (WITH_DOC "Build with documentation" OFF) | ||
| option (WITH_RPMSG_TRACE "Enable Rpmsg Device Trace" OFF) | ||
|
|
||
| if (WITH_RPMSG_TRACE) |
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.
Please explain commit mesasge in detail what this option is for.
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.
Adding this is to track the application and release of rpmsg buffer,then connect to the OS trace system
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.
Have you checked virtqueue_dump functionality? Is it not enough for above purpose?
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.
Virtqueue_dump is not enough for record historical information of buffer application and release.
it just record the info of virtqueue
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.
Look to me too complex just for some specific traces...
What about using RPMSG_DEBUG in open-amp/lib/rpmsg/rpmsg_internal.h?
Then you could define RPMSG_LOG macro to add debug traces in RPMSG
| * @release_tx_buffer: trace callback, called when release a tx buffer | ||
| */ | ||
| struct rpmsg_device_trace { | ||
| void (*get_tx_buffer)(struct rpmsg_device *rvdev, void *hdr); |
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.
What these callbacks are expected to trace ?
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.
rpmsg_get_tx_payload_buffer and rpmsg_release_tx_buffer
Adding this is to track the application and release of rpmsg buffer, then connect to the OS trace system Signed-off-by: Bowen Wang <[email protected]>
123fdb6 to
2d948b9
Compare
|
@arnopo hi, please help me to solve this ci problem, think you very much: open-amp Heath Check / Zephyr build from latest on main (pull_request) CMake Error at /github/workspace/zephyrproject/zephyr/cmake/modules/boards.cmake:228 (message): -- Configuring incomplete, errors occurred! |
I will have a look , you can ignore it for the moment , only the required checks are mandatory |
|
This pull request has been marked as a stale pull request because it has been open (more than) 45 days with no activity. |
The trace API is already defined in libmetal: https://github.com/OpenAMP/libmetal/blob/main/lib/log.h, #ifdef RPMSG_DEBUG
#define RPMSG_LOG_DBG(fmt, args...) metal_dbg(fmt, ##args)
#endif |
|
@arnopo I mean add a new API named |
I better understand your request. You would have two types of information: logs and traces.My concern is that these concepts could differ depending on the OS. |
Firstly, in many embedded projects, the log is always output the UART for the convenience of debugging, and the trace information is always output the ram and can be dumped manually or triggered by some special system event (e.g. PANIC). So the log is a always a slow process but trace has small impact on performance. So I think the log is used to print some infrequent information such as the error information and initialization information. |
This is probably a good topic to discuss in the next OpenAMP technical meeting... Could you please detail what you expect to output in trace logs?
|
open-amp can have a trace buffer type of resource where you can copy all the logs in RAM when you use metal_log API. In Heterogeneous system it's recommended to not throw logs on UART usually because number of UARTs are mostly less than number of cores and possibility of corruption of logs. The recommended way is to use trace buffer and from linux you can get those logs via debugfs or memory dump etc.
We do have debug level or many other levels of log for this. Besides it's not good idea to keep any logs enabled to measure performance of actual software for long time. We use logs only for notification purpose if performance goes down or varies a lot. And I agree it varies from project to project, and that is why should not be introduced in a library, but probably some higher level framework. |
|
We discussed this point during the OpenAMP meeting.
|
|
This pull request has been marked as a stale pull request because it has been open (more than) 45 days with no activity. |
support set trace callback to trace buffer status
Adding this is to track the application and release of rpmsg buffer,then connect to the OS trace system
users can enable RPMSG_TRACE to monitor application and release of txbuffer