[PATCH v9 17/24] coresight: cti: Fix remove sysfs link error

2020-08-19 Thread Tingwei Zhang
. This patch corrects the link removal code. Fixes: 73274abb6557 ("coresight: cti: Add in sysfs links to other coresight devices") Reported-by: Tingwei Zhang Signed-off-by: Mike Leach Reviewed-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-cti.c | 9 ++--- 1 file

[PATCH v9 14/24] coresight: allow funnel driver to be built as module

2020-08-19 Thread Tingwei Zhang
Yan Cc: Alexander Shishkin Cc: Randy Dunlap Cc: Suzuki K Poulose Cc: Greg Kroah-Hartman Cc: Russell King Co-developed-by: Mian Yousaf Kaukab Signed-off-by: Mian Yousaf Kaukab Signed-off-by: Kim Phillips Signed-off-by: Tingwei Zhang Tested-by: Mike Leach Reviewed-by: Mathieu Poirier

[PATCH v9 10/24] coresight: etm4x: allow etm4x to be built as a module

2020-08-19 Thread Tingwei Zhang
Signed-off-by: Tingwei Zhang Tested-by: Mike Leach Suggested-by: Suzuki K Poulose --- drivers/hwtracing/coresight/Kconfig | 5 +- drivers/hwtracing/coresight/Makefile | 4 +- ...resight-etm4x.c => coresight-etm4x-core.c} | 84 ++- 3 files changed,

[PATCH v9 09/24] coresight: etm3x: allow etm3x to be built as a module

2020-08-19 Thread Tingwei Zhang
a MODULE_DEVICE_TABLE for autoloading on boot Cc: Mathieu Poirier Cc: Leo Yan Cc: Alexander Shishkin Cc: Randy Dunlap Cc: Suzuki K Poulose Cc: Greg Kroah-Hartman Cc: Russell King Signed-off-by: Kim Phillips Signed-off-by: Tingwei Zhang Reviewed-by: Mike Leach --- drivers/hwtracing/coresight/Kconfig

[PATCH v9 06/24] coresight: add try_get_module() in coresight_grab_device()

2020-08-19 Thread Tingwei Zhang
When coresight device is in an active session, driver module of that device should not be removed. Use try_get_module() in coresight_grab_device() to prevent module to be unloaded. Use get_device()/put_device() to protect device data in the middle of active session. Signed-off-by: Tingwei Zhang

[PATCH v9 03/24] coresight: use IS_ENABLED for CONFIGs that may be modules

2020-08-19 Thread Tingwei Zhang
: Greg Kroah-Hartman Cc: Russell King Signed-off-by: Kim Phillips Signed-off-by: Tingwei Zhang Reviewed-by: Suzuki K Poulose Reviewed-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm-perf.h | 2 +- drivers/hwtracing/coresight/coresight-priv.h | 2 +- include/linux

[PATCH v9 08/24] coresight: etm: perf: Fix warning caused by etm_setup_aux failure

2020-08-19 Thread Tingwei Zhang
When coresight_build_path() fails on all the cpus, etm_setup_aux calls etm_free_aux() to free allocated event_data. WARN_ON(cpumask_empty(mask) will be triggered since cpu mask is empty. Check event_data->snk_config is not NULL first to avoid this warning. Signed-off-by: Tingwei Zhang Revie

[PATCH v9 02/24] coresight: cpu_debug: define MODULE_DEVICE_TABLE

2020-08-19 Thread Tingwei Zhang
Define a MODULE_DEVICE_TABLE for cpu_debug so module can be auto loaded on boot. Signed-off-by: Tingwei Zhang Reviewed-by: Suzuki K Poulose Reviewed-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-cpu-debug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers

[PATCH v9 05/24] coresight: export global symbols

2020-08-19 Thread Tingwei Zhang
From: Mian Yousaf Kaukab Export symbols used among coresight modules. Signed-off-by: Mian Yousaf Kaukab Signed-off-by: Tingwei Zhang Tested-by: Mike Leach Reviewed-by: Suzuki K Poulose Reviewed-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm-perf.c | 1 + drivers

[PATCH v9 04/24] coresight: add coresight prefix to barrier_pkt

2020-08-19 Thread Tingwei Zhang
Add coresight prefix to make it specific. It will be a export symbol. Signed-off-by: Mian Yousaf Kaukab Signed-off-by: Tingwei Zhang Reviewed-by: Suzuki K Poulose Reviewed-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etb10.c | 2 +- drivers/hwtracing/coresight/coresight

[PATCH v9 07/24] coresight: stm: allow to build coresight-stm as a module

2020-08-19 Thread Tingwei Zhang
-by: Kim Phillips Signed-off-by: Tingwei Zhang Tested-by: Mike Leach Reviewed-by: Suzuki K Poulose Reviewed-by: Mathieu Poirier --- drivers/hwtracing/coresight/Kconfig | 5 - drivers/hwtracing/coresight/coresight-stm.c | 20 +++- 2 files changed, 23 insertions(+), 2

[PATCH v9 00/24] coresight: allow to build coresight as modules

2020-08-19 Thread Tingwei Zhang
tion to register catu ops Mike Leach (2): coresight: cti: Fix remove sysfs link error coresight: cti: Fix bug clearing sysfs links on callback Tingwei Zhang (12): coresight: cpu_debug: add module name in Kconfig coresight: cpu_debug: define MODULE_DEVICE_TABLE coresight: add coresigh

[PATCH v9 01/24] coresight: cpu_debug: add module name in Kconfig

2020-08-19 Thread Tingwei Zhang
Provide name of cpu_debug module in Kconfig help section. Signed-off-by: Tingwei Zhang Tested-by: Mike Leach Reviewed-by: Suzuki K Poulose Reviewed-by: Mathieu Poirier --- drivers/hwtracing/coresight/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hwtracing/coresight

[PATCH] coresight: cti: write regsiters directly in cti_enable_hw()

2020-08-18 Thread Tingwei Zhang
wered has been checked to be true with spinlock holded. CTI is powered and can be programmed until spinlock is released. Fixes: 6a0953ce7de9 ("coresight: cti: Add CPU idle pm notifer to CTI devices") Signed-off-by: Tingwei Zhang --- drivers/hwtracing/coresight/coresight-cti.c | 17 +-

[PATCH] coresight: cti: remove pm_runtime_get_sync() from CPU hotplug

2020-08-18 Thread Tingwei Zhang
] cpuhp_invoke_callback+0x84/0x1e0 [ 105.800814] notify_cpu_starting+0x9c/0xb8 [ 105.800834] secondary_start_kernel+0xd8/0x164 [ 105.800933] CPU1: Booted secondary processor 0x000100 [0x517f803c] Fixes: e9b880581d55 ("coresight: cti: Add CPU Hotplug handling to CTI driver") Signed-off-by: Tin

[PATCH] coresight: cti: disclaim device only when it's claimed

2020-08-18 Thread Tingwei Zhang
/0x18 Fixes: e9b880581d55 ("coresight: cti: Add CPU Hotplug handling to CTI driver") Signed-off-by: Tingwei Zhang --- drivers/hwtracing/coresight/coresight-cti.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-cti.c b/drivers

Re: [PATCH v3 0/6] tracing: export event trace and trace_marker

2020-08-12 Thread Tingwei Zhang
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 >

[PATCH v3 6/6] stm class: ftrace: use different channel accroding to CPU

2020-08-12 Thread Tingwei Zhang
To avoid mixup of packets from differnt ftrace packets simultaneously, use different channel for packets from different CPU. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- drivers/hwtracing/stm/ftrace.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH v3 5/6] stm class: ftrace: enable supported trace export flag

2020-08-12 Thread Tingwei Zhang
Set flags for trace_export. Export function trace, event trace and trace marker to stm. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- drivers/hwtracing/stm/ftrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hwtracing/stm/ftrace.c b/drivers/hwtracing

[PATCH v3 0/6] tracing: export event trace and trace_marker

2020-08-12 Thread Tingwei Zhang
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

[PATCH v3 2/6] tracing: add flag to control different traces

2020-08-12 Thread Tingwei Zhang
More traces like event trace or trace marker will be supported. Add flag for difference traces, so that they can be controlled separately. Move current function trace to it's own flag instead of global ftrace enable flag. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware

[PATCH v3 3/6] tracing: add trace_export support for event trace

2020-08-12 Thread Tingwei Zhang
Only function traces can be exported to other destinations currently. This patch exports event trace as well. Move trace export related function to the beginning of file so other trace can call trace_process_export() to export. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware

[PATCH v3 1/6] stm class: ftrace: change dependency to TRACING

2020-08-12 Thread Tingwei Zhang
We will support copying event trace to STM. Change STM_SOURCE_FTRACE to depend on TRACING since we will support multiple tracers. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- drivers/hwtracing/stm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v3 4/6] tracing: add trace_export support for trace_marker

2020-08-12 Thread Tingwei Zhang
Add the support to route trace_marker buffer to other destination via trace_export. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- include/linux/trace.h | 1 + kernel/trace/trace.c | 9 + 2 files changed, 10 insertions(+) diff --git a/include/linux/trace.h b

Re: [PATCH v3 0/6] tracing: export event trace and trace_marker

2020-08-11 Thread Tingwei Zhang
On Tue, Aug 11, 2020 at 12:03:33PM +0800, Steven Rostedt wrote: > On Tue, 11 Aug 2020 11:49:46 +0800 > Tingwei Zhang 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 wrote:

[PATCH v3 5/6] stm class: ftrace: enable supported trace export flag

2020-08-10 Thread Tingwei Zhang
Set flags for trace_export. Export function trace, event trace and trace marker to stm. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- drivers/hwtracing/stm/ftrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hwtracing/stm/ftrace.c b/drivers/hwtracing

[PATCH v3 6/6] stm class: ftrace: use different channel accroding to CPU

2020-08-10 Thread Tingwei Zhang
To avoid mixup of packets from differnt ftrace packets simultaneously, use different channel for packets from different CPU. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- drivers/hwtracing/stm/ftrace.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH v3 0/6] tracing: export event trace and trace_marker

2020-08-10 Thread Tingwei Zhang
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

[PATCH v3 1/6] stm class: ftrace: change dependency to TRACING

2020-08-10 Thread Tingwei Zhang
We will support copying event trace to STM. Change STM_SOURCE_FTRACE to depend on TRACING since we will support multiple tracers. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- drivers/hwtracing/stm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v3 2/6] tracing: add flag to control different traces

2020-08-10 Thread Tingwei Zhang
More traces like event trace or trace marker will be supported. Add flag for difference traces, so that they can be controlled separately. Move current function trace to it's own flag instead of global ftrace enable flag. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware

[PATCH v3 3/6] tracing: add trace_export support for event trace

2020-08-10 Thread Tingwei Zhang
Only function traces can be exported to other destinations currently. This patch exports event trace as well. Move trace export related function to the beginning of file so other trace can call trace_process_export() to export. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware

[PATCH v3 4/6] tracing: add trace_export support for trace_marker

2020-08-10 Thread Tingwei Zhang
Add the support to route trace_marker buffer to other destination via trace_export. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- include/linux/trace.h | 1 + kernel/trace/trace.c | 9 + 2 files changed, 10 insertions(+) diff --git a/include/linux/trace.h b

Re: [PATCH v3 0/6] tracing: export event trace and trace_marker

2020-08-10 Thread Tingwei Zhang
Hi Steven, On Tue, Jul 28, 2020 at 09:33:53AM +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 de

Re: [PATCHv3] coresight: etm4x: Fix etm4_count race by moving cpuhp callbacks to init

2020-08-06 Thread Tingwei Zhang
On Wed, Jul 29, 2020 at 01:13:10PM +0800, Sai Prakash Ranjan wrote: > etm4_count keeps track of number of ETMv4 registered and on some systems, > a race is observed on etm4_count variable which can lead to multiple calls > to cpuhp_setup_state_nocalls_cpuslocked(). This function internally calls >

[PATCH v3 4/6] tracing: add trace_export support for trace_marker

2020-07-27 Thread Tingwei Zhang
Add the support to route trace_marker buffer to other destination via trace_export. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- include/linux/trace.h | 1 + kernel/trace/trace.c | 9 + 2 files changed, 10 insertions(+) diff --git a/include/linux/trace.h b

[PATCH v3 0/6] tracing: export event trace and trace_marker

2020-07-27 Thread Tingwei Zhang
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

[PATCH v3 6/6] stm class: ftrace: use different channel accroding to CPU

2020-07-27 Thread Tingwei Zhang
To avoid mixup of packets from differnt ftrace packets simultaneously, use different channel for packets from different CPU. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- drivers/hwtracing/stm/ftrace.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH v3 2/6] tracing: add flag to control different traces

2020-07-27 Thread Tingwei Zhang
More traces like event trace or trace marker will be supported. Add flag for difference traces, so that they can be controlled separately. Move current function trace to it's own flag instead of global ftrace enable flag. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware

[PATCH v3 1/6] stm class: ftrace: change dependency to TRACING

2020-07-27 Thread Tingwei Zhang
We will support copying event trace to STM. Change STM_SOURCE_FTRACE to depend on TRACING since we will support multiple tracers. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- drivers/hwtracing/stm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v3 5/6] stm class: ftrace: enable supported trace export flag

2020-07-27 Thread Tingwei Zhang
Set flags for trace_export. Export function trace, event trace and trace marker to stm. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware) --- drivers/hwtracing/stm/ftrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hwtracing/stm/ftrace.c b/drivers/hwtracing

[PATCH v3 3/6] tracing: add trace_export support for event trace

2020-07-27 Thread Tingwei Zhang
Only function traces can be exported to other destinations currently. This patch exports event trace as well. Move trace export related function to the beginning of file so other trace can call trace_process_export() to export. Signed-off-by: Tingwei Zhang Reviewed-by: Steven Rostedt (VMware

Re: [PATCH v2 2/6] tracing: add flag to control different traces

2020-07-27 Thread Tingwei Zhang
Hi Steve, On Tue, Jul 28, 2020 at 02:45:50AM +0800, Steven Rostedt wrote: > On Sun, 26 Jul 2020 10:59:27 +0800 > Tingwei Zhang wrote: > > > > diff --git a/include/linux/trace.h b/include/linux/trace.h > > index 7fd86d3c691f..d2fdf9be84b5 100644 > > --- a/include/l

Re: [PATCH v2 6/6] stm class: ftrace: use different channel accroding to CPU

2020-07-27 Thread Tingwei Zhang
Hi Steve, On Tue, Jul 28, 2020 at 03:08:12AM +0800, Steven Rostedt wrote: > On Sun, 26 Jul 2020 10:59:31 +0800 > Tingwei Zhang wrote: > > > --- a/drivers/hwtracing/stm/ftrace.c > > +++ b/drivers/hwtracing/stm/ftrace.c > > @@ -37,8 +37,9 @@ static void notrace &

[PATCH v2 5/6] stm class: ftrace: enable supported trace export flag

2020-07-25 Thread Tingwei Zhang
Set flags for trace_export. Export function trace, event trace and trace marker to stm. Signed-off-by: Tingwei Zhang --- 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

[PATCH v2 2/6] tracing: add flag to control different traces

2020-07-25 Thread Tingwei Zhang
More traces like event trace or trace marker will be supported. Add flag for difference traces, so that they can be controlled separately. Move current function trace to it's own flag instead of global ftrace enable flag. Signed-off-by: Tingwei Zhang --- include/linux/trace.h | 5 + kernel

[PATCH v2 3/6] tracing: add trace_export support for event trace

2020-07-25 Thread Tingwei Zhang
Only function traces can be exported to other destinations currently. This patch exports event trace as well. Move trace export related function to the beginning of file so other trace can call trace_process_export() to export. Signed-off-by: Tingwei Zhang --- include/linux/trace.h | 1

[PATCH v2 6/6] stm class: ftrace: use different channel accroding to CPU

2020-07-25 Thread Tingwei Zhang
To avoid mixup of packets from differnt ftrace packets simultaneously, use different channel for packets from different CPU. Signed-off-by: Tingwei Zhang --- drivers/hwtracing/stm/ftrace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/stm/ftrace.c b

[PATCH v2 4/6] tracing: add trace_export support for trace_marker

2020-07-25 Thread Tingwei Zhang
Add the support to route trace_marker buffer to other destination via trace_export. Signed-off-by: Tingwei Zhang --- include/linux/trace.h | 1 + kernel/trace/trace.c | 9 + 2 files changed, 10 insertions(+) diff --git a/include/linux/trace.h b/include/linux/trace.h index 91f6f1c0f2db

[PATCH v2 1/6] stm class: ftrace: change dependency to TRACING

2020-07-25 Thread Tingwei Zhang
We will support copying event trace to STM. Change STM_SOURCE_FTRACE to depend on TRACING since we will support multiple tracers. Signed-off-by: Tingwei Zhang --- drivers/hwtracing/stm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/stm/Kconfig b

[PATCH v2 0/6] tracing: export event trace and trace_marker

2020-07-25 Thread Tingwei Zhang
different CPUs together. Change from v1: All changes are suggested by Steven Rostedt. User seperate 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

[PATCH 4/4] stm class: ftrace: use different channel accroding to CPU

2020-07-19 Thread Tingwei Zhang
To avoid mixup of packets from differnt ftrace packets simultaneously, use different channel for packets from different CPU. Signed-off-by: Tingwei Zhang --- drivers/hwtracing/stm/ftrace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/stm/ftrace.c b

[PATCH 2/4] tracing: add trace_export support for event trace

2020-07-19 Thread Tingwei Zhang
Only function traces can be exported to other destinations currently. This patch exports event trace as well. Signed-off-by: Tingwei Zhang --- kernel/trace/trace.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/kernel/trace/trace.c b/kernel/trace

[PATCH 3/4] tracing: add trace_export support for trace_marker

2020-07-19 Thread Tingwei Zhang
Add the support to route trace_marker buffer to other destination via trace_export. Signed-off-by: Tingwei Zhang --- kernel/trace/trace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index aef6330836e2..ac18e0ee9246 100644 --- a/kernel/trace

[PATCH 1/4] stm class: ftrace: change dependency to TRACING

2020-07-19 Thread Tingwei Zhang
We will support copying event trace to STM. Change STM_SOURCE_FTRACE to depend on TRACING since we will support multiple tracers. Signed-off-by: Tingwei Zhang --- drivers/hwtracing/stm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/stm/Kconfig b

[PATCH 0/4] tracing: export event trace and trace_marker

2020-07-19 Thread Tingwei Zhang
different CPUs together. Tingwei Zhang (4): stm class: ftrace: change dependency to TRACING tracing: add trace_export support for event trace tracing: add trace_export support for trace_marker stm class: ftrace: use different channel accroding to CPU drivers/hwtracing/stm/Kconfig | 2

<    1   2