diff options
author | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2011-10-18 09:05:32 +0200 |
---|---|---|
committer | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2011-11-24 21:16:05 +0100 |
commit | 0a25b9e2b934f07cfc820efc820187f77cb98875 (patch) | |
tree | 07435a2f4a5b2bf463ba4d3f08caf6d0bf52f9e7 | |
parent | 70ce8e3bb691d6533aef93a1ec300a8cfbd018d8 (diff) | |
download | latrace-0a25b9e2b934f07cfc820efc820187f77cb98875.tar.gz latrace-0a25b9e2b934f07cfc820efc820187f77cb98875.tar.xz latrace-0a25b9e2b934f07cfc820efc820187f77cb98875.zip |
fifo: Using shared config in fifo functions
Switching to shared config structure for all fifo object functions.
-rw-r--r-- | src/audit.c | 10 | ||||
-rw-r--r-- | src/config.h | 20 | ||||
-rw-r--r-- | src/fifo.c | 12 | ||||
-rw-r--r-- | src/run.c | 4 |
4 files changed, 23 insertions, 23 deletions
diff --git a/src/audit.c b/src/audit.c index a0468b2..6f46e22 100644 --- a/src/audit.c +++ b/src/audit.c @@ -109,13 +109,13 @@ static int sym_entry(const char *symname, void *ptr, int len; if (!pipe_fd) - pipe_fd = lt_fifo_create(&cfg, cfg.dir); + pipe_fd = lt_fifo_create(cfg.sh, cfg.dir); - len = lt_fifo_msym_get(&cfg, buf, LT_FIFO_MTYPE_ENTRY, &tv, + len = lt_fifo_msym_get(cfg.sh, buf, LT_FIFO_MTYPE_ENTRY, &tv, (char*) symname, lib_to, argbuf, argdbuf); free_argbuf(argret, argbuf, argdbuf); - return lt_fifo_send(&cfg, pipe_fd, buf, len); + return lt_fifo_send(cfg.sh, pipe_fd, buf, len); } indent_depth++; @@ -159,11 +159,11 @@ static int sym_exit(const char *symname, void *ptr, char buf[LT_FIFO_MSG_MAXLEN]; int len; - len = lt_fifo_msym_get(&cfg, buf, LT_FIFO_MTYPE_EXIT, &tv, + len = lt_fifo_msym_get(cfg.sh, buf, LT_FIFO_MTYPE_EXIT, &tv, (char*) symname, lib_to, argbuf, argdbuf); free_argbuf(argret, argbuf, argdbuf); - return lt_fifo_send(&cfg, pipe_fd, buf, len); + return lt_fifo_send(cfg.sh, pipe_fd, buf, len); } lt_out_exit(cfg.sh, &tv, syscall(SYS_gettid), diff --git a/src/config.h b/src/config.h index cf9c64c..e05e8c6 100644 --- a/src/config.h +++ b/src/config.h @@ -339,18 +339,18 @@ int lt_config(struct lt_config_app *cfg, int argc, char **argv); int lt_run(struct lt_config_app *cfg); /* fifo */ -int lt_fifo_create(struct lt_config_audit *cfg, char *dir); -int lt_fifo_open(struct lt_config_app *cfg, char *dir, char *name); +int lt_fifo_create(struct lt_config_shared *cfg, char *dir); +int lt_fifo_open(struct lt_config_shared *cfg, char *dir, char *name); int lt_fifo_notify_init(struct lt_config_app *cfg, char *dir); void lt_fifo_notify_cleanup(struct lt_config_app *cfg); -int lt_fifo_send(struct lt_config_audit *cfg, int fd, char *buf, int len); -int lt_fifo_recv(struct lt_config_app *cfg, struct lt_thread *t, - void *buf, int bufsize); -int lt_fifo_msym_get(struct lt_config_audit *cfg, char *buf, int type, - struct timeval *tv, char *symname, char *libto, - char *arg, char *argd); -int lt_fifo_mtext_get(struct lt_config_audit *cfg, char *buf, - struct timeval *tv, char *text); +int lt_fifo_send(struct lt_config_shared *cfg, int fd, char *buf, int len); +int lt_fifo_recv(struct lt_config_shared *cfg, struct lt_thread *t, + void *buf, int bufsize); +int lt_fifo_msym_get(struct lt_config_shared *cfg, char *buf, int type, + struct timeval *tv, char *symname, char *libto, + char *arg, char *argd); +int lt_fifo_mtext_get(struct lt_config_shared *cfg, char *buf, + struct timeval *tv, char *text); /* counts */ int lt_stats_init(struct lt_config_app *cfg); @@ -50,7 +50,7 @@ static char *get_notify_dir(char *dir) return notify_dir; } -int lt_fifo_create(struct lt_config_audit *cfg, char *dir) +int lt_fifo_create(struct lt_config_shared *cfg, char *dir) { int fd; char fifo[100]; @@ -71,7 +71,7 @@ int lt_fifo_create(struct lt_config_audit *cfg, char *dir) return fd; } -int lt_fifo_open(struct lt_config_app *cfg, char *dir, char *name) +int lt_fifo_open(struct lt_config_shared *cfg, char *dir, char *name) { int fd; char str_fifo[LT_MAXFILE]; @@ -132,7 +132,7 @@ void lt_fifo_notify_cleanup(struct lt_config_app *cfg) close(cfg->notify_fd); } -int lt_fifo_send(struct lt_config_audit *cfg, int fd, char *buf, int len) +int lt_fifo_send(struct lt_config_shared *cfg, int fd, char *buf, int len) { static unsigned int written = 0; @@ -147,7 +147,7 @@ int lt_fifo_send(struct lt_config_audit *cfg, int fd, char *buf, int len) return 0; } -int lt_fifo_recv(struct lt_config_app *cfg, struct lt_thread *t, void *buf, +int lt_fifo_recv(struct lt_config_shared *cfg, struct lt_thread *t, void *buf, int bufsize) { static unsigned int red = 0; @@ -183,7 +183,7 @@ int lt_fifo_recv(struct lt_config_app *cfg, struct lt_thread *t, void *buf, return 0; } -int lt_fifo_msym_get(struct lt_config_audit *cfg, char *buf, int type, +int lt_fifo_msym_get(struct lt_config_shared *cfg, char *buf, int type, struct timeval *tv, char *symname, char *libto, char *arg, char *argd) { @@ -219,7 +219,7 @@ int lt_fifo_msym_get(struct lt_config_audit *cfg, char *buf, int type, return len; } -int lt_fifo_mtext_get(struct lt_config_audit *cfg, char *buf, +int lt_fifo_mtext_get(struct lt_config_shared *cfg, char *buf, struct timeval *tv, char *text) { struct lt_fifo_mtext *m = (struct lt_fifo_mtext*) buf; @@ -102,7 +102,7 @@ static int get_fifo(struct lt_config_app *cfg, int fd_notify, PRINT_VERBOSE(cfg, 1, "thread id %d, got fifo: %s\n", *pid, event->name); - return lt_fifo_open(cfg, dir, event->name); + return lt_fifo_open(cfg->sh, dir, event->name); } static int process_fifo(struct lt_config_app *cfg, struct lt_thread *t) @@ -112,7 +112,7 @@ static int process_fifo(struct lt_config_app *cfg, struct lt_thread *t) struct lt_fifo_msym *msym = (struct lt_fifo_msym*) buf; struct lt_fifo_mtext *mtext = (struct lt_fifo_mtext*) buf; - if (-1 == lt_fifo_recv(cfg, t, mbase, LT_FIFO_MSG_MAXLEN)) + if (-1 == lt_fifo_recv(cfg->sh, t, mbase, LT_FIFO_MSG_MAXLEN)) return -1; if (lt_sh(cfg, counts)) { |