trace-cmd: Use libtraceevent for parsing tracefs files
PATCH 1/1 trace-cmd: Use libtraceevent for parsing tracefs files
From: "Steven Rostedt (VMware)" <[email protected]>
Now that libtraceevent has the functionality to parse and load the mappings of kallsyms, saved_cmdlines and printk_formats, use them instead of having the functionality in libtracecmd.
Signed-off-by Steven Rostedt (VMware) <[email protected]>
--- .../include/private/trace-cmd-private.h | 3 - lib/trace-cmd/trace-input.c | 6 +- lib/trace-cmd/trace-util.c | 91 ------------------- tracecmd/trace-read.c | 5 +- 4 files changed, 6 insertions(+), 99 deletions(-)
lib/trace-cmd/include/private/trace-cmd-private.h +0 -3
@@ -27,9 +27,6 @@#define TSCNSEC_CLOCK "tsc2nsec" -void tracecmd_parse_cmdlines (struct tep_handle *pevent,char *file,int size); -void tracecmd_parse_proc_kallsyms (struct tep_handle *pevent,char *file,unsigned int size); -void tracecmd_parse_ftrace_printk (struct tep_handle *pevent,char *file,unsigned int size);struct tep_plugin_list *trace_load_plugins (struct tep_handle *tep,int flags);int *tracecmd_add_id (int *list,int id,int len);
lib/trace-cmd/trace-input.c +3 -3
@@ -743,7 +743,7 @@ static int read_proc_kallsyms(struct tracecmd_input *handle) } buf[size] =0 ; -tracecmd_parse_proc_kallsyms (pevent, buf, size); +tep_parse_kallsyms (pevent, buf);free (buf);
@@ -775,7 +775,7 @@ static int read_ftrace_printk(struct tracecmd_input *handle) buf[size] =0 ; -tracecmd_parse_ftrace_printk (handle->pevent, buf, size); +tep_parse_printk_formats (handle->pevent, buf);free (buf);
@@ -2970,7 +2970,7 @@ static int read_and_parse_cmdlines(struct tracecmd_input *handle)if (read_data_and_size (handle, &cmdlines, &size) <0 )return -1 ; cmdlines[size] =0 ; -tracecmd_parse_cmdlines (pevent, cmdlines, size); +tep_parse_saved_cmdlines (pevent, cmdlines);free (cmdlines); handle->file_state =TRACECMD_FILE_CMD_LINES ;
lib/trace-cmd/trace-util.c +0 -91
97 lines not on this page · raw message
tracecmd/trace-read.c +3 -2
@@ -1413,12 +1413,13 @@ static void add_functions(struct tep_handle *pevent, const char *file)if (ret <0 )die ("Can't stat file %s" , file); - buf =malloc (st.st_size); + buf =malloc (st.st_size +1 );if (!buf)die ("Failed to allocate for function buffer" );read_file_fd (fd, buf, st.st_size); + buf[st.st_size] ='\0' ;close (fd); -tracecmd_parse_proc_kallsyms (pevent, buf, st.st_size); +tep_parse_kallsyms (pevent, buf);free (buf); }
Signature · 1 line
2.29.2