ContainerTracer  0.1
Macros | Functions | Variables
tr-driver-test.c File Reference

Check the correctness of tr-driver. More...

#include <stdlib.h>
#include <unity.h>
#include <time.h>
#include <unistd.h>
#include <sys/sysinfo.h>
#include <jemalloc/jemalloc.h>
#include <json.h>
#include <assert.h>
#include <generic.h>
#include <runner.h>
#include <trace_replay.h>
Include dependency graph for tr-driver-test.c:

Macros

#define __s8
 
#define TEST_TARGET_DRIVER   "trace-replay"
 
#define TRACE_REPLAY_PATH   "./build/release/trace-replay"
 
#define SCHEDULER   "none"
 
#define TIME   (5)
 
#define Q_DEPTH   (get_nprocs())
 
#define PREFIX_CGROUP_NAME   "tester.trace."
 
#define NR_TASKS   (key_len)
 
#define NR_THREAD   ((int)(Q_DEPTH / NR_TASKS))
 
#define FLAGS_MASK   ((0x1 << NR_TASKS) - 1)
 

Functions

static void print_json_string (const char *msg, const char *buffer)
 
void setUp (void)
 
void tearDown (void)
 
void test (void)
 
int main (void)
 

Variables

static const char * key []
 
static const int weight [] = { 100, 250, 500, 1000, 2000, 4000 }
 
static const char * test_path []
 
static const unsigned long key_len = sizeof(key) / sizeof(char *)
 
static char * json
 
static char * task_options
 
static struct json_object * jobject
 

Detailed Description

Check the correctness of tr-driver.

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-05

Macro Definition Documentation

◆ __s8

#define __s8

◆ FLAGS_MASK

#define FLAGS_MASK   ((0x1 << NR_TASKS) - 1)

◆ NR_TASKS

#define NR_TASKS   (key_len)

◆ NR_THREAD

#define NR_THREAD   ((int)(Q_DEPTH / NR_TASKS))

◆ PREFIX_CGROUP_NAME

#define PREFIX_CGROUP_NAME   "tester.trace."

The rule to generate the cgroup directory

◆ Q_DEPTH

#define Q_DEPTH   (get_nprocs())

Queue depth size which based on the number of cores.

◆ SCHEDULER

#define SCHEDULER   "none"

"none, bfq" in SCSI; "none, kyber, bfq" in NVMe

◆ TEST_TARGET_DRIVER

#define TEST_TARGET_DRIVER   "trace-replay"

◆ TIME

#define TIME   (5)

seconds

◆ TRACE_REPLAY_PATH

#define TRACE_REPLAY_PATH   "./build/release/trace-replay"

Function Documentation

◆ main()

int main ( void  )
Here is the call graph for this function:

◆ print_json_string()

static void print_json_string ( const char *  msg,
const char *  buffer 
)
static

◆ setUp()

void setUp ( void  )
Here is the call graph for this function:

◆ tearDown()

void tearDown ( void  )
Here is the call graph for this function:

◆ test()

void test ( void  )
Here is the call graph for this function:

Variable Documentation

◆ jobject

struct json_object* jobject
static

◆ json

char* json
static

◆ key

const char* key[]
static
Initial value:
= { "cgroup-1", "cgroup-2", "cgroup-3",
"cgroup-4", "cgroup-5", "cgroup-6" }

◆ key_len

const unsigned long key_len = sizeof(key) / sizeof(char *)
static

◆ task_options

char * task_options
static

◆ test_path

const char* test_path[]
static
Initial value:
= {
"./sample/sample1.dat", "./sample/sample2.dat",
"./sample/sample1.dat", "rand_read",
"rand_mixed", "seq_mixed",
}

◆ weight

const int weight[] = { 100, 250, 500, 1000, 2000, 4000 }
static