From: Sebastien Godard Date: Sat, 13 Aug 2011 12:44:43 +0000 (+0200) Subject: DTD and XSD documents updated. X-Git-Tag: v10.0.2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=74f7ff9e5190ea7bf67a33b76fcbaf7caeac16de;p=sysstat DTD and XSD documents updated. A new mark ("utc") has been added in the XML output generated by sadf -x. This mark has a value of 0 or 1 depending on whether the timestamp is expressed in local time or UTC. A correction has also been made in the XSD document, where the description of "comment" messages was erroneous. --- diff --git a/CHANGES b/CHANGES index 5d78354..c864adb 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,7 @@ xxxx/xx/xx: Version 10.0.2 - Sebastien Godard (sysstat orange.fr) Its design is still not generic anyway. * [Jeroen Roovers]: Automate translation files handling in Makefile.in. + * DTD and XSD documents updated. * Various cosmetic changes (sar.c, sadf.c). * CREDITS file updated. diff --git a/sadf.c b/sadf.c index 36e1460..348dfa3 100644 --- a/sadf.c +++ b/sadf.c @@ -275,7 +275,7 @@ void prtab(int nr_tab) /* *************************************************************************** - * printf() function modified for XML display + * printf() function modified for textual (XML-like) display. * * IN: * @nr_tab Number of tabs to print. @@ -317,8 +317,8 @@ void xprintf(int nr_tab, const char *fmtf, ...) * been saved. *************************************************************************** */ -void write_xml_restarts(int curr, int use_tm_start, int use_tm_end, int tab, /* FIXME: revoir nom proc */ - struct tm *rectime, struct tm *loctime) +void write_textual_restarts(int curr, int use_tm_start, int use_tm_end, int tab, + struct tm *rectime, struct tm *loctime) { char cur_date[32], cur_time[32]; @@ -340,7 +340,7 @@ void write_xml_restarts(int curr, int use_tm_start, int use_tm_end, int tab, /* /* *************************************************************************** - * Display XML COMMENT records for textual (XML-like) reports. + * Display COMMENT records for textual (XML-like) reports. * * IN: * @curr Index in array for current sample statistics. @@ -361,8 +361,8 @@ void write_xml_restarts(int curr, int use_tm_start, int use_tm_end, int tab, /* * been saved. *************************************************************************** */ -void write_xml_comments(int curr, int use_tm_start, int use_tm_end, int tab, int ifd, /* FIXME: revoir nom proc */ - struct tm *rectime, struct tm *loctime) +void write_textual_comments(int curr, int use_tm_start, int use_tm_end, int tab, int ifd, + struct tm *rectime, struct tm *loctime) { char cur_date[32], cur_time[32]; char file_comment[MAX_COMMENT_LEN]; @@ -612,9 +612,9 @@ int write_parsable_stats(int curr, int reset, long *cnt, int use_tm_start, * 1 if stats have been successfully displayed. *************************************************************************** */ -int write_xml_stats(int curr, int use_tm_start, int use_tm_end, int reset, - long *cnt, int tab, __nr_t cpu_nr, struct tm *rectime, - struct tm *loctime) +int write_textual_stats(int curr, int use_tm_start, int use_tm_end, int reset, + long *cnt, int tab, __nr_t cpu_nr, struct tm *rectime, + struct tm *loctime) { int i; unsigned long long dt, itv, g_itv; @@ -683,11 +683,10 @@ int write_xml_stats(int curr, int use_tm_start, int use_tm_end, int reset, } tab++; - /* Display XML statistics */ + /* Display textual statistics */ for (i = 0; i < NR_ACT; i++) { - /* FIXME: PB: le nom de la fonction a appeler va dependre du format d'affichage choisi (ex.: f_xml_print si on est en XML) */ - + /* This code is not generic at all...! */ if (CLOSE_MARKUP(act[i]->options) || (IS_SELECTED(act[i]->options) && (act[i]->nr > 0))) { (*act[i]->f_xml_print)(act[i], curr, tab, @@ -874,9 +873,9 @@ void rw_curr_act_stats(int ifd, off_t fpos, int *curr, long *cnt, int *eosaf, * saved for current record. *************************************************************************** */ -void xml_display_loop(int ifd, struct file_activity *file_actlst, char *dfile, - struct file_magic *file_magic, __nr_t cpu_nr, - struct tm *rectime, struct tm *loctime) +void textual_display_loop(int ifd, struct file_activity *file_actlst, char *dfile, + struct file_magic *file_magic, __nr_t cpu_nr, + struct tm *rectime, struct tm *loctime) { int curr, tab = 0, rtype; int eosaf = TRUE, next, reset = FALSE; @@ -953,8 +952,8 @@ void xml_display_loop(int ifd, struct file_activity *file_actlst, char *dfile, file_actlst); /* next is set to 1 when we were close enough to desired interval */ - next = write_xml_stats(curr, tm_start.use, tm_end.use, reset, - &cnt, tab, cpu_nr, rectime, loctime); + next = write_textual_stats(curr, tm_start.use, tm_end.use, reset, + &cnt, tab, cpu_nr, rectime, loctime); if (next) { curr ^= 1; @@ -1024,8 +1023,8 @@ void xml_display_loop(int ifd, struct file_activity *file_actlst, char *dfile, file_actlst); } if (rtype == R_RESTART) { - write_xml_restarts(0, tm_start.use, tm_end.use, tab, - rectime, loctime); + write_textual_restarts(0, tm_start.use, tm_end.use, tab, + rectime, loctime); } else if (rtype == R_COMMENT) { /* Ignore COMMENT record */ @@ -1063,8 +1062,8 @@ void xml_display_loop(int ifd, struct file_activity *file_actlst, char *dfile, file_actlst); } if (rtype == R_COMMENT) { - write_xml_comments(0, tm_start.use, tm_end.use, - tab, ifd, rectime, loctime); + write_textual_comments(0, tm_start.use, tm_end.use, + tab, ifd, rectime, loctime); } } } @@ -1264,12 +1263,11 @@ void read_stats_from_file(char dfile[]) if (DISPLAY_GROUPED_STATS(fmt[f_position]->options)) { main_display_loop(ifd, file_actlst, cpu_nr, - &rectime, &loctime); /* FIXME: revoir nom */ + &rectime, &loctime); } else { - xml_display_loop(ifd, file_actlst, - dfile, &file_magic, cpu_nr, - &rectime, &loctime); /* FIXME: revoir nom */ + textual_display_loop(ifd, file_actlst, dfile, + &file_magic, cpu_nr, &rectime, &loctime); } close(ifd); diff --git a/sadf.h b/sadf.h index 87d4dee..660d739 100644 --- a/sadf.h +++ b/sadf.h @@ -8,6 +8,9 @@ #include "sa.h" +/* DTD version for XML output */ +#define XML_DTD_VERSION "2.12" + /* Possible actions for functions used to display reports */ #define F_BEGIN 0x01 #define F_MAIN 0x02 @@ -167,9 +170,6 @@ struct report_format { __printf_funct_t (*f_comment) (int *, int, char *, char *, int, char *, struct file_header *); }; -/* DTD version for XML output */ -#define XML_DTD_VERSION "2.11" - /* *************************************************************************** * Various function prototypes diff --git a/sadf_misc.c b/sadf_misc.c index 708b2db..fe5f1fd 100644 --- a/sadf_misc.c +++ b/sadf_misc.c @@ -129,7 +129,7 @@ __printf_funct_t print_xml_restart(int *tab, int action, char *cur_date, } if (action & F_MAIN) { xprintf(*tab, "", - cur_date, cur_time, utc ? 1 : 0); /* FIXME: Nouvelle balise a prevoir dans DTD/XSD */ + cur_date, cur_time, utc ? 1 : 0); } if (action & F_END) { xprintf(--(*tab), ""); @@ -238,7 +238,7 @@ __printf_funct_t print_xml_comment(int *tab, int action, char *cur_date, xprintf((*tab)++, ""); } if (action & F_MAIN) { - xprintf(*tab, "", /* FIXME: modification du DTD/XSD */ + xprintf(*tab, "", cur_date, cur_time, utc ? 1 : 0, comment); } if (action & F_END) { @@ -288,7 +288,7 @@ __printf_funct_t print_xml_timestamp(int *tab, int action, char *cur_date, char *cur_time, int utc, unsigned long long itv) { if (action & F_BEGIN) { - xprintf(*tab, "", /* FIXME: modification du DTD/XSD */ + xprintf(*tab, "", cur_date, cur_time, utc ? 1 : 0, itv); } if (action & F_END) { diff --git a/xml/sysstat.dtd b/xml/sysstat.dtd index 7779828..dc96ff7 100644 --- a/xml/sysstat.dtd +++ b/xml/sysstat.dtd @@ -1,5 +1,5 @@ - + @@ -26,6 +26,7 @@ @@ -35,6 +36,7 @@ @@ -43,6 +45,7 @@ diff --git a/xml/sysstat.xsd b/xml/sysstat.xsd index 6cf3624..990c03a 100644 --- a/xml/sysstat.xsd +++ b/xml/sysstat.xsd @@ -1,7 +1,7 @@ - -- XML Schema v2.11 for sysstat. See sadf.h -- + -- XML Schema v2.12 for sysstat. See sadf.h -- @@ -74,9 +74,9 @@ - - - + + + @@ -100,6 +100,7 @@ + @@ -107,6 +108,15 @@ + + + + + + + + +