diff options
author | jolsa@redhat.com <jolsa@redhat.com> | 2011-08-15 19:10:35 +0200 |
---|---|---|
committer | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2012-01-11 19:55:00 +0100 |
commit | 164a254c65d9d70c465bd3395fba6f400a7be1b5 (patch) | |
tree | c5c41ce4c40c448153eb0defb54ec9a424ff222e | |
parent | 1d5b19bf2536ef95203da132e791cf4333a4faf7 (diff) | |
download | latrace-164a254c65d9d70c465bd3395fba6f400a7be1b5.tar.gz latrace-164a254c65d9d70c465bd3395fba6f400a7be1b5.tar.xz latrace-164a254c65d9d70c465bd3395fba6f400a7be1b5.zip |
error simulation: add starting point for GO definition
-rw-r--r-- | src/config-bison.y | 13 | ||||
-rw-r--r-- | src/config-flex.l | 1 | ||||
-rw-r--r-- | src/error.c | 5 | ||||
-rw-r--r-- | src/error.h | 5 |
4 files changed, 17 insertions, 7 deletions
diff --git a/src/config-bison.y b/src/config-bison.y index 0e6b3ef..c93c802 100644 --- a/src/config-bison.y +++ b/src/config-bison.y @@ -73,7 +73,7 @@ static struct lt_list_head ln_names; %token OPT_ARGS_STRING_POINTER_LENGTH %token ERROR %token ERR_DO ERR_DIR ERR_RUN ERR_GO ERR_RETURN ERR_N -%token ERR_PROG ERR_ARGS ERR_FILTER ERR_SEQ +%token ERR_PROG ERR_ARGS ERR_FILTER ERR_SEQ ERR_START %union { @@ -372,14 +372,21 @@ error_go: ERR_GO NAME list_names_comma { if (lt_error_go(scfg, &error_app_go, &error_app, - strdup($2), 1, &ln_names)) + strdup($2), 0, 1, &ln_names)) ABORT("failed to add go"); } | ERR_GO NAME ERR_N '=' VALUE list_names_comma { if (lt_error_go(scfg, &error_app_go, &error_app, - strdup($2), $5, &ln_names)) + strdup($2), 0, $5, &ln_names)) + ABORT("failed to add go"); +} +| +ERR_GO NAME ERR_START '=' VALUE ERR_N '=' VALUE list_names_comma +{ + if (lt_error_go(scfg, &error_app_go, &error_app, + strdup($2), $5, $8, &ln_names)) ABORT("failed to add go"); } diff --git a/src/config-flex.l b/src/config-flex.l index 3b761d7..22855e4 100644 --- a/src/config-flex.l +++ b/src/config-flex.l @@ -126,6 +126,7 @@ ERROR { BEGIN(error); return ERROR; } <error>PROG { return ERR_PROG; } <error>ARGS { return ERR_ARGS; } <error>N { return ERR_N; } +<error>START { return ERR_START; } <error>FILTER { return ERR_FILTER; } <error>SEQ { return ERR_SEQ; } diff --git a/src/error.c b/src/error.c index 7d1a418..fefa87d 100644 --- a/src/error.c +++ b/src/error.c @@ -388,7 +388,7 @@ static int process_go(struct lt_config_app *cfg, char *dir_base, PRINT_VERBOSE(cfg, 1, "dir '%s'\n", dir); - for(i = 0; i < go->n; i++) { + for(i = go->start; i < (go->start + go->n); i++) { struct lt_error_app_run *run; lt_list_for_each_entry(run, &go->head_run, list_go) @@ -556,7 +556,7 @@ static struct lt_error_app_run *find_run(struct lt_config_app *cfg, int lt_error_go(struct lt_config_app *cfg, struct lt_error_app_go **go, struct lt_error_app *error_app, - char *name, int n, + char *name, int start, int n, struct lt_list_head *runs) { struct lt_error_app_go *app_go = *go; @@ -571,6 +571,7 @@ int lt_error_go(struct lt_config_app *cfg, lt_init_list_head(&app_go->list); app_go->n = n; + app_go->start = start; app_go->name = name; lt_list_for_each_entry_safe(ln, h, runs, list) { diff --git a/src/error.h b/src/error.h index 042d594..367e576 100644 --- a/src/error.h +++ b/src/error.h @@ -74,6 +74,7 @@ struct lt_error_app_run { struct lt_error_app_go { int n; + int start; char *name; struct lt_list_head head_run; @@ -100,7 +101,7 @@ int lt_error_app(struct lt_config_app *cfg, int lt_error_go(struct lt_config_app *cfg, struct lt_error_app_go **go, struct lt_error_app *error_app, - char *name, int n, + char *name, int start, int n, struct lt_list_head *runs); int lt_error_run_return(struct lt_config_app *cfg, struct lt_error_app_run **run, @@ -127,7 +128,7 @@ static inline int lt_error_app(struct lt_config_app *cfg, static inline int lt_error_go(struct lt_config_app *cfg, struct lt_error_app_go **go, struct lt_error_app *error_app, - char *name, int n, + char *name, int start, int n, struct lt_list_head *runs) { return -1; |