diff options
Diffstat (limited to 'trace-util.c')
-rw-r--r-- | trace-util.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/trace-util.c b/trace-util.c index fbdb071..a3ee05c 100644 --- a/trace-util.c +++ b/trace-util.c | |||
@@ -69,7 +69,8 @@ int __weak bigendian(void) | |||
69 | return *ptr == 0x01020304; | 69 | return *ptr == 0x01020304; |
70 | } | 70 | } |
71 | 71 | ||
72 | void parse_cmdlines(char *file, int size __unused) | 72 | void parse_cmdlines(struct pevent *pevent, |
73 | char *file, int size __unused) | ||
73 | { | 74 | { |
74 | char *comm; | 75 | char *comm; |
75 | char *line; | 76 | char *line; |
@@ -80,12 +81,13 @@ void parse_cmdlines(char *file, int size __unused) | |||
80 | while (line) { | 81 | while (line) { |
81 | sscanf(line, "%d %as", &pid, | 82 | sscanf(line, "%d %as", &pid, |
82 | (float *)(void *)&comm); /* workaround gcc warning */ | 83 | (float *)(void *)&comm); /* workaround gcc warning */ |
83 | pevent_register_comm(comm, pid); | 84 | pevent_register_comm(pevent, comm, pid); |
84 | line = strtok_r(NULL, "\n", &next); | 85 | line = strtok_r(NULL, "\n", &next); |
85 | } | 86 | } |
86 | } | 87 | } |
87 | 88 | ||
88 | void parse_proc_kallsyms(char *file, unsigned int size __unused) | 89 | void parse_proc_kallsyms(struct pevent *pevent, |
90 | char *file, unsigned int size __unused) | ||
89 | { | 91 | { |
90 | unsigned long long addr; | 92 | unsigned long long addr; |
91 | char *func; | 93 | char *func; |
@@ -111,7 +113,7 @@ void parse_proc_kallsyms(char *file, unsigned int size __unused) | |||
111 | if (mod) | 113 | if (mod) |
112 | mod[strlen(mod) - 1] = 0; | 114 | mod[strlen(mod) - 1] = 0; |
113 | 115 | ||
114 | pevent_register_function(func, addr, mod); | 116 | pevent_register_function(pevent, func, addr, mod); |
115 | 117 | ||
116 | line = strtok_r(NULL, "\n", &next); | 118 | line = strtok_r(NULL, "\n", &next); |
117 | } | 119 | } |
@@ -136,7 +138,8 @@ void parse_ftrace_printk(char *file, unsigned int size __unused) | |||
136 | } | 138 | } |
137 | } | 139 | } |
138 | 140 | ||
139 | static int load_plugin(const char *path, const char *file) | 141 | static int load_plugin(struct pevent *pevent, |
142 | const char *path, const char *file) | ||
140 | { | 143 | { |
141 | char *plugin; | 144 | char *plugin; |
142 | void *handle; | 145 | void *handle; |
@@ -164,13 +167,13 @@ static int load_plugin(const char *path, const char *file) | |||
164 | } | 167 | } |
165 | 168 | ||
166 | printf("registering plugin: %s\n", plugin); | 169 | printf("registering plugin: %s\n", plugin); |
167 | ret = func(); | 170 | ret = func(pevent); |
168 | 171 | ||
169 | /* dlclose ?? */ | 172 | /* dlclose ?? */ |
170 | return ret; | 173 | return ret; |
171 | } | 174 | } |
172 | 175 | ||
173 | int trace_load_plugins(void) | 176 | int trace_load_plugins(struct pevent *pevent) |
174 | { | 177 | { |
175 | struct dirent *dent; | 178 | struct dirent *dent; |
176 | struct stat st; | 179 | struct stat st; |
@@ -209,7 +212,7 @@ int trace_load_plugins(void) | |||
209 | strcmp(name, "..") == 0) | 212 | strcmp(name, "..") == 0) |
210 | continue; | 213 | continue; |
211 | 214 | ||
212 | load_plugin(path, name); | 215 | load_plugin(pevent, path, name); |
213 | } | 216 | } |
214 | 217 | ||
215 | fail: | 218 | fail: |