ContainerTracer  0.1
Data Structures | Macros | Enumerations | Functions
runner.h File Reference

Declaration information of runnner More...

#include <linux/limits.h>
#include <sys/user.h>
#include <json.h>
#include <generic.h>
Include dependency graph for runner.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  runner_config
 This structure has user-inputted information. More...
 

Macros

#define INTERVAL_RESULT_STRING_SIZE   (PAGE_SIZE)
 
#define TOTAL_RESULT_STRING_SIZE   (PAGE_SIZE * PAGE_SIZE)
 
#define BFQ_MIN_WEIGHT   1
 
#define BFQ_MAX_WEIGHT   1000
 

Enumerations

enum  { RUNNER_FREE_ALL_MASK, RUNNER_FREE_DRIVER_MASK }
 
enum  { RUNNER_FREE_ALL = 0xFFFF }
 

Functions

int runner_init (const char *json_str)
 Read the JSON string and config the runner. More...
 
int runner_run (void)
 Execute the benchmark program. More...
 
char * runner_get_interval_result (const char *key)
 Get a specific driver's execution-time results. More...
 
char * runner_get_total_result (const char *key)
 Get a specific driver's end-time results. More...
 
void runner_put_result_string (char *buffer)
 Deallocate the buffer which is allocated by runner_get_result_string() function. More...
 
void runner_free (void)
 Wrapping function of __runner_free(). More...
 
void runner_config_free (struct runner_config *config, const int flags)
 Deallocate the global_runner's contents. More...
 
const struct runner_configrunner_get_global_config (void)
 Get a global configuration pointer. More...
 
static int runner_is_valid_bfq_weight (unsigned int weight)
 Check the validation of BFQ scheduler's weight. More...
 

Detailed Description

Declaration information of runnner

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Author
BlaCkinkGJ (ss5ki.nosp@m.jun@.nosp@m.gmail.nosp@m..com)
Version
0.1
Date
2020-08-04

Macro Definition Documentation

◆ BFQ_MAX_WEIGHT

#define BFQ_MAX_WEIGHT   1000

◆ BFQ_MIN_WEIGHT

#define BFQ_MIN_WEIGHT   1

◆ INTERVAL_RESULT_STRING_SIZE

#define INTERVAL_RESULT_STRING_SIZE   (PAGE_SIZE)

Expected 4KB

◆ TOTAL_RESULT_STRING_SIZE

#define TOTAL_RESULT_STRING_SIZE   (PAGE_SIZE * PAGE_SIZE)

Expected 16MB

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
RUNNER_FREE_ALL_MASK 

This mask checks the flag want to deallocate all.

RUNNER_FREE_DRIVER_MASK 

This mask checks the flag want to deallocate driver

◆ anonymous enum

anonymous enum
Enumerator
RUNNER_FREE_ALL 

Deallocate the whole runner contents.

Function Documentation

◆ runner_config_free()

void runner_config_free ( struct runner_config config,
const int  flags 
)

Deallocate the global_runner's contents.

Parameters
[in]configpointer of runner_config structure.
[in]flagsFlag of deallocation range.

◆ runner_free()

void runner_free ( void  )

Wrapping function of __runner_free().

Here is the call graph for this function:

◆ runner_get_global_config()

const struct runner_config* runner_get_global_config ( void  )

Get a global configuration pointer.

Returns
global_config pointer.
Note
You must use only on debugging or restricted environments.

◆ runner_get_interval_result()

char* runner_get_interval_result ( const char *  key)

Get a specific driver's execution-time results.

Parameters
[in]keyThe key which specifies target to get execution-time result.
Returns
Return JSON string which contains the execution-time results. However, if allocates fail then returns NULL.
Warning
Due to the buffer was allocated by runner_get_result_string(), you must deallocate this buffer by using runner_put_result_string().
Here is the call graph for this function:

◆ runner_get_total_result()

char* runner_get_total_result ( const char *  key)

Get a specific driver's end-time results.

Parameters
[in]keyThe key which specifies target to get end-time result.
Returns
Return JSON string which contains the end-time results. However, if allocates fail then returns NULL.
Warning
Due to the buffer was allocated by runner_get_result_string(), you must deallocate this buffer by using runner_put_result_string().
Here is the call graph for this function:

◆ runner_init()

int runner_init ( const char *  json_str)

Read the JSON string and config the runner.

Parameters
[in]json_strJSON string which is used in runner config.
Returns
0 for success to init, error number for fail to init.
Exceptions
Errornumber returns if there exists any invalid value in JSON string.
Here is the call graph for this function:

◆ runner_is_valid_bfq_weight()

static int runner_is_valid_bfq_weight ( unsigned int  weight)
static

Check the validation of BFQ scheduler's weight.

Parameters
[in]weightBFQ scheduler's weight.
Returns
1 for valid BFQ weight, 0 for invalid BFQ weight.

◆ runner_put_result_string()

void runner_put_result_string ( char *  buffer)

Deallocate the buffer which is allocated by runner_get_result_string() function.

Parameters
[in]bufferA dynamically allocated buffer which wants to deallocate.

◆ runner_run()

int runner_run ( void  )

Execute the benchmark program.

Returns
Driver's execution result.