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] [day] [month] [year] [list]
Date:	Wed, 07 Dec 2011 10:37:57 +0900
From:	Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>
To:	linux-kernel@...r.kernel.org
CC:	linux-btrfs@...r.kernel.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Subject: [PATCH 3/3] perf: allow typecast for signed value

Still I got following warning with btrfs tracepoints:

  $ perf script
  Warning: Error: expected type 5 but read 4
  Warning: Error: expected type 5 but read 0

I found that the complained format is:

  print fmt: "%s", (REC->val >= (u64)-4) ? "-" : __print_symbolic(...)
                                     ~
In perf's parser, the typecast, which is processed in process_paren(),
only expects that (unsigned) token or another parenthesis will follow
to the typecast.  It should expect signed tokens can be there too.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>
---
 tools/perf/util/trace-event-parse.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index b709f78..032f3de 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -1645,10 +1645,11 @@ process_paren(struct event *event, struct print_arg *arg, char **tok)
 	type = read_token_item(&token);
 
 	/*
-	 * If the next token is an item or another open paren, then
-	 * this was a typecast.
+	 * If the next token is an item (might be signed, with single op "-")
+	 * or another open paren, then this was a typecast.
 	 */
 	if (event_item_type(type) ||
+	    (type == EVENT_OP && strcmp(token, "-") == 0) ||
 	    (type == EVENT_DELIM && strcmp(token, "(") == 0)) {
 
 		/* make this a typecast and contine */
-- 
1.7.7.3


--
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