SDDS ToolKit Programs and Libraries for C and Python
All Classes Files Functions Variables Macros Pages
report_stats.c File Reference

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.

#include "mdb.h"

Go to the source code of this file.

Functions

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

Function Documentation

◆ bio_count()

long bio_count ( )

Definition at line 125 of file timer.c.

125 {
126 return 0;
127}

◆ dio_count()

long dio_count ( )

Definition at line 133 of file timer.c.

133 {
134 return (0);
135}

◆ 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 28 of file report_stats.c.

28 {
29 char s[200];
30 extern char *elapsed_time();
31 //long cpu_time(), bio_count(), dio_count(), page_faults(), memory_count();
32
33 sprintf(s, "ET:%13s CP:%8.2f BIO:%ld DIO:%ld PF:%ld MEM:%ld", elapsed_time(),
34 cpu_time() / 100.0, bio_count(), dio_count(), page_faults(), memory_count());
35
36 fprintf(fp, "%s %s\n", label, s);
37 fflush(fp);
38}
long page_faults()
Retrieves the number of page faults since the last initialization.
Definition timer.c:144
long cpu_time()
Retrieves the CPU time used since the last initialization.
Definition timer.c:117