Namhyung Kim | 22 Jun 2012 10:10
Gravatar

[PATCH 1/2] tools lib traceevent: Teach [ce]tags about libtraceeevent error codes

From: Namhyung Kim <namhyung.kim <at> lge.com>

As we use a macro trick to sync each error codes with its
description string, teach [ce]tags to process them properly.

This patch modifies the libtraceevent's Makefile not a
kernel one.

Cc: Frederic Weisbecker <fweisbec <at> gmail.com>
Suggested-by: Steven Rostedt <rostedt <at> goodmis.org>
Link: http://lkml.kernel.org/n/tip-3101nsbg52glxdqih291qj74 <at> git.kernel.org
Signed-off-by: Namhyung Kim <namhyung <at> kernel.org>
---
 tools/lib/traceevent/Makefile |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index 56daa768b9e3..15f6eb8f4935 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
 <at>  <at>  -284,11 +284,13  <at>  <at>  TRACEEVENT-CFLAGS: force

 tags:	force
 	$(RM) tags
-	find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px
+	find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px \
+	--regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/'

 TAGS:	force
 	$(RM) TAGS
(Continue reading)

Namhyung Kim | 22 Jun 2012 10:10
Gravatar

[PATCH 2/2] tools lib traceevent: Check string is really printable

From: Namhyung Kim <namhyung.kim <at> lge.com>

When libtraceevent parses format fields, it assumes that
array of 1 byte is string but it's not always true. The
kvm_emulate_insn contains 15 u8 array of insn that contains
(binary) instructions. Thus when it's printed, it'll have
broken output like below:

  kvm_emulate_insn:     [FAILED TO PARSE] rip=3238197797 csbase=0 len=2 \
  insn=<89>P^]<B4>& flags=5 failed=0

With this patch:

  kvm_emulate_insn:     [FAILED TO PARSE] rip=3238197797 csbase=0 len=2 \
  insn=ARRAY[89, 10, 5d, c3, 8d, b4, 26, 00, 00, 00, 00, 55, 89, e5, 3e] flags=5 failed=0

Suggested-by: Steven Rostedt <rostedt <at> goodmis.org>
Link: http://lkml.kernel.org/n/tip-c5ypr2k43uuc57ru6b8vi7ax <at> git.kernel.org
Signed-off-by: Namhyung Kim <namhyung <at> kernel.org>
---
 tools/lib/traceevent/event-parse.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 853b604b6240..eb195cbc841c 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
 <at>  <at>  -3655,6 +3655,16  <at>  <at>  static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size,
 	trace_seq_printf(s, fmt, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
 }
(Continue reading)

Arnaldo Carvalho de Melo | 28 Jun 2012 18:17

Re: [PATCH 2/2] tools lib traceevent: Check string is really printable

Em Fri, Jun 22, 2012 at 05:10:15PM +0900, Namhyung Kim escreveu:
> From: Namhyung Kim <namhyung.kim <at> lge.com>
> 
> When libtraceevent parses format fields, it assumes that
> array of 1 byte is string but it's not always true. The
> kvm_emulate_insn contains 15 u8 array of insn that contains
> (binary) instructions. Thus when it's printed, it'll have
> broken output like below:

Thanks, applied to perf/core.

- Arnaldo
tip-bot for Namhyung Kim | 6 Jul 2012 12:53

[tip:perf/core] tools lib traceevent: Check string is really printable

Commit-ID:  600da3cfe19496485c5d8d52ff703590a0bd53f6
Gitweb:     http://git.kernel.org/tip/600da3cfe19496485c5d8d52ff703590a0bd53f6
Author:     Namhyung Kim <namhyung.kim <at> lge.com>
AuthorDate: Fri, 22 Jun 2012 17:10:15 +0900
Committer:  Arnaldo Carvalho de Melo <acme <at> redhat.com>
CommitDate: Fri, 29 Jun 2012 13:28:12 -0300

tools lib traceevent: Check string is really printable

When libtraceevent parses format fields, it assumes that array of 1 byte
is string but it's not always true. The kvm_emulate_insn contains 15 u8
array of insn that contains (binary) instructions. Thus when it's
printed, it'll have broken output like below:

  kvm_emulate_insn:     [FAILED TO PARSE] rip=3238197797 csbase=0 len=2 \
  insn=<89>P^]<B4>& flags=5 failed=0

With this patch:

  kvm_emulate_insn:     [FAILED TO PARSE] rip=3238197797 csbase=0 len=2 \
  insn=ARRAY[89, 10, 5d, c3, 8d, b4, 26, 00, 00, 00, 00, 55, 89, e5, 3e] flags=5 failed=0

Suggested-by: Steven Rostedt <rostedt <at> goodmis.org>
Signed-off-by: Namhyung Kim <namhyung <at> kernel.org>
Cc: Frederic Weisbecker <fweisbec <at> gmail.com>
Cc: Ingo Molnar <mingo <at> kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra <at> chello.nl>
Cc: Steven Rostedt <rostedt <at> goodmis.org>
Link: http://lkml.kernel.org/r/1340352615-20737-2-git-send-email-namhyung <at> kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme <at> redhat.com>
(Continue reading)

Arnaldo Carvalho de Melo | 28 Jun 2012 18:14

Re: [PATCH 1/2] tools lib traceevent: Teach [ce]tags about libtraceeevent error codes

Em Fri, Jun 22, 2012 at 05:10:14PM +0900, Namhyung Kim escreveu:
> From: Namhyung Kim <namhyung.kim <at> lge.com>
> 
> As we use a macro trick to sync each error codes with its
> description string, teach [ce]tags to process them properly.
> 
> This patch modifies the libtraceevent's Makefile not a
> kernel one.

Thanks, applied to perf/core.

- Arnaldo
tip-bot for Namhyung Kim | 6 Jul 2012 12:51

[tip:perf/core] tools lib traceevent: Teach [ce] tags about libtraceeevent error codes

Commit-ID:  6545e3a8f0666b60b26202a5271a94f7cd9601a8
Gitweb:     http://git.kernel.org/tip/6545e3a8f0666b60b26202a5271a94f7cd9601a8
Author:     Namhyung Kim <namhyung.kim <at> lge.com>
AuthorDate: Fri, 22 Jun 2012 17:10:14 +0900
Committer:  Arnaldo Carvalho de Melo <acme <at> redhat.com>
CommitDate: Fri, 29 Jun 2012 13:28:12 -0300

tools lib traceevent: Teach [ce]tags about libtraceeevent error codes

As we use a macro trick to sync each error codes with its description
string, teach [ce]tags to process them properly.

This patch modifies the libtraceevent's Makefile not a kernel one.

Suggested-by: Steven Rostedt <rostedt <at> goodmis.org>
Signed-off-by: Namhyung Kim <namhyung <at> kernel.org>
Link: http://lkml.kernel.org/n/tip-3101nsbg52glxdqih291qj74 <at> git.kernel.org
Cc: Frederic Weisbecker <fweisbec <at> gmail.com>
Cc: Ingo Molnar <mingo <at> kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra <at> chello.nl>
Cc: Steven Rostedt <rostedt <at> goodmis.org>
Link: http://lkml.kernel.org/r/1340352615-20737-1-git-send-email-namhyung <at> kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme <at> redhat.com>
---
 tools/lib/traceevent/Makefile |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index 423f4b8..34a577e 100644
--- a/tools/lib/traceevent/Makefile
(Continue reading)


Gmane