Skip to contentSkip to conversation

trace/events: add chip name and hwirq to irq entry tracepoint

PATCH Superseded Ankit Gupta 2 participants 3 messages Jun 22, 2015 – Jun 23, 2015

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 trace/events: add chip name and hwirq to irq entry tracepoint

Add chip name and hw-irq number to the trace_irq_handler_entry() tracepoint. When tracing interrupt events the chip-name and hw-irq numbers are stable and known in advance. This makes them a better choice as a filtering criteria for the trace buffer dump. On the flipside, the os-irq numbers are dynamically allocated which makes them difficult to use for the same purpose.

Dump messages will look like:
...irq_handler_entry: irq=22 name=msm_serial0 domain=GIC hwirq=140

---
Changes since V1:
- added reviewed by Andy Gross

---
 include/trace/events/irq.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
include/trace/events/irq.h +14 -1
index 3608beb..5370075 100644
@@ -23,6 +23,17 @@ struct softirq_action;
 			 softirq_name(HRTIMER),		\
 			 softirq_name(RCU))
 
+
+#define show_chip_name(irq)					\
+	(irq_get_irq_data(irq)					\
+			 ? irq_get_irq_data(irq)->chip->name	\
+			 : "NULL")
+
+#define show_hwirq(irq)						\
+	(irq_get_irq_data(irq)					\
+			 ? irq_get_irq_data(irq)->hwirq		\
+			 : -ENODEV)
+
 /**
  * irq_handler_entry - called immediately before the irq action handler
  * @irq: irq number
@@ -50,7 +61,9 @@ TRACE_EVENT(irq_handler_entry,
 		__assign_str(name, action->name);
 	),
 
-	TP_printk("irq=%d name=%s", __entry->irq, __get_str(name))
+	TP_printk("irq=%d name=%s chip_name=%s hwirq=%ld", __entry->irq,
+	  __get_str(name), show_chip_name(__entry->irq),
+	  show_hwirq(__entry->irq))
 );
 
 /**
Signature · 1 line
1.8.5.2
#1 lore raw
Quoted 9 lines · Ankit Gupta

Add chip name and hw-irq number to the trace_irq_handler_entry() tracepoint. When tracing interrupt events the chip-name and hw-irq numbers are stable and known in advance. This makes them a better choice as a filtering criteria for the trace buffer dump. On the flipside, the os-irq numbers are dynamically allocated which makes them difficult to use for the same purpose.

Dump messages will look like:
...irq_handler_entry: irq=22 name=msm_serial0 domain=GIC hwirq=140

I can't see the domain name being captured/printed in the code below.

include/trace/events/irq.h TRACE_EVENT(irq_handler_entry, · line 67

Quoted 5 lines
include/trace/events/irq.h +3 -1
-	TP_printk("irq=%d name=%s", __entry->irq, __get_str(name))
+	TP_printk("irq=%d name=%s chip_name=%s hwirq=%ld", __entry->irq,
+	  __get_str(name), show_chip_name(__entry->irq),
+	  show_hwirq(__entry->irq))
 );

Thanks,

tglx

#2 lore raw
Quoted 13 lines · Ankit Gupta
Quoted 10 lines

Add chip name and hw-irq number to the trace_irq_handler_entry() tracepoint. When tracing interrupt events the chip-name and hw-irq numbers are stable and known in advance. This makes them a better choice as a filtering criteria for the trace buffer dump. On the flipside, the os-irq numbers are dynamically allocated which makes them difficult to use for the same purpose.

Dump messages will look like:
...irq_handler_entry: irq=22 name=msm_serial0 domain=GIC hwirq=140

Quoted 7 lines

I can't see the domain name being captured/printed in the code below.

include/trace/events/irq.h TRACE_EVENT(irq_handler_entry, · line 67

Quoted 5 lines
include/trace/events/irq.h +3 -1
-	TP_printk("irq=%d name=%s", __entry->irq, __get_str(name))
+	TP_printk("irq=%d name=%s chip_name=%s hwirq=%ld", __entry->irq,
+	  __get_str(name), show_chip_name(__entry->irq),
+	  show_hwirq(__entry->irq))
 );

Thanks Thomas for your comment. Its actually printing a chipname and not the domain. Will correct the dump message in the next patch. It will print as follow.
...irq_handler_entry: irq=22 name=msm_serial0 Chip=GIC hwirq=140

Quoted 10 lines

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html