Skip to contentSkip to conversation

tracing: Last minute updates for 6.11

PATCH New Steven Rostedt 1 participant 4 messages Jul 16, 2024

Subsystems (3)
lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

cover tracing: Last minute updates for 6.11

git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace/for-next

Head SHA1: 7dc836187f7c6f70a82b4521503e9f9f96194581

Luis Claudio R. Goncalves (1):
rtla/osnoise: set the default threshold to 1us

Tio Zhang (1):
tracing/sched: sched_switch: place prev_comm and next_comm in right order

levi.yun (1):
trace/pid_list: Change gfp flags in pid_list_fill_irq()

----

 Documentation/trace/osnoise-tracer.rst | 2 +-
 include/trace/events/sched.h           | 4 ++--
 kernel/trace/pid_list.c                | 4 ++--
 kernel/trace/trace_osnoise.c           | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)
author maintainer
#1 lore raw

PATCH 1/3 rtla/osnoise: set the default threshold to 1us

From: "Luis Claudio R. Goncalves" <[email protected]>

Change the default threshold for osnoise to 1us, so that any noise equal or above this value is recorded. Let the user set a higher threshold if necessary.

---
 Documentation/trace/osnoise-tracer.rst | 2 +-
 kernel/trace/trace_osnoise.c           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Documentation/trace/osnoise-tracer.rst +1 -1
index 140ef2533d26..a520adbd3476 100644
@@ -108,7 +108,7 @@ The tracer has a set of options inside the osnoise directory, they are:
    option.
  - tracing_threshold: the minimum delta between two time() reads to be
    considered as noise, in us. When set to 0, the default value will
-   be used, which is currently 5 us.
+   be used, which is currently 1 us.
  - osnoise/options: a set of on/off options that can be enabled by
    writing the option name to the file or disabled by writing the option
    name preceded with the 'NO\_' prefix. For example, writing
kernel/trace/trace_osnoise.c +2 -2
index a8e28f9b9271..66a871553d4a 100644
@@ -1444,9 +1444,9 @@ static int run_osnoise(void)
 	save_osn_sample_stats(osn_var, &s);
 
 	/*
-	 * if threshold is 0, use the default value of 5 us.
+	 * if threshold is 0, use the default value of 1 us.
 	 */
-	threshold = tracing_thresh ? : 5000;
+	threshold = tracing_thresh ? : 1000;
 
 	/*
 	 * Apply PREEMPT and IRQ disabled options.
Signature · 1 line
2.43.0
author maintainer
#2 lore raw

PATCH 2/3 tracing/sched: sched_switch: place prev_comm and next_comm in right order

In reply to Steven Rostedt

From: Tio Zhang <[email protected]>

Switch the order of prev_comm and next_comm in sched_switch's code to align with its printing order.

---
 include/trace/events/sched.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/trace/events/sched.h +2 -2
index 6df2b4685b08..9ea4c404bd4e 100644
@@ -239,11 +239,11 @@ TRACE_EVENT(sched_switch,
 	),
 
 	TP_fast_assign(
-		memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
+		memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
 		__entry->prev_pid	= prev->pid;
 		__entry->prev_prio	= prev->prio;
 		__entry->prev_state	= __trace_sched_switch_state(preempt, prev_state, prev);
-		memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
+		memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
 		__entry->next_pid	= next->pid;
 		__entry->next_prio	= next->prio;
 		/* XXX SCHED_DEADLINE */
Signature · 1 line
2.43.0
author maintainer
#3 lore raw

PATCH 3/3 trace/pid_list: Change gfp flags in pid_list_fill_irq()

In reply to Steven Rostedt

From: "levi.yun" <[email protected]>

pid_list_fill_irq() runs via irq_work.
When CONFIG_PREEMPT_RT is disabled, it would run in irq_context. so it shouldn't sleep while memory allocation.

Change gfp flags from GFP_KERNEL to GFP_NOWAIT to prevent sleep in irq_work.

This change wouldn't impact functionality in practice because the worst-size is 2K.

---
 kernel/trace/pid_list.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/pid_list.c +2 -2
index 19b271a12c99..4966e6bbdf6f 100644
@@ -354,7 +354,7 @@ static void pid_list_refill_irq(struct irq_work *iwork)
 	while (upper_count-- > 0) {
 		union upper_chunk *chunk;
 
-		chunk = kzalloc(sizeof(*chunk), GFP_KERNEL);
+		chunk = kzalloc(sizeof(*chunk), GFP_NOWAIT);
 		if (!chunk)
 			break;
 		*upper_next = chunk;
@@ -365,7 +365,7 @@ static void pid_list_refill_irq(struct irq_work *iwork)
 	while (lower_count-- > 0) {
 		union lower_chunk *chunk;
 
-		chunk = kzalloc(sizeof(*chunk), GFP_KERNEL);
+		chunk = kzalloc(sizeof(*chunk), GFP_NOWAIT);
 		if (!chunk)
 			break;
 		*lower_next = chunk;
Signature · 1 line
2.43.0