aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuukka Tikkanen <tuukka.tikkanen@linaro.org>2014-12-10 10:09:13 +0200
committerTuukka Tikkanen <tuukka.tikkanen@linaro.org>2014-12-12 08:57:27 +0200
commitd2011821a22ce57898421b24f4703cfac94c58e3 (patch)
tree2e42f7e210339c8154bd2fd0a90eeefcac0426cb
parent682d9dc3b57b1a99e3b04d80aeab35ace36fbc30 (diff)
report_ops: Move struct report_ops definition to report_ops.h
Struct report_ops is defined in idlestat.h. Having the definition in report_ops.h keeps the definition grouped with the declarations of different report types. Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
-rw-r--r--csv_report.c1
-rw-r--r--default_report.c1
-rw-r--r--idlestat.h26
-rw-r--r--report_ops.h30
4 files changed, 32 insertions, 26 deletions
diff --git a/csv_report.c b/csv_report.c
index f910cf2..fb74eed 100644
--- a/csv_report.c
+++ b/csv_report.c
@@ -3,6 +3,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include "report_ops.h"
#include "idlestat.h"
#include "utils.h"
diff --git a/default_report.c b/default_report.c
index 95f72f9..c1d0af8 100644
--- a/default_report.c
+++ b/default_report.c
@@ -4,6 +4,7 @@
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
+#include "report_ops.h"
#include "idlestat.h"
#include "utils.h"
diff --git a/idlestat.h b/idlestat.h
index c382c1f..2c92a2b 100644
--- a/idlestat.h
+++ b/idlestat.h
@@ -187,30 +187,4 @@ extern struct cpufreq_pstates *build_pstate_info(int nrcpus);
extern void cpu_change_pstate(struct cpuidle_datas *datas, int cpu, unsigned int freq, double time);
extern int get_wakeup_irq(struct cpuidle_datas *datas, char *buffer, int count);
-
-struct report_ops {
- int (*check_output)(struct program_options *, void *);
-
- int (*open_report_file)(char *path, void *);
- int (*close_report_file)(void *);
-
- void (*cstate_table_header)(void *);
- void (*cstate_table_footer)(void *);
- void (*cstate_cpu_header)(const char *cpu, void *);
- void (*cstate_single_state)(struct cpuidle_cstate*, void *);
- void (*cstate_end_cpu)(void *);
-
- void (*pstate_table_header)(void *);
- void (*pstate_table_footer)(void *);
- void (*pstate_cpu_header)(const char *cpu, void *);
- void (*pstate_single_state)(struct cpufreq_pstate*, void *);
- void (*pstate_end_cpu)(void*);
-
- void (*wakeup_table_header)(void *);
- void (*wakeup_table_footer)(void *);
- void (*wakeup_cpu_header)(const char *cpu, void *);
- void (*wakeup_single_state)(struct wakeup_irq *irqinfo, void *);
- void (*wakeup_end_cpu)(void *);
-};
-
#endif
diff --git a/report_ops.h b/report_ops.h
index e502902..eef79bc 100644
--- a/report_ops.h
+++ b/report_ops.h
@@ -1,6 +1,36 @@
#ifndef __REPORT_OPS_H
#define __REPORT_OPS_H
+struct program_options;
+struct cpuidle_cstate;
+struct cpufreq_pstate;
+struct wakeup_irq;
+
+struct report_ops {
+ int (*check_output)(struct program_options *, void *);
+
+ int (*open_report_file)(char *path, void *);
+ int (*close_report_file)(void *);
+
+ void (*cstate_table_header)(void *);
+ void (*cstate_table_footer)(void *);
+ void (*cstate_cpu_header)(const char *cpu, void *);
+ void (*cstate_single_state)(struct cpuidle_cstate*, void *);
+ void (*cstate_end_cpu)(void *);
+
+ void (*pstate_table_header)(void *);
+ void (*pstate_table_footer)(void *);
+ void (*pstate_cpu_header)(const char *cpu, void *);
+ void (*pstate_single_state)(struct cpufreq_pstate*, void *);
+ void (*pstate_end_cpu)(void*);
+
+ void (*wakeup_table_header)(void *);
+ void (*wakeup_table_footer)(void *);
+ void (*wakeup_cpu_header)(const char *cpu, void *);
+ void (*wakeup_single_state)(struct wakeup_irq *irqinfo, void *);
+ void (*wakeup_end_cpu)(void *);
+};
+
extern struct report_ops default_report_ops;
extern struct report_ops csv_report_ops;
extern struct report_ops boxless_report_ops;