TSLoad high-level API

Use this API to build custom agent on top of libtsload

Constants

TSLOAD_ERROR, TSLOAD_OK


TSLoad error codes

#define TSLOAD_ERROR    1
#define TSLOAD_OK   0

TSLOAD_PARAM_NULL, TSLOAD_PARAM_RANDVAR, TSLOAD_PARAM_MASK, TSLOAD_PARAM_MAP_FLAG, TSLOAD_PARAM_BOOLEAN, TSLOAD_PARAM_ARRAY_FLAG, TSLOAD_PARAM_INTEGER, TSLOAD_PARAM_FLOAT, TSLOAD_PARAM_RANDGEN, TSLOAD_PARAM_STRING


TSLoad parameter types. Used for describing complex parameters

#define TSLOAD_PARAM_NULL   0
#define TSLOAD_PARAM_BOOLEAN    1
#define TSLOAD_PARAM_INTEGER    2
#define TSLOAD_PARAM_FLOAT  3
#define TSLOAD_PARAM_STRING 4
#define TSLOAD_PARAM_RANDGEN    5
#define TSLOAD_PARAM_RANDVAR    6
#define TSLOAD_PARAM_MASK   0x0ff
#define TSLOAD_PARAM_ARRAY_FLAG 0x100
#define TSLOAD_PARAM_MAP_FLAG   0x200

Functions

tsload_error_msg, tsload_error_msg_func


Hook that called when one of high-level operations encounters errors.
May be called multiple times during one call

typedef void (*tsload_error_msg_func)(ts_errcode_t code, const char* format, ...);
LIBIMPORT tsload_error_msg_func tsload_error_msg

tsload_workload_status, tsload_workload_status_func


Hook for reporting workload statuses

typedef void (*tsload_workload_status_func)(const char* wl_name,int status,long progress,const char* config_msg);
LIBIMPORT tsload_workload_status_func tsload_workload_status

tsload_requests_report_func, tsload_requests_report


Hook for reporting requests and it's params

typedef void (*tsload_requests_report_func)(list_head_t* rq_list);
LIBIMPORT tsload_requests_report_func tsload_requests_report

tsload_walk_workload_types

public


Walk over workload types registered within TSLoad

LIBEXPORT void* tsload_walk_workload_types(tsload_walk_op_t op, void* arg, hm_walker_func walker)

tsload_walk_tp_dispatchers, tsload_walk_random_variators, tsload_walk_rqsched_variators, tsload_walk_request_schedulers, tsload_walk_random_generators

public

LIBEXPORT void* tsload_walk_random_generators(tsload_walk_op_t op, void* arg, hm_walker_func walker)
LIBEXPORT void* tsload_walk_random_variators(tsload_walk_op_t op, void* arg, hm_walker_func walker)
LIBEXPORT void* tsload_walk_tp_dispatchers(tsload_walk_op_t op, void* arg, hm_walker_func walker)
LIBEXPORT void* tsload_walk_rqsched_variators(tsload_walk_op_t op, void* arg, hm_walker_func walker)
LIBEXPORT void* tsload_walk_request_schedulers(tsload_walk_op_t op, void* arg, hm_walker_func walker)

tsload_get_resources, tsload_get_hostinfo

public

LIBEXPORT tsobj_node_t* tsload_get_resources(void)
LIBEXPORT tsobj_node_t* tsload_get_hostinfo(void)

tsload_configure_workload

public


Create and configure new workload

ARGUMENTS

LIBEXPORT int tsload_configure_workload(const char* wl_name, const char* wl_type, const char* tp_name, ts_time_t deadline,tsobj_node_t* wl_chain_params, tsobj_node_t* rqsched_params, tsobj_node_t* wl_params)

tsload_provide_step

public


Provide step for workload

ARGUMENTS

LIBEXPORT int tsload_provide_step(const char* wl_name, long step_id, unsigned num_rqs, list_head_t* trace_rqs,int* pstatus)

tsload_create_request

public


Create request and link it into rq_list to create trace-driven workloads

If chained is set B_TRUE, then it actually chains to last request in rq_list

ARGUMENTS

NOTES
If error occurs, tsload_create_request() will empty rq_list

LIBEXPORT int tsload_create_request(const char* wl_name, list_head_t* rq_list, boolean_t chained,int rq_id, long step, int user_id, int thread_id,ts_time_t sched_time, void* rq_params)

tsload_start_workload

public


Schedule workload to start

ARGUMENTS

LIBEXPORT int tsload_start_workload(const char* wl_name, ts_time_t start_time)

tsload_unconfigure_workload

public


Unconfigure workload. Couldn't be called for workload that
currenly have "WLS_CONFIGURING" state because we couldn't interrupt
module routine

ARGUMENTS

LIBEXPORT int tsload_unconfigure_workload(const char* wl_name)

tsload_create_threadpool

public


Create threadpool

ARGUMENTS

LIBEXPORT int tsload_create_threadpool(const char* tp_name, unsigned num_threads, ts_time_t quantum,boolean_t discard, tsobj_node_t* disp)

tsload_schedule_threadpool

public


Set threadpool scheduler options

ARGUMENTS

LIBEXPORT int tsload_schedule_threadpool(const char* tp_name, tsobj_node_t* sched)

tsload_destroy_threadpool, tsload_walk_threadpools

public

LIBEXPORT void* tsload_walk_threadpools(tsload_walk_op_t op, void* arg, hm_walker_func walker)
LIBEXPORT int tsload_destroy_threadpool(const char* tp_name)

tsload_start, tsload_init

public

LIBEXPORT int tsload_init(struct subsystem* pre_subsys, unsigned pre_count,struct subsystem* post_subsys, unsigned post_count)
LIBEXPORT int tsload_start(const char* basename)

Types

typedef struct tsload_param

typedef struct tsload_param {
    int            type;
    const char* name;
    const char* hint;
} tsload_param_t;

typedef enum tsload_walk_op


Walkie-talkie. Operations for tsload_walk_ functions

VALUES

typedef enum tsload_walk_op {
    TSLOAD_WALK_FIND,
    TSLOAD_WALK_TSOBJ,
    TSLOAD_WALK_TSOBJ_ALL,
    TSLOAD_WALK_WALK
} tsload_walk_op_t;