* Prototypes used to display restart messages
*/
__printf_funct_t print_db_restart
- (int *, int, char *, char *, int, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, struct file_header *, struct record_header *);
__printf_funct_t print_ppc_restart
- (int *, int, char *, char *, int, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, struct file_header *, struct record_header *);
__printf_funct_t print_xml_restart
- (int *, int, char *, char *, int, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, struct file_header *, struct record_header *);
__printf_funct_t print_json_restart
- (int *, int, char *, char *, int, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, struct file_header *, struct record_header *);
__printf_funct_t print_raw_restart
- (int *, int, char *, char *, int, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, struct file_header *, struct record_header *);
__printf_funct_t print_pcp_restart
- (int *, int, char *, char *, int, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, struct file_header *, struct record_header *);
/*
* Prototypes used to display comments
*/
__printf_funct_t print_db_comment
- (int *, int, char *, char *, int, char *, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, char *, struct file_header *, struct record_header *);
__printf_funct_t print_ppc_comment
- (int *, int, char *, char *, int, char *, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, char *, struct file_header *, struct record_header *);
__printf_funct_t print_xml_comment
- (int *, int, char *, char *, int, char *, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, char *, struct file_header *, struct record_header *);
__printf_funct_t print_json_comment
- (int *, int, char *, char *, int, char *, struct file_header *, struct record_header *);
-__printf_funct_t print_sar_comment
- (int *, int, char *, char *, int, char *, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, char *, struct file_header *, struct record_header *);
__printf_funct_t print_raw_comment
- (int *, int, char *, char *, int, char *, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, char *, struct file_header *, struct record_header *);
__printf_funct_t print_pcp_comment
- (int *, int, char *, char *, int, char *, struct file_header *, struct record_header *);
+ (int *, int, char *, char *, char *, struct file_header *, struct record_header *);
/*
* Prototypes used to display the statistics part of the report
* IN:
* @cur_date Date string of current restart message.
* @cur_time Time string of current restart message.
- * @utc True if @cur_time is expressed in UTC.
* @sep Character used as separator.
* @file_hdr System activity file standard header.
***************************************************************************
*/
-void print_dbppc_restart(char *cur_date, char *cur_time, int utc, char sep,
+void print_dbppc_restart(char *cur_date, char *cur_time, char sep,
struct file_header *file_hdr)
{
printf("%s%c-1%c", file_hdr->sa_nodename, sep, sep);
printf("%s ", cur_date);
}
printf("%s", cur_time);
- if (strlen(cur_date) && utc) {
- printf(" UTC");
+ if (strlen(cur_date) && !PRINT_LOCAL_TIME(flags)) {
+ printf(" %s", PRINT_TRUE_TIME(flags) ? file_hdr->sa_tzname : "UTC");
}
printf("%cLINUX-RESTART\t(%d CPU)\n",
sep, file_hdr->sa_cpu_nr > 1 ? file_hdr->sa_cpu_nr - 1 : 1);
* @action Action expected from current function.
* @cur_date Date string of current restart message.
* @cur_time Time string of current restart message.
- * @utc True if @cur_time is expressed in UTC.
* @file_hdr System activity file standard header.
* @record_hdr Current record header (unused here).
***************************************************************************
*/
__printf_funct_t print_db_restart(int *tab, int action, char *cur_date,
- char *cur_time, int utc, struct file_header *file_hdr,
+ char *cur_time, struct file_header *file_hdr,
struct record_header *record_hdr)
{
/* Actions F_BEGIN and F_END ignored */
if (action == F_MAIN) {
- print_dbppc_restart(cur_date, cur_time, utc, ';', file_hdr);
+ print_dbppc_restart(cur_date, cur_time, ';', file_hdr);
}
}
* @action Action expected from current function.
* @cur_date Date string of current restart message.
* @cur_time Time string of current restart message.
- * @utc True if @cur_time is expressed in UTC.
* @file_hdr System activity file standard header.
* @record_hdr Current record header (unused here).
***************************************************************************
*/
__printf_funct_t print_ppc_restart(int *tab, int action, char *cur_date,
- char *cur_time, int utc, struct file_header *file_hdr,
+ char *cur_time, struct file_header *file_hdr,
struct record_header *record_hdr)
{
/* Actions F_BEGIN and F_END ignored */
if (action == F_MAIN) {
- print_dbppc_restart(cur_date, cur_time, utc, '\t', file_hdr);
+ print_dbppc_restart(cur_date, cur_time, '\t', file_hdr);
}
}
* @action Action expected from current function.
* @cur_date Date string of current restart message.
* @cur_time Time string of current restart message.
- * @utc True if @cur_time is expressed in UTC.
* @file_hdr System activity file standard header.
* @record_hdr Current record header (unused here).
*
***************************************************************************
*/
__printf_funct_t print_xml_restart(int *tab, int action, char *cur_date,
- char *cur_time, int utc, struct file_header *file_hdr,
+ char *cur_time, struct file_header *file_hdr,
struct record_header *record_hdr)
{
if (action & F_BEGIN) {
}
if (action & F_MAIN) {
xprintf(*tab, "<boot date=\"%s\" time=\"%s\" utc=\"%d\" cpu_count=\"%d\"/>",
- cur_date, cur_time, utc ? 1 : 0,
+ cur_date, cur_time,
+ !PRINT_LOCAL_TIME(flags) && !PRINT_TRUE_TIME(flags) ? 1 : 0,
file_hdr->sa_cpu_nr > 1 ? file_hdr->sa_cpu_nr - 1 : 1);
}
if (action & F_END) {
* @action Action expected from current function.
* @cur_date Date string of current restart message.
* @cur_time Time string of current restart message.
- * @utc True if @cur_time is expressed in UTC.
* @file_hdr System activity file standard header.
* @record_hdr Current record header (unused here).
*
***************************************************************************
*/
__printf_funct_t print_json_restart(int *tab, int action, char *cur_date,
- char *cur_time, int utc, struct file_header *file_hdr,
+ char *cur_time, struct file_header *file_hdr,
struct record_header *record_hdr)
{
static int sep = FALSE;
}
xprintf((*tab)++, "{");
xprintf(*tab, "\"boot\": {\"date\": \"%s\", \"time\": \"%s\", \"utc\": %d, \"cpu_count\": %d}",
- cur_date, cur_time, utc ? 1 : 0,
+ cur_date, cur_time,
+ !PRINT_LOCAL_TIME(flags) && !PRINT_TRUE_TIME(flags) ? 1 : 0,
file_hdr->sa_cpu_nr > 1 ? file_hdr->sa_cpu_nr - 1 : 1);
xprintf0(--(*tab), "}");
sep = TRUE;
* @action Action expected from current function.
* @cur_date Date string of current restart message.
* @cur_time Time string of current restart message.
- * @utc True if @cur_time is expressed in UTC.
* @file_hdr System activity file standard header.
* @record_hdr Current record header (unused here).
***************************************************************************
*/
__printf_funct_t print_raw_restart(int *tab, int action, char *cur_date,
- char *cur_time, int utc, struct file_header *file_hdr,
+ char *cur_time, struct file_header *file_hdr,
struct record_header *record_hdr)
{
/* Actions F_BEGIN and F_END ignored */
if (action == F_MAIN) {
printf("%s", cur_time);
- if (strlen(cur_date) && utc) {
- printf(" UTC");
+ if (strlen(cur_date) && !PRINT_LOCAL_TIME(flags)) {
+ printf(" %s", PRINT_TRUE_TIME(flags) ? file_hdr->sa_tzname : "UTC");
}
printf("; LINUX-RESTART (%d CPU)\n",
file_hdr->sa_cpu_nr > 1 ? file_hdr->sa_cpu_nr - 1 : 1);
* @action Action expected from current function.
* @cur_date Date string of current restart message (unused here).
* @cur_time Time string of current restart message (unused here).
- * @utc True if @cur_time is expressed in UTC (unused here).
* @file_hdr System activity file standard header.
* @record_hdr Current record header.
***************************************************************************
*/
__printf_funct_t print_pcp_restart(int *tab, int action, char *cur_date, char *cur_time,
- int utc, struct file_header *file_hdr,
+ struct file_header *file_hdr,
struct record_header *record_hdr)
{
#ifdef HAVE_PCP
* IN:
* @cur_date Date string of current restart message.
* @cur_time Time string of current restart message.
- * @utc True if @cur_time is expressed in UTC.
* @comment Comment to display.
* @sep Character used as separator.
* @file_hdr System activity file standard header.
***************************************************************************
*/
-void print_dbppc_comment(char *cur_date, char *cur_time, int utc,
- char *comment, char sep, struct file_header *file_hdr)
+void print_dbppc_comment(char *cur_date, char *cur_time, char *comment,
+ char sep, struct file_header *file_hdr)
{
printf("%s%c-1%c", file_hdr->sa_nodename, sep, sep);
if (strlen(cur_date)) {
printf("%s ", cur_date);
}
printf("%s", cur_time);
- if (strlen(cur_date) && utc) {
- printf(" UTC");
+ if (strlen(cur_date) && !PRINT_LOCAL_TIME(flags)) {
+ printf(" %s", PRINT_TRUE_TIME(flags) ? file_hdr->sa_tzname : "UTC");
}
printf("%cCOM %s\n", sep, comment);
}
* @action Action expected from current function.
* @cur_date Date string of current restart message.
* @cur_time Time string of current restart message.
- * @utc True if @cur_time is expressed in UTC.
* @comment Comment to display.
* @file_hdr System activity file standard header.
* @record_hdr Current record header (unused here).
***************************************************************************
*/
__printf_funct_t print_db_comment(int *tab, int action, char *cur_date, char *cur_time,
- int utc, char *comment, struct file_header *file_hdr,
+ char *comment, struct file_header *file_hdr,
struct record_header *record_hdr)
{
/* Actions F_BEGIN and F_END ignored */
if (action & F_MAIN) {
- print_dbppc_comment(cur_date, cur_time, utc, comment,
- ';', file_hdr);
+ print_dbppc_comment(cur_date, cur_time, comment, ';', file_hdr);
}
}
* @action Action expected from current function.
* @cur_date Date string of current restart message.
* @cur_time Time string of current restart message.
- * @utc True if @cur_time is expressed in UTC.
* @comment Comment to display.
* @file_hdr System activity file standard header.
* @record_hdr Current record header (unused here).
***************************************************************************
*/
__printf_funct_t print_ppc_comment(int *tab, int action, char *cur_date, char *cur_time,
- int utc, char *comment, struct file_header *file_hdr,
+ char *comment, struct file_header *file_hdr,
struct record_header *record_hdr)
{
/* Actions F_BEGIN and F_END ignored */
if (action & F_MAIN) {
- print_dbppc_comment(cur_date, cur_time, utc, comment,
- '\t', file_hdr);
+ print_dbppc_comment(cur_date, cur_time, comment, '\t', file_hdr);
}
}
* @action Action expected from current function.
* @cur_date Date string of current comment.
* @cur_time Time string of current comment.
- * @utc True if @cur_time is expressed in UTC.
* @comment Comment to display.
* @file_hdr System activity file standard header (unused here).
* @record_hdr Current record header (unused here).
***************************************************************************
*/
__printf_funct_t print_xml_comment(int *tab, int action, char *cur_date, char *cur_time,
- int utc, char *comment, struct file_header *file_hdr,
+ char *comment, struct file_header *file_hdr,
struct record_header *record_hdr)
{
if (action & F_BEGIN) {
}
if (action & F_MAIN) {
xprintf(*tab, "<comment date=\"%s\" time=\"%s\" utc=\"%d\" com=\"%s\"/>",
- cur_date, cur_time, utc ? 1 : 0, comment);
+ cur_date, cur_time,
+ !PRINT_LOCAL_TIME(flags) && !PRINT_TRUE_TIME(flags) ? 1 : 0,
+ comment);
}
if (action & F_END) {
xprintf(--(*tab), "</comments>");
* @action Action expected from current function.
* @cur_date Date string of current comment.
* @cur_time Time string of current comment.
- * @utc True if @cur_time is expressed in UTC.
* @comment Comment to display.
* @file_hdr System activity file standard header (unused here).
* @record_hdr Current record header (unused here).
***************************************************************************
*/
__printf_funct_t print_json_comment(int *tab, int action, char *cur_date, char *cur_time,
- int utc, char *comment, struct file_header *file_hdr,
+ char *comment, struct file_header *file_hdr,
struct record_header *record_hdr)
{
static int sep = FALSE;
xprintf(*tab,
"\"comment\": {\"date\": \"%s\", \"time\": \"%s\", "
"\"utc\": %d, \"com\": \"%s\"}",
- cur_date, cur_time, utc ? 1 : 0, comment);
+ cur_date, cur_time,
+ !PRINT_LOCAL_TIME(flags) && !PRINT_TRUE_TIME(flags) ? 1 : 0,
+ comment);
xprintf0(--(*tab), "}");
sep = TRUE;
}
* @action Action expected from current function.
* @cur_date Date string of current restart message.
* @cur_time Time string of current restart message.
- * @utc True if @cur_time is expressed in UTC.
* @comment Comment to display.
* @file_hdr System activity file standard header (unused here).
* @record_hdr Current record header (unused here).
***************************************************************************
*/
__printf_funct_t print_raw_comment(int *tab, int action, char *cur_date, char *cur_time,
- int utc, char *comment, struct file_header *file_hdr,
+ char *comment, struct file_header *file_hdr,
struct record_header *record_hdr)
{
/* Actions F_BEGIN and F_END ignored */
if (action & F_MAIN) {
printf("%s", cur_time);
- if (strlen(cur_date) && utc) {
- printf(" UTC");
+ if (strlen(cur_date) && !PRINT_LOCAL_TIME(flags)) {
+ printf(" %s", PRINT_TRUE_TIME(flags) ? file_hdr->sa_tzname : "UTC");
}
printf("; COM %s\n", comment);
}
***************************************************************************
*/
__printf_funct_t print_pcp_comment(int *tab, int action, char *cur_date, char *cur_time,
- int utc, char *comment, struct file_header *file_hdr,
+ char *comment, struct file_header *file_hdr,
struct record_header *record_hdr)
{
#ifdef HAVE_PCP
* @file_hdr System activity file standard header.
* @cur_date Date string of current record.
* @cur_time Time string of current record.
- * @utc True if @cur_time is expressed in UTC.
* @itv Interval of time with preceding record.
*
* RETURNS:
***************************************************************************
*/
char *print_dbppc_timestamp(int fmt, struct file_header *file_hdr, char *cur_date,
- char *cur_time, int utc, unsigned long long itv)
+ char *cur_time, unsigned long long itv)
{
int isdb = (fmt == F_DB_OUTPUT);
static char pre[512];
char temp1[128], temp2[256];
+ int sep = !PRINT_LOCAL_TIME(flags);
/* This substring appears on every output line, preformat it here */
snprintf(temp1, sizeof(temp1), "%s%s%lld%s",
else {
strcpy(temp2, temp1);
}
- snprintf(pre, sizeof(pre), "%s%s%s", temp2, cur_time,
- strlen(cur_date) && utc ? " UTC" : "");
+ snprintf(pre, sizeof(pre), "%s%s%s%s", temp2, cur_time, sep ? " " : "",
+ strlen(cur_date) && !PRINT_LOCAL_TIME(flags) ?
+ (PRINT_TRUE_TIME(flags) ? file_hdr->sa_tzname : "UTC") : "");
pre[sizeof(pre) - 1] = '\0';
if (DISPLAY_HORIZONTALLY(flags)) {
struct record_header *record_hdr,
struct file_header *file_hdr, unsigned int flags)
{
- int utc = !PRINT_LOCAL_TIME(flags) && !PRINT_TRUE_TIME(flags);
-
if (action & F_BEGIN) {
- return print_dbppc_timestamp(F_PPC_OUTPUT, file_hdr, cur_date, cur_time, utc, itv);
+ return print_dbppc_timestamp(F_PPC_OUTPUT, file_hdr, cur_date, cur_time, itv);
}
return NULL;
struct record_header *record_hdr,
struct file_header *file_hdr, unsigned int flags)
{
- int utc = !PRINT_LOCAL_TIME(flags) && !PRINT_TRUE_TIME(flags);
-
if (action & F_BEGIN) {
- return print_dbppc_timestamp(F_DB_OUTPUT, file_hdr, cur_date, cur_time, utc, itv);
+ return print_dbppc_timestamp(F_DB_OUTPUT, file_hdr, cur_date, cur_time, itv);
}
if (action & F_END) {
if (DISPLAY_HORIZONTALLY(flags)) {
struct record_header *record_hdr,
struct file_header *file_hdr, unsigned int flags)
{
- int utc = !PRINT_LOCAL_TIME(flags) && !PRINT_TRUE_TIME(flags);
+ int sep = !PRINT_LOCAL_TIME(flags);
static char pre[80];
if (action & F_BEGIN) {
- snprintf(pre, sizeof(pre), "%s%s", cur_time, strlen(cur_date) && utc ? " UTC" : "");
+ snprintf(pre, sizeof(pre), "%s%s%s", cur_time, sep ? " " : "",
+ strlen(cur_date) && !PRINT_LOCAL_TIME(flags) ?
+ (PRINT_TRUE_TIME(flags) ? file_hdr->sa_tzname : "UTC") : "");
pre[sizeof(pre) - 1] = '\0';
return pre;
}