static int __noinstrument ilatcurve_read_proc( char *page_buffer, char **my_first_byte, off_t virtual_start, int length, int *eof, void *data) { int my_buffer_offset = 0; char * const my_base = page_buffer; int i; if (virtual_start == 0) { /* * Just been opened so display the header information * also stop logging BUGBUG: stop logging while we are * reading, initialize the index numbers in the log array */ unsigned int usecs; g_read_completed = 0; usecs = clock_to_usecs(clock_diff(ilatency_start, ilatency_stop));; my_buffer_offset += sprintf(my_base+my_buffer_offset, "#%lu samples logged\n#timer measured %u ticks per usec.\n" "#interrupt overhead %u microseconds\n" "#maximum interrupt off time %u microseconds\n" "#usecs samples\n", total_ilat_samples, (unsigned)ticks_per_usec, usecs, maximum_off); } else if (g_read_completed == BUCKETS) { *eof = 1; /* BUGBUG: start logging again */ return 0; } /* dump the sample log on the screen */ for (i = 0; i < (BUCKETS-1); i++) { my_buffer_offset += sprintf(my_base + my_buffer_offset, "%5u\t%8lu\n", (i + 1) * BUCKET_SIZE, bucketlog[i]); g_read_completed++; } my_buffer_offset += sprintf(my_base + my_buffer_offset, "%5u\t%8lu(greater than this time)\n", i * BUCKET_SIZE, bucketlog[LAST_BUCKET]); g_read_completed++; *my_first_byte = page_buffer; return my_buffer_offset; }
/*! * This function is needed by KFI to convert machine cycles to microseconds * * @param mputicks number of machine cycles * * @return elapsed microseconds */ unsigned long __noinstrument machinecycles_to_usecs(unsigned long mputicks) { return clock_to_usecs(mputicks); }