From patchwork Mon Apr 7 15:04:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 27905 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 262C120490 for ; Mon, 7 Apr 2014 15:07:16 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id n16sf28713741oag.1 for ; Mon, 07 Apr 2014 08:07:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=MXwPXqHD1EMN82raav3+YznApJVm8ft66JnlZiRLpTo=; b=ZFkqzV6OXQJxLzqSD2WbYB03JwzEbeKVogmYh6MH2vmGHpEG2TQf8Qy4A+E1u2NnZV R3uTNO6hptJEgtBWUgLscp0ikP5DJZagJXI0+wwQ2b3z4lZI/E4Ex9yS117enZNgs42o ERkDaIPWie0/CVwYaLJBmcTYbO5U9I8t+fVMKnkNbRaazr5ZQohCgiJlxKTiUnG96F/I Z+i+Tfa4NIqFoHyu93liimjBsIr9P1kvNZCEY+EQ/BTVbQgaXWqTv66exK8SFU33U7Mm GHcQcheWAb0nivNJ/219YhACMsmoDNT0vrlx1/1pypzT0xYd5N73zMMThR2DITrvOJPs /ceQ== X-Gm-Message-State: ALoCoQmN0vQCcRAb80qzJkBnlsT3K9exdjZ5WIcHMS8LiF11c2tJX0MM6uUexz+I+4wEk8aSaxEA X-Received: by 10.182.216.200 with SMTP id os8mr10538475obc.0.1396883235572; Mon, 07 Apr 2014 08:07:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.230 with SMTP id m93ls1776301qge.87.gmail; Mon, 07 Apr 2014 08:07:15 -0700 (PDT) X-Received: by 10.220.92.135 with SMTP id r7mr24577871vcm.11.1396883235488; Mon, 07 Apr 2014 08:07:15 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id wj8si964504vcb.92.2014.04.07.08.07.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Apr 2014 08:07:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id sa20so3553742veb.22 for ; Mon, 07 Apr 2014 08:07:15 -0700 (PDT) X-Received: by 10.52.251.199 with SMTP id zm7mr11464584vdc.21.1396883235371; Mon, 07 Apr 2014 08:07:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp169779vcv; Mon, 7 Apr 2014 08:07:14 -0700 (PDT) X-Received: by 10.68.237.38 with SMTP id uz6mr31525598pbc.72.1396883234375; Mon, 07 Apr 2014 08:07:14 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id td10si8502507pac.140.2014.04.07.08.07.13; Mon, 07 Apr 2014 08:07:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755558AbaDGPHG (ORCPT + 27 others); Mon, 7 Apr 2014 11:07:06 -0400 Received: from mail-ee0-f42.google.com ([74.125.83.42]:48394 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755414AbaDGPF0 (ORCPT ); Mon, 7 Apr 2014 11:05:26 -0400 Received: by mail-ee0-f42.google.com with SMTP id d17so740518eek.15 for ; Mon, 07 Apr 2014 08:05:25 -0700 (PDT) X-Received: by 10.15.33.136 with SMTP id c8mr286278eev.111.1396883125162; Mon, 07 Apr 2014 08:05:25 -0700 (PDT) Received: from localhost.localdomain (201-179-62-37.mobileinternet.proximus.be. [37.62.179.201]) by mx.google.com with ESMTPSA id o4sm42287649eef.20.2014.04.07.08.05.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 07 Apr 2014 08:05:24 -0700 (PDT) From: Jean Pihet To: Borislav Petkov , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Jiri Olsa , linux-kernel@vger.kernel.org, Robert Richter Cc: Robert Richter , Jean Pihet Subject: [PATCH 13/16] perf tools: Rename flex conditions to avoid name conflicts Date: Mon, 7 Apr 2014 17:04:35 +0200 Message-Id: <1396883078-25320-14-git-send-email-jean.pihet@linaro.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1396883078-25320-1-git-send-email-jean.pihet@linaro.org> References: <1396883078-25320-1-git-send-email-jean.pihet@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: jean.pihet@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Robert Richter These define's may cause conflicts with other definitions: #define INITIAL 0 #define mem 1 #define config 2 #define event 3 Prefix them with cond_* to avoid this. Signed-off-by: Robert Richter Signed-off-by: Robert Richter Signed-off-by: Jean Pihet --- tools/perf/util/parse-events.l | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index 3432995..a5808d1 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l @@ -69,9 +69,9 @@ static int term(yyscan_t scanner, int type) %} -%x mem -%s config -%x event +%x cond_mem +%s cond_config +%x cond_event group [^,{}/]*[{][^}]*[}][^,{}/]* event_pmu [^,{}/]+[/][^/]*[/][^,{}/]* @@ -95,9 +95,9 @@ modifier_bp [rwx]{1,3} start_token = parse_events_get_extra(yyscanner); if (start_token == PE_START_TERMS) - BEGIN(config); + BEGIN(cond_config); else if (start_token == PE_START_EVENTS) - BEGIN(event); + BEGIN(cond_event); if (start_token) { parse_events_set_extra(NULL, yyscanner); @@ -106,7 +106,7 @@ modifier_bp [rwx]{1,3} } %} -{ +{ {group} { BEGIN(INITIAL); yyless(0); @@ -126,7 +126,7 @@ modifier_bp [rwx]{1,3} } -{ +{ config { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_CONFIG); } config1 { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_CONFIG1); } config2 { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_CONFIG2); } @@ -138,7 +138,7 @@ branch_type { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE {name_minus} { return str(yyscanner, PE_NAME); } } -{ +{ {modifier_bp} { return str(yyscanner, PE_MODIFIER_BP); } : { return ':'; } {num_dec} { return value(yyscanner, 10); } @@ -146,7 +146,7 @@ branch_type { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE /* * We need to separate 'mem:' scanner part, in order to get specific * modifier bits parsed out. Otherwise we would need to handle PE_NAME - * and we'd need to parse it manually. During the escape from + * and we'd need to parse it manually. During the escape from * state we need to put the escaping char back, so we dont miss it. */ . { unput(*yytext); BEGIN(INITIAL); } @@ -193,18 +193,18 @@ speculative-read|speculative-load | refs|Reference|ops|access | misses|miss { return str(yyscanner, PE_NAME_CACHE_OP_RESULT); } -mem: { BEGIN(mem); return PE_PREFIX_MEM; } +mem: { BEGIN(cond_mem); return PE_PREFIX_MEM; } r{num_raw_hex} { return raw(yyscanner); } {num_dec} { return value(yyscanner, 10); } {num_hex} { return value(yyscanner, 16); } {modifier_event} { return str(yyscanner, PE_MODIFIER_EVENT); } {name} { return str(yyscanner, PE_NAME); } -"/" { BEGIN(config); return '/'; } +"/" { BEGIN(cond_config); return '/'; } - { return '-'; } -, { BEGIN(event); return ','; } +, { BEGIN(cond_event); return ','; } : { return ':'; } -"{" { BEGIN(event); return '{'; } +"{" { BEGIN(cond_event); return '{'; } "}" { return '}'; } = { return '='; } \n { }