Skip to content

[PW_SID:1087467] Linux RISC-V trace framework and drivers#1841

Closed
linux-riscv-bot wants to merge 13 commits into
workflowfrom
pw1087467
Closed

[PW_SID:1087467] Linux RISC-V trace framework and drivers#1841
linux-riscv-bot wants to merge 13 commits into
workflowfrom
pw1087467

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1087467 applied to workflow

Name: Linux RISC-V trace framework and drivers
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1087467
Version: 4

Linux RISC-V bot and others added 13 commits April 28, 2026 17:02
Add device tree bindings for the memory mapped RISC-V trace components
which support both the RISC-V efficient trace (E-trace) protocol and
the RISC-V Nexus-based trace (N-trace) protocol.

The RISC-V trace components are defined by the RISC-V trace control
interface specification.

Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The RISC-V Trace Control Interface Specification [1] defines a standard
way of implementing RISC-V trace related modular components irrespective
to underlying trace format (E-trace or N-trace). These RISC-V trace
components are organized in a graph-like topology where each RISC-V
hart has its own RISC-V trace encoder component.

Implement a basic driver framework for RISC-V trace where RISC-V trace
components are instantiated by a common platform driver and a separate
RISC-V trace driver for each type of RISC-V trace component.

[1] https://github.com/riscv-non-isa/tg-nexus-trace/releases/download/1.0_Ratified/RISC-V-Trace-Control-Interface.pdf

Co-developed-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Trace needs to be configured on a chain of trace components which are
connected to each other. These chain of components is also referred
to as trace component path. Add functions to create/destroy a trace
component path which will be later used by RISC-V trace perf support.

Co-developed-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The perf driver framework needs to be able to start / stop all components
in a trace component path during its operation. Add rvtrace_path_start()
and rvtrace_path_stop() functions for this purpose.

Co-developed-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add initial implementation of RISC-V trace encoder driver. The encoder
is defined in the RISC-V Trace Control Interface specification.

Co-developed-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The RISC-V trace ramsink will need a mechanism to copy trace data
into the perf AUX buffer. Add rvtrace_path_copyto_auxbuf() function
and corresponding trace driver callback copyto_auxbuf() for this
purpose.

Co-developed-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add initial implementation of RISC-V trace ramsink driver. The ramsink
is defined in the RISC-V Trace Control Interface specification.

Co-developed-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The RISC-V ramsink trace component may have implementation specific
restrictions such that the component can only write trace data in
particular parts of DRAM.

Enable DMA_RESTRICTED_POOL in the defconfig so that dma_alloc_*()
and dma_free_*() APIs work for devices with DMA address restrictions.

Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add perf driver for RISC-V tracing similar to ARM Coresight and Hisilicon
PTT drivers. The driver adds 'rvtrace' event descriptor which can be used
by the perf tool to record the RISC-V trace data.

Co-developed-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Introduce the required auxiliary API functions allowing the perf core
to interact with RISC-V trace perf driver.

Co-developed-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add bare bones support for RISC-V trace decoder so that the data received
from the hardware by the RISC-V trace perf driver can be written to the
perf record output file.

Co-developed-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add Mayuresh and myself as maintainers for RISC-V trace framework
and drivers.

Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 116.40 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1035.13 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1390.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 23.33 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.94 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.86 seconds
Result: WARNING
Output:

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#21: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 120 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 5be0ade87477 ("dt-bindings: Add RISC-V trace component bindings") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 0 checks, 120 lines checked
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 77.39 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
kdoc
Desc: Detects for kdoc errors
Duration: 0.71 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 4.01 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,01/12] dt-bindings: Add RISC-V trace component bindings"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.73 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,02/12] rvtrace: Initial implementation of driver framework"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 116.66 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,02/12] rvtrace: Initial implementation of driver framework"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 779.06 seconds
Result: ERROR
Output:

Redirect to /build/tmp.yNblAaghla and /build/tmp.eJYZvPBnIs
Tree base:
5be0ade87477d ("dt-bindings: Add RISC-V trace component bindings")
Building the whole tree with the patch
error:
Warning: /build/tmp2zuon6g7/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:245 struct __packed mtk_mfg_opp_entry { __le32 freq_khz; __le32 voltage_core; __le32 voltage_sram; __le32 posdiv; __le32 voltage_margin; __le32 power_mw; }; error: Cannot parse struct or union!



real	12m52.290s
user	480m52.067s
sys	100m9.034s

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,02/12] rvtrace: Initial implementation of driver framework"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1139.32 seconds
Result: ERROR
Output:

Redirect to /build/tmp.fUerhjpC69 and /build/tmp.JEK9uuzBsw
Tree base:
5be0ade87477d ("dt-bindings: Add RISC-V trace component bindings")
Building the whole tree with the patch
error:
Warning: /build/tmp2zuon6g7/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:245 struct __packed mtk_mfg_opp_entry { __le32 freq_khz; __le32 voltage_core; __le32 voltage_sram; __le32 posdiv; __le32 voltage_margin; __le32 power_mw; }; error: Cannot parse struct or union!



real	18m52.960s
user	668m56.449s
sys	121m45.435s

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,02/12] rvtrace: Initial implementation of driver framework"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.36 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,02/12] rvtrace: Initial implementation of driver framework"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 114.86 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 766.58 seconds
Result: ERROR
Output:

Redirect to /build/tmp.ik6Uj8QabJ and /build/tmp.y9Ddx9AUwi
Tree base:
3aa5661531c99 ("perf tools: Initial support for RISC-V trace decoder")
Building the whole tree with the patch
error:
Warning: /build/tmp3m1r04sz/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:245 struct __packed mtk_mfg_opp_entry { __le32 freq_khz; __le32 voltage_core; __le32 voltage_sram; __le32 posdiv; __le32 voltage_margin; __le32 power_mw; }; error: Cannot parse struct or union!



real	12m40.092s
user	478m58.952s
sys	93m54.341s

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1124.80 seconds
Result: ERROR
Output:

Redirect to /build/tmp.Dj2aSNrrQB and /build/tmp.OG8DltS324
Tree base:
3aa5661531c99 ("perf tools: Initial support for RISC-V trace decoder")
Building the whole tree with the patch
error:
Warning: /build/tmp3m1r04sz/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:245 struct __packed mtk_mfg_opp_entry { __le32 freq_khz; __le32 voltage_core; __le32 voltage_sram; __le32 posdiv; __le32 voltage_margin; __le32 power_mw; }; error: Cannot parse struct or union!



real	18m38.445s
user	667m57.628s
sys	114m36.248s

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.94 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 23.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.59 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 80.86 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.82 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
kdoc
Desc: Detects for kdoc errors
Duration: 1.01 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
module-param
Desc: Detect module_param changes
Duration: 0.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 12: "[v4,12/12] MAINTAINERS: Add entry for RISC-V trace framework"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow branch 16 times, most recently from 60ec8ef to 5927802 Compare May 6, 2026 21:44
@linux-riscv-bot linux-riscv-bot deleted the pw1087467 branch May 7, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants