perf script: Explicitly handle known default print arg type
authorFrederic Weisbecker <fweisbec@gmail.com>
Tue, 22 May 2012 14:30:48 +0000 (16:30 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 22 May 2012 15:31:26 +0000 (12:31 -0300)
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>
tools/perf/util/scripting-engines/trace-event-perl.c

index e30749e38a9b72d30d86486cc91924e10f6f15dc..d50658b7d9e0fb31b82649d18674175ffb0b62ed 100644 (file)
@@ -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;
        }