sched/walt: improve preemptirq template based tracepoints
To determine why a particular long preemption or long irqs off period has happened, without crashing the device, the tracepoints need improvement. The callers should be included. Change-Id: If147969717517563e56cd20d3c036f51835a5c73 Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
This commit is contained in:
parent
127b73f001
commit
6b814579db
@ -51,7 +51,7 @@ static void note_irq_disable(void *u1, unsigned long u2, unsigned long u3)
|
|||||||
this_cpu_write(irq_disabled_ts, sched_clock());
|
this_cpu_write(irq_disabled_ts, sched_clock());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_irq_disable_long(void *u1, unsigned long u2, unsigned long u3)
|
static void test_irq_disable_long(void *u1, unsigned long ip, unsigned long parent_ip)
|
||||||
{
|
{
|
||||||
u64 ts = this_cpu_read(irq_disabled_ts);
|
u64 ts = this_cpu_read(irq_disabled_ts);
|
||||||
|
|
||||||
@ -62,10 +62,10 @@ static void test_irq_disable_long(void *u1, unsigned long u2, unsigned long u3)
|
|||||||
ts = sched_clock() - ts;
|
ts = sched_clock() - ts;
|
||||||
|
|
||||||
if (ts > sysctl_irqsoff_tracing_threshold_ns) {
|
if (ts > sysctl_irqsoff_tracing_threshold_ns) {
|
||||||
trace_irq_disable_long(ts);
|
trace_irq_disable_long(ts, ip, parent_ip, CALLER_ADDR4, CALLER_ADDR5);
|
||||||
|
|
||||||
if (sysctl_irqsoff_dmesg_output_enabled == IRQSOFF_SENTINEL)
|
if (sysctl_irqsoff_dmesg_output_enabled == IRQSOFF_SENTINEL)
|
||||||
printk_deferred("D=%llu C:(%ps<-%ps<-%ps<-%ps)\n",
|
printk_deferred("irqs off exceeds thresh delta=%llu C:(%ps<-%ps<-%ps<-%ps)\n",
|
||||||
ts, (void *)CALLER_ADDR2,
|
ts, (void *)CALLER_ADDR2,
|
||||||
(void *)CALLER_ADDR3,
|
(void *)CALLER_ADDR3,
|
||||||
(void *)CALLER_ADDR4,
|
(void *)CALLER_ADDR4,
|
||||||
@ -90,8 +90,8 @@ static void note_preempt_disable(void *u1, unsigned long u2, unsigned long u3)
|
|||||||
ps->ncsw = current->nvcsw + current->nivcsw;
|
ps->ncsw = current->nvcsw + current->nivcsw;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_preempt_disable_long(void *u1, unsigned long u2,
|
static void test_preempt_disable_long(void *u1, unsigned long ip,
|
||||||
unsigned long u3)
|
unsigned long parent_ip)
|
||||||
{
|
{
|
||||||
struct preempt_store *ps = &per_cpu(the_ps, raw_smp_processor_id());
|
struct preempt_store *ps = &per_cpu(the_ps, raw_smp_processor_id());
|
||||||
u64 delta = 0;
|
u64 delta = 0;
|
||||||
@ -114,7 +114,7 @@ static void test_preempt_disable_long(void *u1, unsigned long u2,
|
|||||||
|
|
||||||
ps->ts = 0;
|
ps->ts = 0;
|
||||||
if (delta > sysctl_preemptoff_tracing_threshold_ns)
|
if (delta > sysctl_preemptoff_tracing_threshold_ns)
|
||||||
trace_preempt_disable_long(delta);
|
trace_preempt_disable_long(delta, ip, parent_ip, CALLER_ADDR4, CALLER_ADDR5);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ctl_table preemptirq_long_table[] = {
|
static struct ctl_table preemptirq_long_table[] = {
|
||||||
|
@ -14,30 +14,44 @@
|
|||||||
|
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
|
/* reference preemptirq_template */
|
||||||
DECLARE_EVENT_CLASS(preemptirq_long_template,
|
DECLARE_EVENT_CLASS(preemptirq_long_template,
|
||||||
|
|
||||||
TP_PROTO(u64 delta),
|
TP_PROTO(u64 delta, unsigned long ip, unsigned long parent_ip,
|
||||||
|
unsigned long pparent_ip, unsigned long ppparent_ip),
|
||||||
|
|
||||||
TP_ARGS(delta),
|
TP_ARGS(delta, ip, parent_ip, pparent_ip, ppparent_ip),
|
||||||
|
|
||||||
TP_STRUCT__entry(
|
TP_STRUCT__entry(
|
||||||
__field(u64, delta)
|
__field(u64, delta)
|
||||||
|
__field(unsigned long, caller_offs)
|
||||||
|
__field(unsigned long, parent_offs)
|
||||||
|
__field(unsigned long, pparent_offs)
|
||||||
|
__field(unsigned long, ppparent_offs)
|
||||||
),
|
),
|
||||||
|
|
||||||
TP_fast_assign(
|
TP_fast_assign(
|
||||||
__entry->delta = delta;
|
__entry->delta = delta;
|
||||||
|
__entry->caller_offs = ip;
|
||||||
|
__entry->parent_offs = parent_ip;
|
||||||
|
__entry->pparent_offs = pparent_ip;
|
||||||
|
__entry->ppparent_offs = ppparent_ip;
|
||||||
),
|
),
|
||||||
|
|
||||||
TP_printk("delta=%llu(ns)", __entry->delta)
|
TP_printk("delta=%llu(ns) caller=%ps <- %ps <- %ps <- %ps",
|
||||||
|
__entry->delta, __entry->caller_offs,
|
||||||
|
__entry->parent_offs, __entry->pparent_offs, __entry->ppparent_offs)
|
||||||
);
|
);
|
||||||
|
|
||||||
DEFINE_EVENT(preemptirq_long_template, irq_disable_long,
|
DEFINE_EVENT(preemptirq_long_template, irq_disable_long,
|
||||||
TP_PROTO(u64 delta),
|
TP_PROTO(u64 delta, unsigned long ip, unsigned long parent_ip,
|
||||||
TP_ARGS(delta));
|
unsigned long pparent_ip, unsigned long ppparent_ip),
|
||||||
|
TP_ARGS(delta, ip, parent_ip, pparent_ip, ppparent_ip));
|
||||||
|
|
||||||
DEFINE_EVENT(preemptirq_long_template, preempt_disable_long,
|
DEFINE_EVENT(preemptirq_long_template, preempt_disable_long,
|
||||||
TP_PROTO(u64 delta),
|
TP_PROTO(u64 delta, unsigned long ip, unsigned long parent_ip,
|
||||||
TP_ARGS(delta));
|
unsigned long pparent_ip, unsigned long ppparent_ip),
|
||||||
|
TP_ARGS(delta, ip, parent_ip, pparent_ip, ppparent_ip));
|
||||||
|
|
||||||
#endif /* _TRACE_PREEMPTIRQ_LONG_H */
|
#endif /* _TRACE_PREEMPTIRQ_LONG_H */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user