Line 19... |
Line 19... |
|
|
/* Command line utility, that displays profiling information, generated
|
/* Command line utility, that displays profiling information, generated
|
by or1ksim. (use --profile option at command line, when running or1ksim. */
|
by or1ksim. (use --profile option at command line, when running or1ksim. */
|
|
|
#include <stdio.h>
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
#include "profiler.h"
|
#include "profiler.h"
|
#include "sim-config.h"
|
#include "sim-config.h"
|
|
|
static struct stack_struct stack[MAX_STACK];
|
static struct stack_struct stack[MAX_STACK];
|
|
|
Line 198... |
Line 200... |
if (prof_func[i].cum_cycles > bestcyc) {
|
if (prof_func[i].cum_cycles > bestcyc) {
|
bestcyc = prof_func[i].cum_cycles;
|
bestcyc = prof_func[i].cum_cycles;
|
besti = i;
|
besti = i;
|
}
|
}
|
i = besti;
|
i = besti;
|
PRINTF ("| %-24s|%08X|%8i|%12.1f|%11i,%3.0f%%|\n",
|
PRINTF ("| %-24s|%08X|%8li|%12.1f|%11li,%3.0f%%|\n",
|
prof_func[i].name, prof_func[i].addr, prof_func[i].calls, ((double)prof_func[i].cum_cycles / prof_func[i].calls), prof_func[i].cum_cycles, (100. * prof_func[i].cum_cycles / prof_cycles));
|
prof_func[i].name, prof_func[i].addr, prof_func[i].calls, ((double)prof_func[i].cum_cycles / prof_func[i].calls), prof_func[i].cum_cycles, (100. * prof_func[i].cum_cycles / prof_cycles));
|
prof_func[i].cum_cycles = -1;
|
prof_func[i].cum_cycles = -1;
|
}
|
}
|
PRINTF ("---------------------------------------------------------------------------\n");
|
PRINTF ("---------------------------------------------------------------------------\n");
|
PRINTF ("Total %i functions, %i cycles.\n", prof_nfuncs, prof_cycles);
|
PRINTF ("Total %i functions, %i cycles.\n", prof_nfuncs, prof_cycles);
|