All of lore.kernel.org
 help / color / mirror / Atom feed
* [for-linus][PATCH 0/8] tracing: Minor fixes for 6.3
@ 2023-03-19 16:46 Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 1/8] tracing: Fix wrong return in kprobe_event_gen_test.c Steven Rostedt
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Steven Rostedt @ 2023-03-19 16:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Masami Hiramatsu, Mark Rutland, Andrew Morton


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace/urgent

Head SHA1: 7e11ef3dd01bd781bbbd975b58564518cf7d3949


Anton Gusev (1):
      tracing: Fix wrong return in kprobe_event_gen_test.c

Costa Shulyupin (1):
      tracing/hwlat: Replace sched_setaffinity with set_cpus_allowed_ptr

Sung-hun Kim (1):
      tracing: Make splice_read available again

Tero Kristo (2):
      trace/hwlat: Do not wipe the contents of per-cpu thread data
      trace/hwlat: Do not start per-cpu thread if it is already running

Tom Rix (2):
      tracing/osnoise: set several trace_osnoise.c variables storage-class-specifier to static
      ftrace: Set direct_ops storage-class-specifier to static

Vlastimil Babka (1):
      ring-buffer: remove obsolete comment for free_buffer_page()

----
 kernel/trace/ftrace.c                |  2 +-
 kernel/trace/kprobe_event_gen_test.c |  4 ++--
 kernel/trace/ring_buffer.c           |  4 ----
 kernel/trace/trace.c                 |  2 ++
 kernel/trace/trace_hwlat.c           | 11 ++++++-----
 kernel/trace/trace_osnoise.c         | 10 +++++-----
 6 files changed, 16 insertions(+), 17 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [for-linus][PATCH 1/8] tracing: Fix wrong return in kprobe_event_gen_test.c
  2023-03-19 16:46 [for-linus][PATCH 0/8] tracing: Minor fixes for 6.3 Steven Rostedt
@ 2023-03-19 16:46 ` Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 2/8] tracing/osnoise: set several trace_osnoise.c variables storage-class-specifier to static Steven Rostedt
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2023-03-19 16:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Masami Hiramatsu, Mark Rutland, Andrew Morton, Anton Gusev

From: Anton Gusev <aagusev@ispras.ru>

Overwriting the error code with the deletion result may cause the
function to return 0 despite encountering an error. Commit b111545d26c0
("tracing: Remove the useless value assignment in
test_create_synth_event()") solves a similar issue by
returning the original error code, so this patch does the same.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Link: https://lore.kernel.org/linux-trace-kernel/20230131075818.5322-1-aagusev@ispras.ru

Signed-off-by: Anton Gusev <aagusev@ispras.ru>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/kprobe_event_gen_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/kprobe_event_gen_test.c b/kernel/trace/kprobe_event_gen_test.c
index 4850fdfe27f1..5a4b722b5045 100644
--- a/kernel/trace/kprobe_event_gen_test.c
+++ b/kernel/trace/kprobe_event_gen_test.c
@@ -146,7 +146,7 @@ static int __init test_gen_kprobe_cmd(void)
 	if (trace_event_file_is_valid(gen_kprobe_test))
 		gen_kprobe_test = NULL;
 	/* We got an error after creating the event, delete it */
-	ret = kprobe_event_delete("gen_kprobe_test");
+	kprobe_event_delete("gen_kprobe_test");
 	goto out;
 }
 
@@ -211,7 +211,7 @@ static int __init test_gen_kretprobe_cmd(void)
 	if (trace_event_file_is_valid(gen_kretprobe_test))
 		gen_kretprobe_test = NULL;
 	/* We got an error after creating the event, delete it */
-	ret = kprobe_event_delete("gen_kretprobe_test");
+	kprobe_event_delete("gen_kretprobe_test");
 	goto out;
 }
 
-- 
2.39.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [for-linus][PATCH 2/8] tracing/osnoise: set several trace_osnoise.c variables storage-class-specifier to static
  2023-03-19 16:46 [for-linus][PATCH 0/8] tracing: Minor fixes for 6.3 Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 1/8] tracing: Fix wrong return in kprobe_event_gen_test.c Steven Rostedt
@ 2023-03-19 16:46 ` Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 3/8] trace/hwlat: Do not wipe the contents of per-cpu thread data Steven Rostedt
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2023-03-19 16:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Masami Hiramatsu, Mark Rutland, Andrew Morton, Tom Rix,
	Daniel Bristot de Oliveira

From: Tom Rix <trix@redhat.com>

smatch reports several similar warnings
kernel/trace/trace_osnoise.c:220:1: warning:
  symbol '__pcpu_scope_per_cpu_osnoise_var' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:243:1: warning:
  symbol '__pcpu_scope_per_cpu_timerlat_var' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:335:14: warning:
  symbol 'interface_lock' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:2242:5: warning:
  symbol 'timerlat_min_period' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:2243:5: warning:
  symbol 'timerlat_max_period' was not declared. Should it be static?

These variables are only used in trace_osnoise.c, so it should be static

Link: https://lore.kernel.org/linux-trace-kernel/20230309150414.4036764-1-trix@redhat.com

Signed-off-by: Tom Rix <trix@redhat.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/trace_osnoise.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index 04f0fdae19a1..9176bb7a9bb4 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -217,7 +217,7 @@ struct osnoise_variables {
 /*
  * Per-cpu runtime information.
  */
-DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var);
+static DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var);
 
 /*
  * this_cpu_osn_var - Return the per-cpu osnoise_variables on its relative CPU
@@ -240,7 +240,7 @@ struct timerlat_variables {
 	u64			count;
 };
 
-DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var);
+static DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var);
 
 /*
  * this_cpu_tmr_var - Return the per-cpu timerlat_variables on its relative CPU
@@ -332,7 +332,7 @@ struct timerlat_sample {
 /*
  * Protect the interface.
  */
-struct mutex interface_lock;
+static struct mutex interface_lock;
 
 /*
  * Tracer data.
@@ -2239,8 +2239,8 @@ static struct trace_min_max_param osnoise_print_stack = {
 /*
  * osnoise/timerlat_period: min 100 us, max 1 s
  */
-u64 timerlat_min_period = 100;
-u64 timerlat_max_period = 1000000;
+static u64 timerlat_min_period = 100;
+static u64 timerlat_max_period = 1000000;
 static struct trace_min_max_param timerlat_period = {
 	.lock	= &interface_lock,
 	.val	= &osnoise_data.timerlat_period,
-- 
2.39.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [for-linus][PATCH 3/8] trace/hwlat: Do not wipe the contents of per-cpu thread data
  2023-03-19 16:46 [for-linus][PATCH 0/8] tracing: Minor fixes for 6.3 Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 1/8] tracing: Fix wrong return in kprobe_event_gen_test.c Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 2/8] tracing/osnoise: set several trace_osnoise.c variables storage-class-specifier to static Steven Rostedt
@ 2023-03-19 16:46 ` Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 4/8] trace/hwlat: Do not start per-cpu thread if it is already running Steven Rostedt
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2023-03-19 16:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Masami Hiramatsu, Mark Rutland, Andrew Morton, stable,
	Tero Kristo, Daniel Bristot de Oliveira

From: Tero Kristo <tero.kristo@linux.intel.com>

Do not wipe the contents of the per-cpu kthread data when starting the
tracer, as this will completely forget about already running instances
and can later start new additional per-cpu threads.

Link: https://lore.kernel.org/all/20230302113654.2984709-1-tero.kristo@linux.intel.com/
Link: https://lkml.kernel.org/r/20230310100451.3948583-2-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>
---
 kernel/trace/trace_hwlat.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c
index d440ddd5fd8b..edc26dc22c3f 100644
--- a/kernel/trace/trace_hwlat.c
+++ b/kernel/trace/trace_hwlat.c
@@ -584,9 +584,6 @@ static int start_per_cpu_kthreads(struct trace_array *tr)
 	 */
 	cpumask_and(current_mask, cpu_online_mask, tr->tracing_cpumask);
 
-	for_each_online_cpu(cpu)
-		per_cpu(hwlat_per_cpu_data, cpu).kthread = NULL;
-
 	for_each_cpu(cpu, current_mask) {
 		retval = start_cpu_kthread(cpu);
 		if (retval)
-- 
2.39.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [for-linus][PATCH 4/8] trace/hwlat: Do not start per-cpu thread if it is already running
  2023-03-19 16:46 [for-linus][PATCH 0/8] tracing: Minor fixes for 6.3 Steven Rostedt
                   ` (2 preceding siblings ...)
  2023-03-19 16:46 ` [for-linus][PATCH 3/8] trace/hwlat: Do not wipe the contents of per-cpu thread data Steven Rostedt
@ 2023-03-19 16:46 ` Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 5/8] ftrace: Set direct_ops storage-class-specifier to static Steven Rostedt
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2023-03-19 16:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Masami Hiramatsu, Mark Rutland, Andrew Morton, stable,
	Tero Kristo, Daniel Bristot de Oliveira

From: Tero Kristo <tero.kristo@linux.intel.com>

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>
---
 kernel/trace/trace_hwlat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c
index edc26dc22c3f..c4945f8adc11 100644
--- a/kernel/trace/trace_hwlat.c
+++ b/kernel/trace/trace_hwlat.c
@@ -492,6 +492,10 @@ static int start_cpu_kthread(unsigned int cpu)
 {
 	struct task_struct *kthread;
 
+	/* Do not start a new hwlatd thread if it is already running */
+	if (per_cpu(hwlat_per_cpu_data, cpu).kthread)
+		return 0;
+
 	kthread = kthread_run_on_cpu(kthread_fn, NULL, cpu, "hwlatd/%u");
 	if (IS_ERR(kthread)) {
 		pr_err(BANNER "could not start sampling thread\n");
-- 
2.39.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [for-linus][PATCH 5/8] ftrace: Set direct_ops storage-class-specifier to static
  2023-03-19 16:46 [for-linus][PATCH 0/8] tracing: Minor fixes for 6.3 Steven Rostedt
                   ` (3 preceding siblings ...)
  2023-03-19 16:46 ` [for-linus][PATCH 4/8] trace/hwlat: Do not start per-cpu thread if it is already running Steven Rostedt
@ 2023-03-19 16:46 ` Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 6/8] tracing: Make splice_read available again Steven Rostedt
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2023-03-19 16:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Masami Hiramatsu, Mark Rutland, Andrew Morton, Tom Rix

From: Tom Rix <trix@redhat.com>

smatch reports this warning
kernel/trace/ftrace.c:2594:19: warning:
  symbol 'direct_ops' was not declared. Should it be static?

The variable direct_ops is only used in ftrace.c, so it should be static

Link: https://lore.kernel.org/linux-trace-kernel/20230311135113.711824-1-trix@redhat.com

Signed-off-by: Tom Rix <trix@redhat.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index a47f7d93e32d..ec2897a76004 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2503,7 +2503,7 @@ static void call_direct_funcs(unsigned long ip, unsigned long pip,
 	arch_ftrace_set_direct_caller(fregs, addr);
 }
 
-struct ftrace_ops direct_ops = {
+static struct ftrace_ops direct_ops = {
 	.func		= call_direct_funcs,
 	.flags		= FTRACE_OPS_FL_DIRECT | FTRACE_OPS_FL_SAVE_REGS
 			  | FTRACE_OPS_FL_PERMANENT,
-- 
2.39.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [for-linus][PATCH 6/8] tracing: Make splice_read available again
  2023-03-19 16:46 [for-linus][PATCH 0/8] tracing: Minor fixes for 6.3 Steven Rostedt
                   ` (4 preceding siblings ...)
  2023-03-19 16:46 ` [for-linus][PATCH 5/8] ftrace: Set direct_ops storage-class-specifier to static Steven Rostedt
@ 2023-03-19 16:46 ` Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 7/8] ring-buffer: remove obsolete comment for free_buffer_page() Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 8/8] tracing/hwlat: Replace sched_setaffinity with set_cpus_allowed_ptr Steven Rostedt
  7 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2023-03-19 16:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Masami Hiramatsu, Mark Rutland, Andrew Morton, Sung-hun Kim

From: Sung-hun Kim <sfoon.kim@samsung.com>

Since the commit 36e2c7421f02 ("fs: don't allow splice read/write
without explicit ops") is applied to the kernel, splice() and
sendfile() calls on the trace file (/sys/kernel/debug/tracing
/trace) return EINVAL.

This patch restores these system calls by initializing splice_read
in file_operations of the trace file. This patch only enables such
functionalities for the read case.

Link: https://lore.kernel.org/linux-trace-kernel/20230314013707.28814-1-sfoon.kim@samsung.com

Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/trace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index fbb602a8b64b..4e9a7a952025 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5164,6 +5164,8 @@ loff_t tracing_lseek(struct file *file, loff_t offset, int whence)
 static const struct file_operations tracing_fops = {
 	.open		= tracing_open,
 	.read		= seq_read,
+	.read_iter	= seq_read_iter,
+	.splice_read	= generic_file_splice_read,
 	.write		= tracing_write_stub,
 	.llseek		= tracing_lseek,
 	.release	= tracing_release,
-- 
2.39.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [for-linus][PATCH 7/8] ring-buffer: remove obsolete comment for free_buffer_page()
  2023-03-19 16:46 [for-linus][PATCH 0/8] tracing: Minor fixes for 6.3 Steven Rostedt
                   ` (5 preceding siblings ...)
  2023-03-19 16:46 ` [for-linus][PATCH 6/8] tracing: Make splice_read available again Steven Rostedt
@ 2023-03-19 16:46 ` Steven Rostedt
  2023-03-19 16:46 ` [for-linus][PATCH 8/8] tracing/hwlat: Replace sched_setaffinity with set_cpus_allowed_ptr Steven Rostedt
  7 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2023-03-19 16:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Masami Hiramatsu, Mark Rutland, Andrew Morton, Ingo Molnar,
	Mike Rapoport, Vlastimil Babka, Mukesh Ojha

From: Vlastimil Babka <vbabka@suse.cz>

The comment refers to mm/slob.c which is being removed. It comes from
commit ed56829cb319 ("ring_buffer: reset buffer page when freeing") and
according to Steven the borrowed code was a page mapcount and mapping
reset, which was later removed by commit e4c2ce82ca27 ("ring_buffer:
allocate buffer page pointer"). Thus the comment is not accurate anyway,
remove it.

Link: https://lore.kernel.org/linux-trace-kernel/20230315142446.27040-1-vbabka@suse.cz

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Reported-by: Mike Rapoport <mike.rapoport@gmail.com>
Suggested-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Fixes: e4c2ce82ca27 ("ring_buffer: allocate buffer page pointer")
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/ring_buffer.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 071184324d18..3c7cd135333f 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -354,10 +354,6 @@ static void rb_init_page(struct buffer_data_page *bpage)
 	local_set(&bpage->commit, 0);
 }
 
-/*
- * Also stolen from mm/slob.c. Thanks to Mathieu Desnoyers for pointing
- * this issue out.
- */
 static void free_buffer_page(struct buffer_page *bpage)
 {
 	free_page((unsigned long)bpage->page);
-- 
2.39.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [for-linus][PATCH 8/8] tracing/hwlat: Replace sched_setaffinity with set_cpus_allowed_ptr
  2023-03-19 16:46 [for-linus][PATCH 0/8] tracing: Minor fixes for 6.3 Steven Rostedt
                   ` (6 preceding siblings ...)
  2023-03-19 16:46 ` [for-linus][PATCH 7/8] ring-buffer: remove obsolete comment for free_buffer_page() Steven Rostedt
@ 2023-03-19 16:46 ` Steven Rostedt
  7 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2023-03-19 16:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Masami Hiramatsu, Mark Rutland, Andrew Morton, Costa Shulyupin,
	Daniel Bristot de Oliveira

From: Costa Shulyupin <costa.shul@redhat.com>

There is a problem with the behavior of hwlat in a container,
resulting in incorrect output. A warning message is generated:
"cpumask changed while in round-robin mode, switching to mode none",
and the tracing_cpumask is ignored. This issue arises because
the kernel thread, hwlatd, is not a part of the container, and
the function sched_setaffinity is unable to locate it using its PID.
Additionally, the task_struct of hwlatd is already known.
Ultimately, the function set_cpus_allowed_ptr achieves
the same outcome as sched_setaffinity, but employs task_struct
instead of PID.

Test case:

  # cd /sys/kernel/tracing
  # echo 0 > tracing_on
  # echo round-robin > hwlat_detector/mode
  # echo hwlat > current_tracer
  # unshare --fork --pid bash -c 'echo 1 > tracing_on'
  # dmesg -c

Actual behavior:

[573502.809060] hwlat_detector: cpumask changed while in round-robin mode, switching to mode none

Link: https://lore.kernel.org/linux-trace-kernel/20230316144535.1004952-1-costa.shul@redhat.com

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 0330f7aa8ee63 ("tracing: Have hwlat trace migrate across tracing_cpumask CPUs")
Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/trace_hwlat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c
index c4945f8adc11..2f37a6e68aa9 100644
--- a/kernel/trace/trace_hwlat.c
+++ b/kernel/trace/trace_hwlat.c
@@ -339,7 +339,7 @@ static void move_to_next_cpu(void)
 	cpumask_clear(current_mask);
 	cpumask_set_cpu(next_cpu, current_mask);
 
-	sched_setaffinity(0, current_mask);
+	set_cpus_allowed_ptr(current, current_mask);
 	return;
 
  change_mode:
@@ -446,7 +446,7 @@ static int start_single_kthread(struct trace_array *tr)
 
 	}
 
-	sched_setaffinity(kthread->pid, current_mask);
+	set_cpus_allowed_ptr(kthread, current_mask);
 
 	kdata->kthread = kthread;
 	wake_up_process(kthread);
-- 
2.39.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-19 16:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-19 16:46 [for-linus][PATCH 0/8] tracing: Minor fixes for 6.3 Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 1/8] tracing: Fix wrong return in kprobe_event_gen_test.c Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 2/8] tracing/osnoise: set several trace_osnoise.c variables storage-class-specifier to static Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 3/8] trace/hwlat: Do not wipe the contents of per-cpu thread data Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 4/8] trace/hwlat: Do not start per-cpu thread if it is already running Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 5/8] ftrace: Set direct_ops storage-class-specifier to static Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 6/8] tracing: Make splice_read available again Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 7/8] ring-buffer: remove obsolete comment for free_buffer_page() Steven Rostedt
2023-03-19 16:46 ` [for-linus][PATCH 8/8] tracing/hwlat: Replace sched_setaffinity with set_cpus_allowed_ptr Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.