ContainerTracer  0.1
Functions | Variables
docker-info.c File Reference

Initialize the info structure. More...

#include <stdlib.h>
#include <search.h>
#include <assert.h>
#include <sys/stat.h>
#include <json.h>
#include <jemalloc/jemalloc.h>
#include <driver/docker-driver.h>
Include dependency graph for docker-info.c:

Functions

static int docker_info_int_value_set (struct json_object *setting, const char *key, unsigned int *member, int is_print)
 Read the JSON string and convert the value to integer form and set that value to info->(member) More...
 
static int docker_info_str_value_set (struct json_object *setting, const char *key, char *member, size_t size, int is_print)
 Read the JSON string and convert the value to string form and set that value to info->(member) More...
 
int docker_is_synth_type (const char *trace_data_path)
 Check the trace_data_path value form is synthetic from. More...
 
static int __docker_info_init (struct json_object *setting, int index, struct docker_info *info)
 Set the configuration of each process's behavior. More...
 
struct docker_infodocker_info_init (struct json_object *setting, int index)
 Generate and construct the per processes info object and return it. More...
 

Variables

static const char * global_synth_type []
 Definition of a well-known synthetic form. This value depends on the trace-replay specification. More...
 

Detailed Description

Initialize the info structure.

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
SuhoSon (ngeol.nosp@m.564@.nosp@m.gmail.nosp@m..com)
Version
0.1.2
Date
2020-08-19

Function Documentation

◆ __docker_info_init()

static int __docker_info_init ( struct json_object *  setting,
int  index,
struct docker_info info 
)
static

Set the configuration of each process's behavior.

Parameters
[in]settingJSON object pointer which has the setting value.
[in]indextask_option array's index.
[out]infoThe target structure of the member will be set by the JSON object.
Returns
0 for success to init, error number for fail to init

< Variable for hsearch.

Here is the call graph for this function:

◆ docker_info_init()

struct docker_info* docker_info_init ( struct json_object *  setting,
int  index 
)

Generate and construct the per processes info object and return it.

Parameters
[in]settingJSON object pointer which has the setting value.
[in]indextask_option array's index.
Returns
0 for success to init, error number for fail to init
Here is the call graph for this function:

◆ docker_info_int_value_set()

static int docker_info_int_value_set ( struct json_object *  setting,
const char *  key,
unsigned int *  member,
int  is_print 
)
static

Read the JSON string and convert the value to integer form and set that value to info->(member)

Parameters
[in]settingThe traverse start location of JSON object.
[in]keyJSON object's key which points to the value I want to find.
[out]memberinfo structure member address.
[in]is_printThe flag that determines to print the error.
Returns
0 for success to input, -EINVAL for fail to input.
Warning
member must be an integer type.

◆ docker_info_str_value_set()

static int docker_info_str_value_set ( struct json_object *  setting,
const char *  key,
char *  member,
size_t  size,
int  is_print 
)
static

Read the JSON string and convert the value to string form and set that value to info->(member)

Parameters
[in]settingThe traverse start location of JSON object.
[in]keyJSON object's key which points to the value I want to find.
[out]memberinfo structure member address.
[in]sizeThis value must under member memory size
[in]is_printThe flag that determines to print the error.
Returns
0 for success to input, -EINVAL for fail to input.
Warning
member must be an string type.
Here is the call graph for this function:

◆ docker_is_synth_type()

int docker_is_synth_type ( const char *  trace_data_path)

Check the trace_data_path value form is synthetic from.

Parameters
[in]trace_data_pathThe value which I want to know either synthetic or not.
Returns
DOCKER_SYNTH for trace_data_path is synthetic, DOCKER_NOT_SYNTH for trace_data_path isn't synthetic

Variable Documentation

◆ global_synth_type

const char* global_synth_type[]
static
Initial value:
= { "rand_read", "rand_write",
"rand_mixed", "seq_read",
"seq_write", "seq_mixed",
NULL }

Definition of a well-known synthetic form. This value depends on the trace-replay specification.