From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935247AbcCKIsY (ORCPT ); Fri, 11 Mar 2016 03:48:24 -0500 Received: from torg.zytor.com ([198.137.202.12]:33270 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934946AbcCKIsP (ORCPT ); Fri, 11 Mar 2016 03:48:15 -0500 Date: Fri, 11 Mar 2016 00:47:14 -0800 From: tip-bot for Steven Rostedt Message-ID: Cc: namhyung@kernel.org, eranian@google.com, tglx@linutronix.de, hpa@zytor.com, wangnan0@huawei.com, andi@firstfloor.org, peterz@infradead.org, rostedt@goodmis.org, jolsa@kernel.org, dsahern@gmail.com, mingo@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com Reply-To: dsahern@gmail.com, rostedt@goodmis.org, jolsa@kernel.org, peterz@infradead.org, mingo@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org, andi@firstfloor.org, hpa@zytor.com, wangnan0@huawei.com, eranian@google.com, tglx@linutronix.de, namhyung@kernel.org In-Reply-To: <20160226181328.22f47129@gandalf.local.home> References: <20160226181328.22f47129@gandalf.local.home> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] tools lib traceevent: Add '~' operation within arg_num_eval() Git-Commit-ID: 9eb42dee2b11635174c74a7996934b6ca18f2179 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9eb42dee2b11635174c74a7996934b6ca18f2179 Gitweb: http://git.kernel.org/tip/9eb42dee2b11635174c74a7996934b6ca18f2179 Author: Steven Rostedt AuthorDate: Fri, 26 Feb 2016 18:13:28 -0500 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 10 Mar 2016 16:27:41 -0300 tools lib traceevent: Add '~' operation within arg_num_eval() When evaluating values for print flags, if the value included a '~' operator, the parsing would fail. This broke kmalloc's parsing of: __print_flags(REC->gfp_flags, "|", {(unsigned long)((((((( gfp_t)(0x400000u|0x2000000u)) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | (( gfp_t)0x20000u)) | (( gfp_t)0x02u)) | (( gfp_t)0x08u)) | (( gfp_t)0x4000u) | (( gfp_t)0x10000u) | (( gfp_t)0x1000u) | (( gfp_t)0x200u)) & ~(( gfp_t)0x2000000u)) ^ | here Signed-off-by: Steven Rostedt Reported-by: Arnaldo Carvalho de Melo Tested-by: David Ahern Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Wang Nan Link: http://lkml.kernel.org/r/20160226181328.22f47129@gandalf.local.home Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/event-parse.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 865dea5..190cc88 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -2398,6 +2398,12 @@ static int arg_num_eval(struct print_arg *arg, long long *val) break; *val = left + right; break; + case '~': + ret = arg_num_eval(arg->op.right, &right); + if (!ret) + break; + *val = ~right; + break; default: do_warning("unknown op '%s'", arg->op.op); ret = 0;