Skip to content

Commit 147db6e

Browse files
committed
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: ftrace: handle archs that do not support irqs_disabled_flags
2 parents 4390819 + 9244489 commit 147db6e

3 files changed

Lines changed: 20 additions & 10 deletions

File tree

‎Documentation/ftrace.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ explains which is which.
291291
CPU#: The CPU which the process was running on.
292292

293293
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.
294297

295298
need-resched: 'N' task need_resched is set, '.' otherwise.
296299

‎kernel/trace/trace.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,11 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags,
656656
entry->preempt_count = pc & 0xff;
657657
entry->pid = (tsk) ? tsk->pid : 0;
658658
entry->flags =
659+
#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
659660
(irqs_disabled_flags(flags) ? TRACE_FLAG_IRQS_OFF : 0) |
661+
#else
662+
TRACE_FLAG_IRQS_NOSUPPORT |
663+
#endif
660664
((pc & HARDIRQ_MASK) ? TRACE_FLAG_HARDIRQ : 0) |
661665
((pc & SOFTIRQ_MASK) ? TRACE_FLAG_SOFTIRQ : 0) |
662666
(need_resched() ? TRACE_FLAG_NEED_RESCHED : 0);
@@ -1244,7 +1248,8 @@ lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu)
12441248
trace_seq_printf(s, "%8.8s-%-5d ", comm, entry->pid);
12451249
trace_seq_printf(s, "%3d", cpu);
12461250
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' : '.',
12481253
((entry->flags & TRACE_FLAG_NEED_RESCHED) ? 'N' : '.'));
12491254

12501255
hardirq = entry->flags & TRACE_FLAG_HARDIRQ;

‎kernel/trace/trace.h‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,20 @@ struct trace_boot {
120120
/*
121121
* trace_flag_type is an enumeration that holds different
122122
* states when a trace occurs. These are:
123-
* IRQS_OFF - interrupts were disabled
124-
* NEED_RESCED - reschedule is requested
125-
* HARDIRQ - inside an interrupt handler
126-
* SOFTIRQ - inside a softirq handler
127-
* CONT - multiple entries hold the trace item
123+
* IRQS_OFF - interrupts were disabled
124+
* IRQS_NOSUPPORT - arch does not support irqs_disabled_flags
125+
* NEED_RESCED - reschedule is requested
126+
* HARDIRQ - inside an interrupt handler
127+
* SOFTIRQ - inside a softirq handler
128+
* CONT - multiple entries hold the trace item
128129
*/
129130
enum trace_flag_type {
130131
TRACE_FLAG_IRQS_OFF = 0x01,
131-
TRACE_FLAG_NEED_RESCHED = 0x02,
132-
TRACE_FLAG_HARDIRQ = 0x04,
133-
TRACE_FLAG_SOFTIRQ = 0x08,
134-
TRACE_FLAG_CONT = 0x10,
132+
TRACE_FLAG_IRQS_NOSUPPORT = 0x02,
133+
TRACE_FLAG_NEED_RESCHED = 0x04,
134+
TRACE_FLAG_HARDIRQ = 0x08,
135+
TRACE_FLAG_SOFTIRQ = 0x10,
136+
TRACE_FLAG_CONT = 0x20,
135137
};
136138

137139
#define TRACE_BUF_SIZE 1024

0 commit comments

Comments
 (0)