trace/events: add chip name and hwirq to irq entry tracepoint
Subsystems (2)
PATCH v3 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 chip_name=GIC hwirq=140
---
Changes since V2:
- fixed dump message in commit text to reflect Chip name instead of domain.
---
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
@@ -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
Steven Rostedt
maintainerQuoted 33 lines · On Wed, 24 Jun 2015 10:17:30 -0600 Ankit Gupta <[email protected]> wrote:
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 chip_name=GIC hwirq=140Suggested-by Stephen Boyd <[email protected]>Reviewed-by Andy Gross <[email protected]>Signed-off-by Gilad Avidov <[email protected]>Signed-off-by Ankit Gupta <[email protected]>---
Changes since V2:
- fixed dump message in commit text to reflect Chip name instead of domain.
---
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 +0
-0@@ -23,6 +23,17 @@ struct softirq_action;softirq_name (HRTIMER ), \ softirq_name(RCU))
include/trace/events/irq.h struct softirq_action; · line 35
Quoted 10 lines
include/trace/events/irq.h +10
-0+ +#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)
Note these magic functions will only be useful for the tracefs reads of the trace files. Userspace tools that extract the data (like perf and trace-cmd), will have no idea of how to parse it.
I'm not against doing this, but I'm just letting you know what the effect of this change will be.
-- Steve
Quoted 15 lines
include/trace/events/irq.h +4
-1+/** * 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)) );/**
Quoted 15 lines · Steven Rostedt
include/trace/events/irq.h struct softirq_action; · line 35
Quoted 10 lines
include/trace/events/irq.h +10
-0+ +#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)Note these magic functions will only be useful for the tracefs reads of the trace files. Userspace tools that extract the data (like perf and trace-cmd), will have no idea of how to parse it.
Quoted 2 lines
I'm not against doing this, but I'm just letting you know what the effect of this change will be.
What's worse is, that they are racy against a concurrent teardown of the interrupt. Not a good idea ...
Thanks,
tglx
Quoted 16 lines · Steven Rostedt
Quoted 15 lines
include/trace/events/irq.h struct softirq_action; · line 35
Quoted 10 lines
include/trace/events/irq.h +10
-0+ +#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)Note these magic functions will only be useful for the tracefs reads of the trace files. Userspace tools that extract the data (like perf and trace-cmd), will have no idea of how to parse it.
Quoted 6 lines
Quoted 2 lines
I'm not against doing this, but I'm just letting you know what the effect of this change will be.
What's worse is, that they are racy against a concurrent teardown of the interrupt. Not a good idea ...
Agree, I'll save the chip-name and hwirq in the struct. This technique using the same macros to save the chip-name and hwirq in the struct also works well with trace-cmd.
Thanks,
Ankit and Gilad
Quoted 9 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
Quoted 19 lines · Ankit Gupta
Quoted 19 lines · Steven Rostedt
Quoted 17 lines
include/trace/events/irq.h struct softirq_action; · line 35
Quoted 10 lines
include/trace/events/irq.h +10
-0+ +#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)Note these magic functions will only be useful for the tracefs reads of the trace files. Userspace tools that extract the data (like perf and trace-cmd), will have no idea of how to parse it.
I'm not against doing this, but I'm just letting you know what the effect of this change will be.
Quoted 7 lines
Quoted 3 lines
What's worse is, that they are racy against a concurrent teardown of the interrupt. Not a good idea ...
Agree, I'll save the chip-name and hwirq in the struct. This technique using the same macros to save the chip-name and hwirq in the struct also works well with trace-cmd.
Though I really doubt that this is the proper way to go. Why do you want to store redundant information on every tracepoint?
That does not make any sense.
What we really want is an interface to query the interrupt association (linux interrupt number, chip, domain, hwirq, ...) in one go when the tracer starts and have tracepoints which keep track of irq setup and teardown.
That way we keep the hotpath tracepoints tiny and the analysis tools can create rich tracepoints for postprocessing. That's how perf is working as well.
Thanks,
tglx