qres-test.c File Reference

#include <linux/aquosa/qos_debug.h>
#include <aquosa/qres_lib.h>
#include <aquosa/qmgr_util.h>
#include <sys/time.h>
#include <time.h>
#include <stdio.h>
#include <sched.h>
#include <string.h>

Go to the source code of this file.

Defines

#define QOS_DEBUG_LEVEL   QOS_LEVEL_NODEBUG
#define NUM_JOBS   1000
#define C_MIN   10000ul
#define C_MAX   20000ul
#define APP_T   40000ul
#define Q_MIN   1000ul
#define Q_MAX   2000ul
#define SRV_P   4000ul

Functions

signed long timespec_sub_us (struct timespec *ts2, struct timespec *ts1)
 Compute t2 - t1 and return the result in microseconds.
unsigned long count_and_wait (unsigned long duration_usec)
 Actively increments a counter and gets time until duration_usec elapsed.
unsigned long count (unsigned long sheeps)
 Loop identical to the one in count_and_wait(), but runs until the counter goes to the supplied parameter.
int job_fn_setup (void *app_data)
int job_fn (void *app_data)
qos_rv start_periodic (qmgr_period_spec_t *p_ps, struct timespec *p_ts)
qos_rv wait_periodic (qmgr_period_spec_t *p_ps)
int main (int argc, char *argv[])

Variables

unsigned long c [NUM_JOBS]
unsigned long cr [NUM_JOBS]
unsigned long cs [NUM_JOBS]
signed long em [NUM_JOBS]
signed long e [NUM_JOBS]
unsigned long s [NUM_JOBS]
unsigned long f [NUM_JOBS]
unsigned long q [NUM_JOBS]
int job = 0
struct timespec ts1
qres_sid_t sid
qres_params_t params
struct timespec foo_ts

Define Documentation

#define APP_T   40000ul

Definition at line 16 of file qres-test.c.

Referenced by job_fn(), job_fn_setup(), and main().

#define C_MAX   20000ul

Definition at line 15 of file qres-test.c.

Referenced by main().

#define C_MIN   10000ul

Definition at line 14 of file qres-test.c.

Referenced by main().

#define NUM_JOBS   1000

Definition at line 12 of file qres-test.c.

Referenced by job_fn(), job_fn_setup(), and main().

#define Q_MAX   2000ul

Definition at line 19 of file qres-test.c.

Referenced by main().

#define Q_MIN   1000ul

Definition at line 18 of file qres-test.c.

Referenced by main().

#define QOS_DEBUG_LEVEL   QOS_LEVEL_NODEBUG

Definition at line 1 of file qres-test.c.

#define SRV_P   4000ul

Definition at line 20 of file qres-test.c.

Referenced by main().


Function Documentation

unsigned long count ( unsigned long  sheeps  ) 

Loop identical to the one in count_and_wait(), but runs until the counter goes to the supplied parameter.

Returns the elapsed usecs during the count

Definition at line 73 of file qres-test.c.

References qos_log_debug, and timespec_sub_us().

Referenced by job_fn(), job_fn_setup(), and main().

unsigned long count_and_wait ( unsigned long  duration_usec  ) 

Actively increments a counter and gets time until duration_usec elapsed.

Returns the counter value.

Definition at line 54 of file qres-test.c.

References qos_log_debug, and timespec_sub_us().

Referenced by main(), and main_loop().

int job_fn ( void *  app_data  ) 

Definition at line 135 of file qres-test.c.

References APP_T, count(), cs, e, f, job, NUM_JOBS, q, qres_params_t::Q, qos_chk_ok_do, qos_log_debug, qres_set_params(), s, sid, timespec_sub_us(), and ts1.

Referenced by main().

int job_fn_setup ( void *  app_data  ) 

Definition at line 103 of file qres-test.c.

References APP_T, count(), cr, cs, e, f, foo_ts, job, NUM_JOBS, q, qres_params_t::Q, qos_chk_ok_do, qos_log_debug, qres_set_params(), s, sid, timespec_sub_us(), and ts1.

Referenced by main().

int main ( int  argc,
char *  argv[] 
)
qos_rv start_periodic ( qmgr_period_spec_t *  p_ps,
struct timespec *  p_ts 
)

Definition at line 163 of file qres-test.c.

References qos_chk_go, QOS_E_GENERIC, qos_log_debug, and QOS_OK.

Referenced by main().

signed long timespec_sub_us ( struct timespec *  ts2,
struct timespec *  ts1 
)

Compute t2 - t1 and return the result in microseconds.

Definition at line 47 of file qres-test.c.

Referenced by count(), count_and_wait(), job_fn(), and job_fn_setup().

qos_rv wait_periodic ( qmgr_period_spec_t *  p_ps  ) 

Definition at line 188 of file qres-test.c.

References QOS_E_GENERIC, qos_log_debug, qos_log_err, qos_log_warn, and QOS_OK.

Referenced by main().


Variable Documentation

unsigned long c[NUM_JOBS]

Definition at line 23 of file qres-test.c.

Referenced by main().

unsigned long cr[NUM_JOBS]

Definition at line 26 of file qres-test.c.

Referenced by job_fn_setup(), and main().

unsigned long cs[NUM_JOBS]

Definition at line 29 of file qres-test.c.

Referenced by job_fn(), job_fn_setup(), and main().

signed long e[NUM_JOBS]

Definition at line 35 of file qres-test.c.

Referenced by job_fn(), job_fn_setup(), and main().

signed long em[NUM_JOBS]

Definition at line 32 of file qres-test.c.

Referenced by main().

unsigned long f[NUM_JOBS]

Definition at line 41 of file qres-test.c.

Referenced by data_write_timestamps(), job_fn(), job_fn_setup(), main(), and test_rres_init_module().

struct timespec foo_ts

Definition at line 101 of file qres-test.c.

Referenced by job_fn_setup().

int job = 0

Definition at line 89 of file qres-test.c.

Referenced by job_fn(), and job_fn_setup().

Initial value:
 {
  .Q_min = 0,
  .Q = 0,
  .P = SRV_P,
  .flags = 0,
  .timeout = 0
}

Definition at line 93 of file qres-test.c.

Referenced by f(), main(), main_body(), and main_loop().

unsigned long q[NUM_JOBS]

Definition at line 44 of file qres-test.c.

Referenced by job_fn(), job_fn_setup(), main(), qres_update_bandwidths(), and test_rres_init_module().

unsigned long s[NUM_JOBS]

Definition at line 38 of file qres-test.c.

Referenced by job_fn(), job_fn_setup(), and main().

Definition at line 92 of file qres-test.c.

Referenced by job_fn(), job_fn_setup(), main(), main_body(), main_loop(), and test_rres_init_module().

struct timespec ts1

Definition at line 90 of file qres-test.c.

Referenced by job_fn(), and job_fn_setup().

Generated on Mon Aug 2 22:39:17 2010 for qosres by  doxygen 1.6.3