KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
gprof.c File Reference
#include <stdio.h>

Macros

#define ROUNDS   8 /* times the whole workload repeats */
 
#define HOT_ROUNDS   300 /* spin() calls per hot_path() (the hot caller) */
 
#define WARM_ROUNDS   60 /* spin() calls per warm_path() (the cool caller)*/
 
#define SPIN_WORK   4000 /* FP iterations inside each spin() call */
 
#define FIB_N   19 /* recursion depth: a self-edge with modest time */
 

Functions

static double spin (int iters)
 
static double hot_path (int rounds)
 
static double warm_path (int rounds)
 
static long fibonacci (int n)
 
static void workload (void)
 
int main (int argc, char *argv[])
 

Variables

static volatile double sink
 
static volatile int spin_iters = SPIN_WORK
 

Macro Definition Documentation

◆ FIB_N

#define FIB_N   19 /* recursion depth: a self-edge with modest time */

Referenced by workload().

◆ HOT_ROUNDS

#define HOT_ROUNDS   300 /* spin() calls per hot_path() (the hot caller) */

Referenced by workload().

◆ ROUNDS

#define ROUNDS   8 /* times the whole workload repeats */

Referenced by main().

◆ SPIN_WORK

#define SPIN_WORK   4000 /* FP iterations inside each spin() call */

◆ WARM_ROUNDS

#define WARM_ROUNDS   60 /* spin() calls per warm_path() (the cool caller)*/

Referenced by workload().

Function Documentation

◆ fibonacci()

static long fibonacci ( int n)
static

References fibonacci().

Referenced by fibonacci(), and workload().

◆ hot_path()

static double hot_path ( int rounds)
static

References spin, and spin_iters.

Referenced by workload().

◆ main()

int main ( int argc,
char * argv[] )

References printf, ROUNDS, sink, and workload().

◆ spin()

static double spin ( int iters)
static

◆ warm_path()

static double warm_path ( int rounds)
static

References spin, and spin_iters.

Referenced by workload().

◆ workload()

static void workload ( void )
static

References FIB_N, fibonacci(), hot_path(), HOT_ROUNDS, sink, warm_path(), and WARM_ROUNDS.

Referenced by main().

Variable Documentation

◆ sink

volatile double sink
static

Referenced by main(), and workload().

◆ spin_iters

volatile int spin_iters = SPIN_WORK
static

Referenced by hot_path(), and warm_path().