lkml.org 
[lkml]   [2011]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[RFC][PATCH 7/8] perf/events: Add flag/symbol format_flags
    From: Tom Zanussi <tzanussi@gmail.com>

    This is a port of commit eb9a42caa7a92
    perf trace: Add flag/symbolic format_flags
    of the old trace-event-parse.c to the new event-parse.c that
    was written by Tom Zanussi and forward ported by Steven Rostedt.

    Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    ---
    tools/lib/events/event-parse.c | 15 +++++++++++++++
    1 files changed, 15 insertions(+), 0 deletions(-)

    diff --git a/tools/lib/events/event-parse.c b/tools/lib/events/event-parse.c
    index dff66ad..3e9af2c 100644
    --- a/tools/lib/events/event-parse.c
    +++ b/tools/lib/events/event-parse.c
    @@ -39,6 +39,9 @@ static const char *input_buf;
    static unsigned long long input_buf_ptr;
    static unsigned long long input_buf_siz;

    +static int is_flag_field;
    +static int is_symbolic_field;
    +
    static int show_warning = 1;

    #define do_warning(fmt, ...) \
    @@ -1789,6 +1792,16 @@ process_entry(struct event_format *event __unused, struct print_arg *arg,
    arg->type = PRINT_FIELD;
    arg->field.name = field;

    + if (is_flag_field) {
    + arg->field.field = pevent_find_any_field(event, arg->field.name);
    + arg->field.field->flags |= FIELD_IS_FLAG;
    + is_flag_field = 0;
    + } else if (is_symbolic_field) {
    + arg->field.field = pevent_find_any_field(event, arg->field.name);
    + arg->field.field->flags |= FIELD_IS_SYMBOLIC;
    + is_symbolic_field = 0;
    + }
    +
    type = read_token(&token);
    *tok = token;

    @@ -2393,10 +2406,12 @@ process_function(struct event_format *event, struct print_arg *arg,

    if (strcmp(token, "__print_flags") == 0) {
    free_token(token);
    + is_flag_field = 1;
    return process_flags(event, arg, tok);
    }
    if (strcmp(token, "__print_symbolic") == 0) {
    free_token(token);
    + is_symbolic_field = 1;
    return process_symbols(event, arg, tok);
    }
    if (strcmp(token, "__get_str") == 0) {
    --
    1.7.5.4



    \
     
     \ /
      Last update: 2011-08-05 23:17    [W:0.022 / U:29.944 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site