lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150729110250.GA9606@krava.brq.redhat.com>
Date:	Wed, 29 Jul 2015 13:02:50 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Kan Liang <kan.liang@...el.com>
Cc:	acme@...nel.org, jolsa@...nel.org, namhyung@...nel.org,
	ak@...ux.intel.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC V6 4/6] perf,tool: per-event time support

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@...va 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ