tracing/syscalls: Fix the output of syscalls with no arguments
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 tracing/syscalls: Fix the output of syscalls with no arguments
Before:
# echo 1 > events/syscalls/sys_enter_sync/enable
# cat events/syscalls/sys_enter_sync/format
...
field:int nr; offset:12; size:4;print fmt: "# sync
# cat trace
...
sync-8950 [000] 2366.087670: sys_sync(After:
# echo 1 > events/syscalls/sys_enter_sync/enable
# cat events/syscalls/sys_enter_sync/format
...
field:int nr; offset:12; size:4;print fmt: ""
# sync
# cat trace
sync-2134 [001] 136.780735: sys_sync()Reported-by Masami Hiramatsu <[email protected]>
Signed-off-by Li Zefan <[email protected]>
---
sorry for the repost, but I forgot to CC LKML.
--- kernel/trace/trace_syscalls.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-)
kernel/trace/trace_syscalls.c +16 -9
@@ -46,15 +46,22 @@ print_syscall_enter(struct trace_iterator *iter, int flags)return TRACE_TYPE_PARTIAL_LINE ; }/* parameter values */ - ret =trace_seq_printf (s,"%s: %lx%s " , entry->args[i], + ret =trace_seq_printf (s,"%s: %lx%s" , entry->args[i], trace->args[i], - i == entry->nb_args -1 ?")" :"," ); + i == entry->nb_args -1 ?"" :", " );if (!ret)return TRACE_TYPE_PARTIAL_LINE ; } + ret =trace_seq_putc (s,')' ); +if (!ret) +return TRACE_TYPE_PARTIAL_LINE ; + end: -trace_seq_printf (s,"\n" ); + ret =trace_seq_putc (s,'\n' ); +if (!ret) +return TRACE_TYPE_PARTIAL_LINE ; +return TRACE_TYPE_HANDLED ; }
@@ -129,24 +136,24 @@ int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s) offset +=sizeof (unsigned long ); } -trace_seq_printf (s,"\nprint fmt: \"" ); +trace_seq_puts (s,"\nprint fmt: \"" );for (i =0 ; i < entry->nb_args; i++) { ret =trace_seq_printf (s,"%s: 0x%%0%zulx%s" , entry->args[i],sizeof (unsigned long ), - i == entry->nb_args -1 ?"\", " :", " ); + i == entry->nb_args -1 ?"" :", " );if (!ret)return 0 ; } +trace_seq_putc (s,'"' );for (i =0 ; i < entry->nb_args; i++) { - ret =trace_seq_printf (s,"((unsigned long)(REC->%s))%s" , - entry->args[i], - i == entry->nb_args -1 ?"\n" :", " ); + ret =trace_seq_printf (s,", ((unsigned long)(REC->%s))" , + entry->args[i]);if (!ret)return 0 ; } -return ret; +return trace_seq_putc (s,'\n' ); }int syscall_exit_format (struct ftrace_event_call *call,struct trace_seq *s)
-- 1.6.3
Commit-ID: 4539f07701b3f743580d19dc5d655fb8d21b0a3c Gitweb: http://git.kernel.org/tip/4539f07701b3f743580d19dc5d655fb8d21b0a3c Author: Li Zefan <[email protected]> AuthorDate: Thu, 20 Aug 2009 16:13:35 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 20 Aug 2009 12:12:22 +0200
tracing/syscalls: Fix the output of syscalls with no arguments
Before:
# echo 1 > events/syscalls/sys_enter_sync/enable
# cat events/syscalls/sys_enter_sync/format
...
field:int nr; offset:12; size:4;print fmt: "# sync
# cat trace
...
sync-8950 [000] 2366.087670: sys_sync(After:
# echo 1 > events/syscalls/sys_enter_sync/enable
# cat events/syscalls/sys_enter_sync/format
...
field:int nr; offset:12; size:4;print fmt: ""
# sync
# cat trace
sync-2134 [001] 136.780735: sys_sync()Reported-by Masami Hiramatsu <[email protected]>
Signed-off-by Li Zefan <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Jason Baron <[email protected]>
Cc Masami Hiramatsu <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- kernel/trace/trace_syscalls.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-)
kernel/trace/trace_syscalls.c +16 -9
@@ -46,15 +46,22 @@ print_syscall_enter(struct trace_iterator *iter, int flags)return TRACE_TYPE_PARTIAL_LINE ; }/* parameter values */ - ret =trace_seq_printf (s,"%s: %lx%s " , entry->args[i], + ret =trace_seq_printf (s,"%s: %lx%s" , entry->args[i], trace->args[i], - i == entry->nb_args -1 ?")" :"," ); + i == entry->nb_args -1 ?"" :", " );if (!ret)return TRACE_TYPE_PARTIAL_LINE ; } + ret =trace_seq_putc (s,')' ); +if (!ret) +return TRACE_TYPE_PARTIAL_LINE ; + end: -trace_seq_printf (s,"\n" ); + ret =trace_seq_putc (s,'\n' ); +if (!ret) +return TRACE_TYPE_PARTIAL_LINE ; +return TRACE_TYPE_HANDLED ; }
@@ -129,24 +136,24 @@ int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s) offset +=sizeof (unsigned long ); } -trace_seq_printf (s,"\nprint fmt: \"" ); +trace_seq_puts (s,"\nprint fmt: \"" );for (i =0 ; i < entry->nb_args; i++) { ret =trace_seq_printf (s,"%s: 0x%%0%zulx%s" , entry->args[i],sizeof (unsigned long ), - i == entry->nb_args -1 ?"\", " :", " ); + i == entry->nb_args -1 ?"" :", " );if (!ret)return 0 ; } +trace_seq_putc (s,'"' );for (i =0 ; i < entry->nb_args; i++) { - ret =trace_seq_printf (s,"((unsigned long)(REC->%s))%s" , - entry->args[i], - i == entry->nb_args -1 ?"\n" :", " ); + ret =trace_seq_printf (s,", ((unsigned long)(REC->%s))" , + entry->args[i]);if (!ret)return 0 ; } -return ret; +return trace_seq_putc (s,'\n' ); }int syscall_exit_format (struct ftrace_event_call *call,struct trace_seq *s)
Quoted 19 lines · Li Zefan
Before:
# echo 1 > events/syscalls/sys_enter_sync/enable # cat events/syscalls/sys_enter_sync/format ... field:int nr; offset:12; size:4;print fmt: "# sync
# cat trace ... sync-8950 [000] 2366.087670: sys_sync(After:
# echo 1 > events/syscalls/sys_enter_sync/enable # cat events/syscalls/sys_enter_sync/format ... field:int nr; offset:12; size:4;
Quoted 8 lines
print fmt: ""
# sync # cat trace sync-2134 [001] 136.780735: sys_sync()Reported-by Masami Hiramatsu <[email protected]>Signed-off-by Li Zefan <[email protected]>---
Thanks for fixing this!