diff options
author | Koan-Sin Tan <freedom.tan@linaro.org> | 2014-11-27 17:10:47 +0800 |
---|---|---|
committer | Tuukka Tikkanen <tuukka.tikkanen@linaro.org> | 2014-11-28 05:11:18 +0200 |
commit | db63259a01cb3c88b82dbecddd48a2c166c84e20 (patch) | |
tree | c86902bcdc3f2d1b5d66363e44e0561a21b97512 /idlestat.h | |
parent | 262e24b0d2136e8c3ee847bf65f6527f27973730 (diff) |
add code to handle different output formats
The goals of this patch are
1) to support different report formats (e.g., text, csv, gnuplot
commands),
2) to support different report modes (e.g., single run stats,
histograms, comparison), and
3) without cluttering the main program code with vast amounts of
conditional output code in primary processing loop.
This patch implements report output via an "report operations
structure" (struct output_ops) pointed to from options structure.
Clutter in main source file has been reduced by moving the default
report generation functions to separate report format specific source
file and utils.c.
Signed-off-by: Koan-Sin Tan <freedom.tan@linaro.org>
Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
Diffstat (limited to 'idlestat.h')
-rw-r--r-- | idlestat.h | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -131,6 +131,8 @@ struct program_options { char *outfilename; int verbose; char *energy_model_filename; + struct report_ops *report_ops; + void *report_data; }; #define IDLE_DISPLAY 0x1 @@ -179,4 +181,29 @@ struct init_pstates { unsigned int *freqs; }; +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 |