SDDSlib
Loading...
Searching...
No Matches
report_stats.c File Reference

Reports elapsed time, CPU time, BIO/DIO counts, page faults, and memory usage to a file. More...

#include "mdb.h"

Go to the source code of this file.

Functions

void report_stats (FILE *fp, char *label)
 Reports statistics to a specified file.
 

Detailed Description

Reports elapsed time, CPU time, BIO/DIO counts, page faults, and memory usage to a file.

License
This file is distributed under the terms of the Software License Agreement found in the file LICENSE included with this distribution.
Author
M. Borland, C. Saunders, R. Soliday

Definition in file report_stats.c.

Function Documentation

◆ report_stats()

void report_stats ( FILE * fp,
char * label )

Reports statistics to a specified file.

This function formats and writes various statistics such as elapsed time, CPU time, BIO/DIO counts, page faults, and memory usage to the specified file.

Parameters
fpPointer to the file where the statistics will be written.
labelA label string to prepend to the statistics output.

Definition at line 27 of file report_stats.c.

27 {
28 char s[200];
29 extern char *elapsed_time();
30 long cpu_time(), bio_count(), dio_count(), page_faults(), memory_count();
31
32 sprintf(s, "ET:%13s CP:%8.2f BIO:%ld DIO:%ld PF:%ld MEM:%ld", elapsed_time(),
33 cpu_time() / 100.0, bio_count(), dio_count(), page_faults(), memory_count());
34
35 fprintf(fp, "%s %s\n", label, s);
36 fflush(fp);
37}