Skip to content
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

tracing: riscv: Missing invoking the sys_trace_isr_exit() #41995

Closed
WealianLiao opened this issue Jan 20, 2022 · 4 comments
Closed

tracing: riscv: Missing invoking the sys_trace_isr_exit() #41995

WealianLiao opened this issue Jan 20, 2022 · 4 comments
Assignees
Labels
area: RISCV RISCV Architecture (32-bit & 64-bit) area: Tracing Tracing bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale

Comments

@WealianLiao
Copy link

Describe the bug
RISCV core doesn't invoke the sys_trace_isr_exit() for tracing system.

To Reproduce
Apply PR:41863 &

./scripts/twister -T ./samples/subsys/tracing/ -p qemu_riscv32

or

./scripts/twister -T ./samples/subsys/tracing/ -p qemu_riscv64

Expected behavior
In the report log, the ISR counter should not increase.

Impact
Can't trace ISR leave for RISCV.

@WealianLiao WealianLiao added the bug The issue is a bug, or the PR is fixing a bug label Jan 20, 2022
@WealianLiao
Copy link
Author

This probably works but I don't have real the RISCV platform to check.

diff --git a/arch/riscv/core/isr.S b/arch/riscv/core/isr.S
index 1ff0144315..e09d3da1aa 100644
--- a/arch/riscv/core/isr.S
+++ b/arch/riscv/core/isr.S
@@ -235,6 +235,7 @@ GTEXT(z_thread_mark_switched_in)
 GTEXT(z_thread_mark_switched_out)
 #ifdef CONFIG_TRACING
 GTEXT(sys_trace_isr_enter)
+GTEXT(sys_trace_isr_exit)
 #endif
 #endif
 
@@ -735,6 +736,10 @@ call_irq:
        /* Call ISR function */
        jalr ra, t1
 
+#ifdef CONFIG_TRACING_ISR
+       call sys_trace_isr_exit
+#endif
+
 on_thread_stack:
        /* Get reference to _kernel */
        la t1, _kernel

@WealianLiao WealianLiao changed the title tracing: risvc: Missing invoking the sys_trace_isr_exit() tracing: riscv: Missing invoking the sys_trace_isr_exit() Jan 20, 2022
@henrikbrixandersen henrikbrixandersen added the area: RISCV RISCV Architecture (32-bit & 64-bit) label Jan 24, 2022
@dkalowsk dkalowsk added area: Tracing Tracing priority: low Low impact/importance bug labels Jan 25, 2022
@nashif nashif assigned edersondisouza and unassigned nashif Feb 8, 2022
@edersondisouza
Copy link
Collaborator

Hi @WealianLiao,

The patch you pasted seems fine and it works on QEMU - I think you should just send it as a PR so it can be reviewed and merged!

@edersondisouza
Copy link
Collaborator

@WealianLiao - gentle reminder about sending your patch as a PR - if you have already done so, please link it here.

@github-actions
Copy link

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions bot added the Stale label Apr 25, 2022
@github-actions github-actions bot closed this as completed May 9, 2022
robertszczepanski added a commit to antmicro/zephyr that referenced this issue May 11, 2022
nashif pushed a commit that referenced this issue May 11, 2022
laxiLang pushed a commit to laxiLang/zephyr that referenced this issue May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: RISCV RISCV Architecture (32-bit & 64-bit) area: Tracing Tracing bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale
Projects
None yet
Development

No branches or pull requests

5 participants