tool functions TAPI

Overview

TAPI to handle sfnt-pingpong tool. More…

// typedefs

typedef struct tapi_sfnt_pp_opt tapi_sfnt_pp_opt;
typedef struct tapi_sfnt_pp_report tapi_sfnt_pp_report;
typedef struct tapi_sfnt_pp_app_server_t tapi_sfnt_pp_app_server_t;
typedef struct tapi_sfnt_pp_app_client_t tapi_sfnt_pp_app_client_t;

// enums

enum tapi_sfnt_pp_muxer;

// structs

struct tapi_sfnt_pp_opt;
struct tapi_sfnt_pp_report;

// global variables

const tapi_sfnt_pp_opt tapi_sfnt_pp_opt_default_opt;

// global functions

te_errno tapi_sfnt_pp_create_client(tapi_job_factory_t* factory, const tapi_sfnt_pp_opt* opt, tapi_sfnt_pp_app_client_t** app);
te_errno tapi_sfnt_pp_create_server(tapi_job_factory_t* factory, const tapi_sfnt_pp_opt* opt, tapi_sfnt_pp_app_server_t** app);
te_errno tapi_sfnt_pp_create(tapi_job_factory_t* client_factory, tapi_job_factory_t* server_factory, const tapi_sfnt_pp_opt* opt, tapi_sfnt_pp_app_client_t** client, tapi_sfnt_pp_app_server_t** server);
te_errno tapi_sfnt_pp_start_client(tapi_sfnt_pp_app_client_t* app);
te_errno tapi_sfnt_pp_start_server(tapi_sfnt_pp_app_server_t* app);
te_errno tapi_sfnt_pp_start(tapi_sfnt_pp_app_client_t* client, tapi_sfnt_pp_app_server_t* server);
te_errno tapi_sfnt_pp_wait_client(tapi_sfnt_pp_app_client_t* app, int timeout_ms);
te_errno tapi_sfnt_pp_wait_server(tapi_sfnt_pp_app_server_t* app, int timeout_ms);
te_errno tapi_sfnt_pp_get_report(tapi_sfnt_pp_app_client_t* app, tapi_sfnt_pp_report** report);
te_errno tapi_sfnt_pp_kill_client(tapi_sfnt_pp_app_client_t* app, int signo);
te_errno tapi_sfnt_pp_kill_server(tapi_sfnt_pp_app_server_t* app, int signo);
te_errno tapi_sfnt_pp_destroy_client(tapi_sfnt_pp_app_client_t* app);
te_errno tapi_sfnt_pp_destroy_server(tapi_sfnt_pp_app_server_t* app);
te_errno tapi_sfnt_pp_mi_report(const tapi_sfnt_pp_report* report);
te_errno tapi_sfnt_pp_client_wrapper_add(tapi_sfnt_pp_app_client_t* app, const char* tool, const char** argv, tapi_job_wrapper_priority_t priority, tapi_job_wrapper_t** wrap);
te_errno tapi_sfnt_pp_client_add_sched_param(tapi_sfnt_pp_app_client_t* app, tapi_job_sched_param* sched_param);

// macros

#define TAPI_SFNT_PP_MUXER_MAP_LIST
#define TEST_GET_SFNT_PP_MUXER(var_name_)

Detailed Documentation

TAPI to handle sfnt-pingpong tool.

Copyright (C) 2020-2022 OKTET Labs Ltd. All rights reserved.

Typedefs

typedef struct tapi_sfnt_pp_opt tapi_sfnt_pp_opt

sfnt-pingping tool specific command line options

typedef struct tapi_sfnt_pp_report tapi_sfnt_pp_report

Struct for storage report for one size value.

The output of sfnt-pingpong in the form of a table:

size mean min median max ile stddev iter 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

So this structure stores the values of a single row.

typedef struct tapi_sfnt_pp_app_server_t tapi_sfnt_pp_app_server_t

sfnt-pingpong server context

typedef struct tapi_sfnt_pp_app_client_t tapi_sfnt_pp_app_client_t

sfnt-pingpong clinet context

Global Variables

const tapi_sfnt_pp_opt tapi_sfnt_pp_opt_default_opt

Default options initializer

Global Functions

te_errno tapi_sfnt_pp_create_client(tapi_job_factory_t* factory, const tapi_sfnt_pp_opt* opt, tapi_sfnt_pp_app_client_t** app)

Create client app. All needed information to run is in opt.

Parameters:

factory

Job factory.

opt

Command line options.

app

Clinet app handle.

Returns:

Status code.

te_errno tapi_sfnt_pp_create_server(tapi_job_factory_t* factory, const tapi_sfnt_pp_opt* opt, tapi_sfnt_pp_app_server_t** app)

Create server app. All needed information to run is in opt.

Parameters:

factory

Job factory.

opt

Command line options.

app

Clinet app handle.

Returns:

Status code.

te_errno tapi_sfnt_pp_create(tapi_job_factory_t* client_factory, tapi_job_factory_t* server_factory, const tapi_sfnt_pp_opt* opt, tapi_sfnt_pp_app_client_t** client, tapi_sfnt_pp_app_server_t** server)

Create client and server app.

Parameters:

client_factory

Client job factory.

server_factory

Server job factory.

opt

Command line options.

client

Client app handle.

server

Server app handle.

Returns:

Status code.

te_errno tapi_sfnt_pp_start_client(tapi_sfnt_pp_app_client_t* app)

Start client.

Parameters:

app

Client app handle.

Returns:

Status code.

te_errno tapi_sfnt_pp_start_server(tapi_sfnt_pp_app_server_t* app)

Start server.

Parameters:

app

Server app handle.

Returns:

Status code.

te_errno tapi_sfnt_pp_start(tapi_sfnt_pp_app_client_t* client, tapi_sfnt_pp_app_server_t* server)

Start clinet and server.

Parameters:

client

Client app handle.

server

Server app handle.

Returns:

Status code.

te_errno tapi_sfnt_pp_wait_client(tapi_sfnt_pp_app_client_t* app, int timeout_ms)

Wait for client completion.

Parameters:

app

Client app handle.

timeout_ms

Wait timeout in milliseconds. (negative means tapi_job_get_timeout())

Returns:

Status code.

te_errno tapi_sfnt_pp_wait_server(tapi_sfnt_pp_app_server_t* app, int timeout_ms)

Wait for server completion.

Parameters:

app

Server app handle.

timeout_ms

Wait timeout in milliseconds. (negative means tapi_job_get_timeout())

Returns:

Status code.

te_errno tapi_sfnt_pp_get_report(tapi_sfnt_pp_app_client_t* app, tapi_sfnt_pp_report** report)

Get sfnt-pingpong report.

‘report’ should be freed by user.

Parameters:

app

Clinet app handle.

report

sfnt-pingpong statistics report.

Returns:

Status code.

te_errno tapi_sfnt_pp_kill_client(tapi_sfnt_pp_app_client_t* app, int signo)

Send a signal to clinet.

Parameters:

app

Client app handle.

signo

Signal to send to client.

Returns:

Status code.

te_errno tapi_sfnt_pp_kill_server(tapi_sfnt_pp_app_server_t* app, int signo)

Send a signal to server.

Parameters:

app

Server app handle.

signo

Signal to send to server.

Returns:

Status code.

te_errno tapi_sfnt_pp_destroy_client(tapi_sfnt_pp_app_client_t* app)

Destroy client app.

Parameters:

app

Client app handle.

Returns:

Status code.

te_errno tapi_sfnt_pp_destroy_server(tapi_sfnt_pp_app_server_t* app)

Destroy server app.

Parameters:

app

Server app handle.

Returns:

Status code.

te_errno tapi_sfnt_pp_mi_report(const tapi_sfnt_pp_report* report)

Output sfnt-pingpong report via MI logger.

Parameters:

report

sfnt-pingpong report

Returns:

Status code

te_errno tapi_sfnt_pp_client_wrapper_add(tapi_sfnt_pp_app_client_t* app, const char* tool, const char** argv, tapi_job_wrapper_priority_t priority, tapi_job_wrapper_t** wrap)

Add a wrapper tool/script to sfnt-pinping client

Parameters:

app

Client app handle

tool

Path to the wrapper tool

argv

Wrapper arguments (last item should be NULL)

priority

Wrapper priority

wrap

Wrapper instance handle

Returns:

Status code

te_errno tapi_sfnt_pp_client_add_sched_param(tapi_sfnt_pp_app_client_t* app, tapi_job_sched_param* sched_param)

Add a scheduling parameters to sfnt-pingping client

Parameters:

app

Client app handle.

sched_param

Array of scheduling parameters. The last element must have the type TAPI_JOB_SCHED_END and data pointer to NULL.

Returns:

Status code

Macros

#define TAPI_SFNT_PP_MUXER_MAP_LIST

The list of values allowed for parameter of type ‘tapi_sfnt_pp_muxer’

#define TEST_GET_SFNT_PP_MUXER(var_name_)

Get the value of parameter of type ‘tapi_sfnt_pp_muxer’

Parameters:

var_name_

Name of the variable used to get the value of “var_name_” parameter of type ‘tapi_sfnt_pp_muxer’