@@ -1477,6 +1477,47 @@ static int event_read_fields(struct tep_event *event, struct tep_format_field **
/* read the rest of the type */
for (;;) {
type = read_token(&token);
+
+ /* On some configs, gcc __attribute((*)) may appear. */
+ if (type == TEP_EVENT_DELIM && strcmp(token, "(") == 0 &&
+ last_token && strcmp(last_token, "__attribute__") == 0) {
+ char *new_token;
+
+ breakpoint();
+ if (read_expected(TEP_EVENT_DELIM, "(") < 0) {
+ free(last_token);
+ goto fail;
+ }
+ free(token);
+ if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) {
+ free(last_token);
+ goto fail;
+ }
+ new_token = realloc(last_token,
+ strlen(last_token) +
+ strlen(token) + 5);
+ if (!new_token) {
+ free(last_token);
+ goto fail;
+ }
+ last_token = new_token;
+ strcat(last_token, "((");
+ strcat(last_token, token);
+ strcat(last_token, "))");
+ free(token);
+ token = NULL;
+
+ if (read_expected(TEP_EVENT_DELIM, ")") < 0) {
+ free(last_token);
+ goto fail;
+ }
+ if (read_expected(TEP_EVENT_DELIM, ")") < 0) {
+ free(last_token);
+ goto fail;
+ }
+ continue;
+ }
+
if (type == TEP_EVENT_ITEM ||
(type == TEP_EVENT_OP && strcmp(token, "*") == 0) ||
/*