aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/traceevent
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2018-01-11 19:47:45 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-01-17 08:22:03 -0500
commit38d70b7ca1769f26c0b79f3c08ff2cc949712b59 (patch)
tree9399da6650219182747b8c8309183a5ecf19effa /tools/lib/traceevent
parentd63444739bee6acfa9a834515da17f9cec544505 (diff)
tools lib traceevent: Simplify pointer print logic and fix %pF
When processing %pX in pretty_print(), simplify the logic slightly by incrementing the ptr to the format string if isalnum(ptr[1]) is true. This follows the logic a bit more closely to what is in the kernel. Also, this fixes a small bug where %pF was not giving the offset of the function. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/r/20180112004822.260262257@goodmis.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/traceevent')
-rw-r--r--tools/lib/traceevent/event-parse.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 87757eabbb08..8757dd64e42c 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -4956,21 +4956,22 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
4956 else 4956 else
4957 ls = 2; 4957 ls = 2;
4958 4958
4959 if (*(ptr+1) == 'F' || *(ptr+1) == 'f' || 4959 if (isalnum(ptr[1]))
4960 *(ptr+1) == 'S' || *(ptr+1) == 's') {
4961 ptr++; 4960 ptr++;
4961
4962 if (*ptr == 'F' || *ptr == 'f' ||
4963 *ptr == 'S' || *ptr == 's') {
4962 show_func = *ptr; 4964 show_func = *ptr;
4963 } else if (*(ptr+1) == 'M' || *(ptr+1) == 'm') { 4965 } else if (*ptr == 'M' || *ptr == 'm') {
4964 print_mac_arg(s, *(ptr+1), data, size, event, arg); 4966 print_mac_arg(s, *ptr, data, size, event, arg);
4965 ptr++;
4966 arg = arg->next; 4967 arg = arg->next;
4967 break; 4968 break;
4968 } else if (*(ptr+1) == 'I' || *(ptr+1) == 'i') { 4969 } else if (*ptr == 'I' || *ptr == 'i') {
4969 int n; 4970 int n;
4970 4971
4971 n = print_ip_arg(s, ptr+1, data, size, event, arg); 4972 n = print_ip_arg(s, ptr, data, size, event, arg);
4972 if (n > 0) { 4973 if (n > 0) {
4973 ptr += n; 4974 ptr += n - 1;
4974 arg = arg->next; 4975 arg = arg->next;
4975 break; 4976 break;
4976 } 4977 }