Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1390079imm; Wed, 6 Jun 2018 15:27:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJMbT/0PyMZJC5aduO7vbXnnqI5+2XIzyQjC9NUd1SDofrjhBJABztIebW3LyuZ848iyeHb X-Received: by 2002:a17:902:c6b:: with SMTP id 98-v6mr4887859pls.37.1528324021123; Wed, 06 Jun 2018 15:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528324021; cv=none; d=google.com; s=arc-20160816; b=jB2KgpboyPyEN94qG47Vv3pQlnALE0ZAVbRrqkjJAmJ01eroStHbxtAuz+JhJ6tHsH z3lpg4cSfLoEDGU0sV/bvX8hrTLnEo1uoCU3oUL4A80u7bj1fQB9VkO/rPmfsWmRqAFL f/k+Mj3B4zTBRhmzPuBcKV8xgM1G0dk/tChZLDqKsUPOMmVbOf7aGBFGp191DxzDbR30 376bFcENOrtO7c3PUP7WEhCsHhbJ95RA/TFHuNltji3xQQfwLPZhVypEDnH+U6+INuqS nqhOmryYUmbpUbdLI/kACeVC+uPp4q+qeMJvp2fHOIKmuxVnbw5UQNJDkKvMyejCNkG1 sh2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Zk/er+iKhwZ0het6etLN5b7B6+bUQ78T098bYlGEZNY=; b=vMDlFD8ZgqpUfJHjFTtuIh2kAAmIzEbXQ1zF/sU7Lx8aAL1/HTuq1px88VxLykXv8e NX1nsfPwPucHXBM2MS/xAB/yjN6Ml5hFmUr+0IW6wPtD1kjzsU5Z8khaY2TFvD9XqBQ/ LwK57NCijV0JSBC0Y4XIkErVsQOOzXiiwJZhLySWEFnb0+5EJ8cTh9WSD52MMPw8e33F DUFn2FdfESuoOAZlipMBXdIUmp2oqI9Di3oia/jKoSPwOmu+OLAxQh7xoVQtxcLI7vOn ZQ76Ya/Zxl20CAvUceYL+jvVJ46L/Qbwr2tUt23KyCdNqddzvKl7Q2LY6zE8/weGoYu2 RadQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16-v6si22740650pgc.232.2018.06.06.15.26.46; Wed, 06 Jun 2018 15:27:01 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbeFFWPa (ORCPT + 99 others); Wed, 6 Jun 2018 18:15:30 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57708 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752336AbeFFWPZ (ORCPT ); Wed, 6 Jun 2018 18:15:25 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14BAEC12B1; Wed, 6 Jun 2018 22:15:25 +0000 (UTC) Received: from krava.redhat.com (ovpn-204-89.brq.redhat.com [10.40.204.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78F202026DEF; Wed, 6 Jun 2018 22:15:22 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo , Peter Zijlstra Cc: lkml , Ingo Molnar , Namhyung Kim , David Ahern , Alexander Shishkin , Stephane Eranian , Milian Wolff , Andi Kleen , Frederic Weisbecker Subject: [PATCH 02/10] perf tools: Fix error index for pmu event parser Date: Thu, 7 Jun 2018 00:15:05 +0200 Message-Id: <20180606221513.11302-3-jolsa@kernel.org> In-Reply-To: <20180606221513.11302-1-jolsa@kernel.org> References: <20180606221513.11302-1-jolsa@kernel.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 06 Jun 2018 22:15:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 06 Jun 2018 22:15:25 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@kernel.org' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For events we provide specific error message we need to set error column index, PMU parser is missing that, adding it. Before: $ perf stat -e cycles,krava/cycles/ kill event syntax error: 'cycles,krava/cycles/' \___ Cannot find PMU `krava'. Missing kernel support? After: $ perf stat -e cycles,krava/cycles/ kill event syntax error: 'cycles,krava/cycles/' \___ Cannot find PMU `krava'. Missing kernel support? Link: http://lkml.kernel.org/n/tip-mhlal798evb07oo3rxs8sa78@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/util/parse-events.y | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index 155d2570274f..da8fe57691b8 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y @@ -227,11 +227,16 @@ event_def: event_pmu | event_pmu: PE_NAME opt_pmu_config { + struct parse_events_state *parse_state = _parse_state; + struct parse_events_error *error = parse_state->error; struct list_head *list, *orig_terms, *terms; if (parse_events_copy_term_list($2, &orig_terms)) YYABORT; + if (error) + error->idx = @1.first_column; + ALLOC_LIST(list); if (parse_events_add_pmu(_parse_state, list, $1, $2, false, false)) { struct perf_pmu *pmu = NULL; -- 2.13.6