28 #include <linux/limits.h> 30 #include <sys/types.h> 44 #define tr_info_list_traverse(ptr, head) \ 45 for (ptr = head; ptr != NULL; ptr = ptr->next) 54 #define tr_json_field_traverse(ptr, begin, end) \ 55 for (ptr = begin; ptr != end; ptr++) 58 #pragma message "Compile redhat version" 59 #define TR_CGROUP_PREFIX "/sys/fs/cgroup/" 60 #define TR_CGROUP_WEIGHT_PREFIX "io" 61 #define TR_CGROUP_SET_PID "cgroup.procs" 65 #pragma message "Compile not redhat version" 66 #define TR_CGROUP_PREFIX "/sys/fs/cgroup/blkio/" 67 #define TR_CGROUP_WEIGHT_PREFIX "blkio" 68 #define TR_CGROUP_SET_PID "tasks" 72 #define tr_print_info(info) \ 75 "\t\t[[ current %p ]]\n" \ 79 "\t\tnr_thread: %u\n" \ 81 "\t\ttrace_repeat: %u\n" \ 83 "\t\tutilization: %u\n" \ 88 "\t\tprefix_cgroup_name: %s\n" \ 89 "\t\tscheduler: %s\n" \ 91 "\t\ttrace_replay_path: %s\n" \ 92 "\t\ttrace_data_path: %s\n" \ 94 "\t\tglobal_config: %p\n" \ 96 (info), (info)->pid, (info)->time, (info)->q_depth, \ 97 (info)->nr_thread, (info)->weight, (info)->trace_repeat, \ 98 (info)->wss, (info)->utilization, (info)->iosize, \ 99 (info)->mqid, (info)->shmid, (info)->semid, \ 100 (info)->prefix_cgroup_name, (info)->scheduler, \ 101 (info)->cgroup_id, (info)->trace_replay_path, \ 102 (info)->trace_data_path, (info)->device, \ 103 (info)->global_config, (info)->next); 132 struct json_object *per_trace
164 char prefix_cgroup_name
166 char device[NAME_MAX];
167 char scheduler[NAME_MAX];
170 char trace_replay_path[PATH_MAX];
171 char trace_data_path[PATH_MAX];
unsigned int time
Definition: tr-driver.h:148
Definition: tr-driver.h:106
void tr_free(void)
Deallocate resources of this driver.
Definition: tr-driver.c:536
int tr_has_weight_scheduler(const int scheduler_index)
Check the parameter's scheduler_index supports weight.
Definition: tr-driver.c:162
static const char * key[]
Definition: docker-driver-test.c:55
Support structure of the tr_stats_serializer() function.
Definition: tr-driver.h:121
Support structure of the total_results structures which located in include/trace_replay.h.
Definition: tr-driver.h:129
void tr_realtime_serializer(const struct tr_info *info, const struct realtime_log *log, char *buffer)
Converts realtime_log to JSON string.
Definition: tr-serializer.c:399
int shmid
Definition: tr-driver.h:156
int tr_shm_get(const struct tr_info *info, void *buffer)
Retrieve the data from Shared Memory.
Definition: tr-shm.c:241
int tr_mq_init(struct tr_info *info)
Wrapping function of __tr_mq_init()
Definition: tr-mq.c:98
int tr_init(void *object)
Initialize the global configuration and per processes configuration.
Definition: tr-driver.c:182
Definition: tr-driver.h:107
void tr_total_serializer(const struct tr_info *info, const struct total_results *total, char *buffer)
Converts total_results to JSON string.
Definition: tr-serializer.c:427
This structure has the major information of the each process.
Definition: tr-driver.h:143
pid_t pid
Definition: tr-driver.h:145
const void * member
Definition: tr-driver.h:123
void tr_mq_free(struct tr_info *info, int flags)
Deallocate the Message Queue resources.
Definition: tr-mq.c:151
int semid
Definition: tr-driver.h:157
Definition: trace_replay.h:193
Definition: trace_replay.h:239
struct tr_info * tr_info_init(struct json_object *setting, int index)
Generate and construct the per processes info object and return it.
Definition: tr-info.c:232
int tr_valid_scheduler_test(const char *scheduler)
Check the current inputted scheduler text can be supported by the driver.
Definition: tr-driver.c:143
struct tr_info * next
Definition: tr-driver.h:174
Definition: trace_replay.h:160
#define MAX_THREADS
Definition: trace_replay.h:34
int tr_shm_init(struct tr_info *info)
Do the __tr_shm_init() and __tr_sem_init()
Definition: tr-shm.c:201
int tr_get_interval(const char *key, char *buffer)
Get execution-time results from trace-replay.
Definition: tr-driver.c:461
Definition: tr-driver.h:110
Definition: tr-driver.h:115
void * global_config
Definition: tr-driver.h:173
unsigned int q_depth
Definition: tr-driver.h:150
unsigned int trace_repeat
Definition: tr-driver.h:159
Definition: tr-driver.h:111
pid_t ppid
Definition: tr-driver.h:144
void tr_shm_free(struct tr_info *info, int flags)
Deallocate the Shared Memory resources.
Definition: tr-shm.c:266
unsigned int utilization
Definition: tr-driver.h:161
Definition: trace_replay.h:176
int tr_mq_get(const struct tr_info *info, void *buffer)
Retrieve the data from Message Queue.
Definition: tr-mq.c:128
unsigned int nr_thread
Definition: tr-driver.h:151
def info()
Definition: routes.py:6
int tr_get_total(const char *key, char *buffer)
Get end-time results from trace-replay.
Definition: tr-driver.c:502
int tr_runner(void)
Run all processes' trace-replay part.
Definition: tr-driver.c:379
unsigned int wss
Definition: tr-driver.h:160
Definition: tr-driver.h:114
int mqid
Definition: tr-driver.h:155
unsigned int iosize
Definition: tr-driver.h:162
unsigned int weight
Definition: tr-driver.h:153
const char * name
Definition: tr-driver.h:122
char scheduler[NAME_MAX]
Definition: tr-driver.h:167
This header maintain the driver's mapping information. It's definition in runner/generic.c.