Skip to contentSkip to conversation

ARM: Add support for on-demand backtrace of other CPUs

PATCH RESEND Hillf Danton 2 participants 2 messages Apr 8, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Review

Quoted 12 lines
(quoted diff) +11 -0
+void ipi_cpu_backtrace(struct pt_regs *regs)
+{
+	int cpu = smp_processor_id();
+
+	if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
+		printk_nmi_backtrace_this_cpu_begin();
+		pr_warn("FIQ backtrace for cpu %d\n", cpu);
+		if (regs != NULL)
+			show_regs(regs);
+		else
+			dump_stack();

Help more if we could print both register and stack info.

Quoted 5 lines
(quoted diff) +5 -0
+		printk_nmi_backtrace_this_cpu_end();
+
+		cpumask_clear_cpu(cpu, to_cpumask(backtrace_mask));
+	}
+}
#2 lore raw
Quoted 14 lines · Hillf Danton

Review

Quoted 12 lines
(quoted diff) +11 -0
+void ipi_cpu_backtrace(struct pt_regs *regs)
+{
+	int cpu = smp_processor_id();
+
+	if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
+		printk_nmi_backtrace_this_cpu_begin();
+		pr_warn("FIQ backtrace for cpu %d\n", cpu);
+		if (regs != NULL)
+			show_regs(regs);
+		else
+			dump_stack();

Help more if we could print both register and stack info.

I think this code already prints as much as it can in all cases.

The arch/arm implementation of show_regs() calls dump_stack() internally so the first case does show register and stack info.

In the second case, where regs is NULL because we have been called directly from task context, there aren't any saved regs for us to show.

Daniel.