aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/interrupt.h5
-rw-r--r--include/linux/kernel.h40
-rw-r--r--include/trace/irq_event_types.h12
3 files changed, 44 insertions, 13 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 472f11765f60..9b7e9d743476 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -258,6 +258,11 @@ enum
258 NR_SOFTIRQS 258 NR_SOFTIRQS
259}; 259};
260 260
261/* map softirq index to softirq name. update 'softirq_to_name' in
262 * kernel/softirq.c when adding a new softirq.
263 */
264extern char *softirq_to_name[NR_SOFTIRQS];
265
261/* softirq mask and active fields moved to irq_cpustat_t in 266/* softirq mask and active fields moved to irq_cpustat_t in
262 * asm/hardirq.h to get better cache usage. KAO 267 * asm/hardirq.h to get better cache usage. KAO
263 */ 268 */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 7742798c9208..1daca3b062bb 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -452,32 +452,46 @@ do { \
452 452
453#define trace_printk(fmt, args...) \ 453#define trace_printk(fmt, args...) \
454do { \ 454do { \
455 static const char *trace_printk_fmt \
456 __attribute__((section("__trace_printk_fmt"))); \
457 \
458 if (!trace_printk_fmt) \
459 trace_printk_fmt = fmt; \
460 \
461 __trace_printk_check_format(fmt, ##args); \ 455 __trace_printk_check_format(fmt, ##args); \
462 __trace_printk(_THIS_IP_, trace_printk_fmt, ##args); \ 456 if (__builtin_constant_p(fmt)) { \
457 static const char *trace_printk_fmt \
458 __attribute__((section("__trace_printk_fmt"))) = \
459 __builtin_constant_p(fmt) ? fmt : NULL; \
460 \
461 __trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
462 } else \
463 __trace_printk(_THIS_IP_, fmt, ##args); \
463} while (0) 464} while (0)
464 465
465extern int 466extern int
467__trace_bprintk(unsigned long ip, const char *fmt, ...)
468 __attribute__ ((format (printf, 2, 3)));
469
470extern int
466__trace_printk(unsigned long ip, const char *fmt, ...) 471__trace_printk(unsigned long ip, const char *fmt, ...)
467 __attribute__ ((format (printf, 2, 3))); 472 __attribute__ ((format (printf, 2, 3)));
468 473
474/*
475 * The double __builtin_constant_p is because gcc will give us an error
476 * if we try to allocate the static variable to fmt if it is not a
477 * constant. Even with the outer if statement.
478 */
469#define ftrace_vprintk(fmt, vargs) \ 479#define ftrace_vprintk(fmt, vargs) \
470do { \ 480do { \
471 static const char *trace_printk_fmt \ 481 if (__builtin_constant_p(fmt)) { \
472 __attribute__((section("__trace_printk_fmt"))); \ 482 static const char *trace_printk_fmt \
473 \ 483 __attribute__((section("__trace_printk_fmt"))) = \
474 if (!trace_printk_fmt) \ 484 __builtin_constant_p(fmt) ? fmt : NULL; \
475 trace_printk_fmt = fmt; \
476 \ 485 \
477 __ftrace_vprintk(_THIS_IP_, trace_printk_fmt, vargs); \ 486 __ftrace_vbprintk(_THIS_IP_, trace_printk_fmt, vargs); \
487 } else \
488 __ftrace_vprintk(_THIS_IP_, fmt, vargs); \
478} while (0) 489} while (0)
479 490
480extern int 491extern int
492__ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);
493
494extern int
481__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); 495__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
482 496
483extern void ftrace_dump(void); 497extern void ftrace_dump(void);
diff --git a/include/trace/irq_event_types.h b/include/trace/irq_event_types.h
index 214bb928fe9e..85964ebd47ec 100644
--- a/include/trace/irq_event_types.h
+++ b/include/trace/irq_event_types.h
@@ -40,4 +40,16 @@ TRACE_EVENT(irq_handler_exit,
40 __entry->irq, __entry->ret ? "handled" : "unhandled") 40 __entry->irq, __entry->ret ? "handled" : "unhandled")
41); 41);
42 42
43TRACE_FORMAT(softirq_entry,
44 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
45 TP_ARGS(h, vec),
46 TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
47 );
48
49TRACE_FORMAT(softirq_exit,
50 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
51 TP_ARGS(h, vec),
52 TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec])
53 );
54
43#undef TRACE_SYSTEM 55#undef TRACE_SYSTEM