Ftrace has ability to export trace packets to other destination.
Currently, only function trace can be exported. This series extends the
support to event trace and trace_maker. STM is one possible destination to
export ftrace. Use separate channel for each CPU to avoid mixing up packets
from different CPUs together.
Change from v2:
Change flag definition to BIT(). (Steven)
Add comment in stm_ftrace_write() to clarify it's safe to use
smp_processor_id() here since preempt is disabled. (Steven)
Change from v1:
All changes are suggested by Steven Rostedt.
User separate flag to control function trace, event trace and trace mark.
Allocate channels according to num_possible_cpu() dynamically.
Move ftrace_exports routines up so all ftrace can use them.
Tingwei Zhang (6):
stm class: ftrace: change dependency to TRACING
tracing: add flag to control different traces
tracing: add trace_export support for event trace
tracing: add trace_export support for trace_marker
stm class: ftrace: enable supported trace export flag
stm class: ftrace: use different channel accroding to CPU
drivers/hwtracing/stm/Kconfig | 2 +-
drivers/hwtracing/stm/ftrace.c | 7 +-
include/linux/trace.h | 7 +
kernel/trace/trace.c | 270 ++++++++++++++++++---------------
4 files changed, 159 insertions(+), 127 deletions(-)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Set flags for trace_export. Export function trace, event trace
and trace marker to stm.
Signed-off-by: Tingwei Zhang <[email protected]>
Reviewed-by: Steven Rostedt (VMware) <[email protected]>
---
drivers/hwtracing/stm/ftrace.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hwtracing/stm/ftrace.c b/drivers/hwtracing/stm/ftrace.c
index ce868e095410..c694a6e692d1 100644
--- a/drivers/hwtracing/stm/ftrace.c
+++ b/drivers/hwtracing/stm/ftrace.c
@@ -46,6 +46,8 @@ static int stm_ftrace_link(struct stm_source_data *data)
struct stm_ftrace *sf = container_of(data, struct stm_ftrace, data);
sf->ftrace.write = stm_ftrace_write;
+ sf->ftrace.flags = TRACE_EXPORT_FUNCTION | TRACE_EXPORT_EVENT
+ | TRACE_EXPORT_MARKER;
return register_ftrace_export(&sf->ftrace);
}
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
On Tue, Aug 11, 2020 at 12:03:33PM +0800, Steven Rostedt wrote:
> On Tue, 11 Aug 2020 11:49:46 +0800
> Tingwei Zhang <[email protected]> wrote:
>
> > On Tue, Aug 11, 2020 at 11:19:54AM +0800, Steven Rostedt wrote:
> > > On Tue, 11 Aug 2020 11:04:18 +0800
> > > Tingwei Zhang <[email protected]> wrote:
> > >
> > > > Thanks for your comments, Steven. I've addressed all your comments
> in
> > > v3.
> > > > Do you have more comments on v3? Is there anything I need to do to
> merge
> > > > this series to Linux Kernel?
> > >
> > > I gave my Reviewed-by tag on each of the patches that touch my tree.
> It
> > > should go in via whoever maintains the drivers/hwtracing tree. Is that
> > > Greg KH?
> > I thought it will go to tracing tree since majority of the changes are
> in
> > kernel/trace.
> >
> > Maintainers of drviers/hwtracing are Mathieu and Suzuki. I'll add them
> > into review list.
> >
>
> As I didn't have reviews or acks from them. I couldn't take the code.
> When touching two subsystems, it usually requires one of the subsystem
> maintainers to ack the changes to their subsystem, so that the other
> subsystem maintainer can take the rest of the code through their tree.
>
> And it usually goes through the tree that has the interface that is
> changing. That is, the changes to tracing was the infrastructure
> needed for the changes in the hwtrace subsystem. And I don't test that
> subsystem, so I wouldn't really be able to test this code.
>
Thanks a lot for detail clarification, Steven.
Thanks,
Tingwei
> -- Steve
On Tue, Aug 11, 2020 at 11:57:20AM +0800, Tingwei Zhang wrote:
> Ftrace has ability to export trace packets to other destination.
> Currently, only function trace can be exported. This series extends the
> support to event trace and trace_maker. STM is one possible destination to
> export ftrace. Use separate channel for each CPU to avoid mixing up packets
> from different CPUs together.
As the get_maintainer script points out, you are missing the maintainer of the
system trace subsystem.
>
> Change from v2:
> Change flag definition to BIT(). (Steven)
> Add comment in stm_ftrace_write() to clarify it's safe to use
> smp_processor_id() here since preempt is disabled. (Steven)
>
> Change from v1:
> All changes are suggested by Steven Rostedt.
> User separate flag to control function trace, event trace and trace mark.
> Allocate channels according to num_possible_cpu() dynamically.
> Move ftrace_exports routines up so all ftrace can use them.
>
> Tingwei Zhang (6):
> stm class: ftrace: change dependency to TRACING
> tracing: add flag to control different traces
> tracing: add trace_export support for event trace
> tracing: add trace_export support for trace_marker
> stm class: ftrace: enable supported trace export flag
> stm class: ftrace: use different channel accroding to CPU
>
> drivers/hwtracing/stm/Kconfig | 2 +-
> drivers/hwtracing/stm/ftrace.c | 7 +-
> include/linux/trace.h | 7 +
> kernel/trace/trace.c | 270 ++++++++++++++++++---------------
> 4 files changed, 159 insertions(+), 127 deletions(-)
>
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
On Thu, Aug 13, 2020 at 12:49:25AM +0800, Mathieu Poirier wrote:
> On Tue, Aug 11, 2020 at 11:57:20AM +0800, Tingwei Zhang wrote:
> > Ftrace has ability to export trace packets to other destination.
> > Currently, only function trace can be exported. This series extends the
> > support to event trace and trace_maker. STM is one possible destination
> to
> > export ftrace. Use separate channel for each CPU to avoid mixing up
> packets
> > from different CPUs together.
>
> As the get_maintainer script points out, you are missing the maintainer of
> the
> system trace subsystem.
>
Sorry for missing that. I resent the patch and add Alexander.
> >
> > Change from v2:
> > Change flag definition to BIT(). (Steven)
> > Add comment in stm_ftrace_write() to clarify it's safe to use
> > smp_processor_id() here since preempt is disabled. (Steven)
> >
> > Change from v1:
> > All changes are suggested by Steven Rostedt.
> > User separate flag to control function trace, event trace and trace
> mark.
> > Allocate channels according to num_possible_cpu() dynamically.
> > Move ftrace_exports routines up so all ftrace can use them.
> >
> > Tingwei Zhang (6):
> > stm class: ftrace: change dependency to TRACING
> > tracing: add flag to control different traces
> > tracing: add trace_export support for event trace
> > tracing: add trace_export support for trace_marker
> > stm class: ftrace: enable supported trace export flag
> > stm class: ftrace: use different channel accroding to CPU
> >
> > drivers/hwtracing/stm/Kconfig | 2 +-
> > drivers/hwtracing/stm/ftrace.c | 7 +-
> > include/linux/trace.h | 7 +
> > kernel/trace/trace.c | 270 ++++++++++++++++++---------------
> > 4 files changed, 159 insertions(+), 127 deletions(-)
> >
> > --
> > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
> Forum,
> > a Linux Foundation Collaborative Project
> >