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: default avatarDavid 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ccb3a829
......@@ -135,36 +135,6 @@ void event_format__print(struct event_format *event,
return event_format__fprintf(event, cpu, data, size, stdout);
}
void parse_proc_kallsyms(struct pevent *pevent,
char *file, unsigned int size __maybe_unused)
{
unsigned long long addr;
char *func;
char *line;
char *next = NULL;
char *addr_str;
char *mod;
char *fmt = NULL;
line = strtok_r(file, "\n", &next);
while (line) {
mod = NULL;
addr_str = strtok_r(line, " ", &fmt);
addr = strtoull(addr_str, NULL, 16);
/* skip character */
strtok_r(NULL, " ", &fmt);
func = strtok_r(NULL, "\t", &fmt);
mod = strtok_r(NULL, "]", &fmt);
/* truncate the extra '[' */
if (mod)
mod = mod + 1;
pevent_register_function(pevent, func, addr, mod);
line = strtok_r(NULL, "\n", &next);
}
}
void parse_ftrace_printk(struct pevent *pevent,
char *file, unsigned int size __maybe_unused)
{
......
......@@ -162,25 +162,23 @@ static char *read_string(void)
static int read_proc_kallsyms(struct pevent *pevent)
{
unsigned int size;
char *buf;
size = read4(pevent);
if (!size)
return 0;
buf = malloc(size + 1);
if (buf == NULL)
return -1;
if (do_read(buf, size) < 0) {
free(buf);
return -1;
}
buf[size] = '\0';
parse_proc_kallsyms(pevent, buf, size);
free(buf);
/*
* Just skip it, now that we configure libtraceevent to use the
* tools/perf/ symbol resolver.
*
* We need to skip it so that we can continue parsing old perf.data
* files, that contains this /proc/kallsyms payload.
*
* Newer perf.data files will have just the 4-bytes zeros "kallsyms
* payload", so that older tools can continue reading it and interpret
* it as "no kallsyms payload is present".
*/
lseek(input_fd, size, SEEK_CUR);
trace_data_size += size;
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment