Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752508AbbG2LCy (ORCPT ); Wed, 29 Jul 2015 07:02:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40789 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133AbbG2LCx (ORCPT ); Wed, 29 Jul 2015 07:02:53 -0400 Date: Wed, 29 Jul 2015 13:02:50 +0200 From: Jiri Olsa To: Kan Liang Cc: acme@kernel.org, jolsa@kernel.org, namhyung@kernel.org, ak@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC V6 4/6] perf,tool: per-event time support Message-ID: <20150729110250.GA9606@krava.brq.redhat.com> References: <1437999699-19632-1-git-send-email-kan.liang@intel.com> <1437999699-19632-5-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437999699-19632-5-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1496 Lines: 48 On Mon, Jul 27, 2015 at 08:21:37AM -0400, Kan Liang wrote: SNIP > > diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c > index 09bee93..b10a5c0 100644 > --- a/tools/perf/util/parse-events.c > +++ b/tools/perf/util/parse-events.c > @@ -603,6 +603,11 @@ do { \ > * attr->branch_sample_type = term->val.num; > */ > break; > + case PARSE_EVENTS__TERM_TYPE_TIME: > + CHECK_TYPE_VAL(NUM); > + if (term->val.num > 1) > + return -EINVAL; you might want to add the error info stuff to get: [jolsa@krava perf]$ ./perf record -e 'cpu/cpu-cycles,time=111111111/' --no-timestamp ls event syntax error: '..es,time=111111111/' \___ expected 0 or 1 --- diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index b10a5c03ec3e..a6cb9afc20e2 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -605,8 +605,11 @@ do { \ break; case PARSE_EVENTS__TERM_TYPE_TIME: CHECK_TYPE_VAL(NUM); - if (term->val.num > 1) + if (term->val.num > 1) { + err->str = strdup("expected 0 or 1"); + err->idx = term->err_val; return -EINVAL; + } break; case PARSE_EVENTS__TERM_TYPE_NAME: CHECK_TYPE_VAL(STR); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/