ContainerTracer  0.1
Enumerations | Functions | Variables
docker-driver.c File Reference

Implementation of run the trace-replay benchmark with Docker. More...

#include <stdlib.h>
#include <errno.h>
#include <search.h>
#include <assert.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/syscall.h>
#include <json.h>
#include <jemalloc/jemalloc.h>
#include <generic.h>
#include <runner.h>
#include <driver/docker-driver.h>
#include <log.h>
#include <trace_replay.h>
Include dependency graph for docker-driver.c:

Enumerations

enum  { DOCKER_NONE_SCHEDULER = 0, DOCKER_KYBER_SCHEDULER, DOCKER_BFQ_SCHEDULER }
 

Functions

static void __docker_rm_container (struct docker_info *info)
 Remove the docker container. More...
 
static void __docker_free (void)
 Deallocate this driver's resources. More...
 
int docker_valid_scheduler_test (const char *scheduler)
 Check the current inputted scheduler text can be supported by the driver. More...
 
int docker_has_weight_scheduler (const int scheduler_index)
 Check the parameter's scheduler_index supports weight. More...
 
int docker_create_local_images (void)
 Create the docker local image. More...
 
int docker_init (void *object)
 Initialize the global configuration and per processes configuration. More...
 
static int docker_set_cgroup_state (struct docker_info *current)
 Set the child process to specific control group(cgroup) More...
 
static int docker_create_container (struct docker_info *current)
 Each process trace-replay execute part. More...
 
int docker_runner (void)
 Run all processes' trace-replay part. More...
 
int docker_get_interval (const char *key, char *buffer)
 Get execution-time results from trace-replay. More...
 
int docker_get_total (const char *key, char *buffer)
 Get end-time results from trace-replay. More...
 
void docker_free (void)
 Deallocate resources of this driver. More...
 

Variables

static const char * docker_valid_scheduler []
 Associated table of I/O scheduler. More...
 
static const int docker_weight_support_scheduler [] = { DOCKER_BFQ_SCHEDULER }
 
static struct docker_infoglobal_info_head
 

Detailed Description

Implementation of run the trace-replay benchmark with Docker.

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DOCKER_NONE_SCHEDULER 
DOCKER_KYBER_SCHEDULER 
DOCKER_BFQ_SCHEDULER 

Function Documentation

◆ __docker_free()

static void __docker_free ( void  )
static

Deallocate this driver's resources.

Note
http://www.ascii-art.de/ascii/def/dr_who.txt
Here is the call graph for this function:

◆ __docker_rm_container()

static void __docker_rm_container ( struct docker_info info)
static

Remove the docker container.

Parameters
[in]infoDocker information that wants to remove.

◆ docker_create_container()

static int docker_create_container ( struct docker_info current)
static

Each process trace-replay execute part.

Parameters
[in]currentThe structure which has the current process information.
Returns
0 for success to create, negative value for fail to create.
Here is the call graph for this function:

◆ docker_create_local_images()

int docker_create_local_images ( void  )

Create the docker local image.

Returns
0 for success to create the docker image, other for fail to create the docker image.

◆ docker_free()

void docker_free ( void  )

Deallocate resources of this driver.

Here is the call graph for this function:

◆ docker_get_interval()

int docker_get_interval ( const char *  key,
char *  buffer 
)

Get execution-time results from trace-replay.

Parameters
[in]keycgroup_id value which specifies the location of data I want to get.
[out]bufferData contains the execution-time results based on key.
Returns
log.type for success to get information, negative value for fail to get information.
Warning
buffer must be allocated memory over and equal INTERVAL_RESULT_STRING_SIZE
Here is the call graph for this function:

◆ docker_get_total()

int docker_get_total ( const char *  key,
char *  buffer 
)

Get end-time results from trace-replay.

Parameters
[in]keycgroup_id value which specifies the location of data I want to get.
[out]bufferData contains the end-time results based on key.
Returns
0 for success to get information, negative value for fail to get information.
Warning
buffer must be allocated memory over and equal TOTAL_RESULT_STRING_SIZE
Here is the call graph for this function:

◆ docker_has_weight_scheduler()

int docker_has_weight_scheduler ( const int  scheduler_index)

Check the parameter's scheduler_index supports weight.

Parameters
[in]scheduler_indexThe scheduler's index which is based on docker_valid_scheduler and wants to check.
Returns
0 for doesn't support the weight, 1 for supporting the weight.

◆ docker_init()

int docker_init ( void *  object)

Initialize the global configuration and per processes configuration.

Parameters
[in]objectglobal runner_config pointer.
Returns
0 for success to init, error number for fail to init.
Warning
Do not run this function in child process.
Here is the call graph for this function:

◆ docker_runner()

int docker_runner ( void  )

Run all processes' trace-replay part.

Returns
0 for success to run, error number for fail to run.
Here is the call graph for this function:

◆ docker_set_cgroup_state()

static int docker_set_cgroup_state ( struct docker_info current)
static

Set the child process to specific control group(cgroup)

Parameters
[in]currentThe structure which has the current process information.
Returns
0 for success to set, errno for fail to set.
Here is the call graph for this function:

◆ docker_valid_scheduler_test()

int docker_valid_scheduler_test ( const char *  scheduler)

Check the current inputted scheduler text can be supported by the driver.

Parameters
[in]schedulerInputted scheduler string.
Returns
0 and positive integer for mean support the scheduler, -EINVAL for mean don't support the scheduler.

Variable Documentation

◆ docker_valid_scheduler

const char* docker_valid_scheduler[]
static
Initial value:
= {
NULL,
}
Definition: docker-driver.c:46
Definition: docker-driver.c:45
Definition: docker-driver.c:47

Associated table of I/O scheduler.

Warning
Kyber sceduler doesn't support in SCSI devices.

◆ docker_weight_support_scheduler

const int docker_weight_support_scheduler[] = { DOCKER_BFQ_SCHEDULER }
static

◆ global_info_head

struct docker_info* global_info_head
static
Initial value:
=
NULL

global docker_info list