tracing: add handler to trace_stat
authorSteven Rostedt <srostedt@redhat.com>
Tue, 24 Mar 2009 17:38:36 +0000 (13:38 -0400)
committerSteven Rostedt <srostedt@redhat.com>
Wed, 25 Mar 2009 03:22:58 +0000 (23:22 -0400)
Currently, if a trace_stat user wants a handle to some private data,
the trace_stat infrastructure does not supply a way to do that.

This patch passes the trace_stat structure to the start function of
the trace_stat code.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
kernel/trace/trace_branch.c
kernel/trace/trace_stat.c
kernel/trace/trace_stat.h
kernel/trace/trace_workqueue.c

index ad8c22efff417ac1711cb4cc35c245b5a11c8efa..e6e32912ffb8102d94e6773a126a92da7988eccd 100644 (file)
@@ -263,7 +263,7 @@ static int branch_stat_show(struct seq_file *m, void *v)
        return 0;
 }
 
-static void *annotated_branch_stat_start(void)
+static void *annotated_branch_stat_start(struct tracer_stat *trace)
 {
        return __start_annotated_branch_profile;
 }
@@ -338,7 +338,7 @@ static int all_branch_stat_headers(struct seq_file *m)
        return 0;
 }
 
-static void *all_branch_stat_start(void)
+static void *all_branch_stat_start(struct tracer_stat *trace)
 {
        return __start_branch_profile;
 }
index f71b85b22cfe29ae6a58067b7e9f6f66c802fabb..f8f48d84b2c389a1bbcdef262189db410b978ce9 100644 (file)
@@ -85,7 +85,7 @@ static int stat_seq_init(struct tracer_stat_session *session)
        if (!ts->stat_cmp)
                ts->stat_cmp = dummy_cmp;
 
-       stat = ts->stat_start();
+       stat = ts->stat_start(ts);
        if (!stat)
                goto exit;
 
index 202274cf7f3d06d1145437ab8cd27d43eaf90e04..f3546a2cd826bc6ae0ecb85c3c631bd411884aab 100644 (file)
@@ -12,7 +12,7 @@ struct tracer_stat {
        /* The name of your stat file */
        const char              *name;
        /* Iteration over statistic entries */
-       void                    *(*stat_start)(void);
+       void                    *(*stat_start)(struct tracer_stat *trace);
        void                    *(*stat_next)(void *prev, int idx);
        /* Compare two entries for stats sorting */
        int                     (*stat_cmp)(void *p1, void *p2);
index 9ab035b58cf1425b4b817dfae37d0b36e5eeada3..ee533c2e161bb4b5741e4cb574f50c29c911fdc7 100644 (file)
@@ -152,7 +152,7 @@ static struct cpu_workqueue_stats *workqueue_stat_start_cpu(int cpu)
        return ret;
 }
 
-static void *workqueue_stat_start(void)
+static void *workqueue_stat_start(struct tracer_stat *trace)
 {
        int cpu;
        void *ret = NULL;