#define TERMINATE_ALL (-1)
-static void terminate_threads(int groupid)
+static void terminate_threads(int group_id)
{
int i;
for (i = 0; i < thread_number; i++) {
struct thread_data *td = &threads[i];
- if (groupid == TERMINATE_ALL || groupid == td->groupid) {
+ if (group_id == TERMINATE_ALL || groupid == td->groupid) {
td->terminate = 1;
td->start_delay = 0;
}
is->samples++;
}
-static void add_log_sample(struct thread_data *td, struct io_log *log,
+static void add_log_sample(struct thread_data *td, struct io_log *iolog,
unsigned long val)
{
- if (log->nr_samples == log->max_samples) {
- int new_size = sizeof(struct io_sample) * log->max_samples * 2;
+ if (iolog->nr_samples == iolog->max_samples) {
+ int new_size = sizeof(struct io_sample) * iolog->max_samples*2;
- log->log = realloc(log->log, new_size);
- log->max_samples <<= 1;
+ iolog->log = realloc(iolog->log, new_size);
+ iolog->max_samples <<= 1;
}
- log->log[log->nr_samples].val = val;
- log->log[log->nr_samples].time = mtime_since_now(&td->start);
- log->nr_samples++;
+ iolog->log[iolog->nr_samples].val = val;
+ iolog->log[iolog->nr_samples].time = mtime_since_now(&td->start);
+ iolog->nr_samples++;
}
static void add_clat_sample(struct thread_data *td, unsigned long msec)
}
-static void *fork_main(int shm_id, int offset)
+static void *fork_main(int shmid, int offset)
{
struct thread_data *td;
void *data;
- data = shmat(shm_id, NULL, 0);
+ data = shmat(shmid, NULL, 0);
if (data == (void *) -1) {
perror("shmat");
return NULL;
* start created threads (TD_CREATED -> TD_RUNNING)
*/
for (i = 0; i < thread_number; i++) {
- struct thread_data *td = &threads[i];
+ td = &threads[i];
if (td->runstate != TD_CREATED)
continue;
}
for (i = 0; i < thread_number; i++) {
- struct thread_data *td = &threads[i];
+ td = &threads[i];
if (td->runstate != TD_RUNNING &&
td->runstate != TD_VERIFYING)