meas.c File Reference

#include "copyright.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include "b.h"
#include "qt.h"
#include "stp.h"

Include dependency graph for meas.c:

Go to the source code of this file.

Classes

struct  thread_t
struct  foo_t

Defines

#define ROUND(v, a)   (((v) + (a) - 1) & ~((a)-1))
#define TEST07_N   (4)
#define TEST08_N   (4)

Typedefs

typedef unsigned long iaddr_t

Functions

void exit (int status)
int atoi (char const *s)
int fprintf (FILE *out, char const *fmt,...)
int fputs (char const *s, FILE *fp)
void free (void *sto)
void * malloc (unsigned nbytes)
void perror (char const *s)
void usage (void)
void tracer (void)
static thread_tt_alloc (void)
static thread_tt_create (qt_only_t *starter, void *p0, qt_userf_t *f)
static void t_free (thread_t *t)
static void * t_null (qt_t *old, void *p1, void *p2)
static void * t_splat (qt_t *old, void *oldp, void *null)
static void test01 (int n)
static void test02_aux1 (void *pu, void *pt, qt_userf_t *f)
static void * test02_aux2 (qt_t *old, void *farg1, void *farg2)
static void test02 (int n)
static void * test03_aux0 (qt_t *old_is_garbage, void *farg1, void *farg2)
static void * test03_aux1 (qt_t *old, void *farg1, void *farg2)
static void test03_aux2 (void *pu, void *pt, qt_userf_t *f)
static void test03 (int n)
static void test04 (int n)
static void test05_aux (void *null)
static void test05 (int n)
static void test06_aux2 (void *null0a, void *null1b, void *null2b, qt_userf_t *null)
static void * test06_aux3 (qt_t *sp, void *null0c, void *null1c)
static void test06 (int n)
static void test07_aux2 (void *null0, void *mep, void *nxtp, qt_userf_t *null)
static void test07_aux3 (void *np, void *mep, void *nxtp, qt_userf_t *null)
static void test07 (int n)
static void test08_aux2 (void *null0, void *mep, void *nxtp, qt_userf_t *null)
static void test08_aux3 (void *np, void *mep, void *nxtp, qt_userf_t *null)
static void test08 (int n)
thread_ttest09_create (qt_startup_t *start, qt_vuserf_t *f, qt_cleanup_t *cleanup, int nbytes,...)
static void test09_cleanup (void *pt, void *vuserf_retval)
static void test09_start (void *pt)
static void * test09_user0 (void)
static void * test09_user2 (int one, int two)
static void * test09_user10 (int one, int two, int three, int four, int five, int six, int seven, int eight, int nine, int ten)
void test09 (int n)
static void test10_startup (void *pt)
static void * test10_run (int arg0,...)
void test10_cleanup (void *pt, void *vuserf_retval)
void test10_init (thread_t *new, thread_t *next, int nbytes,...)
void test10 (int n)
void test11 (int n)
void test12 (int n)
void test13 (int n)
void test14 (int n)
void test15 (int n)
void test16 (int n)
void test17 (int n)
void test18 (int n)
void test19 (int n)
void test20 (int n)
void test21 (int n)
void tracer2 (void *val)
void describe ()
void args (int *which, int *n, int argc, char **argv)
int main (int argc, char **argv)

Variables

static char const test01_msg []
static char const * test01_descr []
static char const test02_msg [] = "QT_BLOCKI (0, 0, test02_aux, t->qt)"
static qt_trootthread
static char const test03_msg [] = "QT_BLOCKI (...) test vals are right."
static char const test04_msg [] = "stp_start w/ no threads."
static char const test05_msg [] = "stp w/ 2 yielding thread."
static char const test06_msg [] = "*QT_ARGS(...), QT_BLOCKI one thread"
static char const * test06_descr []
static qt_ttest06_sp
static char test07_msg [] = "*cswap between threads"
static char const * test07_descr []
static qt_ttest07_heavy
static char test08_msg [] = "Floating-point cswap between threads"
static char const * test08_descr []
static qt_ttest08_heavy
char const test09_msg [] = { "Start and run threads using varargs." }
thread_ttest09_t0
thread_ttest09_t1
thread_ttest09_t2
thread_ttest09_main
char const test10_msg [] = { "*Test varargs init & startup w/ 0 args." }
char const * test10_descr []
char const test11_msg [] = { "*Test varargs init & startup w/ 2 args." }
char const * test11_descr []
char const test12_msg [] = { "*Test varargs init & startup w/ 4 args." }
char const * test12_descr []
char const test13_msg [] = { "*Test varargs init & startup w/ 8 args." }
char const * test13_descr []
char const test14_msg [] = { "*Test varargs initialization w/ 0 args." }
char const * test14_descr []
char const test15_msg [] = { "*Test varargs initialization w/ 2 args." }
char const * test15_descr []
char const test16_msg [] = { "*Test varargs initialization w/ 4 args." }
char const * test16_descr []
char const test17_msg [] = { "*Test varargs initialization w/ 8 args." }
char const * test17_descr []
char const test18_msg [] = { "*Call register indirect." }
char const * test18_descr [] = { NULL }
char const test19_msg [] = { "*Call immediate." }
char const * test19_descr [] = { NULL }
char const test20_msg [] = { "*Add register-to-register." }
char const * test20_descr [] = { NULL }
char const test21_msg [] = { "*Load memory to a register." }
char const * test21_descr [] = { NULL }
static foo_t foo []
static int tv = 0


Define Documentation

#define ROUND ( v,
 )     (((v) + (a) - 1) & ~((a)-1))

Definition at line 45 of file meas.c.

#define TEST07_N   (4)

Definition at line 403 of file meas.c.

#define TEST08_N   (4)

Definition at line 464 of file meas.c.


Typedef Documentation

typedef unsigned long iaddr_t

Definition at line 25 of file meas.c.


Function Documentation

void args ( int *  which,
int *  n,
int  argc,
char **  argv 
)

Definition at line 1014 of file meas.c.

int atoi ( char const *  s  ) 

void describe (  ) 

Definition at line 979 of file meas.c.

void exit ( int  status  ) 

int fprintf ( FILE *  out,
char const *  fmt,
  ... 
)

int fputs ( char const *  s,
FILE *  fp 
)

void free ( void *  sto  ) 

int main ( int  argc,
char **  argv 
)

Definition at line 1042 of file meas.c.

void* malloc ( unsigned  nbytes  ) 

void perror ( char const *  s  ) 

static thread_t* t_alloc ( void   )  [static]

Definition at line 56 of file meas.c.

static thread_t* t_create ( qt_only_t starter,
void *  p0,
qt_userf_t f 
) [static]

Definition at line 81 of file meas.c.

static void t_free ( thread_t t  )  [static]

Definition at line 92 of file meas.c.

static void* t_null ( qt_t old,
void *  p1,
void *  p2 
) [static]

Definition at line 100 of file meas.c.

static void* t_splat ( qt_t old,
void *  oldp,
void *  null 
) [static]

Definition at line 107 of file meas.c.

static void test01 ( int  n  )  [static]

Definition at line 126 of file meas.c.

static void test02 ( int  n  )  [static]

Definition at line 182 of file meas.c.

static void test02_aux1 ( void *  pu,
void *  pt,
qt_userf_t f 
) [static]

Definition at line 169 of file meas.c.

static void* test02_aux2 ( qt_t old,
void *  farg1,
void *  farg2 
) [static]

Definition at line 175 of file meas.c.

static void test03 ( int  n  )  [static]

Definition at line 245 of file meas.c.

static void* test03_aux0 ( qt_t old_is_garbage,
void *  farg1,
void *  farg2 
) [static]

Definition at line 215 of file meas.c.

static void* test03_aux1 ( qt_t old,
void *  farg1,
void *  farg2 
) [static]

Definition at line 227 of file meas.c.

static void test03_aux2 ( void *  pu,
void *  pt,
qt_userf_t f 
) [static]

Definition at line 237 of file meas.c.

static void test04 ( int  n  )  [static]

Definition at line 264 of file meas.c.

static void test05 ( int  n  )  [static]

Definition at line 294 of file meas.c.

static void test05_aux ( void *  null  )  [static]

Definition at line 287 of file meas.c.

static void test06 ( int  n  )  [static]

Definition at line 340 of file meas.c.

static void test06_aux2 ( void *  null0a,
void *  null1b,
void *  null2b,
qt_userf_t null 
) [static]

Definition at line 325 of file meas.c.

static void* test06_aux3 ( qt_t sp,
void *  null0c,
void *  null1c 
) [static]

Definition at line 332 of file meas.c.

static void test07 ( int  n  )  [static]

Definition at line 437 of file meas.c.

static void test07_aux2 ( void *  null0,
void *  mep,
void *  nxtp,
qt_userf_t null 
) [static]

Definition at line 407 of file meas.c.

static void test07_aux3 ( void *  np,
void *  mep,
void *  nxtp,
qt_userf_t null 
) [static]

Definition at line 421 of file meas.c.

static void test08 ( int  n  )  [static]

Definition at line 495 of file meas.c.

static void test08_aux2 ( void *  null0,
void *  mep,
void *  nxtp,
qt_userf_t null 
) [static]

Definition at line 468 of file meas.c.

static void test08_aux3 ( void *  np,
void *  mep,
void *  nxtp,
qt_userf_t null 
) [static]

Definition at line 479 of file meas.c.

void test09 ( int  n  ) 

Definition at line 597 of file meas.c.

static void test09_cleanup ( void *  pt,
void *  vuserf_retval 
) [static]

Definition at line 535 of file meas.c.

thread_t* test09_create ( qt_startup_t start,
qt_vuserf_t f,
qt_cleanup_t cleanup,
int  nbytes,
  ... 
)

Definition at line 520 of file meas.c.

static void test09_start ( void *  pt  )  [static]

Definition at line 544 of file meas.c.

static void* test09_user0 ( void   )  [static]

Definition at line 550 of file meas.c.

static void* test09_user10 ( int  one,
int  two,
int  three,
int  four,
int  five,
int  six,
int  seven,
int  eight,
int  nine,
int  ten 
) [static]

Definition at line 568 of file meas.c.

static void* test09_user2 ( int  one,
int  two 
) [static]

Definition at line 557 of file meas.c.

void test10 ( int  n  ) 

Definition at line 692 of file meas.c.

void test10_cleanup ( void *  pt,
void *  vuserf_retval 
)

Definition at line 673 of file meas.c.

void test10_init ( thread_t new,
thread_t next,
int  nbytes,
  ... 
)

Definition at line 680 of file meas.c.

static void* test10_run ( int  arg0,
  ... 
) [static]

Definition at line 662 of file meas.c.

static void test10_startup ( void *  pt  )  [static]

Definition at line 654 of file meas.c.

void test11 ( int  n  ) 

Definition at line 718 of file meas.c.

void test12 ( int  n  ) 

Definition at line 743 of file meas.c.

void test13 ( int  n  ) 

Definition at line 768 of file meas.c.

void test14 ( int  n  ) 

Definition at line 794 of file meas.c.

void test15 ( int  n  ) 

Definition at line 819 of file meas.c.

void test16 ( int  n  ) 

Definition at line 844 of file meas.c.

void test17 ( int  n  ) 

Definition at line 870 of file meas.c.

void test18 ( int  n  ) 

Definition at line 890 of file meas.c.

void test19 ( int  n  ) 

Definition at line 900 of file meas.c.

void test20 ( int  n  ) 

Definition at line 910 of file meas.c.

void test21 ( int  n  ) 

Definition at line 920 of file meas.c.

void tracer ( void   ) 

Definition at line 963 of file meas.c.

void tracer2 ( void *  val  ) 

Definition at line 971 of file meas.c.

void usage ( void   ) 

Definition at line 1001 of file meas.c.


Variable Documentation

foo_t foo[] [static]

qt_t* rootthread [static]

Definition at line 166 of file meas.c.

char const* test01_descr[] [static]

Initial value:

 {
  "Performs 1 QT_SP and one QT_ARGS per iteration.",
  NULL
}

Definition at line 117 of file meas.c.

char const test01_msg[] [static]

Initial value:

  "*QT_SP(sto,sz), QT_ARGS(top,p0,p1,userf,first)"

Definition at line 114 of file meas.c.

char const test02_msg[] = "QT_BLOCKI (0, 0, test02_aux, t->qt)" [static]

Definition at line 165 of file meas.c.

char const test03_msg[] = "QT_BLOCKI (...) test vals are right." [static]

Definition at line 208 of file meas.c.

char const test04_msg[] = "stp_start w/ no threads." [static]

Definition at line 261 of file meas.c.

char const test05_msg[] = "stp w/ 2 yielding thread." [static]

Definition at line 284 of file meas.c.

char const* test06_descr[] [static]

Initial value:

 {
  "Does a QT_ARGS, QT_BLOCKI to a helper function that saves the",
  "stack pointer of the main thread, calls an `only' function that",
  "saves aborts the thread, calling a null helper function.",
  ":: start/stop = QT_ARGS + QT_BLOCKI + QT_ABORT + 3 procedure calls.",
  NULL
}

Definition at line 309 of file meas.c.

char const test06_msg[] = "*QT_ARGS(...), QT_BLOCKI one thread" [static]

Definition at line 307 of file meas.c.

qt_t* test06_sp [static]

Definition at line 321 of file meas.c.

char const* test07_descr[] [static]

Initial value:

 {
  "Build a chain of threads where each thread has a fixed successor.",
  "There is no scheduling performed.  Each thread but one is a loop",
  "that simply blocks with QT_BLOCKI, calling a helper that saves the",
  "current stack pointer.  The last thread decrements a count, and,",
  "if zero, aborts back to the main thread.  Else it continues with",
  "the blocking chain.  The count is divided by the number of threads",
  "in the chain, so `n' is the number of integer block operations.",
  ":: integer cswap = QT_BLOCKI + a procedure call.",
  NULL
}

Definition at line 376 of file meas.c.

qt_t* test07_heavy [static]

Definition at line 401 of file meas.c.

char test07_msg[] = "*cswap between threads" [static]

Definition at line 374 of file meas.c.

char const* test08_descr[] [static]

Initial value:

 {
  "Measure context switch times including floating-point, use QT_BLOCK.",
  NULL
}

Definition at line 457 of file meas.c.

qt_t* test08_heavy [static]

Definition at line 462 of file meas.c.

char test08_msg[] = "Floating-point cswap between threads" [static]

Definition at line 455 of file meas.c.

Definition at line 517 of file meas.c.

char const test09_msg[] = { "Start and run threads using varargs." }

Definition at line 515 of file meas.c.

Definition at line 517 of file meas.c.

Definition at line 517 of file meas.c.

Definition at line 517 of file meas.c.

char const* test10_descr[]

Initial value:

 {
  "Start and stop threads that use variant argument lists (varargs).",
  "Each thread is initialized by calling a routine that calls",
  "QT_VARARGS.  Then runs the thread by calling QT_BLOCKI to hald the",
  "main thread, a helper that saves the main thread's stack pointer,",
  "a null startup function, a null user function, a cleanup function",
  "that calls QT_ABORT and restarts the main thread.  Copies no user",
  "parameters.",
  ":: varargs start/stop = QT_BLOCKI + QT_ABORT + 6 function calls.",
  NULL
}

Definition at line 631 of file meas.c.

char const test10_msg[] = { "*Test varargs init & startup w/ 0 args." }

Definition at line 629 of file meas.c.

char const* test11_descr[]

Initial value:

 {
  "Varargs initialization/run.  Copies 2 user arguments.",
  ":: varargs 2 start/stop = QT_VARGS(2 args), QT_BLOCKI, QT_ABORT, 6 f() calls.",
  NULL
}

Definition at line 710 of file meas.c.

char const test11_msg[] = { "*Test varargs init & startup w/ 2 args." }

Definition at line 708 of file meas.c.

char const* test12_descr[]

Initial value:

 {
  "Varargs initialization/run.  Copies 4 user arguments.",
  ":: varargs 4 start/stop = QT_VARGS(4 args), QT_BLOCKI, QT_ABORT, 6 f() calls.",
  NULL
}

Definition at line 735 of file meas.c.

char const test12_msg[] = { "*Test varargs init & startup w/ 4 args." }

Definition at line 733 of file meas.c.

char const* test13_descr[]

Initial value:

 {
  "Varargs initialization/run.  Copies 8 user arguments.",
  ":: varargs 8 start/stop = QT_VARGS(8 args), QT_BLOCKI, QT_ABORT, 6 f() calls.",
  NULL
}

Definition at line 761 of file meas.c.

char const test13_msg[] = { "*Test varargs init & startup w/ 8 args." }

Definition at line 759 of file meas.c.

char const* test14_descr[]

Initial value:

 {
  "Varargs initialization without running the thread.  Just calls",
  "QT_VARGS.",
  ":: varargs 0 init = QT_VARGS()",
  NULL
}

Definition at line 786 of file meas.c.

char const test14_msg[] = { "*Test varargs initialization w/ 0 args." }

Definition at line 784 of file meas.c.

char const* test15_descr[]

Initial value:

 {
  "Varargs initialization without running the thread.  Just calls",
  "QT_VARGS.",
  ":: varargs 2 init = QT_VARGS(2 args)",
  NULL
}

Definition at line 811 of file meas.c.

char const test15_msg[] = { "*Test varargs initialization w/ 2 args." }

Definition at line 809 of file meas.c.

char const* test16_descr[]

Initial value:

 {
  "Varargs initialization without running the thread.  Just calls",
  "QT_VARGS.",
  ":: varargs 4 init = QT_VARGS(4 args)",
  NULL
}

Definition at line 835 of file meas.c.

char const test16_msg[] = { "*Test varargs initialization w/ 4 args." }

Definition at line 833 of file meas.c.

char const* test17_descr[]

Initial value:

 {
  "Varargs initialization without running the thread.  Just calls",
  "QT_VARGS.",
  ":: varargs 8 init = QT_VARGS(8 args)",
  NULL
}

Definition at line 861 of file meas.c.

char const test17_msg[] = { "*Test varargs initialization w/ 8 args." }

Definition at line 859 of file meas.c.

char const* test18_descr[] = { NULL }

Definition at line 887 of file meas.c.

char const test18_msg[] = { "*Call register indirect." }

Definition at line 886 of file meas.c.

char const* test19_descr[] = { NULL }

Definition at line 897 of file meas.c.

char const test19_msg[] = { "*Call immediate." }

Definition at line 896 of file meas.c.

char const* test20_descr[] = { NULL }

Definition at line 907 of file meas.c.

char const test20_msg[] = { "*Add register-to-register." }

Definition at line 906 of file meas.c.

char const* test21_descr[] = { NULL }

Definition at line 917 of file meas.c.

char const test21_msg[] = { "*Load memory to a register." }

Definition at line 916 of file meas.c.

int tv = 0 [static]

Definition at line 960 of file meas.c.


Generated on Wed Jan 21 15:32:11 2009 for SystemC by  doxygen 1.5.5