summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjolsa@redhat.com <jolsa@redhat.com>2011-08-15 19:10:35 +0200
committerJiri Olsa <Jiri Olsa jolsa@redhat.com>2011-11-24 21:20:27 +0100
commitc6bb0e49bed67c0cd53cd725f5efa09e6e94df56 (patch)
treec75a3e4e9d07b4385c1658b997edc5e5630bcf36
parenta7fcfb0f70301b09cea3ba59338aaa5a01bbefcb (diff)
downloadlatrace-c6bb0e49bed67c0cd53cd725f5efa09e6e94df56.tar.gz
latrace-c6bb0e49bed67c0cd53cd725f5efa09e6e94df56.tar.xz
latrace-c6bb0e49bed67c0cd53cd725f5efa09e6e94df56.zip
error simulation: add starting point for GO definition
-rw-r--r--src/config-bison.y13
-rw-r--r--src/config-flex.l1
-rw-r--r--src/error.c5
-rw-r--r--src/error.h5
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;