aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/ftrace.txt3
-rw-r--r--kernel/trace/trace.c7
-rw-r--r--kernel/trace/trace.h20
3 files changed, 20 insertions, 10 deletions
diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
index d330fe3103da..ea5a827395dd 100644
--- a/Documentation/ftrace.txt
+++ b/Documentation/ftrace.txt
@@ -291,6 +291,9 @@ explains which is which.
291 CPU#: The CPU which the process was running on. 291 CPU#: The CPU which the process was running on.
292 292
293 irqs-off: 'd' interrupts are disabled. '.' otherwise. 293 irqs-off: 'd' interrupts are disabled. '.' otherwise.
294 Note: If the architecture does not support a way to
295 read the irq flags variable, an 'X' will always
296 be printed here.
294 297
295 need-resched: 'N' task need_resched is set, '.' otherwise. 298 need-resched: 'N' task need_resched is set, '.' otherwise.
296 299
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index a610ca771558..8a499e2adaec 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -656,7 +656,11 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags,
656 entry->preempt_count = pc & 0xff; 656 entry->preempt_count = pc & 0xff;
657 entry->pid = (tsk) ? tsk->pid : 0; 657 entry->pid = (tsk) ? tsk->pid : 0;
658 entry->flags = 658 entry->flags =
659#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
659 (irqs_disabled_flags(flags) ? TRACE_FLAG_IRQS_OFF : 0) | 660 (irqs_disabled_flags(flags) ? TRACE_FLAG_IRQS_OFF : 0) |
661#else
662 TRACE_FLAG_IRQS_NOSUPPORT |
663#endif
660 ((pc & HARDIRQ_MASK) ? TRACE_FLAG_HARDIRQ : 0) | 664 ((pc & HARDIRQ_MASK) ? TRACE_FLAG_HARDIRQ : 0) |
661 ((pc & SOFTIRQ_MASK) ? TRACE_FLAG_SOFTIRQ : 0) | 665 ((pc & SOFTIRQ_MASK) ? TRACE_FLAG_SOFTIRQ : 0) |
662 (need_resched() ? TRACE_FLAG_NEED_RESCHED : 0); 666 (need_resched() ? TRACE_FLAG_NEED_RESCHED : 0);
@@ -1244,7 +1248,8 @@ lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu)
1244 trace_seq_printf(s, "%8.8s-%-5d ", comm, entry->pid); 1248 trace_seq_printf(s, "%8.8s-%-5d ", comm, entry->pid);
1245 trace_seq_printf(s, "%3d", cpu); 1249 trace_seq_printf(s, "%3d", cpu);
1246 trace_seq_printf(s, "%c%c", 1250 trace_seq_printf(s, "%c%c",
1247 (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : '.', 1251 (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' :
1252 (entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ? 'X' : '.',
1248 ((entry->flags & TRACE_FLAG_NEED_RESCHED) ? 'N' : '.')); 1253 ((entry->flags & TRACE_FLAG_NEED_RESCHED) ? 'N' : '.'));
1249 1254
1250 hardirq = entry->flags & TRACE_FLAG_HARDIRQ; 1255 hardirq = entry->flags & TRACE_FLAG_HARDIRQ;
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 6889ca48f1f1..8465ad052707 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -120,18 +120,20 @@ struct trace_boot {
120/* 120/*
121 * trace_flag_type is an enumeration that holds different 121 * trace_flag_type is an enumeration that holds different
122 * states when a trace occurs. These are: 122 * states when a trace occurs. These are:
123 * IRQS_OFF - interrupts were disabled 123 * IRQS_OFF - interrupts were disabled
124 * NEED_RESCED - reschedule is requested 124 * IRQS_NOSUPPORT - arch does not support irqs_disabled_flags
125 * HARDIRQ - inside an interrupt handler 125 * NEED_RESCED - reschedule is requested
126 * SOFTIRQ - inside a softirq handler 126 * HARDIRQ - inside an interrupt handler
127 * CONT - multiple entries hold the trace item 127 * SOFTIRQ - inside a softirq handler
128 * CONT - multiple entries hold the trace item
128 */ 129 */
129enum trace_flag_type { 130enum trace_flag_type {
130 TRACE_FLAG_IRQS_OFF = 0x01, 131 TRACE_FLAG_IRQS_OFF = 0x01,
131 TRACE_FLAG_NEED_RESCHED = 0x02, 132 TRACE_FLAG_IRQS_NOSUPPORT = 0x02,
132 TRACE_FLAG_HARDIRQ = 0x04, 133 TRACE_FLAG_NEED_RESCHED = 0x04,
133 TRACE_FLAG_SOFTIRQ = 0x08, 134 TRACE_FLAG_HARDIRQ = 0x08,
134 TRACE_FLAG_CONT = 0x10, 135 TRACE_FLAG_SOFTIRQ = 0x10,
136 TRACE_FLAG_CONT = 0x20,
135}; 137};
136 138
137#define TRACE_BUF_SIZE 1024 139#define TRACE_BUF_SIZE 1024