FIO tool

Overview

Test API to control ‘fio’ tool. More…

// typedefs

typedef struct tapi_fio_report_lat tapi_fio_report_lat;
typedef struct tapi_fio_report_bw tapi_fio_report_bw;
typedef struct tapi_fio_report_percentiles tapi_fio_report_percentiles;
typedef struct tapi_fio_report_clat tapi_fio_report_clat;
typedef struct tapi_fio_report_iops tapi_fio_report_iops;
typedef struct tapi_fio_report_io tapi_fio_report_io;
typedef struct tapi_fio_report tapi_fio_report;
typedef struct tapi_fio_numjobs_t tapi_fio_numjobs_t;
typedef struct tapi_fio_opts tapi_fio_opts;
typedef struct tapi_fio_app tapi_fio_app;
typedef struct tapi_fio tapi_fio;
typedef te_errno (*tapi_fio_method_start)(tapi_fio *fio);

typedef te_errno (*tapi_fio_method_wait)(
    tapi_fio *fio,
    int16_t timeout_sec
    );

typedef te_errno (*tapi_fio_method_stop)(tapi_fio *fio);

typedef te_errno (*tapi_fio_method_get_report)(
    tapi_fio *fio,
    tapi_fio_report *report
    );

typedef struct tapi_fio_methods tapi_fio_methods;

// enums

enum tapi_fio_ioengine;
enum tapi_fio_rwtype;

// structs

struct tapi_fio;
struct tapi_fio_app;
struct tapi_fio_methods;
struct tapi_fio_numjobs_t;
struct tapi_fio_opts;
struct tapi_fio_report;
struct tapi_fio_report_bw;
struct tapi_fio_report_clat;
struct tapi_fio_report_io;
struct tapi_fio_report_iops;
struct tapi_fio_report_lat;
struct tapi_fio_report_percentiles;

// global functions

tapi_fio* tapi_fio_create(const tapi_fio_opts* options, tapi_job_factory_t* factory, const char* path);
void tapi_fio_destroy(tapi_fio* fio);
void tapi_fio_opts_init(tapi_fio_opts* options);
te_errno tapi_fio_start(tapi_fio* fio);
te_errno tapi_fio_wait(tapi_fio* fio, int16_t timeout_sec);
te_errno tapi_fio_stop(tapi_fio* fio);
te_errno tapi_fio_get_report(tapi_fio* fio, tapi_fio_report* report);
void tapi_fio_log_report(tapi_fio_report* report);
te_errno tapi_fio_mi_report(te_mi_logger* logger, const tapi_fio_report* report);

// macros

#define TAPI_FIO_IOENGINE_MAPPING_LIST
#define TAPI_FIO_MAX_NUMJOBS
#define TAPI_FIO_MAX_REPORT
#define TAPI_FIO_OPTS_DEFAULTS
#define TAPI_FIO_RWTYPE_MAPPING_LIST
#define TAPI_FIO_TIMEOUT_DEFAULT
#define TEST_FIO_IOENGINE_PARAM(var_name_)
#define TEST_FIO_NUMJOBS_PARAM(var_name_)
#define TEST_FIO_RWTYPE_PARAM(var_name_)
#define TEST_GET_FIO_IOENGINE_PARAM(var_name_)
#define TEST_GET_FIO_NUMJOBS_PARAM(var_name_)
#define TEST_GET_FIO_RWTYPE_PARAM(var_name_)

Detailed Documentation

Test API to control ‘fio’ tool.

Typedefs

typedef struct tapi_fio_report_lat tapi_fio_report_lat

Latency FIO report

typedef struct tapi_fio_report_bw tapi_fio_report_bw

Bandwidth FIO report

typedef struct tapi_fio_report_percentiles tapi_fio_report_percentiles

Latency percentiles

typedef struct tapi_fio_report_clat tapi_fio_report_clat

Completion latency FIO report

typedef struct tapi_fio_report_iops tapi_fio_report_iops

IOPS FIO report

typedef struct tapi_fio_report_io tapi_fio_report_io

FIO reports

typedef struct tapi_fio_report tapi_fio_report

FIO test tool report.

typedef struct tapi_fio_numjobs_t tapi_fio_numjobs_t

Contain FIO numjobs.

numjobs.expr is used to calculate the actual number of jobs if it is not NULL, otherwise numjobs.value is used.

typedef struct tapi_fio_opts tapi_fio_opts

List of possible FIO test tool options.

typedef struct tapi_fio_app tapi_fio_app

FIO tool context. Based on tapi_perf_app

typedef struct tapi_fio tapi_fio

FIO tool context

typedef te_errno (*tapi_fio_method_start)(tapi_fio *fio)

Method to start FIO. Call from tapi_fio_start().

Parameters:

fio

FIO context

0

No errors.

TE_EOPNOTSUPP

If FIO control structure not valid.

Returns:

Status code.

See also:

tapi_fio_start

typedef te_errno (*tapi_fio_method_wait)(
    tapi_fio *fio,
    int16_t timeout_sec
    )

Method wait certain time for FIO to complete.

Parameters:

fio

FIO context

timeout_sec

Timeout in seconds

0

No errors.

TE_EOPNOTSUPP

If FIO control structure not valid.

TE_ETIMEDOUT

If timeout is expired.

Returns:

Status code.

See also:

tapi_fio_wait

typedef te_errno (*tapi_fio_method_stop)(tapi_fio *fio)

Method for stop FIO.

Parameters:

fio

FIO context

0

No errors.

TE_EOPNOTSUPP

If FIO control structure not valid.

Returns:

Status code.

See also:

tapi_fio_stop

typedef te_errno (*tapi_fio_method_get_report)(
    tapi_fio *fio,
    tapi_fio_report *report
    )

Generate report from fio output.

Parameters:

fio

FIO context

report

FIO test tool report

0

No errors.

TE_EOPNOTSUPP

If FIO control structure not valid.

Returns:

Status code.

See also:

tapi_fio_get_report

typedef struct tapi_fio_methods tapi_fio_methods

Methods to operate FIO test tool.

Global Functions

tapi_fio* tapi_fio_create(const tapi_fio_opts* options, tapi_job_factory_t* factory, const char* path)

Create FIO context based on options. Never return NULL, test failed if error.

Parameters:

options

FIO options

factory

Job factory

path

Path to fio tool. May be NULL if no special path desired.

Returns:

Initialization created fio.

See also:

tapi_fio_destroy

void tapi_fio_destroy(tapi_fio* fio)

Destroy FIO context.

Parameters:

fio

what destroy

See also:

tapi_fio_create

void tapi_fio_opts_init(tapi_fio_opts* options)

Initialize default value.

Parameters:

options

fio options

te_errno tapi_fio_start(tapi_fio* fio)

Start FIO.

Parameters:

fio

FIO context

0

No errors.

TE_EOPNOTSUPP

If FIO control structure not valid.

Returns:

Status code.

te_errno tapi_fio_wait(tapi_fio* fio, int16_t timeout_sec)

Wait certain time for FIO to complete.

Parameters:

fio

FIO context

timeout_sec

Timeout in seconds

0

No errors.

TE_EOPNOTSUPP

If FIO control structure not valid.

Returns:

Status code.

te_errno tapi_fio_stop(tapi_fio* fio)

Kill FIO execution.

Parameters:

fio

FIO context

0

No errors.

TE_EOPNOTSUPP

If FIO control structure not valid.

Returns:

Status code.

te_errno tapi_fio_get_report(tapi_fio* fio, tapi_fio_report* report)

Dump report in TE log

Parameters:

fio

FIO context

report

FIO report structure

0

No errors.

TE_EOPNOTSUPP

If FIO control structure not valid.

Returns:

Status code.

void tapi_fio_log_report(tapi_fio_report* report)

Log report to TE log

Parameters:

report

report to log

te_errno tapi_fio_mi_report(te_mi_logger* logger, const tapi_fio_report* report)

Add FIO report to MI logger

Parameters:

logger

MI logger

report

FIO report structure

Returns:

Status code

Macros

#define TAPI_FIO_MAX_NUMJOBS

The maximum value of numjobs, used to estimate the timeout

#define TAPI_FIO_MAX_REPORT

FIO report max size

#define TAPI_FIO_OPTS_DEFAULTS

Macro to initialize default value.

#define TAPI_FIO_RWTYPE_MAPPING_LIST

List of values allowed for parameter of type ‘tapi_fio_rwtype’.

#define TAPI_FIO_TIMEOUT_DEFAULT

Estimate timeout from input FIO parameters

#define TEST_FIO_IOENGINE_PARAM(var_name_)

Get the value of parameter of type ‘tapi_fio_ioengine’

Parameters:

var_name_

Name of the parameter

Returns:

value of parameter of type ‘tapi_fio_ioengine’

#define TEST_FIO_NUMJOBS_PARAM(var_name_)

The syntax of the parameter is an expression accepted by tapi_cfg_cpu_calculate_numjobs().

Parameters:

var_name_

Name of the parameter

Returns:

value of parameter of type ‘ tapi_fio_numjobs_t

#define TEST_FIO_RWTYPE_PARAM(var_name_)

Get the value of parameter of type ‘tapi_fio_rwtype’

Parameters:

var_name_

Name of the parameter

Returns:

value of parameter of type ‘tapi_fio_rwtype’

#define TEST_GET_FIO_IOENGINE_PARAM(var_name_)

Get test parameter ioengine

See also:

TEST_FIO_IOENGINE_PARAM

#define TEST_GET_FIO_NUMJOBS_PARAM(var_name_)

Get test parameter numjobs

See also:

TEST_FIO_NUMJOBS_PARAM

#define TEST_GET_FIO_RWTYPE_PARAM(var_name_)

Get test parameter rwtype

See also:

TEST_FIO_RWTYPE_PARAM