tools lib traceevent: Remove unused install targets
PATCH 1/6 tools lib traceevent: Remove unused install targets
From: Namhyung Kim <[email protected]>
The html_install, img_install, install_plugin and install_python are unused in the Makefile. Get rid of them.
--- tools/lib/traceevent/Makefile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
tools/lib/traceevent/Makefile +2 -7
@@ -39,13 +39,8 @@ bindir_relative = bin bindir = $(prefix)/$(bindir_relative) man_dir = $(prefix)/share/man man_dir_SQ = '$(subst ','\'',$(man_dir))' -html_install = $(prefix)/share/kernelshark/html -html_install_SQ = '$(subst ','\'',$(html_install))' -img_install = $(prefix)/share/kernelshark/html/images -img_install_SQ = '$(subst ','\'',$(img_install))' -export man_dir man_dir_SQ html_install html_install_SQ INSTALL -export img_install img_install_SQ +export man_dir man_dir_SQ INSTALL export DESTDIR DESTDIR_SQ # copy a bit from Linux kbuild
@@ -300,7 +295,7 @@ define do_install $(INSTALL) $1 '$(DESTDIR_SQ)$2' endef -install_lib: all_cmd install_plugins install_python +install_lib: all_cmd $(Q)$(call do_install,$(LIB_FILE),$(bindir_SQ)) install: install_lib
Signature · 1 line
1.7.11.7
PATCH 2/6 tools lib traceevent: Get rid of unused gui target
From: Namhyung Kim <[email protected]>
It's came from trace-cmd's kernelshark which is not a part of libtraceevent.
--- tools/lib/traceevent/Makefile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
tools/lib/traceevent/Makefile +1 -7
@@ -71,10 +71,7 @@ $(if $(BUILD_OUTPUT),, \ all: sub-make -gui: force - $(call build_output, all_cmd) - -$(filter-out gui,$(MAKECMDGOALS)): sub-make +$(MAKECMDGOALS): sub-make sub-make: force $(call build_output, $(MAKECMDGOALS))
@@ -253,9 +250,6 @@ define check_deps $(RM) $@.$$$$ endef -$(gui_deps): ks_version.h -$(non_gui_deps): tc_version.h - $(all_deps): .%.d: $(src)/%.c $(Q)$(call check_deps)
Signature · 1 line
1.7.11.7
PATCH 3/6 tools lib traceevent: Add const qualifier to string arguments
In reply to Namhyung KimFrom: Namhyung Kim <[email protected]>
If pevent_register_event_handler() received a string literal as @sys_name or @event_name parameter, it emitted a warning about const qualifier removal. Since they're not modified in the function we can make it have const qualifier.
--- tools/lib/traceevent/event-parse.c | 7 +++---- tools/lib/traceevent/event-parse.h | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-)
tools/lib/traceevent/event-parse.c +3 -4
@@ -5450,10 +5450,9 @@ int pevent_register_print_function(struct pevent *pevent,* If @id is >= 0, then it is used to find the event. * else @sys_name and @event_name are used. */ -int pevent_register_event_handler (struct pevent *pevent, -int id,char *sys_name,char *event_name, -pevent_event_handler_func func, -void *context) +int pevent_register_event_handler (struct pevent *pevent,int id, +const char *sys_name,const char *event_name, +pevent_event_handler_func func,void *context) {struct event_format *event;struct event_handler *handle;
tools/lib/traceevent/event-parse.h +2 -1
@@ -561,7 +561,8 @@ int pevent_print_num_field(struct trace_seq *s, const char *fmt, struct event_format *event, const char *name, struct pevent_record *record, int err); -int pevent_register_event_handler (struct pevent *pevent,int id,char *sys_name,char *event_name, +int pevent_register_event_handler (struct pevent *pevent,int id, +const char *sys_name,const char *event_name,pevent_event_handler_func func,void *context); int pevent_register_print_function(struct pevent *pevent, pevent_func_handler func,
Signature · 1 line
1.7.11.7
PATCH 4/6 tools lib traceevent: Add trace_seq_reset()
In reply to Namhyung KimFrom: Namhyung Kim <[email protected]>
Sometimes it'd be useful if existing trace_seq can be reused. But currently it's impossible since there's no API to reset the trace_seq. Let's add trace_seq_reset() for this case.
--- tools/lib/traceevent/event-parse.h | 1 + tools/lib/traceevent/trace-seq.c | 13 +++++++++++++ 2 files changed, 14 insertions(+)
tools/lib/traceevent/event-parse.h +1 -0
@@ -69,6 +69,7 @@ struct trace_seq { };void trace_seq_init (struct trace_seq *s); +void trace_seq_reset (struct trace_seq *s);void trace_seq_destroy (struct trace_seq *s);extern int trace_seq_printf (struct trace_seq *s,const char *fmt, ...)
tools/lib/traceevent/trace-seq.c +13 -0
@@ -49,6 +49,19 @@ void trace_seq_init(struct trace_seq *s) }/** +* trace_seq_reset - re-initialize the trace_seq structure +* @s: a pointer to the trace_seq structure to reset +*/ +void trace_seq_reset (struct trace_seq *s) +{ +if (!s) +return ; +TRACE_SEQ_CHECK (s); + s->len =0 ; + s->readpos =0 ; +} + +/** * trace_seq_destroy - free up memory of a trace_seq * @s: a pointer to the trace_seq to free the buffer *
Signature · 1 line
1.7.11.7
PATCH 5/6 tools lib traceevent: Add page_size field to pevent
In reply to Namhyung KimFrom: Namhyung Kim <[email protected]>
It's for saving the page size of traced system.
--- tools/lib/traceevent/event-parse.h | 11 +++++++++++ 1 file changed, 11 insertions(+)
tools/lib/traceevent/event-parse.h +11 -0
@@ -400,6 +400,7 @@ struct pevent {int cpus;int long_size; +int page_size;struct cmdline *cmdlines;struct cmdline_list *cmdlist;
@@ -621,6 +622,16 @@ static inline void pevent_set_long_size(struct pevent *pevent, int long_size) pevent->long_size = long_size; } +static inline int pevent_get_page_size (struct pevent *pevent) +{ +return pevent->page_size; +} + +static inline void pevent_set_page_size (struct pevent *pevent,int _page_size) +{ + pevent->page_size = _page_size; +} +static inline int pevent_is_file_bigendian (struct pevent *pevent) {return pevent->file_bigendian;
Signature · 1 line
1.7.11.7
Re: [PATCH 5/6] tools lib traceevent: Add page_size field to pevent
Quoted 3 lines · Namhyung Kim
From: Namhyung Kim <[email protected]>
It's for saving the page size of traced system.
Can you add a bit more detail in the change log about why this patch is necessary.
Thanks,
-- Steve
Quoted 37 lines
Cc Steven Rostedt <[email protected]>Cc Frederic Weisbecker <[email protected]>Signed-off-by Namhyung Kim <[email protected]>--- tools/lib/traceevent/event-parse.h | 11 +++++++++++ 1 file changed, 11 insertions(+)tools/lib/traceevent/event-parse.h +11
-0@@ -400,6 +400,7 @@ struct pevent {int cpus;int long_size; +int page_size;struct cmdline *cmdlines;struct cmdline_list *cmdlist;@@ -621,6 +622,16 @@ static inline void pevent_set_long_size(struct pevent *pevent, int long_size) pevent->long_size = long_size; } +static inline int pevent_get_page_size (struct pevent *pevent) +{ +return pevent->page_size; +} + +static inline void pevent_set_page_size (struct pevent *pevent,int _page_size) +{ + pevent->page_size = _page_size; +} +static inline int pevent_is_file_bigendian (struct pevent *pevent) {return pevent->file_bigendian;
Steven Rostedt
Acked-byRe: [PATCH 5/6] tools lib traceevent: Add page_size field to pevent
Quoted 7 lines · Steven Rostedt
Quoted 3 lines · Namhyung Kim
From: Namhyung Kim <[email protected]>
It's for saving the page size of traced system.
Can you add a bit more detail in the change log about why this patch is necessary.
For now, you can add my
for all but this patch.
I just want to know more about this patch before I ack it.
Thanks,
-- Steve
Re: [PATCH 5/6] tools lib traceevent: Add page_size field to pevent
Hi Steve,
2013-04-11 (목), 10:40 -0400, Steven Rostedt:
Quoted 6 lines · Steven Rostedt
Quoted 5 lines · Namhyung Kim
Quoted 3 lines
From: Namhyung Kim <[email protected]>
It's for saving the page size of traced system.
Quoted 8 lines
Quoted 2 lines
Can you add a bit more detail in the change log about why this patch is necessary.
For now, you can add my
Acked-by Steven Rostedt <[email protected]>for all but this patch.
Thanks!
Quoted 2 lines
I just want to know more about this patch before I ack it.
The page size of traced system can be different than current system's because the recorded data file might be analyzed in a different machine. In this case we should use original page size of traced system when accessing the data file, so this information needs to be saved.
Thanks,
Namhyung
Re: [PATCH 5/6] tools lib traceevent: Add page_size field to pevent
Quoted 7 lines · Namhyung Kim
Quoted 2 lines
I just want to know more about this patch before I ack it.
The page size of traced system can be different than current system's because the recorded data file might be analyzed in a different machine. In this case we should use original page size of traced system when accessing the data file, so this information needs to be saved.
I understand that, it's just strange that it's not used anywhere in the library, or the patch series (that I can find).
It would make more sense if another patch used this new interface. I'm sure new code will, but the patch should be part of a patch series that needs it.
Thanks,
-- Steve
Re: [PATCH 5/6] tools lib traceevent: Add page_size field to pevent
2013-04-12 (금), 21:26 -0400, Steven Rostedt:
Quoted 10 lines · Namhyung Kim
Quoted 8 lines
Quoted 3 lines
I just want to know more about this patch before I ack it.
The page size of traced system can be different than current system's because the recorded data file might be analyzed in a different machine. In this case we should use original page size of traced system when accessing the data file, so this information needs to be saved.
Quoted 6 lines
I understand that, it's just strange that it's not used anywhere in the library, or the patch series (that I can find).
It would make more sense if another patch used this new interface. I'm sure new code will, but the patch should be part of a patch series that needs it.
I know you knew that already. :)
I think it only affects trace-cmd as it's the only user that accesses raw ring-buffer contents for now. I found it during writing code also accesses the ring buffer (with kbuffer code) - perf ftrace. :)
But the code is in a very early stage and needs to handle so many things before posting to the list. So I just wanted to post a part of the preparation first.
Thanks,
Namhyung
Re: [PATCH 5/6] tools lib traceevent: Add page_size field to pevent
Quoted 9 lines · Namhyung Kim
2013-04-12 (금), 21:26 -0400, Steven Rostedt:
I think it only affects trace-cmd as it's the only user that accesses raw ring-buffer contents for now. I found it during writing code also accesses the ring buffer (with kbuffer code) - perf ftrace. :)
But the code is in a very early stage and needs to handle so many things before posting to the list. So I just wanted to post a part of the preparation first.
I understand. But people tend to not like things in upstream that has no user. If Arnaldo wants to include it, that's his decision. I'm just worried that if it takes a while before your other work gets mainline, people might start sending patches to remove that code and your stuff will suddenly break.
-- Steve
Re: [PATCH 5/6] tools lib traceevent: Add page_size field to pevent
2013-04-12 (금), 22:14 -0400, Steven Rostedt:
Quoted 11 lines · Namhyung Kim
Quoted 9 lines
2013-04-12 (금), 21:26 -0400, Steven Rostedt:
I think it only affects trace-cmd as it's the only user that accesses raw ring-buffer contents for now. I found it during writing code also accesses the ring buffer (with kbuffer code) - perf ftrace. :)
But the code is in a very early stage and needs to handle so many things before posting to the list. So I just wanted to post a part of the preparation first.
Quoted 5 lines
I understand. But people tend to not like things in upstream that has no user. If Arnaldo wants to include it, that's his decision. I'm just worried that if it takes a while before your other work gets mainline, people might start sending patches to remove that code and your stuff will suddenly break.
Fair enough.
Arnaldo, what do you think? Do you want me to resend it with new description now?
Thanks,
Namhyung
Re: [PATCH 5/6] tools lib traceevent: Add page_size field to pevent
In reply to Namhyung KimEm Sat, Apr 13, 2013 at 10:17:26AM +0900, Namhyung Kim escreveu:
Quoted 6 lines
Quoted 1 line
I just want to know more about this patch before I ack it.
The page size of traced system can be different than current system's because the recorded data file might be analyzed in a different machine. In this case we should use original page size of traced system when accessing the data file, so this information needs to be saved.
Excellent explanation! So good it deserves being in the changelog commit!
8-)
- Arnaldo
PATCH 6/6 tools lib traceevent: Port kbuffer parser routines
In reply to Namhyung KimFrom: Namhyung Kim <[email protected]>
kbuffer code is for parsing ftrace ring-buffer binary data and used for trace-cmd. Move the code here in order to be used more widely.
--- tools/lib/traceevent/Makefile | 1 + tools/lib/traceevent/kbuffer-parse.c | 732 +++++++++++++++++++++++++++++++++++ tools/lib/traceevent/kbuffer.h | 67 ++++ 3 files changed, 800 insertions(+) create mode 100644 tools/lib/traceevent/kbuffer-parse.c create mode 100644 tools/lib/traceevent/kbuffer.h
tools/lib/traceevent/Makefile +1 -0
@@ -181,6 +181,7 @@ $(obj)/%.o: $(src)/%.c $(Q)$(call do_compile) PEVENT_LIB_OBJS = event-parse.o trace-seq.o parse-filter.o parse-utils.o +PEVENT_LIB_OBJS += kbuffer-parse.o ALL_OBJS = $(PEVENT_LIB_OBJS)
tools/lib/traceevent/kbuffer-parse.c new file +732 -0
732 lines not on this page · raw message
tools/lib/traceevent/kbuffer.h new file +67 -0
67 lines not on this page · raw message
Signature · 1 line
1.7.11.7