tracing/events: Move TRACE_SYSTEM outside of include guard
If TRACE_INCLDUE_FILE is defined, <trace/events/TRACE_INCLUDE_FILE.h> will be included and compiled, otherwise it will be <trace/events/TRACE_SYSTEM.h> So TRACE_SYSTEM should be defined outside of #if proctection, just like TRACE_INCLUDE_FILE. Imaging this scenario: #include <trace/events/foo.h> -> TRACE_SYSTEM == foo ... #include <trace/events/bar.h> -> TRACE_SYSTEM == bar ... #define CREATE_TRACE_POINTS #include <trace/events/foo.h> -> TRACE_SYSTEM == bar !!! and then bar.h will be included and compiled. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <4A5A9CF1.2010007@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
7638d5322b
commit
d0b6e04a4c
@ -1,12 +1,11 @@
|
|||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM gfs2
|
||||||
|
|
||||||
#if !defined(_TRACE_GFS2_H) || defined(TRACE_HEADER_MULTI_READ)
|
#if !defined(_TRACE_GFS2_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
#define _TRACE_GFS2_H
|
#define _TRACE_GFS2_H
|
||||||
|
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
|
||||||
#define TRACE_SYSTEM gfs2
|
|
||||||
#define TRACE_INCLUDE_FILE trace_gfs2
|
|
||||||
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/buffer_head.h>
|
#include <linux/buffer_head.h>
|
||||||
#include <linux/dlmconstants.h>
|
#include <linux/dlmconstants.h>
|
||||||
@ -403,5 +402,6 @@ TRACE_EVENT(gfs2_block_alloc,
|
|||||||
/* This part must be outside protection */
|
/* This part must be outside protection */
|
||||||
#undef TRACE_INCLUDE_PATH
|
#undef TRACE_INCLUDE_PATH
|
||||||
#define TRACE_INCLUDE_PATH .
|
#define TRACE_INCLUDE_PATH .
|
||||||
|
#define TRACE_INCLUDE_FILE trace_gfs2
|
||||||
#include <trace/define_trace.h>
|
#include <trace/define_trace.h>
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM block
|
||||||
|
|
||||||
#if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
|
#if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
#define _TRACE_BLOCK_H
|
#define _TRACE_BLOCK_H
|
||||||
|
|
||||||
@ -5,9 +8,6 @@
|
|||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
|
||||||
#define TRACE_SYSTEM block
|
|
||||||
|
|
||||||
TRACE_EVENT(block_rq_abort,
|
TRACE_EVENT(block_rq_abort,
|
||||||
|
|
||||||
TP_PROTO(struct request_queue *q, struct request *rq),
|
TP_PROTO(struct request_queue *q, struct request *rq),
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
||||||
#define _TRACE_EXT4_H
|
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
#undef TRACE_SYSTEM
|
||||||
#define TRACE_SYSTEM ext4
|
#define TRACE_SYSTEM ext4
|
||||||
|
|
||||||
|
#if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
|
#define _TRACE_EXT4_H
|
||||||
|
|
||||||
#include <linux/writeback.h>
|
#include <linux/writeback.h>
|
||||||
#include "../../../fs/ext4/ext4.h"
|
#include "../../../fs/ext4/ext4.h"
|
||||||
#include "../../../fs/ext4/mballoc.h"
|
#include "../../../fs/ext4/mballoc.h"
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM irq
|
||||||
|
|
||||||
#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
|
#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
#define _TRACE_IRQ_H
|
#define _TRACE_IRQ_H
|
||||||
|
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
|
||||||
#define TRACE_SYSTEM irq
|
|
||||||
|
|
||||||
#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
|
#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
|
||||||
#define show_softirq_name(val) \
|
#define show_softirq_name(val) \
|
||||||
__print_symbolic(val, \
|
__print_symbolic(val, \
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM jbd2
|
||||||
|
|
||||||
#if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ)
|
#if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
#define _TRACE_JBD2_H
|
#define _TRACE_JBD2_H
|
||||||
|
|
||||||
#include <linux/jbd2.h>
|
#include <linux/jbd2.h>
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
|
||||||
#define TRACE_SYSTEM jbd2
|
|
||||||
|
|
||||||
TRACE_EVENT(jbd2_checkpoint,
|
TRACE_EVENT(jbd2_checkpoint,
|
||||||
|
|
||||||
TP_PROTO(journal_t *journal, int result),
|
TP_PROTO(journal_t *journal, int result),
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM kmem
|
||||||
|
|
||||||
#if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ)
|
#if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
#define _TRACE_KMEM_H
|
#define _TRACE_KMEM_H
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
|
||||||
#define TRACE_SYSTEM kmem
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The order of these masks is important. Matching masks will be seen
|
* The order of these masks is important. Matching masks will be seen
|
||||||
* first and the left over flags will end up showing by themselves.
|
* first and the left over flags will end up showing by themselves.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM lockdep
|
||||||
|
|
||||||
#if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ)
|
#if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
#define _TRACE_LOCKDEP_H
|
#define _TRACE_LOCKDEP_H
|
||||||
|
|
||||||
#include <linux/lockdep.h>
|
#include <linux/lockdep.h>
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
|
||||||
#define TRACE_SYSTEM lockdep
|
|
||||||
|
|
||||||
#ifdef CONFIG_LOCKDEP
|
#ifdef CONFIG_LOCKDEP
|
||||||
|
|
||||||
TRACE_EVENT(lock_acquire,
|
TRACE_EVENT(lock_acquire,
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM sched
|
||||||
|
|
||||||
#if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ)
|
#if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
#define _TRACE_SCHED_H
|
#define _TRACE_SCHED_H
|
||||||
|
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
|
||||||
#define TRACE_SYSTEM sched
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tracepoint for calling kthread_stop, performed to end a kthread:
|
* Tracepoint for calling kthread_stop, performed to end a kthread:
|
||||||
*/
|
*/
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM skb
|
||||||
|
|
||||||
#if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
|
#if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
#define _TRACE_SKB_H
|
#define _TRACE_SKB_H
|
||||||
|
|
||||||
#include <linux/skbuff.h>
|
#include <linux/skbuff.h>
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
|
||||||
#define TRACE_SYSTEM skb
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tracepoint for free an sk_buff:
|
* Tracepoint for free an sk_buff:
|
||||||
*/
|
*/
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM workqueue
|
||||||
|
|
||||||
#if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ)
|
#if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
#define _TRACE_WORKQUEUE_H
|
#define _TRACE_WORKQUEUE_H
|
||||||
|
|
||||||
@ -5,9 +8,6 @@
|
|||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
|
||||||
#define TRACE_SYSTEM workqueue
|
|
||||||
|
|
||||||
TRACE_EVENT(workqueue_insertion,
|
TRACE_EVENT(workqueue_insertion,
|
||||||
|
|
||||||
TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
|
TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
|
||||||
|
@ -1,20 +1,3 @@
|
|||||||
/*
|
|
||||||
* Notice that this file is not protected like a normal header.
|
|
||||||
* We also must allow for rereading of this file. The
|
|
||||||
*
|
|
||||||
* || defined(TRACE_HEADER_MULTI_READ)
|
|
||||||
*
|
|
||||||
* serves this purpose.
|
|
||||||
*/
|
|
||||||
#if !defined(_TRACE_EVENT_SAMPLE_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
||||||
#define _TRACE_EVENT_SAMPLE_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* All trace headers should include tracepoint.h, until we finally
|
|
||||||
* make it into a standard header.
|
|
||||||
*/
|
|
||||||
#include <linux/tracepoint.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If TRACE_SYSTEM is defined, that will be the directory created
|
* If TRACE_SYSTEM is defined, that will be the directory created
|
||||||
* in the ftrace directory under /debugfs/tracing/events/<system>
|
* in the ftrace directory under /debugfs/tracing/events/<system>
|
||||||
@ -34,10 +17,30 @@
|
|||||||
* #define TRACE_INCLUDE_FILE trace-events-sample
|
* #define TRACE_INCLUDE_FILE trace-events-sample
|
||||||
*
|
*
|
||||||
* As we do an the bottom of this file.
|
* As we do an the bottom of this file.
|
||||||
|
*
|
||||||
|
* Notice that TRACE_SYSTEM should be defined outside of #if
|
||||||
|
* protection, just like TRACE_INCLUDE_FILE.
|
||||||
*/
|
*/
|
||||||
#undef TRACE_SYSTEM
|
#undef TRACE_SYSTEM
|
||||||
#define TRACE_SYSTEM sample
|
#define TRACE_SYSTEM sample
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notice that this file is not protected like a normal header.
|
||||||
|
* We also must allow for rereading of this file. The
|
||||||
|
*
|
||||||
|
* || defined(TRACE_HEADER_MULTI_READ)
|
||||||
|
*
|
||||||
|
* serves this purpose.
|
||||||
|
*/
|
||||||
|
#if !defined(_TRACE_EVENT_SAMPLE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
|
#define _TRACE_EVENT_SAMPLE_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* All trace headers should include tracepoint.h, until we finally
|
||||||
|
* make it into a standard header.
|
||||||
|
*/
|
||||||
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The TRACE_EVENT macro is broken up into 5 parts.
|
* The TRACE_EVENT macro is broken up into 5 parts.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user