diff options
| author | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2010-04-29 13:21:40 +0200 |
|---|---|---|
| committer | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2010-04-29 13:21:40 +0200 |
| commit | ac8317f173570794e8b95ea9986bbec73710746e (patch) | |
| tree | 8de91733eadc33665c8a26e04fed101f45b38ca3 /src | |
| parent | 6185ff535959e371daf3f789ba2ac9af4a5698e9 (diff) | |
| download | latrace-ac8317f173570794e8b95ea9986bbec73710746e.tar.gz latrace-ac8317f173570794e8b95ea9986bbec73710746e.tar.xz latrace-ac8317f173570794e8b95ea9986bbec73710746e.zip | |
refactoring sysdep configuration
Diffstat (limited to 'src')
| -rw-r--r-- | src/args.c | 12 | ||||
| -rw-r--r-- | src/config.h | 4 | ||||
| -rw-r--r-- | src/sysdeps/x86_64/args.h | 20 |
3 files changed, 36 insertions, 0 deletions
@@ -729,6 +729,18 @@ int lt_args_init(struct lt_config_shared *cfg) ret = -1; } +#if defined(LT_ARGS_ARCH_CONF) + /* Some architectures provides specific + * configuration file. */ + if (lt_args_buf_open(cfg, lt_args_arch_conf(cfg))) + return -1; + + if (yyparse()) { + printf("failed to parse config file %s\n", file); + ret = -1; + } +#endif + if (fclose(yyin)) { perror("failed to close " LT_ARGS_DEF_CONF); return -1; diff --git a/src/config.h b/src/config.h index bacc107..893381d 100644 --- a/src/config.h +++ b/src/config.h @@ -449,4 +449,8 @@ do { \ } while(0) +#if defined(__x86_64) +#include "sysdeps/x86_64/args.h" +#endif + #endif // !CONFIG_H diff --git a/src/sysdeps/x86_64/args.h b/src/sysdeps/x86_64/args.h new file mode 100644 index 0000000..a215c07 --- /dev/null +++ b/src/sysdeps/x86_64/args.h @@ -0,0 +1,20 @@ +#ifndef ARGS_H +#define ARGS_H + +#define LT_ARGS_ARCH_CONF 1 + +struct lt_config_shared; + +static inline +char* lt_args_arch_conf(struct lt_config_shared *cfg) +{ + static char buf[LT_MAXFILE]; + + sprintf(buf, "%s/%s", + LT_ARGS_DEF_DIR, + "sysdeps/x86_64/latrace.conf"); + + return buf; +} + +#endif /* ARGS_H */ |
