2 * format.c: Output format definitions for sadf
3 * (C) 2011 by Sebastien GODARD (sysstat <at> orange.fr)
5 ***************************************************************************
6 * This program is free software; you can redistribute it and/or modify it *
7 * under the terms of the GNU General Public License as published by the *
8 * Free Software Foundation; either version 2 of the License, or (at your *
9 * option) any later version. *
11 * This program is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without the implied warranty of MERCHANTABILITY *
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
16 * You should have received a copy of the GNU General Public License along *
17 * with this program; if not, write to the Free Software Foundation, Inc., *
18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
19 ***************************************************************************
25 ***************************************************************************
26 * Definitions of output formats.
27 * See sadf.h file for format structure definition.
28 ***************************************************************************
32 * Display only datafile header.
34 struct report_format hdr_fmt = {
35 .id = F_HEADER_OUTPUT,
36 .options = FO_HEADER_ONLY + FO_BAD_FILE_FORMAT,
37 .f_header = print_hdr_header,
45 * Database friendly format.
47 struct report_format db_fmt = {
49 .options = FO_GROUPED_STATS + FO_TRUE_TIME + FO_HORIZONTALLY +
50 FO_SEC_EPOCH + FO_FIELD_LIST,
54 .f_restart = print_db_restart,
55 .f_comment = print_db_comment
59 * Format easily handled by pattern processing commands like awk.
61 struct report_format ppc_fmt = {
63 .options = FO_GROUPED_STATS + FO_TRUE_TIME + FO_SEC_EPOCH,
67 .f_restart = print_ppc_restart,
68 .f_comment = print_ppc_comment
74 struct report_format xml_fmt = {
76 .options = FO_HEADER_ONLY + FO_TRUE_TIME,
77 .f_header = print_xml_header,
78 .f_statistics = print_xml_statistics,
79 .f_timestamp = print_xml_timestamp,
80 .f_restart = print_xml_restart,
81 .f_comment = print_xml_comment
87 struct report_format json_fmt = {
89 .options = FO_HEADER_ONLY + FO_TRUE_TIME,
90 .f_header = print_json_header,
91 .f_statistics = print_json_statistics,
92 .f_timestamp = print_json_timestamp,
93 .f_restart = print_json_restart,
94 .f_comment = print_json_comment
98 * Array of output formats.
100 struct report_format *fmt[NR_FMT] = {