* [PATCH 1/2] perf: Explicitly handle known default print arg type in perf scripting
@ 2012-05-22 14:30 fweisbec
2012-05-22 14:30 ` [PATCH 2/2] perf: Rename struct event to struct event_format in perl engine fweisbec
2012-05-23 15:21 ` [tip:perf/core] perf script: Explicitly handle known default print arg type tip-bot for Frederic Weisbecker
0 siblings, 2 replies; 4+ messages in thread
From: fweisbec @ 2012-05-22 14:30 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ingo Molnar
Cc: LKML, Frederic Weisbecker, Peter Zijlstra, Namhyung Kim,
Steven Rostedt, Tom Zanussi, Frederic Weisbecker
From: Frederic Weisbecker <fweisbec@gmail.com>
Handle the print argument types brought by the new libparsevent in perl
scripting engine.
PRINT_BSTRING and PRINT_DYNAMIC_ARRAY are treated just like strings
and thus don't require specific processing.
But PRINT_FUNC need specific plugins which are not yet handled, lets
warn if we meet this case.
This fixes:
util/scripting-engines/trace-event-perl.c: In function define_event_symbol:
util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_BSTRING not handled in switch
util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_DYNAMIC_ARRAY not handled in switch
util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_FUNC not handled in switch
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@redhat.com>
---
.../perf/util/scripting-engines/trace-event-perl.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
index e30749e..d50658b 100644
--- a/tools/perf/util/scripting-engines/trace-event-perl.c
+++ b/tools/perf/util/scripting-engines/trace-event-perl.c
@@ -209,6 +209,8 @@ static void define_event_symbols(struct event *event,
define_symbolic_values(args->symbol.symbols, ev_name,
cur_field_name);
break;
+ case PRINT_BSTRING:
+ case PRINT_DYNAMIC_ARRAY:
case PRINT_STRING:
break;
case PRINT_TYPE:
@@ -220,7 +222,9 @@ static void define_event_symbols(struct event *event,
define_event_symbols(event, ev_name, args->op.left);
define_event_symbols(event, ev_name, args->op.right);
break;
+ case PRINT_FUNC:
default:
+ pr_err("Unsupported print arg type\n");
/* we should warn... */
return;
}
--
1.7.5.4
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 2/2] perf: Rename struct event to struct event_format in perl engine 2012-05-22 14:30 [PATCH 1/2] perf: Explicitly handle known default print arg type in perf scripting fweisbec @ 2012-05-22 14:30 ` fweisbec 2012-05-23 15:22 ` [tip:perf/core] perf script: " tip-bot for Frederic Weisbecker 2012-05-23 15:21 ` [tip:perf/core] perf script: Explicitly handle known default print arg type tip-bot for Frederic Weisbecker 1 sibling, 1 reply; 4+ messages in thread From: fweisbec @ 2012-05-22 14:30 UTC (permalink / raw) To: Arnaldo Carvalho de Melo, Ingo Molnar Cc: LKML, Frederic Weisbecker, Peter Zijlstra, Namhyung Kim, Steven Rostedt, Tom Zanussi, Frederic Weisbecker From: Frederic Weisbecker <fweisbec@gmail.com> While migrating to the libtraceevent, the perl scripting engine missed this structure rename. This fixes: util/scripting-engines/trace-event-perl.c: In function "find_cache_event": util/scripting-engines/trace-event-perl.c:244: error: assignment from incompatible pointer type util/scripting-engines/trace-event-perl.c:248: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:248: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:250: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c: In function "perl_process_tracepoint": util/scripting-engines/trace-event-perl.c:286: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:286: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:307: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c: In function "perl_generate_script": util/scripting-engines/trace-event-perl.c:498: error: passing argument 1 of "trace_find_next_event" from incompatible pointer type util/scripting-engines/../trace-event.h:56: note: expected "struct event_format *" but argument is of type "struct event *" util/scripting-engines/trace-event-perl.c:498: error: assignment from incompatible pointer type util/scripting-engines/trace-event-perl.c:499: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:499: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:513: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:532: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:556: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:569: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:570: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:579: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:580: error: dereferencing pointer to incomplete type Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tom Zanussi <tzanussi@gmail.com> Signed-off-by: Frederic Weisbecker <fweisbec@redhat.com> --- .../perf/util/scripting-engines/trace-event-perl.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index d50658b..4c1b3d7 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c @@ -56,7 +56,7 @@ INTERP my_perl; #define FTRACE_MAX_EVENT \ ((1 << (sizeof(unsigned short) * 8)) - 1) -struct event *events[FTRACE_MAX_EVENT]; +struct event_format *events[FTRACE_MAX_EVENT]; extern struct scripting_context *scripting_context; @@ -181,7 +181,7 @@ static void define_flag_field(const char *ev_name, LEAVE; } -static void define_event_symbols(struct event *event, +static void define_event_symbols(struct event_format *event, const char *ev_name, struct print_arg *args) { @@ -233,10 +233,10 @@ static void define_event_symbols(struct event *event, define_event_symbols(event, ev_name, args->next); } -static inline struct event *find_cache_event(int type) +static inline struct event_format *find_cache_event(int type) { static char ev_name[256]; - struct event *event; + struct event_format *event; if (events[type]) return events[type]; @@ -262,7 +262,7 @@ static void perl_process_tracepoint(union perf_event *pevent __unused, static char handler[256]; unsigned long long val; unsigned long s, ns; - struct event *event; + struct event_format *event; int type; int pid; int cpu = sample->cpu; @@ -450,7 +450,7 @@ static int perl_stop_script(void) static int perl_generate_script(const char *outfile) { - struct event *event = NULL; + struct event_format *event = NULL; struct format_field *f; char fname[PATH_MAX]; int not_first, count; -- 1.7.5.4 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:perf/core] perf script: Rename struct event to struct event_format in perl engine 2012-05-22 14:30 ` [PATCH 2/2] perf: Rename struct event to struct event_format in perl engine fweisbec @ 2012-05-23 15:22 ` tip-bot for Frederic Weisbecker 0 siblings, 0 replies; 4+ messages in thread From: tip-bot for Frederic Weisbecker @ 2012-05-23 15:22 UTC (permalink / raw) To: linux-tip-commits Cc: linux-kernel, acme, hpa, mingo, tzanussi, peterz, namhyung.kim, fweisbec, rostedt, fweisbec, tglx Commit-ID: 8784eb7497b928de33a715e26da2bd51d424bec1 Gitweb: http://git.kernel.org/tip/8784eb7497b928de33a715e26da2bd51d424bec1 Author: Frederic Weisbecker <fweisbec@gmail.com> AuthorDate: Tue, 22 May 2012 16:30:49 +0200 Committer: Arnaldo Carvalho de Melo <acme@redhat.com> CommitDate: Tue, 22 May 2012 12:32:29 -0300 perf script: Rename struct event to struct event_format in perl engine While migrating to the libtraceevent, the perl scripting engine missed this structure rename. This fixes: util/scripting-engines/trace-event-perl.c: In function "find_cache_event": util/scripting-engines/trace-event-perl.c:244: error: assignment from incompatible pointer type util/scripting-engines/trace-event-perl.c:248: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:248: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:250: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c: In function "perl_process_tracepoint": util/scripting-engines/trace-event-perl.c:286: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:286: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:307: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c: In function "perl_generate_script": util/scripting-engines/trace-event-perl.c:498: error: passing argument 1 of "trace_find_next_event" from incompatible pointer type util/scripting-engines/../trace-event.h:56: note: expected "struct event_format *" but argument is of type "struct event *" util/scripting-engines/trace-event-perl.c:498: error: assignment from incompatible pointer type util/scripting-engines/trace-event-perl.c:499: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:499: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:513: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:532: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:556: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:569: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:570: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:579: error: dereferencing pointer to incomplete type util/scripting-engines/trace-event-perl.c:580: error: dereferencing pointer to incomplete type Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@redhat.com> Cc: Frederic Weisbecker <fweisbec@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tom Zanussi <tzanussi@gmail.com> Link: http://lkml.kernel.org/r/1337697049-30251-2-git-send-email-fweisbec@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- .../perf/util/scripting-engines/trace-event-perl.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index d50658b..4c1b3d7 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c @@ -56,7 +56,7 @@ INTERP my_perl; #define FTRACE_MAX_EVENT \ ((1 << (sizeof(unsigned short) * 8)) - 1) -struct event *events[FTRACE_MAX_EVENT]; +struct event_format *events[FTRACE_MAX_EVENT]; extern struct scripting_context *scripting_context; @@ -181,7 +181,7 @@ static void define_flag_field(const char *ev_name, LEAVE; } -static void define_event_symbols(struct event *event, +static void define_event_symbols(struct event_format *event, const char *ev_name, struct print_arg *args) { @@ -233,10 +233,10 @@ static void define_event_symbols(struct event *event, define_event_symbols(event, ev_name, args->next); } -static inline struct event *find_cache_event(int type) +static inline struct event_format *find_cache_event(int type) { static char ev_name[256]; - struct event *event; + struct event_format *event; if (events[type]) return events[type]; @@ -262,7 +262,7 @@ static void perl_process_tracepoint(union perf_event *pevent __unused, static char handler[256]; unsigned long long val; unsigned long s, ns; - struct event *event; + struct event_format *event; int type; int pid; int cpu = sample->cpu; @@ -450,7 +450,7 @@ static int perl_stop_script(void) static int perl_generate_script(const char *outfile) { - struct event *event = NULL; + struct event_format *event = NULL; struct format_field *f; char fname[PATH_MAX]; int not_first, count; ^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:perf/core] perf script: Explicitly handle known default print arg type 2012-05-22 14:30 [PATCH 1/2] perf: Explicitly handle known default print arg type in perf scripting fweisbec 2012-05-22 14:30 ` [PATCH 2/2] perf: Rename struct event to struct event_format in perl engine fweisbec @ 2012-05-23 15:21 ` tip-bot for Frederic Weisbecker 1 sibling, 0 replies; 4+ messages in thread From: tip-bot for Frederic Weisbecker @ 2012-05-23 15:21 UTC (permalink / raw) To: linux-tip-commits Cc: linux-kernel, acme, hpa, mingo, tzanussi, peterz, namhyung.kim, fweisbec, rostedt, fweisbec, tglx Commit-ID: e326e7524531c5c6de4a8cf8eeed60b4a9f47637 Gitweb: http://git.kernel.org/tip/e326e7524531c5c6de4a8cf8eeed60b4a9f47637 Author: Frederic Weisbecker <fweisbec@gmail.com> AuthorDate: Tue, 22 May 2012 16:30:48 +0200 Committer: Arnaldo Carvalho de Melo <acme@redhat.com> CommitDate: Tue, 22 May 2012 12:31:26 -0300 perf script: Explicitly handle known default print arg type Handle the print argument types brought by the new libparsevent in perl scripting engine. PRINT_BSTRING and PRINT_DYNAMIC_ARRAY are treated just like strings and thus don't require specific processing. But PRINT_FUNC need specific plugins which are not yet handled, lets warn if we meet this case. This fixes: util/scripting-engines/trace-event-perl.c: In function define_event_symbol: util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_BSTRING not handled in switch util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_DYNAMIC_ARRAY not handled in switch util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_FUNC not handled in switch Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@redhat.com> Cc: Frederic Weisbecker <fweisbec@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tom Zanussi <tzanussi@gmail.com> Link: http://lkml.kernel.org/r/1337697049-30251-1-git-send-email-fweisbec@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- .../perf/util/scripting-engines/trace-event-perl.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index e30749e..d50658b 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c @@ -209,6 +209,8 @@ static void define_event_symbols(struct event *event, define_symbolic_values(args->symbol.symbols, ev_name, cur_field_name); break; + case PRINT_BSTRING: + case PRINT_DYNAMIC_ARRAY: case PRINT_STRING: break; case PRINT_TYPE: @@ -220,7 +222,9 @@ static void define_event_symbols(struct event *event, define_event_symbols(event, ev_name, args->op.left); define_event_symbols(event, ev_name, args->op.right); break; + case PRINT_FUNC: default: + pr_err("Unsupported print arg type\n"); /* we should warn... */ return; } ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-23 15:22 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-05-22 14:30 [PATCH 1/2] perf: Explicitly handle known default print arg type in perf scripting fweisbec 2012-05-22 14:30 ` [PATCH 2/2] perf: Rename struct event to struct event_format in perl engine fweisbec 2012-05-23 15:22 ` [tip:perf/core] perf script: " tip-bot for Frederic Weisbecker 2012-05-23 15:21 ` [tip:perf/core] perf script: Explicitly handle known default print arg type tip-bot for Frederic Weisbecker
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
Powered by JetHome