diff options
Diffstat (limited to 'tools/perf/util/trace-event-parse.c')
| -rw-r--r-- | tools/perf/util/trace-event-parse.c | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index d6ef414075a6..069f261b225c 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
| @@ -691,11 +691,6 @@ static int __read_expected(enum event_type expect, const char *str, | |||
| 691 | return ret; | 691 | return ret; |
| 692 | } | 692 | } |
| 693 | 693 | ||
| 694 | static int read_expected_warn(enum event_type expect, const char *str, bool warn) | ||
| 695 | { | ||
| 696 | return __read_expected(expect, str, 1, warn); | ||
| 697 | } | ||
| 698 | |||
| 699 | static int read_expected(enum event_type expect, const char *str) | 694 | static int read_expected(enum event_type expect, const char *str) |
| 700 | { | 695 | { |
| 701 | return __read_expected(expect, str, 1, true); | 696 | return __read_expected(expect, str, 1, true); |
| @@ -3104,90 +3099,6 @@ static void print_args(struct print_arg *args) | |||
| 3104 | } | 3099 | } |
| 3105 | } | 3100 | } |
| 3106 | 3101 | ||
| 3107 | static void parse_header_field(const char *field, | ||
| 3108 | int *offset, int *size, bool warn) | ||
| 3109 | { | ||
| 3110 | char *token; | ||
| 3111 | int type; | ||
| 3112 | |||
| 3113 | if (read_expected(EVENT_ITEM, "field") < 0) | ||
| 3114 | return; | ||
| 3115 | if (read_expected(EVENT_OP, ":") < 0) | ||
| 3116 | return; | ||
| 3117 | |||
| 3118 | /* type */ | ||
| 3119 | if (read_expect_type(EVENT_ITEM, &token) < 0) | ||
| 3120 | goto fail; | ||
| 3121 | free_token(token); | ||
| 3122 | |||
| 3123 | if (read_expected_warn(EVENT_ITEM, field, warn) < 0) | ||
| 3124 | return; | ||
| 3125 | if (read_expected(EVENT_OP, ";") < 0) | ||
| 3126 | return; | ||
| 3127 | if (read_expected(EVENT_ITEM, "offset") < 0) | ||
| 3128 | return; | ||
| 3129 | if (read_expected(EVENT_OP, ":") < 0) | ||
| 3130 | return; | ||
| 3131 | if (read_expect_type(EVENT_ITEM, &token) < 0) | ||
| 3132 | goto fail; | ||
| 3133 | *offset = atoi(token); | ||
| 3134 | free_token(token); | ||
| 3135 | if (read_expected(EVENT_OP, ";") < 0) | ||
| 3136 | return; | ||
| 3137 | if (read_expected(EVENT_ITEM, "size") < 0) | ||
| 3138 | return; | ||
| 3139 | if (read_expected(EVENT_OP, ":") < 0) | ||
| 3140 | return; | ||
| 3141 | if (read_expect_type(EVENT_ITEM, &token) < 0) | ||
| 3142 | goto fail; | ||
| 3143 | *size = atoi(token); | ||
| 3144 | free_token(token); | ||
| 3145 | if (read_expected(EVENT_OP, ";") < 0) | ||
| 3146 | return; | ||
| 3147 | type = read_token(&token); | ||
| 3148 | if (type != EVENT_NEWLINE) { | ||
| 3149 | /* newer versions of the kernel have a "signed" type */ | ||
| 3150 | if (type != EVENT_ITEM) | ||
| 3151 | goto fail; | ||
| 3152 | |||
| 3153 | if (strcmp(token, "signed") != 0) | ||
| 3154 | goto fail; | ||
| 3155 | |||
| 3156 | free_token(token); | ||
| 3157 | |||
| 3158 | if (read_expected(EVENT_OP, ":") < 0) | ||
| 3159 | return; | ||
| 3160 | |||
| 3161 | if (read_expect_type(EVENT_ITEM, &token)) | ||
| 3162 | goto fail; | ||
| 3163 | |||
| 3164 | free_token(token); | ||
| 3165 | if (read_expected(EVENT_OP, ";") < 0) | ||
| 3166 | return; | ||
| 3167 | |||
| 3168 | if (read_expect_type(EVENT_NEWLINE, &token)) | ||
| 3169 | goto fail; | ||
| 3170 | } | ||
| 3171 | fail: | ||
| 3172 | free_token(token); | ||
| 3173 | } | ||
| 3174 | |||
| 3175 | int parse_header_page(char *buf, unsigned long size) | ||
| 3176 | { | ||
| 3177 | init_input_buf(buf, size); | ||
| 3178 | |||
| 3179 | parse_header_field("timestamp", &header_page_ts_offset, | ||
| 3180 | &header_page_ts_size, true); | ||
| 3181 | parse_header_field("commit", &header_page_size_offset, | ||
| 3182 | &header_page_size_size, true); | ||
| 3183 | parse_header_field("overwrite", &header_page_overwrite_offset, | ||
| 3184 | &header_page_overwrite_size, false); | ||
| 3185 | parse_header_field("data", &header_page_data_offset, | ||
| 3186 | &header_page_data_size, true); | ||
| 3187 | |||
| 3188 | return 0; | ||
| 3189 | } | ||
| 3190 | |||
| 3191 | int parse_ftrace_file(char *buf, unsigned long size) | 3102 | int parse_ftrace_file(char *buf, unsigned long size) |
| 3192 | { | 3103 | { |
| 3193 | struct format_field *field; | 3104 | struct format_field *field; |
