opd_24_stats.c

Go to the documentation of this file.
00001 
00012 #include "opd_24_stats.h"
00013 #include "opd_proc.h"
00014 #include "opd_image.h"
00015 #include "oprofiled.h"
00016 
00017 #include "op_get_time.h"
00018 
00019 #include <stdlib.h>
00020 #include <stdio.h>
00021 
00022 unsigned long opd_24_stats[OPD_MAX_STATS];
00023 
00024 void opd_print_24_stats(void)
00025 {
00026     printf("\n%s\n", op_get_time());
00027     printf("Nr. proc struct: %d\n", opd_get_nr_procs());
00028     printf("Nr. image struct: %d\n", opd_get_nr_images());
00029     printf("Nr. kernel samples: %lu\n", opd_24_stats[OPD_KERNEL]);
00030     printf("Nr. modules samples: %lu\n", opd_24_stats[OPD_MODULE]);
00031     printf("Nr. modules samples lost: %lu\n", opd_24_stats[OPD_LOST_MODULE]);
00032     printf("Nr. samples lost due to no process information: %lu\n",
00033         opd_24_stats[OPD_LOST_PROCESS]);
00034     printf("Nr. samples lost due to sample file open failure: %lu\n",
00035         opd_24_stats[OPD_LOST_SAMPLEFILE]);
00036     printf("Nr. process samples in user-space: %lu\n", opd_24_stats[OPD_PROCESS]);
00037     printf("Nr. samples lost due to no map information: %lu\n",
00038         opd_24_stats[OPD_LOST_MAP_PROCESS]);
00039     if (opd_24_stats[OPD_PROC_QUEUE_ACCESS]) {
00040         printf("Average depth of search of proc queue: %f\n",
00041             (double)opd_24_stats[OPD_PROC_QUEUE_DEPTH]
00042             / (double)opd_24_stats[OPD_PROC_QUEUE_ACCESS]);
00043     }
00044     if (opd_24_stats[OPD_MAP_ARRAY_ACCESS]) {
00045         printf("Average depth of iteration through mapping array: %f\n",
00046             (double)opd_24_stats[OPD_MAP_ARRAY_DEPTH]
00047             / (double)opd_24_stats[OPD_MAP_ARRAY_ACCESS]);
00048     }
00049     if (opd_24_stats[OPD_IMAGE_HASH_ACCESS]) {
00050         printf("Average depth of iteration through image hash array: %f\n",
00051             (double)opd_24_stats[OPD_IMAGE_HASH_DEPTH]
00052             / (double)opd_24_stats[OPD_IMAGE_HASH_ACCESS]);
00053     }
00054     printf("Nr. sample dumps: %lu\n", opd_24_stats[OPD_DUMP_COUNT]);
00055     printf("Nr. samples total: %lu\n", opd_24_stats[OPD_SAMPLES]);
00056     printf("Nr. notifications: %lu\n", opd_24_stats[OPD_NOTIFICATIONS]);
00057     printf("Nr. kernel note buffer overflow: %u\n",
00058            opd_read_fs_int(OP_MOUNT, "note_buffer_overflow", 0));
00059     printf("Nr. kernel samples buffer overflow: %u\n",
00060            opd_read_fs_int(OP_MOUNT, "buffer_overflow", 0));
00061     fflush(stdout);
00062 }

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1