cobalt/trace: dovetail: improve xntrace_user_stop and xntrace_user_start
PATCH v2 1/2 cobalt/trace: dovetail: improve xntrace_user_stop and xntrace_user_start
xntrace_user_stop is widely similar to xntrace_user_freeze, call trace_cobalt_trigger to improve it and also make xntrace_user_start visible to balance them.
--- include/cobalt/kernel/dovetail/pipeline/trace.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
include/cobalt/kernel/dovetail/pipeline/trace.h +3 -2
@@ -45,13 +45,14 @@ static inline int xntrace_max_reset(void)static inline int xntrace_user_start (void ) { -TODO (); +trace_cobalt_trigger ("user-start" );return 0 ; }static inline int xntrace_user_stop (unsigned long v) { -TODO (); +trace_cobalt_trace_longval (0 , v); +trace_cobalt_trigger ("user-stop" );return 0 ; }
Signature · 1 line
2.17.1
PATCH v2 2/2 cobalt/trace: dovetail: remove TODO and return -ENOSYS for unportable features
Some of the features are unportable because ftrace does not provide equivalent functionality to the ipipe tracer (namely double buffering so that you can continue to record in flight-recorder mode while a previous recording remains available).
We remove TODOs to pass allyesconfig make.
--- include/cobalt/kernel/dovetail/pipeline/trace.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
include/cobalt/kernel/dovetail/pipeline/trace.h +5 -10
@@ -27,20 +27,17 @@static inline int xntrace_max_begin (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_end (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_reset (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_user_start (void )
@@ -96,14 +93,12 @@ static inline int xntrace_tick(unsigned long delay_ticks) /* ns */static inline int xntrace_panic_freeze (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_panic_dump (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline bool xntrace_enabled (void )
Signature · 1 line
2.17.1
Jan Kiszka
AppliedQuoted 21 lines · Hongzhan Chen via Xenomai
xntrace_user_stopis widely similar toxntrace_user_freeze, calltrace_cobalt_triggerto improve it and also makexntrace_user_startvisible to balance them.Signed-off-by Hongzhan Chen <[email protected]>--- include/cobalt/kernel/dovetail/pipeline/trace.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)include/cobalt/kernel/dovetail/pipeline/trace.h +1
-1@@ -45,13 +45,14 @@ static inline int xntrace_max_reset(void)static inline int xntrace_user_start (void ) { -TODO (); +trace_cobalt_trigger ("user-start" );return 0 ;
include/cobalt/kernel/dovetail/pipeline/trace.h static inline int xntrace_max_reset(void) · line 58
Quoted 10 lines
include/cobalt/kernel/dovetail/pipeline/trace.h +2
-1}static inline int xntrace_user_stop (unsigned long v) { -TODO (); +trace_cobalt_trace_longval (0 , v); +trace_cobalt_trigger ("user-stop" );return 0 ; }
Thanks, applied.
Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
Re: [PATCH v2 2/2] cobalt/trace: dovetail: remove TODO and return -ENOSYS for unportable features
In reply to Hongzhan ChenQuoted 46 lines · Hongzhan Chen via Xenomai
Some of the features are unportable because ftrace does not provide equivalent functionality to the ipipe tracer (namely double buffering so that you can continue to record in flight-recorder mode while a previous recording remains available).
We remove TODOs to pass allyesconfig make.
Signed-off-by Hongzhan Chen <[email protected]>--- include/cobalt/kernel/dovetail/pipeline/trace.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)include/cobalt/kernel/dovetail/pipeline/trace.h +3
-8@@ -27,20 +27,17 @@static inline int xntrace_max_begin (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_end (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_reset (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_user_start (void )@@ -96,14 +93,12 @@ static inline int xntrace_tick(unsigned long delay_ticks) /* ns */static inline int xntrace_panic_freeze (void ) { -TODO (); -return 0 ;
include/cobalt/kernel/dovetail/pipeline/trace.h static inline int xntrace_tick(unsigned long delay_ticks) /* ns */ · line 103
Quoted 10 lines
include/cobalt/kernel/dovetail/pipeline/trace.h +2
-2+return -ENOSYS ; }static inline int xntrace_panic_dump (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }
Looking at these two panic "abstractions": They are only called by dovetail-specific handle_oob_trap_entry. There, we should rather use kernel native tracing functions to stop and dump a trace.
And for I-pipe, we can fold the two abstractions into handle_exception() there as well.
Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
RE: [PATCH v2 2/2] cobalt/trace: dovetail: remove TODO and return -ENOSYS for unportable features
Quoted 58 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Monday, November 29, 2021 3:58 PM
To: Chen, Hongzhan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 2/2] cobalt/trace: dovetail: remove TODO and return-ENOSYSfor unportable featuresQuoted 49 lines · Hongzhan Chen via Xenomai
Some of the features are unportable because ftrace does not provide equivalent functionality to the ipipe tracer (namely double buffering so that you can continue to record in flight-recorder mode while a previous recording remains available).
We remove TODOs to pass allyesconfig make.
Signed-off-by Hongzhan Chen <[email protected]>--- include/cobalt/kernel/dovetail/pipeline/trace.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)include/cobalt/kernel/dovetail/pipeline/trace.h +4
-8@@ -27,20 +27,17 @@static inline int xntrace_max_begin (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_end (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_reset (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_user_start (void )@@ -96,14 +93,12 @@ static inline int xntrace_tick(unsigned long delay_ticks) /* ns */static inline int xntrace_panic_freeze (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }
Quoted 11 lines
include/cobalt/kernel/dovetail/pipeline/trace.h static inline int xntrace_tick(unsigned long delay_ticks) /* ns */ · line 103
Quoted 7 lines
include/cobalt/kernel/dovetail/pipeline/trace.h +1
-2static inline int xntrace_panic_dump (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }Looking at these two panic "abstractions": They are only called by dovetail-specific
handle_oob_trap_entry. There, we should rather use kernel native tracing functions to stop and dump a trace.
I found that in EVL implementation of handle_oob_trap_entry ,especially
for note_trap implementation , it have not implemented stop and dump
a trace and just try to printk warning (please refer to kernel/evl/thread.c of evl branch). handle_oob_trap_entry would try to demote current stage and leave in-band to handle following thing. If we do native thing here, is there duplicated thing happen?
Regards
Hongzhan Chen
Quoted 13 lines
And for I-pipe, we can fold the two abstractions into
handle_exception()there as well.Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
Re: [PATCH v2 2/2] cobalt/trace: dovetail: remove TODO and return -ENOSYS for unportable features
Quoted 70 lines · Hongzhan
Quoted 58 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Monday, November 29, 2021 3:58 PM
To: Chen, Hongzhan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 2/2] cobalt/trace: dovetail: remove TODO and return-ENOSYSfor unportable featuresQuoted 49 lines · Hongzhan Chen via Xenomai
Some of the features are unportable because ftrace does not provide equivalent functionality to the ipipe tracer (namely double buffering so that you can continue to record in flight-recorder mode while a previous recording remains available).
We remove TODOs to pass allyesconfig make.
Signed-off-by Hongzhan Chen <[email protected]>--- include/cobalt/kernel/dovetail/pipeline/trace.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)include/cobalt/kernel/dovetail/pipeline/trace.h +4
-8@@ -27,20 +27,17 @@static inline int xntrace_max_begin (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_end (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_reset (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_user_start (void )@@ -96,14 +93,12 @@ static inline int xntrace_tick(unsigned long delay_ticks) /* ns */static inline int xntrace_panic_freeze (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }Quoted 11 lines
include/cobalt/kernel/dovetail/pipeline/trace.h static inline int xntrace_tick(unsigned long delay_ticks) /* ns */ · line 103
Quoted 7 lines
include/cobalt/kernel/dovetail/pipeline/trace.h +1
-2static inline int xntrace_panic_dump (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }Looking at these two panic "abstractions": They are only called by dovetail-specific
handle_oob_trap_entry. There, we should rather use kernel native tracing functions to stop and dump a trace.
Quoted 6 lines
I found that in EVL implementation of
handle_oob_trap_entry,especially
fornote_trapimplementation , it have not implemented stop and dump
a trace and just try to printk warning (please refer tokernel/evl/thread.cof evl branch).handle_oob_trap_entrywould try to demote current stage and leave in-band to handle following thing. If we do native thing here, is there duplicated thing happen?
This is targeting a real error case: fault in kernel space when debugging is on. But if we really oops, ftrace_dump_on_panic may just do the job. So, yes, we could also simply drop this.
Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
RE: [PATCH v2 2/2] cobalt/trace: dovetail: remove TODO and return -ENOSYS for unportable features
Quoted 86 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Tuesday, November 30, 2021 2:41 PM
To: Chen, Hongzhan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 2/2] cobalt/trace: dovetail: remove TODO and return-ENOSYSfor unportable featuresQuoted 70 lines · Hongzhan
Quoted 58 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Monday, November 29, 2021 3:58 PM
To: Chen, Hongzhan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 2/2] cobalt/trace: dovetail: remove TODO and return-ENOSYSfor unportable featuresQuoted 49 lines · Hongzhan Chen via Xenomai
Some of the features are unportable because ftrace does not provide equivalent functionality to the ipipe tracer (namely double buffering so that you can continue to record in flight-recorder mode while a previous recording remains available).
We remove TODOs to pass allyesconfig make.
Signed-off-by Hongzhan Chen <[email protected]>--- include/cobalt/kernel/dovetail/pipeline/trace.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)include/cobalt/kernel/dovetail/pipeline/trace.h +4
-8@@ -27,20 +27,17 @@static inline int xntrace_max_begin (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_end (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_reset (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_user_start (void )@@ -96,14 +93,12 @@ static inline int xntrace_tick(unsigned long delay_ticks) /* ns */static inline int xntrace_panic_freeze (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }Quoted 11 lines
include/cobalt/kernel/dovetail/pipeline/trace.h static inline int xntrace_tick(unsigned long delay_ticks) /* ns */ · line 103
Quoted 7 lines
include/cobalt/kernel/dovetail/pipeline/trace.h +1
-2static inline int xntrace_panic_dump (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }Looking at these two panic "abstractions": They are only called by dovetail-specific
handle_oob_trap_entry. There, we should rather use kernel native tracing functions to stop and dump a trace.Quoted 6 lines
I found that in EVL implementation of
handle_oob_trap_entry,especially
fornote_trapimplementation , it have not implemented stop and dump
a trace and just try to printk warning (please refer tokernel/evl/thread.cof evl branch).handle_oob_trap_entrywould try to demote current stage and leave in-band to handle following thing. If we do native thing here, is there duplicated thing happen?
Quoted 3 lines
This is targeting a real error case: fault in kernel space when debugging is on. But if we really oops,
ftrace_dump_on_panicmay just do the job. So, yes, we could also simply drop this.
So there is no need to do further modification for xntrace_panic_freeze and xntrace_panic_dump based on this patch? Would you apply it?
Regards
Hongzhan Chen
Quoted 10 lines
Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
Re: [PATCH v2 2/2] cobalt/trace: dovetail: remove TODO and return -ENOSYS for unportable features
Quoted 86 lines · Hongzhan
Quoted 86 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Tuesday, November 30, 2021 2:41 PM
To: Chen, Hongzhan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 2/2] cobalt/trace: dovetail: remove TODO and return-ENOSYSfor unportable featuresQuoted 76 lines · Hongzhan
Quoted 58 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Monday, November 29, 2021 3:58 PM
To: Chen, Hongzhan <[email protected]>; [email protected]
Subject: Re: [PATCH v2 2/2] cobalt/trace: dovetail: remove TODO and return-ENOSYSfor unportable featuresQuoted 49 lines · Hongzhan Chen via Xenomai
Some of the features are unportable because ftrace does not provide equivalent functionality to the ipipe tracer (namely double buffering so that you can continue to record in flight-recorder mode while a previous recording remains available).
We remove TODOs to pass allyesconfig make.
Signed-off-by Hongzhan Chen <[email protected]>--- include/cobalt/kernel/dovetail/pipeline/trace.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)include/cobalt/kernel/dovetail/pipeline/trace.h +4
-8@@ -27,20 +27,17 @@static inline int xntrace_max_begin (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_end (unsigned long v) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_max_reset (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }static inline int xntrace_user_start (void )@@ -96,14 +93,12 @@ static inline int xntrace_tick(unsigned long delay_ticks) /* ns */static inline int xntrace_panic_freeze (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }Quoted 11 lines
include/cobalt/kernel/dovetail/pipeline/trace.h static inline int xntrace_tick(unsigned long delay_ticks) /* ns */ · line 103
Quoted 7 lines
include/cobalt/kernel/dovetail/pipeline/trace.h +1
-2static inline int xntrace_panic_dump (void ) { -TODO (); -return 0 ; +return -ENOSYS ; }Looking at these two panic "abstractions": They are only called by dovetail-specific
handle_oob_trap_entry. There, we should rather use kernel native tracing functions to stop and dump a trace.I found that in EVL implementation of
handle_oob_trap_entry,especially
fornote_trapimplementation , it have not implemented stop and dump
a trace and just try to printk warning (please refer tokernel/evl/thread.cof evl branch).handle_oob_trap_entrywould try to demote current stage and leave in-band to handle following thing. If we do native thing here, is there duplicated thing happen?
Quoted 7 lines
Quoted 3 lines
This is targeting a real error case: fault in kernel space when debugging is on. But if we really oops,
ftrace_dump_on_panicmay just do the job. So, yes, we could also simply drop this.So there is no need to do further modification for
xntrace_panic_freezeandxntrace_panic_dumpbased on this patch? Would you apply it?
If you drop those calls from dovetail, yes.
Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux