aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-07-22 15:48:16 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-07-23 21:51:11 -0400
commit4263cece22e3da94f16fbbcf71ce3807946d3ef3 (patch)
tree9d6e0db08577eefc8b3dc6112aabc15d790dc181
parentccb3a8294a7d346257b526702eabcb2faeb721ac (diff)
perf tools: Stop reading the kallsyms data from perf.data
As it is not used anymore, since 'perf script' switched to asking libtraceevent to use tools/perf's symbol resolution routines. Acked-by: David Ahern <dsahern@gmail.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/n/tip-4ilhofz4b7o8yokvutjt9yzz@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/trace-event-parse.c30
-rw-r--r--tools/perf/util/trace-event-read.c28
2 files changed, 13 insertions, 45 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index d4957418657e..8ff7d620d942 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -135,36 +135,6 @@ void event_format__print(struct event_format *event,
135 return event_format__fprintf(event, cpu, data, size, stdout); 135 return event_format__fprintf(event, cpu, data, size, stdout);
136} 136}
137 137
138void parse_proc_kallsyms(struct pevent *pevent,
139 char *file, unsigned int size __maybe_unused)
140{
141 unsigned long long addr;
142 char *func;
143 char *line;
144 char *next = NULL;
145 char *addr_str;
146 char *mod;
147 char *fmt = NULL;
148
149 line = strtok_r(file, "\n", &next);
150 while (line) {
151 mod = NULL;
152 addr_str = strtok_r(line, " ", &fmt);
153 addr = strtoull(addr_str, NULL, 16);
154 /* skip character */
155 strtok_r(NULL, " ", &fmt);
156 func = strtok_r(NULL, "\t", &fmt);
157 mod = strtok_r(NULL, "]", &fmt);
158 /* truncate the extra '[' */
159 if (mod)
160 mod = mod + 1;
161
162 pevent_register_function(pevent, func, addr, mod);
163
164 line = strtok_r(NULL, "\n", &next);
165 }
166}
167
168void parse_ftrace_printk(struct pevent *pevent, 138void parse_ftrace_printk(struct pevent *pevent,
169 char *file, unsigned int size __maybe_unused) 139 char *file, unsigned int size __maybe_unused)
170{ 140{
diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c
index 54d9e9b548a8..b67a0ccf5ab9 100644
--- a/tools/perf/util/trace-event-read.c
+++ b/tools/perf/util/trace-event-read.c
@@ -162,25 +162,23 @@ out:
162static int read_proc_kallsyms(struct pevent *pevent) 162static int read_proc_kallsyms(struct pevent *pevent)
163{ 163{
164 unsigned int size; 164 unsigned int size;
165 char *buf;
166 165
167 size = read4(pevent); 166 size = read4(pevent);
168 if (!size) 167 if (!size)
169 return 0; 168 return 0;
170 169 /*
171 buf = malloc(size + 1); 170 * Just skip it, now that we configure libtraceevent to use the
172 if (buf == NULL) 171 * tools/perf/ symbol resolver.
173 return -1; 172 *
174 173 * We need to skip it so that we can continue parsing old perf.data
175 if (do_read(buf, size) < 0) { 174 * files, that contains this /proc/kallsyms payload.
176 free(buf); 175 *
177 return -1; 176 * Newer perf.data files will have just the 4-bytes zeros "kallsyms
178 } 177 * payload", so that older tools can continue reading it and interpret
179 buf[size] = '\0'; 178 * it as "no kallsyms payload is present".
180 179 */
181 parse_proc_kallsyms(pevent, buf, size); 180 lseek(input_fd, size, SEEK_CUR);
182 181 trace_data_size += size;
183 free(buf);
184 return 0; 182 return 0;
185} 183}
186 184