Tero Kristo 08697bca9b trace/hwlat: Do not start per-cpu thread if it is already running
The hwlatd tracer will end up starting multiple per-cpu threads with
the following script:

    #!/bin/sh
    cd /sys/kernel/debug/tracing
    echo 0 > tracing_on
    echo hwlat > current_tracer
    echo per-cpu > hwlat_detector/mode
    echo 100000 > hwlat_detector/width
    echo 200000 > hwlat_detector/window
    echo 1 > tracing_on

To fix the issue, check if the hwlatd thread for the cpu is already
running, before starting a new one. Along with the previous patch, this
avoids running multiple instances of the same CPU thread on the system.

Link: https://lore.kernel.org/all/20230302113654.2984709-1-tero.kristo@linux.intel.com/
Link: https://lkml.kernel.org/r/20230310100451.3948583-3-tero.kristo@linux.intel.com

Cc: stable@vger.kernel.org
Fixes: f46b16520a087 ("trace/hwlat: Implement the per-cpu mode")
Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com>
Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2023-03-19 12:20:49 -04:00
..
2022-12-13 19:29:45 -08:00
2022-12-02 11:25:00 +01:00
2022-12-21 14:31:52 -08:00
2022-12-13 14:05:39 -08:00
2022-12-19 07:13:33 -06:00
2022-12-21 07:59:57 -08:00
2022-08-29 19:47:03 -04:00
2022-01-11 13:08:21 -08:00
2022-09-26 10:13:13 -07:00
2022-12-17 14:06:53 -06:00
2022-11-15 00:42:02 -08:00
2022-12-23 12:00:24 -08:00
2022-12-19 12:33:32 -06:00
2022-12-23 12:00:24 -08:00
2022-12-16 03:54:54 -08:00
2022-06-29 13:07:16 +02:00
2022-12-16 03:54:54 -08:00
2022-12-14 12:20:00 -08:00
2022-10-10 12:49:34 -07:00
2022-02-25 09:36:06 +01:00
2022-12-13 19:29:45 -08:00
2022-08-06 16:38:17 -07:00