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"

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))

#define TEST07_N   (4)

#define TEST08_N   (4)


Typedef Documentation

typedef unsigned long iaddr_t


Function Documentation

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

int atoi ( char const *  s  ) 

void describe (  ) 

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 
)

void* malloc ( unsigned  nbytes  ) 

void perror ( char const *  s  ) 

static thread_t* t_alloc ( void   )  [static]

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

static void t_free ( thread_t t  )  [static]

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

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

static void test01 ( int  n  )  [static]

static void test02 ( int  n  )  [static]

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

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

static void test03 ( int  n  )  [static]

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

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

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

static void test04 ( int  n  )  [static]

static void test05 ( int  n  )  [static]

static void test05_aux ( void *  null  )  [static]

static void test06 ( int  n  )  [static]

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

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

static void test07 ( int  n  )  [static]

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

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

static void test08 ( int  n  )  [static]

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

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

void test09 ( int  n  ) 

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

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

static void test09_start ( void *  pt  )  [static]

static void* test09_user0 ( void   )  [static]

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]

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

void test10 ( int  n  ) 

void test10_cleanup ( void *  pt,
void *  vuserf_retval 
)

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

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

static void test10_startup ( void *  pt  )  [static]

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 tracer ( void   ) 

void tracer2 ( void *  val  ) 

void usage ( void   ) 


Variable Documentation

foo_t foo[] [static]

Initial value:

qt_t* rootthread [static]

char const* test01_descr[] [static]

Initial value:

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

char const test01_msg[] [static]

Initial value:

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

char const test02_msg[] = "QT_BLOCKI (0, 0, test02_aux, t->qt)" [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_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
}

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

qt_t* test06_sp [static]

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
}

qt_t* test07_heavy [static]

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

char const* test08_descr[] [static]

Initial value:

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

qt_t* test08_heavy [static]

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

thread_t * test09_main

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

thread_t* test09_t0

thread_t * test09_t1

thread_t * test09_t2

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
}

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

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
}

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

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
}

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

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
}

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

char const* test14_descr[]

Initial value:

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

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

char const* test15_descr[]

Initial value:

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

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

char const* test16_descr[]

Initial value:

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

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

char const* test17_descr[]

Initial value:

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

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

char const* test18_descr[] = { NULL }

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

char const* test19_descr[] = { NULL }

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

char const* test20_descr[] = { NULL }

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

char const* test21_descr[] = { NULL }

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

int tv = 0 [static]

Generated by
Matthieu Moy <Matthieu.Moy@st.com>
Back to Pinapa Home Page