/* * Copyright (c) 2001, Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * A copy of the GNU General Public License can be found at * http://www.gnu.org/ * * Written by DJ Delorie * */ #include main() { char buffer[10000]; double perc, cumul, self; char func[10000]; int cycles; int total_cycles; double accum_perc = 0; fgets(buffer, 10000, stdin); fgets(buffer, 10000, stdin); fgets(buffer, 10000, stdin); fgets(buffer, 10000, stdin); fgets(buffer, 10000, stdin); printf("CPU Cycle profile\n\n"); printf(" Accumulated Self\n"); printf("%%Perc Cycles %%Perc Cycles Function Name\n"); printf("\n"); while (fgets(buffer, 10000, stdin)) { sscanf(buffer, "%lg %lg %lg %[^\n\r]", &perc, &cumul, &self, func); cycles = (int)(self * 100 + 0.01); total_cycles = (int)(cumul * 100 + 0.01); accum_perc += perc; printf("%6.2f%8d %6.2f%8d %s\n", accum_perc, total_cycles, perc, cycles, func); } } foo() { strcmp("",""); abort(); }