summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authoraw148015 <none@none>2008-03-27 14:55:06 -0700
committeraw148015 <none@none>2008-03-27 14:55:06 -0700
commit29c773b378195388268beedd40b7b2732967d9e2 (patch)
tree51831beac6914e285c2ad34c9df71780f5b6b6af /usr/src
parentc5f58477f1b190d049c5f4fedeed36e5cc22a1c7 (diff)
downloadillumos-joyent-29c773b378195388268beedd40b7b2732967d9e2.tar.gz
6549500 Filebench error reporting requires traditionalization
6672924 The fileserver.f FileBench workload needs to create files too. 6673349 seg fault when variables defined after define stmt 6673391 go_filebench exit code 1 6673928 creating large filesets is slow
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/filebench/common/filebench.h2
-rw-r--r--usr/src/cmd/filebench/common/fileset.c41
-rw-r--r--usr/src/cmd/filebench/common/fileset.h2
-rw-r--r--usr/src/cmd/filebench/common/ipc.c119
-rw-r--r--usr/src/cmd/filebench/common/ipc.h35
-rw-r--r--usr/src/cmd/filebench/common/misc.c31
-rw-r--r--usr/src/cmd/filebench/common/misc.h11
-rw-r--r--usr/src/cmd/filebench/common/parser_gram.y22
-rw-r--r--usr/src/cmd/filebench/workloads/bringover.f4
-rw-r--r--usr/src/cmd/filebench/workloads/copyfiles.f4
-rw-r--r--usr/src/cmd/filebench/workloads/createfiles.f4
-rw-r--r--usr/src/cmd/filebench/workloads/deletefiles.f4
-rw-r--r--usr/src/cmd/filebench/workloads/filemicro_delete.f9
-rw-r--r--usr/src/cmd/filebench/workloads/fileserver.f27
-rw-r--r--usr/src/cmd/filebench/workloads/mongo.f9
15 files changed, 186 insertions, 138 deletions
diff --git a/usr/src/cmd/filebench/common/filebench.h b/usr/src/cmd/filebench/common/filebench.h
index dfe193183d..b7e9a9e244 100644
--- a/usr/src/cmd/filebench/common/filebench.h
+++ b/usr/src/cmd/filebench/common/filebench.h
@@ -109,7 +109,7 @@ void filebench_shutdown(int error);
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#endif
-#define FILEBENCH_VERSION "1.2.1"
+#define FILEBENCH_VERSION "1.2.2"
#define FILEBENCHDIR "/usr/benchmarks/filebench"
#define FILEBENCH_PROMPT "filebench> "
#define MAX_LINE_LEN 1024
diff --git a/usr/src/cmd/filebench/common/fileset.c b/usr/src/cmd/filebench/common/fileset.c
index 497894ccf6..2a2819a287 100644
--- a/usr/src/cmd/filebench/common/fileset.c
+++ b/usr/src/cmd/filebench/common/fileset.c
@@ -46,6 +46,8 @@
* corresponding to the fileset's filesetentry tree.
*/
+static int fileset_checkraw(fileset_t *fileset);
+
/* parallel allocation control */
#define MAX_PARALLOC_THREADS 32
static pthread_mutex_t paralloc_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -1065,6 +1067,15 @@ fileset_createset(fileset_t *fileset)
if (fileset && avd_get_bool(fileset->fs_prealloc)) {
+ /* check for raw files */
+ if (fileset_checkraw(fileset)) {
+ filebench_log(LOG_INFO,
+ "file %s/%s is a RAW device",
+ avd_get_str(fileset->fs_path),
+ avd_get_str(fileset->fs_name));
+ return (0);
+ }
+
filebench_log(LOG_INFO,
"creating/pre-allocating %s %s",
fileset_entity_name(fileset),
@@ -1082,6 +1093,16 @@ fileset_createset(fileset_t *fileset)
list = filebench_shm->filesetlist;
while (list) {
+ /* check for raw files */
+ if (fileset_checkraw(list)) {
+ filebench_log(LOG_INFO,
+ "file %s/%s is a RAW device",
+ avd_get_str(list->fs_path),
+ avd_get_str(list->fs_name));
+ list = list->fs_next;
+ continue;
+ }
+
if ((ret = fileset_populate(list)) != 0)
return (ret);
if ((ret = fileset_create(list)) != 0)
@@ -1220,17 +1241,33 @@ fileset_checkraw(fileset_t *fileset)
{
char path[MAXPATHLEN];
struct stat64 sb;
+ char *pathname;
+ char *setname;
fileset->fs_attrs &= (~FILESET_IS_RAW_DEV);
#ifdef HAVE_RAW_SUPPORT
/* check for raw device */
- (void) strcpy(path, avd_get_str(fileset->fs_path));
+ if ((pathname = avd_get_str(fileset->fs_path)) == NULL)
+ return (0);
+
+ if ((setname = avd_get_str(fileset->fs_name)) == NULL)
+ return (0);
+
+ (void) strcpy(path, pathname);
(void) strcat(path, "/");
- (void) strcat(path, avd_get_str(fileset->fs_name));
+ (void) strcat(path, setname);
if ((stat64(path, &sb) == 0) &&
((sb.st_mode & S_IFMT) == S_IFBLK) && sb.st_rdev) {
fileset->fs_attrs |= FILESET_IS_RAW_DEV;
+ if (!(fileset->fs_attrs & FILESET_IS_FILE)) {
+ filebench_log(LOG_ERROR,
+ "WARNING Fileset %s/%s Cannot be RAW device",
+ avd_get_str(fileset->fs_path),
+ avd_get_str(fileset->fs_name));
+ filebench_shutdown(1);
+ }
+
return (1);
}
#endif /* HAVE_RAW_SUPPORT */
diff --git a/usr/src/cmd/filebench/common/fileset.h b/usr/src/cmd/filebench/common/fileset.h
index fe0b86ec79..3ad69a61c9 100644
--- a/usr/src/cmd/filebench/common/fileset.h
+++ b/usr/src/cmd/filebench/common/fileset.h
@@ -137,8 +137,6 @@ char *fileset_resolvepath(filesetentry_t *entry);
void fileset_usage(void);
void fileset_iter(int (*cmd)(fileset_t *fileset, int first));
int fileset_print(fileset_t *fileset, int first);
-int fileset_checkraw(fileset_t *fileset);
-
#ifdef __cplusplus
}
diff --git a/usr/src/cmd/filebench/common/ipc.c b/usr/src/cmd/filebench/common/ipc.c
index 596a47ea87..ee92f7b020 100644
--- a/usr/src/cmd/filebench/common/ipc.c
+++ b/usr/src/cmd/filebench/common/ipc.c
@@ -318,15 +318,15 @@ ipc_init(void)
#endif /* USE_PROCESS_MODEL */
c1 = (caddr_t)filebench_shm;
- c2 = (caddr_t)&filebench_shm->marker;
+ c2 = (caddr_t)&filebench_shm->shm_marker;
(void) memset(filebench_shm, 0, c2 - c1);
filebench_shm->epoch = gethrtime();
filebench_shm->debug_level = LOG_VERBOSE;
filebench_shm->shm_rmode = FILEBENCH_MODE_TIMEOUT;
- filebench_shm->string_ptr = &filebench_shm->strings[0];
+ filebench_shm->shm_string_ptr = &filebench_shm->shm_strings[0];
filebench_shm->shm_ptr = (char *)filebench_shm->shm_addr;
- filebench_shm->path_ptr = &filebench_shm->filesetpaths[0];
+ filebench_shm->shm_path_ptr = &filebench_shm->shm_filesetpaths[0];
/* Setup mutexes for object lists */
(void) pthread_mutex_init(&filebench_shm->fileset_lock,
@@ -339,15 +339,17 @@ ipc_init(void)
(void) pthread_mutex_init(&filebench_shm->msg_lock, ipc_mutexattr());
(void) pthread_mutex_init(&filebench_shm->eventgen_lock,
ipc_mutexattr());
- (void) pthread_mutex_init(&filebench_shm->malloc_lock, ipc_mutexattr());
- (void) pthread_mutex_init(&filebench_shm->ism_lock, ipc_mutexattr());
+ (void) pthread_mutex_init(&filebench_shm->shm_malloc_lock,
+ ipc_mutexattr());
+ (void) pthread_mutex_init(&filebench_shm->shm_ism_lock,
+ ipc_mutexattr());
(void) pthread_cond_init(&filebench_shm->eventgen_cv, ipc_condattr());
(void) pthread_rwlock_init(&filebench_shm->flowop_find_lock,
ipc_rwlockattr());
(void) pthread_rwlock_init(&filebench_shm->run_lock, ipc_rwlockattr());
(void) pthread_rwlock_rdlock(&filebench_shm->run_lock);
- (void) ipc_mutex_lock(&filebench_shm->ism_lock);
+ (void) ipc_mutex_lock(&filebench_shm->shm_ism_lock);
/* Create semaphore */
if ((key = ftok(shmpath, 1)) < 0) {
@@ -433,69 +435,77 @@ ipc_malloc(int type)
{
int i;
int max = filebench_sizes[type];
+ int start_idx = filebench_shm->shm_lastbitmapindex[type];
+
+ (void) ipc_mutex_lock(&filebench_shm->shm_malloc_lock);
- (void) ipc_mutex_lock(&filebench_shm->malloc_lock);
+ i = start_idx;
+ do {
+ i++;
+ if (i >= max)
+ i = 0;
- for (i = 0; i < max; i++) {
- if (filebench_shm->bitmap[type][i] == 0)
+ if (filebench_shm->shm_bitmap[type][i] == 0)
break;
- }
- if (i >= max) {
+ } while (i != start_idx);
+
+ if (i == start_idx) {
filebench_log(LOG_ERROR, "Out of shared memory (%d)!", type);
- (void) ipc_mutex_unlock(&filebench_shm->malloc_lock);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_malloc_lock);
return (NULL);
}
- filebench_shm->bitmap[type][i] = 1;
+ filebench_shm->shm_bitmap[type][i] = 1;
+ filebench_shm->shm_lastbitmapindex[type] = i;
switch (type) {
case FILEBENCH_FILESET:
- (void) memset((char *)&filebench_shm->fileset[i], 0,
+ (void) memset((char *)&filebench_shm->shm_fileset[i], 0,
sizeof (fileset_t));
- (void) ipc_mutex_unlock(&filebench_shm->malloc_lock);
- return ((char *)&filebench_shm->fileset[i]);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_malloc_lock);
+ return ((char *)&filebench_shm->shm_fileset[i]);
case FILEBENCH_FILESETENTRY:
- (void) memset((char *)&filebench_shm->filesetentry[i], 0,
+ (void) memset((char *)&filebench_shm->shm_filesetentry[i], 0,
sizeof (filesetentry_t));
- (void) ipc_mutex_unlock(&filebench_shm->malloc_lock);
- return ((char *)&filebench_shm->filesetentry[i]);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_malloc_lock);
+ return ((char *)&filebench_shm->shm_filesetentry[i]);
case FILEBENCH_PROCFLOW:
- (void) memset((char *)&filebench_shm->procflow[i], 0,
+ (void) memset((char *)&filebench_shm->shm_procflow[i], 0,
sizeof (procflow_t));
- (void) ipc_mutex_unlock(&filebench_shm->malloc_lock);
- return ((char *)&filebench_shm->procflow[i]);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_malloc_lock);
+ return ((char *)&filebench_shm->shm_procflow[i]);
case FILEBENCH_THREADFLOW:
- (void) memset((char *)&filebench_shm->threadflow[i], 0,
+ (void) memset((char *)&filebench_shm->shm_threadflow[i], 0,
sizeof (threadflow_t));
- (void) ipc_mutex_unlock(&filebench_shm->malloc_lock);
- return ((char *)&filebench_shm->threadflow[i]);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_malloc_lock);
+ return ((char *)&filebench_shm->shm_threadflow[i]);
case FILEBENCH_FLOWOP:
- (void) memset((char *)&filebench_shm->flowop[i], 0,
+ (void) memset((char *)&filebench_shm->shm_flowop[i], 0,
sizeof (flowop_t));
- (void) ipc_mutex_unlock(&filebench_shm->malloc_lock);
- return ((char *)&filebench_shm->flowop[i]);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_malloc_lock);
+ return ((char *)&filebench_shm->shm_flowop[i]);
case FILEBENCH_AVD:
filebench_shm->shm_avd_ptrs[i].avd_type = AVD_INVALID;
filebench_shm->shm_avd_ptrs[i].avd_val.varptr = NULL;
- (void) ipc_mutex_unlock(&filebench_shm->malloc_lock);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_malloc_lock);
return ((char *)&filebench_shm->shm_avd_ptrs[i]);
case FILEBENCH_VARIABLE:
- (void) memset((char *)&filebench_shm->var[i], 0,
+ (void) memset((char *)&filebench_shm->shm_var[i], 0,
sizeof (var_t));
- (void) ipc_mutex_unlock(&filebench_shm->malloc_lock);
- return ((char *)&filebench_shm->var[i]);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_malloc_lock);
+ return ((char *)&filebench_shm->shm_var[i]);
case FILEBENCH_RANDDIST:
(void) memset((char *)&filebench_shm->shm_randdist[i], 0,
sizeof (randdist_t));
- (void) ipc_mutex_unlock(&filebench_shm->malloc_lock);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_malloc_lock);
return ((char *)&filebench_shm->shm_randdist[i]);
}
@@ -526,27 +536,27 @@ ipc_free(int type, char *addr)
switch (type) {
case FILEBENCH_FILESET:
- base = (caddr_t)&filebench_shm->fileset[0];
+ base = (caddr_t)&filebench_shm->shm_fileset[0];
size = sizeof (fileset_t);
break;
case FILEBENCH_FILESETENTRY:
- base = (caddr_t)&filebench_shm->filesetentry[0];
+ base = (caddr_t)&filebench_shm->shm_filesetentry[0];
size = sizeof (filesetentry_t);
break;
case FILEBENCH_PROCFLOW:
- base = (caddr_t)&filebench_shm->procflow[0];
+ base = (caddr_t)&filebench_shm->shm_procflow[0];
size = sizeof (procflow_t);
break;
case FILEBENCH_THREADFLOW:
- base = (caddr_t)&filebench_shm->threadflow[0];
+ base = (caddr_t)&filebench_shm->shm_threadflow[0];
size = sizeof (threadflow_t);
break;
case FILEBENCH_FLOWOP:
- base = (caddr_t)&filebench_shm->flowop[0];
+ base = (caddr_t)&filebench_shm->shm_flowop[0];
size = sizeof (flowop_t);
break;
@@ -556,7 +566,7 @@ ipc_free(int type, char *addr)
break;
case FILEBENCH_VARIABLE:
- base = (caddr_t)&filebench_shm->var[0];
+ base = (caddr_t)&filebench_shm->shm_var[0];
size = sizeof (var_t);
break;
@@ -569,9 +579,9 @@ ipc_free(int type, char *addr)
offset = ((size_t)addr - (size_t)base);
item = offset / size;
- (void) ipc_mutex_lock(&filebench_shm->malloc_lock);
- filebench_shm->bitmap[type][item] = 0;
- (void) ipc_mutex_unlock(&filebench_shm->malloc_lock);
+ (void) ipc_mutex_lock(&filebench_shm->shm_malloc_lock);
+ filebench_shm->shm_bitmap[type][item] = 0;
+ (void) ipc_mutex_unlock(&filebench_shm->shm_malloc_lock);
}
/*
@@ -583,11 +593,11 @@ ipc_free(int type, char *addr)
char *
ipc_stralloc(char *string)
{
- char *allocstr = filebench_shm->string_ptr;
+ char *allocstr = filebench_shm->shm_string_ptr;
- filebench_shm->string_ptr += strlen(string) + 1;
+ filebench_shm->shm_string_ptr += strlen(string) + 1;
- if ((filebench_shm->string_ptr - &filebench_shm->strings[0]) >
+ if ((filebench_shm->shm_string_ptr - &filebench_shm->shm_strings[0]) >
FILEBENCH_STRINGMEMORY) {
filebench_log(LOG_ERROR, "Out of ipc string memory");
return (NULL);
@@ -611,11 +621,12 @@ ipc_stralloc(char *string)
char *
ipc_pathalloc(char *path)
{
- char *allocpath = filebench_shm->path_ptr;
+ char *allocpath = filebench_shm->shm_path_ptr;
- filebench_shm->path_ptr += strlen(path) + 1;
+ filebench_shm->shm_path_ptr += strlen(path) + 1;
- if ((filebench_shm->path_ptr - &filebench_shm->filesetpaths[0]) >
+ if ((filebench_shm->shm_path_ptr -
+ &filebench_shm->shm_filesetpaths[0]) >
FILEBENCH_FILESETPATHMEMORY) {
filebench_log(LOG_ERROR, "Out of fileset path memory");
return (NULL);
@@ -634,7 +645,7 @@ ipc_pathalloc(char *path)
void
ipc_freepaths(void)
{
- filebench_shm->path_ptr = &filebench_shm->filesetpaths[0];
+ filebench_shm->shm_path_ptr = &filebench_shm->shm_filesetpaths[0];
}
/*
@@ -717,7 +728,7 @@ ipc_ismcreate(size_t size)
size, filebench_shm->shm_addr);
/* Locked until allocated to block allocs */
- (void) ipc_mutex_unlock(&filebench_shm->ism_lock);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_ism_lock);
return (0);
}
@@ -770,7 +781,7 @@ ipc_ismmalloc(size_t size)
{
char *allocstr;
- (void) ipc_mutex_lock(&filebench_shm->ism_lock);
+ (void) ipc_mutex_lock(&filebench_shm->shm_ism_lock);
/* Map in shared memory */
(void) ipc_ismattach();
@@ -780,7 +791,7 @@ ipc_ismmalloc(size_t size)
filebench_shm->shm_ptr += size;
filebench_shm->shm_allocated += size;
- (void) ipc_mutex_unlock(&filebench_shm->ism_lock);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_ism_lock);
return (allocstr);
}
@@ -797,12 +808,12 @@ ipc_ismdelete(void)
filebench_log(LOG_VERBOSE, "Deleting ISM...");
- (void) ipc_mutex_lock(&filebench_shm->ism_lock);
+ (void) ipc_mutex_lock(&filebench_shm->shm_ism_lock);
#ifdef HAVE_SEM_RMID
(void) shmctl(filebench_shm->shm_id, IPC_RMID, 0);
#endif
filebench_shm->shm_ptr = (char *)filebench_shm->shm_addr;
filebench_shm->shm_id = -1;
filebench_shm->shm_allocated = 0;
- (void) ipc_mutex_unlock(&filebench_shm->ism_lock);
+ (void) ipc_mutex_unlock(&filebench_shm->shm_ism_lock);
}
diff --git a/usr/src/cmd/filebench/common/ipc.h b/usr/src/cmd/filebench/common/ipc.h
index 0596d177df..eb90b9b891 100644
--- a/usr/src/cmd/filebench/common/ipc.h
+++ b/usr/src/cmd/filebench/common/ipc.h
@@ -85,13 +85,13 @@ typedef struct filebench_shm {
pthread_mutex_t threadflow_lock;
pthread_mutex_t flowop_lock;
pthread_mutex_t msg_lock;
- pthread_mutex_t malloc_lock;
- pthread_mutex_t ism_lock;
+ pthread_mutex_t shm_malloc_lock;
+ pthread_mutex_t shm_ism_lock;
pthread_rwlock_t run_lock;
pthread_rwlock_t flowop_find_lock;
- char *string_ptr;
- char *path_ptr;
+ char *shm_string_ptr;
+ char *shm_path_ptr;
fileset_t *filesetlist;
flowop_t *flowoplist;
procflow_t *proclist;
@@ -100,7 +100,7 @@ typedef struct filebench_shm {
randdist_t *shm_rand_list;
int debug_level;
hrtime_t epoch;
- hrtime_t starttime;
+ hrtime_t shm_starttime;
int bequiet;
key_t semkey;
int seminit;
@@ -123,21 +123,22 @@ typedef struct filebench_shm {
int f_abort;
int shm_rmode;
int shm_1st_err;
-
- int marker;
-
- fileset_t fileset[FILEBENCH_NFILESETS];
- filesetentry_t filesetentry[FILEBENCH_NFILESETENTRIES];
- char filesetpaths[FILEBENCH_FILESETPATHMEMORY];
- procflow_t procflow[FILEBENCH_NPROCFLOWS];
- threadflow_t threadflow[FILEBENCH_NTHREADFLOWS];
- flowop_t flowop[FILEBENCH_NFLOWOPS];
- var_t var[FILEBENCH_NVARS];
+ int shm_bitmap[FILEBENCH_TYPES][FILEBENCH_MAXBITMAP];
+ int shm_lastbitmapindex[FILEBENCH_TYPES];
+
+ int shm_marker;
+
+ fileset_t shm_fileset[FILEBENCH_NFILESETS];
+ filesetentry_t shm_filesetentry[FILEBENCH_NFILESETENTRIES];
+ char shm_filesetpaths[FILEBENCH_FILESETPATHMEMORY];
+ procflow_t shm_procflow[FILEBENCH_NPROCFLOWS];
+ threadflow_t shm_threadflow[FILEBENCH_NTHREADFLOWS];
+ flowop_t shm_flowop[FILEBENCH_NFLOWOPS];
+ var_t shm_var[FILEBENCH_NVARS];
randdist_t shm_randdist[FILEBENCH_NRANDDISTS];
struct avd shm_avd_ptrs[FILEBENCH_NVARS * 2];
- char strings[FILEBENCH_STRINGMEMORY];
+ char shm_strings[FILEBENCH_STRINGMEMORY];
char semids[FILEBENCH_NSEMS];
- int bitmap[FILEBENCH_TYPES][FILEBENCH_MAXBITMAP];
} filebench_shm_t;
extern char *shmpath;
diff --git a/usr/src/cmd/filebench/common/misc.c b/usr/src/cmd/filebench/common/misc.c
index 820f41c2e9..bc0887e904 100644
--- a/usr/src/cmd/filebench/common/misc.c
+++ b/usr/src/cmd/filebench/common/misc.c
@@ -271,7 +271,7 @@ fatal:
va_end(args);
if (level == LOG_FATAL) {
- (void) fprintf(stdout, "%s\n", line);
+ (void) fprintf(stderr, "%s\n", line);
return;
}
@@ -283,6 +283,8 @@ fatal:
(void) snprintf(buf, sizeof (buf), "%s\n", line);
(void) write(filebench_shm->log_fd, buf, strlen(buf));
(void) fsync(filebench_shm->log_fd);
+ (void) ipc_mutex_unlock(&filebench_shm->msg_lock);
+ return;
}
} else if (level == LOG_DUMP) {
@@ -290,24 +292,31 @@ fatal:
(void) snprintf(buf, sizeof (buf), "%s\n", line);
(void) write(filebench_shm->dump_fd, buf, strlen(buf));
(void) fsync(filebench_shm->dump_fd);
+ (void) ipc_mutex_unlock(&filebench_shm->msg_lock);
+ return;
}
} else if (filebench_shm->debug_level > LOG_INFO) {
- (void) fprintf(stdout, "%5d: %4.3f: %s",
- (int)my_pid, (now - filebench_shm->epoch) / FSECS,
- line);
- } else {
- (void) fprintf(stdout, "%4.3f: %s",
+ if (level < LOG_INFO)
+ (void) fprintf(stderr, "%5d: ", (int)my_pid);
+ else
+ (void) fprintf(stdout, "%5d: ", (int)my_pid);
+ }
+
+ if (level < LOG_INFO) {
+ (void) fprintf(stderr, "%4.3f: %s",
(now - filebench_shm->epoch) / FSECS,
line);
- }
- if (level == LOG_ERROR) {
if (my_procflow == NULL)
- (void) fprintf(stdout, " on line %d", lex_lineno);
- }
+ (void) fprintf(stderr, " on line %d", lex_lineno);
- if ((level != LOG_LOG) && (level != LOG_DUMP)) {
+ (void) fprintf(stderr, "\n");
+ (void) fflush(stderr);
+ } else {
+ (void) fprintf(stdout, "%4.3f: %s",
+ (now - filebench_shm->epoch) / FSECS,
+ line);
(void) fprintf(stdout, "\n");
(void) fflush(stdout);
}
diff --git a/usr/src/cmd/filebench/common/misc.h b/usr/src/cmd/filebench/common/misc.h
index 31d64e2ec9..f9034b7e94 100644
--- a/usr/src/cmd/filebench/common/misc.h
+++ b/usr/src/cmd/filebench/common/misc.h
@@ -51,16 +51,17 @@ uint64_t gethrtime();
#endif
#define FSECS (double)1000000000.0
-#define LOG_INFO 2
-#define LOG_VERBOSE 3
+#define LOG_ERROR 0 /* a major error */
+#define LOG_ERROR1 1 /* also major error, but turn off error reporting */
+ /* for now */
+#define LOG_INFO 2 /* some useful information. Default is to print */
+#define LOG_VERBOSE 3 /* four more levels of detailed information */
#define LOG_DEBUG_SCRIPT 4
#define LOG_DEBUG_IMPL 6
#define LOG_DEBUG_NEVER 10
+#define LOG_FATAL 999 /* really bad error, shut down */
#define LOG_LOG 1000
#define LOG_DUMP 1001
-#define LOG_FATAL 999
-#define LOG_ERROR 0
-#define LOG_ERROR1 1
var_t *date_var(var_t *var);
var_t *script_var(var_t *var);
diff --git a/usr/src/cmd/filebench/common/parser_gram.y b/usr/src/cmd/filebench/common/parser_gram.y
index 894de5395d..3c12884c2d 100644
--- a/usr/src/cmd/filebench/common/parser_gram.y
+++ b/usr/src/cmd/filebench/common/parser_gram.y
@@ -2342,14 +2342,6 @@ parser_file_define(cmd_t *cmd)
fileset->fs_dirgamma = avd_int_alloc(0);
fileset->fs_sizegamma = avd_int_alloc(0);
- /* if a raw device, all done */
- if (fileset_checkraw(fileset)) {
- filebench_log(LOG_VERBOSE, "File %s/%s is RAW device",
- avd_get_str(fileset->fs_path),
- avd_get_str(fileset->fs_name));
- return;
- }
-
/* Does file need to be preallocated? */
if (attr = get_attr_bool(cmd, FSA_PREALLOC)) {
/* yes */
@@ -2381,16 +2373,6 @@ parser_fileset_define(cmd_t *cmd)
return;
}
- /* if a raw device, Error */
- if (fileset_checkraw(fileset)) {
- filebench_log(LOG_ERROR,
- "Fileset %s/%s: Cannot create a fileset on a RAW device",
- avd_get_str(fileset->fs_path),
- avd_get_str(fileset->fs_name));
- filebench_shutdown(0);
- return;
- }
-
/* How much should we preallocate? */
if ((attr = get_attr_integer(cmd, FSA_PREALLOC)) &&
attr->attr_avd) {
@@ -2500,7 +2482,7 @@ parser_proc_create(cmd_t *cmd)
return;
}
- filebench_shm->starttime = gethrtime();
+ filebench_shm->shm_starttime = gethrtime();
eventgen_reset();
}
@@ -2556,7 +2538,7 @@ static void
parser_filebench_shutdown(cmd_t *cmd)
{
ipc_cleanup();
- filebench_shutdown(1);
+ filebench_shutdown(0);
}
/*
diff --git a/usr/src/cmd/filebench/workloads/bringover.f b/usr/src/cmd/filebench/workloads/bringover.f
index cfa6db360c..a889cb49ad 100644
--- a/usr/src/cmd/filebench/workloads/bringover.f
+++ b/usr/src/cmd/filebench/workloads/bringover.f
@@ -50,7 +50,7 @@ define process name=filereader,instances=1
}
}
-echo "Bringover Version 2.2 personality successfully loaded"
+echo "Bringover Version 2.3 personality successfully loaded"
usage "Usage: set \$dir=<dir>"
usage " set \$filesize=<size> defaults to $filesize"
usage " set \$nfiles=<value> defaults to $nfiles"
@@ -58,4 +58,4 @@ usage " set \$iosize=<size> defaults to $iosize"
usage " set \$dirwidth=<value> defaults to $dirwidth"
usage " set \$nthreads=<value> defaults to $nthreads"
usage " "
-usage " run 0"
+usage " run"
diff --git a/usr/src/cmd/filebench/workloads/copyfiles.f b/usr/src/cmd/filebench/workloads/copyfiles.f
index 58e481a913..a47cb8f46f 100644
--- a/usr/src/cmd/filebench/workloads/copyfiles.f
+++ b/usr/src/cmd/filebench/workloads/copyfiles.f
@@ -49,7 +49,7 @@ define process name=filereader,instances=1
}
}
-echo "CopyFiles Version 2.2 personality successfully loaded"
+echo "CopyFiles Version 2.3 personality successfully loaded"
usage "Usage: set \$dir=<dir>"
usage " set \$filesize=<size> defaults to $filesize"
usage " set \$nfiles=<value> defaults to $nfiles"
@@ -57,4 +57,4 @@ usage " set \$iosize=<size> defaults to $iosize"
usage " set \$dirwidth=<value> defaults to $dirwidth"
usage " set \$nthreads=<value> defaults to $nthreads"
usage " "
-usage " run 0"
+usage " run"
diff --git a/usr/src/cmd/filebench/workloads/createfiles.f b/usr/src/cmd/filebench/workloads/createfiles.f
index 3dda144edf..198ecf3bfe 100644
--- a/usr/src/cmd/filebench/workloads/createfiles.f
+++ b/usr/src/cmd/filebench/workloads/createfiles.f
@@ -46,7 +46,7 @@ define process name=filecreate,instances=1
}
}
-echo "Createfiles Version 2.2 personality successfully loaded"
+echo "Createfiles Version 2.3 personality successfully loaded"
usage "Usage: set \$dir=<dir>"
usage " set \$filesize=<size> defaults to $filesize"
usage " set \$iosize=<size> defaults to $iosize"
@@ -55,4 +55,4 @@ usage " set \$nthreads=<value> defaults to $nthreads"
usage " set \$meandirwidth=<size> defaults to $meandirwidth"
usage "(sets mean dir width and dir depth is calculated as log (width, nfiles)"
usage " "
-usage " run 0"
+usage " run"
diff --git a/usr/src/cmd/filebench/workloads/deletefiles.f b/usr/src/cmd/filebench/workloads/deletefiles.f
index 16fde89971..5a75d1d2f8 100644
--- a/usr/src/cmd/filebench/workloads/deletefiles.f
+++ b/usr/src/cmd/filebench/workloads/deletefiles.f
@@ -43,7 +43,7 @@ define process name=filedelete,instances=1
}
}
-echo "Deletefiles Version 2.1 personality successfully loaded"
+echo "Deletefiles Version 2.2 personality successfully loaded"
usage "Usage: set \$dir=<dir>"
usage " set \$filesize=<size> defaults to $filesize"
usage " set \$nfiles=<value> defaults to $nfiles"
@@ -51,4 +51,4 @@ usage " set \$nthreads=<value> defaults to $nthreads"
usage " set \$meandirwidth=<size> defaults to $meandirwidth"
usage "(sets mean dir width and dir depth is calculated as log (width, nfiles)"
usage " "
-usage " run 0"
+usage " run"
diff --git a/usr/src/cmd/filebench/workloads/filemicro_delete.f b/usr/src/cmd/filebench/workloads/filemicro_delete.f
index ec988b2b53..9019842da1 100644
--- a/usr/src/cmd/filebench/workloads/filemicro_delete.f
+++ b/usr/src/cmd/filebench/workloads/filemicro_delete.f
@@ -19,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -33,6 +33,8 @@ set $filesize=16k
set $nthreads=16
set $count=1000
+set mode quit alldone
+
define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=100
define process name=filedelete,instances=1
@@ -45,7 +47,7 @@ define process name=filedelete,instances=1
}
}
-echo "FileMicro-Delete Version 2.0 personality successfully loaded"
+echo "FileMicro-Delete Version 2.1 personality successfully loaded"
usage "Usage: set \$dir=<dir>"
usage " set \$filesize=<size> defaults to $filesize"
usage " set \$nfiles=<value> defaults to $nfiles"
@@ -54,4 +56,5 @@ usage " set \$count=<value> defaults to $count"
usage " set \$meandirwidth=<size> defaults to $meandirwidth"
usage "(sets mean dir width and dir depth is calculated as log (width, nfiles)"
usage " "
-usage " run runtime (e.g. run 60)"
+usage " run"
+
diff --git a/usr/src/cmd/filebench/workloads/fileserver.f b/usr/src/cmd/filebench/workloads/fileserver.f
index 3e06e5536f..f1ba7ec002 100644
--- a/usr/src/cmd/filebench/workloads/fileserver.f
+++ b/usr/src/cmd/filebench/workloads/fileserver.f
@@ -19,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -30,32 +30,35 @@ set $meandirwidth=20
set $filesize=128k
set $nthreads=100
set $meaniosize=16k
-set $readiosize=1m
+set $fixediosize=1m
-define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc
+define fileset name=bigfileset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$meandirwidth,prealloc=80
define process name=filereader,instances=1
{
thread name=filereaderthread,memsize=10m,instances=$nthreads
{
+ flowop createfile name=createfile1,filesetname=bigfileset,fd=1
+ flowop writewholefile name=wrtfile1,srcfd=1,fd=1,iosize=$fixediosize
+ flowop closefile name=closefile1,fd=1
flowop openfile name=openfile1,filesetname=bigfileset,fd=1
flowop appendfilerand name=appendfilerand1,iosize=$meaniosize,fd=1
- flowop closefile name=closefile1,fd=1
- flowop openfile name=openfile2,filesetname=bigfileset,fd=1
- flowop readwholefile name=readfile1,fd=1,iosize=$readiosize
flowop closefile name=closefile2,fd=1
+ flowop openfile name=openfile2,filesetname=bigfileset,fd=1
+ flowop readwholefile name=readfile1,fd=1,iosize=$fixediosize
+ flowop closefile name=closefile3,fd=1
flowop deletefile name=deletefile1,filesetname=bigfileset
flowop statfile name=statfile1,filesetname=bigfileset
}
}
-echo "FileServer Version 2.1 personality successfully loaded"
+echo "FileServer Version 2.2 personality successfully loaded"
usage "Usage: set \$dir=<dir>"
-usage " set \$filesize=<size> defaults to $filesize"
-usage " set \$nfiles=<value> defaults to $nfiles"
-usage " set \$nthreads=<value> defaults to $nthreads"
-usage " set \$meaniosize=<value> defaults to $meaniosize"
-usage " set \$readiosize=<size> defaults to $readiosize"
+usage " set \$filesize=<size> defaults to $filesize"
+usage " set \$nfiles=<value> defaults to $nfiles"
+usage " set \$nthreads=<value> defaults to $nthreads"
+usage " set \$meaniosize=<value> defaults to $meaniosize"
+usage " set \$fixediosize=<size> defaults to $fixediosize"
usage " set \$meandirwidth=<size> defaults to $meandirwidth"
usage "(sets mean dir width and dir depth is calculated as log (width, nfiles)"
usage " "
diff --git a/usr/src/cmd/filebench/workloads/mongo.f b/usr/src/cmd/filebench/workloads/mongo.f
index 218861e9ea..fd9907de1f 100644
--- a/usr/src/cmd/filebench/workloads/mongo.f
+++ b/usr/src/cmd/filebench/workloads/mongo.f
@@ -19,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -32,6 +32,8 @@ set $nthreads=1
set $meaniosize=16k
set $readiosize=1m
+set mode quit alldone
+
define fileset name=postset,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$dirwidth,prealloc
define fileset name=postsetdel,path=$dir,size=$filesize,entries=$nfiles,dirwidth=$dirwidth,prealloc
@@ -49,7 +51,7 @@ define process name=filereader,instances=1
}
}
-echo "Mongo-like Version 2.1 personality successfully loaded"
+echo "Mongo-like Version 2.2 personality successfully loaded"
usage "Usage: set \$dir=<dir>"
usage " set \$filesize=<size> defaults to $filesize"
usage " set \$nfiles=<value> defaults to $nfiles"
@@ -57,4 +59,5 @@ usage " set \$dirwidth=<value> defaults to $dirwidth"
usage " set \$nthreads=<value> defaults to $nthreads"
usage " set \$meaniosize=<value> defaults to $meaniosize"
usage " set \$readiosize=<size> defaults to $readiosize"
-usage " run runtime (e.g. run 60)"
+usage " "
+usage " run"