CV-Bowen opened a new pull request, #21713:
URL: https://github.com/apache/nuttx/pull/21713
## Summary
`rpmsg_trace()` records each rpmsg_port endpoint callback in the note
stream, but rpmsg_virtio had no such call, so with `CONFIG_RPMSG_TRACE`
the trace only showed the port links. Trace the start and the end of
each callback in `rpmsg_virtio_process_rx_buffer()`, with the message
header and payload attached to the start record, the same way
rpmsg_port does.
## Impact
Only with `CONFIG_RPMSG_TRACE=y`; otherwise `rpmsg_trace()` compiles to
nothing. No API or Kconfig change.
## Testing
Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
qemu-armv8a:rpserver + rpproxy (rptun ivshmem and rpmsg_port uart) with
these test-only defconfig additions on both sides:
```
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SCHED_INSTRUMENTATION_DUMP=y
CONFIG_SCHED_INSTRUMENTATION_FILTER=y
CONFIG_DRIVERS_NOTE=y
CONFIG_DRIVERS_NOTECTL=y
CONFIG_DRIVERS_NOTERAM=y
CONFIG_SYSTEM_TRACE=y
CONFIG_RPMSG_TRACE=y
```
On the server: `rpmsg ping all 3 64 3 0`, then `trace dump`.
| tree | records in `trace dump` |
| --- | --- |
| master | `[Port] rx ept->cb` only |
| this PR | `[Port] rx ept->cb` and `[Virtio] rx ept->cb` |
<details><summary>master</summary>
```
rpmsg-uart-rx-5 [0] 9.330266633: tracing_mark_write: [Port] rx ept->cb
end ept:0x404d00d8 name:rpmsg-ping cb:0x402daf18 rdev:0x404d0170 hdr:0x404d
rpmsg-uart-rx-5 [0] 13.707699836: tracing_mark_write: [Port] rx ept->cb
start ept:0x404d00d8 name:rpmsg-ping cb:0x402daf18 rdev:0x404d0170 hdr:0x40
rpmsg-uart-rx-5 [0] 13.707738778: tracing_mark_write: [Port] rx ept->cb
end ept:0x404d00d8 name:rpmsg-ping cb:0x402daf18 rdev:0x404d0170 hdr:0x404d
```
</details>
<details><summary>this PR</summary>
```
rpmsg-virtio-9 [0] 13.683935419: tracing_mark_write: [Virtio] rx ept->cb
end ept:0x404e1e60 name:rpmsg-ping cb:0x402daf18 rdev:0x404e1ef8 hdr:0x800
rpmsg-virtio-9 [0] 13.684168551: tracing_mark_write: [Virtio] rx ept->cb
start ept:0x404e1e60 name:rpmsg-ping cb:0x402daf18 rdev:0x404e1ef8 hdr:0x8
rpmsg-virtio-9 [0] 13.684180488: tracing_mark_write: [Virtio] rx ept->cb
end ept:0x404e1e60 name:rpmsg-ping cb:0x402daf18 rdev:0x404e1ef8 hdr:0x800
rpmsg-virtio-9 [0] 13.684361606: tracing_mark_write: [Virtio] rx ept->cb
start ept:0x404e1e60 name:rpmsg-ping cb:0x402daf18 rdev:0x404e1ef8 hdr:0x8
```
</details>
Baseline, without the trace options:
<details><summary>results.md</summary>
Baseline (`test.sh`, cases: baseline.yaml):
- host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
- tested: nuttx ae542d44650 apps 7f9ae9513
- qemu-armv8a:rpserver qemu-armv8a:rpproxy built with test-only overlay:
disabled LIBC_ENVPATH BINFMT_CHECKEXEC
- sim:rpserver + sim:rpproxy: PASS
- [x] `uname -a` (server)
- [x] `rpmsg dump all` (server)
- [x] `rpmsg ping all 10 1024 3 0` (server)
- [x] `uname -a` (proxy)
- [x] `rpmsg ping all 10 1024 3 0` (proxy)
- [x] `mount -t rpmsgfs -o cpu=server,fs=/proc /sp` (proxy)
- [x] `cat /sp/version` (proxy)
- [x] `rpmsg dump all` (proxy)
- qemu-armv8a:rpserver + qemu-armv8a:rpproxy: PASS
- [x] `uname -a` (server)
- [x] `uname -a` (proxy)
- [x] `rpmsg dump all` (server)
- [x] `rpmsg ping all 10 1024 3 0` (server)
- [x] `rpmsg ping all 10 1024 3 0` (proxy)
- [x] `mount -t rpmsgfs -o cpu=server,fs=/proc /sp` (proxy)
- [x] `cat /sp/version` (proxy)
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]