提交 bd2b879a 编写于 作者: P Paul E. McKenney

rcu: Add tracing to irq/NMI dyntick-idle transitions

Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
上级 844ccdd7
...@@ -421,16 +421,18 @@ TRACE_EVENT(rcu_fqs, ...@@ -421,16 +421,18 @@ TRACE_EVENT(rcu_fqs,
/* /*
* Tracepoint for dyntick-idle entry/exit events. These take a string * Tracepoint for dyntick-idle entry/exit events. These take a string
* as argument: "Start" for entering dyntick-idle mode, "End" for * as argument: "Start" for entering dyntick-idle mode, "Startirq" for
* leaving it, "--=" for events moving towards idle, and "++=" for events * entering it from irq/NMI, "End" for leaving it, "Endirq" for leaving it
* moving away from idle. "Error on entry: not idle task" and "Error on * to irq/NMI, "--=" for events moving towards idle, and "++=" for events
* exit: not idle task" indicate that a non-idle task is erroneously * moving away from idle. "Error on entry: not idle task" and "Error
* on exit: not idle task" indicate that a non-idle task is erroneously
* toying with the idle loop. * toying with the idle loop.
* *
* These events also take a pair of numbers, which indicate the nesting * These events also take a pair of numbers, which indicate the nesting
* depth before and after the event of interest. Note that task-related * depth before and after the event of interest. Note that task-related
* events use the upper bits of each number, while interrupt-related * and interrupt-related events use two separate counters, and that the
* events use the lower bits. * "++=" and "--=" events for irq/NMI will change the counter by two,
* otherwise by one.
*/ */
TRACE_EVENT(rcu_dyntick, TRACE_EVENT(rcu_dyntick,
......
...@@ -880,12 +880,15 @@ void rcu_nmi_exit(void) ...@@ -880,12 +880,15 @@ void rcu_nmi_exit(void)
* leave it in non-RCU-idle state. * leave it in non-RCU-idle state.
*/ */
if (rdtp->dynticks_nmi_nesting != 1) { if (rdtp->dynticks_nmi_nesting != 1) {
trace_rcu_dyntick(TPS("--="), rdtp->dynticks_nmi_nesting,
rdtp->dynticks_nmi_nesting - 2);
WRITE_ONCE(rdtp->dynticks_nmi_nesting, /* No store tearing. */ WRITE_ONCE(rdtp->dynticks_nmi_nesting, /* No store tearing. */
rdtp->dynticks_nmi_nesting - 2); rdtp->dynticks_nmi_nesting - 2);
return; return;
} }
/* This NMI interrupted an RCU-idle CPU, restore RCU-idleness. */ /* This NMI interrupted an RCU-idle CPU, restore RCU-idleness. */
trace_rcu_dyntick(TPS("Startirq"), rdtp->dynticks_nmi_nesting, 0);
WRITE_ONCE(rdtp->dynticks_nmi_nesting, 0); /* Avoid store tearing. */ WRITE_ONCE(rdtp->dynticks_nmi_nesting, 0); /* Avoid store tearing. */
rcu_dynticks_eqs_enter(); rcu_dynticks_eqs_enter();
} }
...@@ -1057,6 +1060,9 @@ void rcu_nmi_enter(void) ...@@ -1057,6 +1060,9 @@ void rcu_nmi_enter(void)
rcu_dynticks_eqs_exit(); rcu_dynticks_eqs_exit();
incby = 1; incby = 1;
} }
trace_rcu_dyntick(incby == 1 ? TPS("Endirq") : TPS("++="),
rdtp->dynticks_nmi_nesting,
rdtp->dynticks_nmi_nesting + incby);
WRITE_ONCE(rdtp->dynticks_nmi_nesting, /* Prevent store tearing. */ WRITE_ONCE(rdtp->dynticks_nmi_nesting, /* Prevent store tearing. */
rdtp->dynticks_nmi_nesting + incby); rdtp->dynticks_nmi_nesting + incby);
barrier(); barrier();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册