diff options
author | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2012-01-11 23:45:18 +0100 |
---|---|---|
committer | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2012-01-11 23:45:18 +0100 |
commit | 50694d55abfdd0807e1617f84c905df330ed97a7 (patch) | |
tree | a736dab4985fcc98437a8249df251ff25a41a14d /src/error.c | |
parent | daafe68255b0fbae2d7c1d4c696538327037b067 (diff) | |
download | latrace-error_simulation5.tar.gz latrace-error_simulation5.tar.xz latrace-error_simulation5.zip |
changeserror_simulation5
Diffstat (limited to 'src/error.c')
-rw-r--r-- | src/error.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/error.c b/src/error.c index 48afa23..7f0d985 100644 --- a/src/error.c +++ b/src/error.c @@ -548,6 +548,27 @@ static int add_error_symbol(struct lt_config_app *cfg, char *name) return index; } +static int copy_start_info(struct lt_config_app *cfg, + struct lt_error_config *cfg_err, + struct lt_error_app_run *run) +{ + struct lt_error_start *start = &run->start; + + cfg_err->start = *start; + + if (start->type == LT_ERROR_START_TYPE_AFTER) { + if (start->after.name.sym) { + int index = add_error_symbol(cfg, start->after.name.sym); + if (index < 0) + return -ENOMEM; + cfg_err->start.after.name.index = index; + } else + cfg_err->start.after.name.index = -1; + } + + return 0; +} + static int prepare_config_error(struct lt_config_app *cfg, struct lt_error_app_run *run) { @@ -591,6 +612,10 @@ static int prepare_config_error(struct lt_config_app *cfg, sym->name, cfg_sym->keep, cfg_sym->ret); } + /* copy the start information */ + if (copy_start_info(cfg, cfg_err, run)) + return -ENOMEM; + cfg_err->names_size = cfg->error_symbols_size_names; cfg->error_config = cfg_err; return 0; @@ -928,6 +953,31 @@ int lt_error_run_args(struct lt_config_app *cfg, return 0; } +int lt_error_run_start_after(struct lt_config_app *cfg, + struct lt_error_app_run **run, + int is_entries, long cnt, char *sym) +{ + struct lt_error_app_run *app_run = app_run_get(cfg, run); + struct lt_error_start *start; + + if (!app_run) + return -ENOMEM; + + PRINT_VERBOSE(cfg, 1, "is_entries %d, cnt %ld, sym %s\n", + is_entries, cnt, sym); + + start->type = LT_ERROR_START_TYPE_AFTER; + + start = &app_run->start; + if (is_entries) + start->after.entries = cnt; + else + start->after.exits = cnt; + + start->after.name.sym = sym; + return 0; +} + static struct lt_error_app_run *find_run(struct lt_config_app *cfg, struct lt_error_app *error_app, char *name) |