mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valentin Schneider <vschneid@redhat.com>
To: rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Frederic Weisbecker <frederic@kernel.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Neeraj Upadhyay <quic_neeraju@quicinc.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Zqiang <qiang.zhang1211@gmail.com>
Subject: [PATCH v2 27/27] context_tracking, rcu: Rename rcu_dyntick trace event into rcu_watching
Date: Tue, 30 Apr 2024 11:17:31 +0200	[thread overview]
Message-ID: <20240430091740.1826862-28-vschneid@redhat.com> (raw)
In-Reply-To: <20240430091740.1826862-1-vschneid@redhat.com>

The "rcu_dyntick" naming convention has been turned into "rcu_watching" for
all helpers now, align the trace event to that.

To add to the confusion, the strings passed to the trace event are now
reversed: when RCU "starts" the dyntick / EQS state, it "stops" watching.

Signed-off-by: Valentin Schneider <vschneid@redhat.com>
---
 include/trace/events/rcu.h | 16 ++++++++--------
 kernel/context_tracking.c  | 10 +++++-----
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 4066b6d51e46a..e51ef658437f0 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -466,40 +466,40 @@ TRACE_EVENT(rcu_stall_warning,
 /*
  * Tracepoint for dyntick-idle entry/exit events.  These take 2 strings
  * as argument:
- * polarity: "Start", "End", "StillNonIdle" for entering, exiting or still not
+ * polarity: "Start", "End", "StillWatching" for entering, exiting or still not
  *            being in dyntick-idle mode.
  * context: "USER" or "IDLE" or "IRQ".
  * NMIs nested in IRQs are inferred with nesting > 1 in IRQ context.
  *
  * These events also take a pair of numbers, which indicate the nesting
  * depth before and after the event of interest, and a third number that is
- * the ->dynticks counter.  Note that task-related and interrupt-related
+ * the RCU_WATCHING counter.  Note that task-related and interrupt-related
  * events use two separate counters, and that the "++=" and "--=" events
  * for irq/NMI will change the counter by two, otherwise by one.
  */
-TRACE_EVENT_RCU(rcu_dyntick,
+TRACE_EVENT_RCU(rcu_watching,
 
-	TP_PROTO(const char *polarity, long oldnesting, long newnesting, int dynticks),
+	TP_PROTO(const char *polarity, long oldnesting, long newnesting, int counter),
 
-	TP_ARGS(polarity, oldnesting, newnesting, dynticks),
+	TP_ARGS(polarity, oldnesting, newnesting, counter),
 
 	TP_STRUCT__entry(
 		__field(const char *, polarity)
 		__field(long, oldnesting)
 		__field(long, newnesting)
-		__field(int, dynticks)
+		__field(int, counter)
 	),
 
 	TP_fast_assign(
 		__entry->polarity = polarity;
 		__entry->oldnesting = oldnesting;
 		__entry->newnesting = newnesting;
-		__entry->dynticks = dynticks;
+		__entry->counter = counter;
 	),
 
 	TP_printk("%s %lx %lx %#3x", __entry->polarity,
 		  __entry->oldnesting, __entry->newnesting,
-		  __entry->dynticks & 0xfff)
+		  __entry->counter & 0xfff)
 );
 
 /*
diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c
index dfa64f21d900d..fdbb584b8e797 100644
--- a/kernel/context_tracking.c
+++ b/kernel/context_tracking.c
@@ -137,7 +137,7 @@ static void noinstr ct_kernel_exit(bool user, int offset)
 
 	instrumentation_begin();
 	lockdep_assert_irqs_disabled();
-	trace_rcu_dyntick(TPS("Start"), ct_nesting(), 0, ct_rcu_watching());
+	trace_rcu_watching(TPS("End"), ct_nesting(), 0, ct_rcu_watching());
 	WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !user && !is_idle_task(current));
 	rcu_preempt_deferred_qs(current);
 
@@ -182,7 +182,7 @@ static void noinstr ct_kernel_enter(bool user, int offset)
 	// instrumentation for the noinstr ct_kernel_enter_state()
 	instrument_atomic_write(&ct->state, sizeof(ct->state));
 
-	trace_rcu_dyntick(TPS("End"), ct_nesting(), 1, ct_rcu_watching());
+	trace_rcu_watching(TPS("Start"), ct_nesting(), 1, ct_rcu_watching());
 	WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !user && !is_idle_task(current));
 	WRITE_ONCE(ct->nesting, 1);
 	WARN_ON_ONCE(ct_nmi_nesting());
@@ -219,7 +219,7 @@ void noinstr ct_nmi_exit(void)
 	 * leave it in non-RCU-idle state.
 	 */
 	if (ct_nmi_nesting() != 1) {
-		trace_rcu_dyntick(TPS("--="), ct_nmi_nesting(), ct_nmi_nesting() - 2,
+		trace_rcu_watching(TPS("--="), ct_nmi_nesting(), ct_nmi_nesting() - 2,
 				  ct_rcu_watching());
 		WRITE_ONCE(ct->nmi_nesting, /* No store tearing. */
 			   ct_nmi_nesting() - 2);
@@ -228,7 +228,7 @@ void noinstr ct_nmi_exit(void)
 	}
 
 	/* This NMI interrupted an RCU-idle CPU, restore RCU-idleness. */
-	trace_rcu_dyntick(TPS("Startirq"), ct_nmi_nesting(), 0, ct_rcu_watching());
+	trace_rcu_watching(TPS("Endirq"), ct_nmi_nesting(), 0, ct_rcu_watching());
 	WRITE_ONCE(ct->nmi_nesting, 0); /* Avoid store tearing. */
 
 	// instrumentation for the noinstr ct_kernel_exit_state()
@@ -294,7 +294,7 @@ void noinstr ct_nmi_enter(void)
 		instrumentation_begin();
 	}
 
-	trace_rcu_dyntick(incby == 1 ? TPS("Endirq") : TPS("++="),
+	trace_rcu_watching(incby == 1 ? TPS("Startirq") : TPS("++="),
 			  ct_nmi_nesting(),
 			  ct_nmi_nesting() + incby, ct_rcu_watching());
 	instrumentation_end();
-- 
2.43.0


  parent reply	other threads:[~2024-04-30  9:19 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30  9:17 [PATCH v2 00/27] context_tracking, rcu: Spring cleaning renaming Valentin Schneider
2024-04-30  9:17 ` [PATCH v2 01/27] treewide: context_tracking: Rename CONTEXT_* into CT_STATE_* Valentin Schneider
2024-04-30  9:17 ` [PATCH v2 02/27] context_tracking, rcu: Rename RCU_DYNTICKS_IDX into CT_RCU_WATCHING Valentin Schneider
2024-05-06 10:39   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 03/27] context_tracking, rcu: Rename ct_dynticks() into ct_rcu_watching() Valentin Schneider
2024-05-06 10:41   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 04/27] context_tracking, rcu: Rename ct_dynticks_cpu() into ct_rcu_watching_cpu() Valentin Schneider
2024-05-06 10:43   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 05/27] context_tracking, rcu: Rename ct_dynticks_cpu_acquire() into ct_rcu_watching_cpu_acquire() Valentin Schneider
2024-05-06 10:45   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 06/27] context_tracking, rcu: Rename struct context_tracking .dynticks_nesting into .nesting Valentin Schneider
2024-05-06 10:48   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 07/27] context_tracking, rcu: Rename ct_dynticks_nesting() into ct_nesting() Valentin Schneider
2024-05-06 11:01   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 08/27] context_tracking, rcu: Rename ct_dynticks_nesting_cpu() into ct_nesting_cpu() Valentin Schneider
2024-05-06 20:09   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 09/27] context_tracking, rcu: Rename struct context_tracking .dynticks_nmi_nesting into .nmi_nesting Valentin Schneider
2024-05-06 20:19   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 10/27] context_tracking, rcu: Rename ct_dynticks_nmi_nesting() into ct_nmi_nesting() Valentin Schneider
2024-05-06 20:50   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 11/27] context_tracking, rcu: Rename ct_dynticks_nmi_nesting_cpu() into ct_nmi_nesting_cpu() Valentin Schneider
2024-05-06 21:03   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 12/27] context_tracking, rcu: Rename DYNTICK_IRQ_NONIDLE into CT_NESTING_IRQ_NONIDLE Valentin Schneider
2024-05-06 21:06   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 13/27] context_tracking, rcu: Rename rcu_dynticks_task*() into rcu_task*() Valentin Schneider
2024-05-06 21:15   ` Frederic Weisbecker
2024-05-08 14:39   ` Frederic Weisbecker
2024-05-13 18:39     ` Valentin Schneider
2024-04-30  9:17 ` [PATCH v2 14/27] context_tracking, rcu: Rename rcu_dynticks_curr_cpu_in_eqs() into rcu_watching_curr_cpu() Valentin Schneider
2024-05-06 22:00   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 15/27] rcu: Rename rcu_dynticks_eqs_online() into rcu_watching_eqs_online() Valentin Schneider
2024-05-06 22:18   ` Frederic Weisbecker
2024-05-07  8:59     ` Valentin Schneider
2024-04-30  9:17 ` [PATCH v2 16/27] rcu: Rename rcu_dynticks_snap() into rcu_watching_snap() Valentin Schneider
2024-05-07 13:11   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 17/27] rcu: Rename rcu_dynticks_in_eqs() into rcu_watching_in_eqs() Valentin Schneider
2024-05-07 13:32   ` Frederic Weisbecker
2024-05-07 15:48     ` Valentin Schneider
2024-05-08 10:46       ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 18/27] rcu: Rename rcu_dynticks_in_eqs_since() into rcu_watching_changed_since() Valentin Schneider
2024-05-07 13:48   ` Frederic Weisbecker
2024-05-07 17:14     ` Paul E. McKenney
2024-05-08 10:59       ` Frederic Weisbecker
2024-05-13 18:40         ` Valentin Schneider
2024-05-14 10:42           ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 19/27] rcu: Rename rcu_dynticks_zero_in_eqs() into rcu_watching_zero_in_eqs() Valentin Schneider
2024-05-08 12:43   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 20/27] rcu: Rename struct rcu_data .dynticks_snap into .watching_snap Valentin Schneider
2024-05-08 12:55   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 21/27] rcu: Rename struct rcu_data .exp_dynticks_snap into .exp_watching_snap Valentin Schneider
2024-05-08 13:06   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 22/27] rcu: Rename dyntick_save_progress_counter() into eqs_save_progress_counter() Valentin Schneider
2024-05-08 13:21   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 23/27] rcu: Rename rcu_implicit_dynticks_qs() into rcu_implicit_eqs() Valentin Schneider
2024-04-30  9:17 ` [PATCH v2 24/27] rcu: Rename rcu_momentary_dyntick_idle() into rcu_momentary_eqs() Valentin Schneider
2024-05-08 13:30   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 25/27] context_tracking, rcu: Rename stray ->dynticks comments Valentin Schneider
2024-05-08 13:39   ` Frederic Weisbecker
2024-04-30  9:17 ` [PATCH v2 26/27] rcu: Update stray documentation references to rcu_dynticks_eqs_{enter, exit}() Valentin Schneider
2024-05-08 14:55   ` Frederic Weisbecker
2024-05-13 18:40     ` Valentin Schneider
2024-04-30  9:17 ` Valentin Schneider [this message]
2024-05-08 13:59   ` [PATCH v2 27/27] context_tracking, rcu: Rename rcu_dyntick trace event into rcu_watching Frederic Weisbecker
2024-05-13 18:40     ` Valentin Schneider
2024-05-14 12:09       ` Frederic Weisbecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240430091740.1826862-28-vschneid@redhat.com \
    --to=vschneid@redhat.com \
    --cc=boqun.feng@gmail.com \
    --cc=frederic@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=qiang.zhang1211@gmail.com \
    --cc=quic_neeraju@quicinc.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®