]> Pileus Git - ~andy/linux/blobdiff - kernel/trace/trace.h
tracing: Use direct field, type and system names
[~andy/linux] / kernel / trace / trace.h
index da09a037abcdd5828a2cc9fb175ede97c0360b2e..e420f2a230de323dae5732401a68699bb13129f0 100644 (file)
 #include <linux/trace_seq.h>
 #include <linux/ftrace_event.h>
 
+#ifdef CONFIG_FTRACE_SYSCALLS
+#include <asm/unistd.h>                /* For NR_SYSCALLS           */
+#include <asm/syscall.h>       /* some archs define it here */
+#endif
+
 enum trace_type {
        __TRACE_FIRST_TYPE = 0,
 
@@ -127,12 +132,21 @@ enum trace_flag_type {
 
 #define TRACE_BUF_SIZE         1024
 
+struct trace_array;
+
+struct trace_cpu {
+       struct trace_array      *tr;
+       struct dentry           *dir;
+       int                     cpu;
+};
+
 /*
  * The CPU trace array - it consists of thousands of trace entries
  * plus some other descriptor data: (for example which task started
  * the trace, etc.)
  */
 struct trace_array_cpu {
+       struct trace_cpu        trace_cpu;
        atomic_t                disabled;
        void                    *buffer_page;   /* ring buffer spare */
 
@@ -151,6 +165,8 @@ struct trace_array_cpu {
        char                    comm[TASK_COMM_LEN];
 };
 
+struct tracer;
+
 /*
  * The trace array - an array of per-CPU trace arrays. This is the
  * highest level data structure that individual tracers deal with.
@@ -159,16 +175,30 @@ struct trace_array_cpu {
 struct trace_array {
        struct ring_buffer      *buffer;
        struct list_head        list;
+       char                    *name;
        int                     cpu;
        int                     buffer_disabled;
+       struct trace_cpu        trace_cpu;      /* place holder */
+#ifdef CONFIG_FTRACE_SYSCALLS
+       int                     sys_refcount_enter;
+       int                     sys_refcount_exit;
+       DECLARE_BITMAP(enabled_enter_syscalls, NR_syscalls);
+       DECLARE_BITMAP(enabled_exit_syscalls, NR_syscalls);
+#endif
+       int                     stop_count;
+       int                     clock_id;
+       struct tracer           *current_trace;
        unsigned int            flags;
        cycle_t                 time_start;
+       raw_spinlock_t          start_lock;
        struct dentry           *dir;
+       struct dentry           *options;
+       struct dentry           *percpu_dir;
        struct dentry           *event_dir;
        struct list_head        systems;
        struct list_head        events;
        struct task_struct      *waiter;
-       struct trace_array_cpu  *data[NR_CPUS];
+       struct trace_array_cpu  *data;
 };
 
 enum {
@@ -474,6 +504,7 @@ struct dentry *trace_create_file(const char *name,
                                 void *data,
                                 const struct file_operations *fops);
 
+struct dentry *tracing_init_dentry_tr(struct trace_array *tr);
 struct dentry *tracing_init_dentry(void);
 
 struct ring_buffer_event;
@@ -856,8 +887,8 @@ enum {
 
 struct ftrace_event_field {
        struct list_head        link;
-       char                    *name;
-       char                    *type;
+       const char              *name;
+       const char              *type;
        int                     filter_type;
        int                     offset;
        int                     size;
@@ -969,6 +1000,8 @@ filter_check_discard(struct ftrace_event_call *call, void *rec,
 }
 
 extern void trace_event_enable_cmd_record(bool enable);
+extern int event_trace_add_tracer(struct dentry *parent, struct trace_array *tr);
+extern int event_trace_del_tracer(struct trace_array *tr);
 
 extern struct mutex event_mutex;
 extern struct list_head ftrace_events;
@@ -979,7 +1012,7 @@ extern const char *__stop___trace_bprintk_fmt[];
 void trace_printk_init_buffers(void);
 void trace_printk_start_comm(void);
 int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set);
-int set_tracer_flag(unsigned int mask, int enabled);
+int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled);
 
 #undef FTRACE_ENTRY
 #define FTRACE_ENTRY(call, struct_name, id, tstruct, print, filter)    \