diff options
Diffstat (limited to 'src/error.c')
-rw-r--r-- | src/error.c | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/src/error.c b/src/error.c index 68cf302..7d1a418 100644 --- a/src/error.c +++ b/src/error.c @@ -15,8 +15,7 @@ int lt_error_app(struct lt_config_app *cfg, struct lt_error_app *error_app) struct lt_error_app_go *go, *g; struct lt_error_app_run *run, *r; - if (!error_app->prog || - !error_app->dir) + if (!error_app->prog) return -EINVAL; app = malloc(sizeof(*app)); @@ -317,14 +316,16 @@ static int prepare_config(struct lt_config_app *cfg, char *dir, { PRINT_VERBOSE(cfg, 1, "dir '%s'\n", dir); - if (prepare_config_trace(cfg, dir)) - return -1; + if (!app->no_storage) { + if (prepare_config_trace(cfg, dir)) + return -1; - if (prepare_config_stat(cfg, dir)) - return -1; + if (prepare_config_stat(cfg, dir)) + return -1; - if (prepare_config_tty(cfg, dir)) - return -1; + if (prepare_config_tty(cfg, dir)) + return -1; + } if (prepare_config_args(cfg, app, run)) return -1; @@ -335,12 +336,15 @@ static int prepare_config(struct lt_config_app *cfg, char *dir, return 0; } -static void post_config(struct lt_config_app *cfg) +static void post_config(struct lt_config_app *cfg, + struct lt_error_app *app) { - if ((lt_sh(cfg, pipe)) && (*lt_sh(cfg, output))) - fclose(lt_sh(cfg, fout)); + if (!app->no_storage) { + if ((lt_sh(cfg, pipe)) && (*lt_sh(cfg, output))) + fclose(lt_sh(cfg, fout)); - fclose(cfg->fstat); + fclose(cfg->fstat); + } } static int process_run(struct lt_config_app *cfg, @@ -352,7 +356,8 @@ static int process_run(struct lt_config_app *cfg, { static char dir[LT_MAXFILE]; - if (dir_run(cfg, dir, dir_base, run, n)) + if (!app->no_storage && + dir_run(cfg, dir, dir_base, run, n)) return -1; PRINT_VERBOSE(cfg, 1, "dir '%s'\n", dir); @@ -360,9 +365,12 @@ static int process_run(struct lt_config_app *cfg, if (prepare_config(cfg, dir, app, run, n)) return -1; + if (app->no_storage) + printf("latrace error simulation [%s] n = %d\n", app->name, n); + lt_run(cfg); - post_config(cfg); + post_config(cfg, app); return 0; } @@ -374,7 +382,8 @@ static int process_go(struct lt_config_app *cfg, char *dir_base, static char dir[LT_MAXFILE]; int i; - if (dir_go(cfg, dir, dir_base, go)) + if (!app->no_storage && + dir_go(cfg, dir, dir_base, go)) return -1; PRINT_VERBOSE(cfg, 1, "dir '%s'\n", dir); @@ -398,7 +407,8 @@ int lt_error_run(struct lt_config_app *cfg) printf("latrace error simulation [%s]\n", app->name); - if (dir_base(cfg, app, dir)) + if (!app->no_storage && + dir_base(cfg, app, dir)) return -1; PRINT_VERBOSE(cfg, 1, "dir '%s'\n", dir); @@ -656,5 +666,6 @@ int lt_error_app_init(struct lt_error_app *app) lt_init_list_head(&app->head_go); lt_init_list_head(&app->head_return); lt_init_list_head(&app->list); + app->no_storage = 1; return 0; } |