Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp879330pxb; Fri, 28 Jan 2022 12:09:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9C1uyZ0Y1GnJ7XTdp1vTDrhxWht7sIsQQI0G7x5fUZeVpXVihwEAIQ68vkr4oUdS8KwB3 X-Received: by 2002:a50:d514:: with SMTP id u20mr9582920edi.374.1643400541673; Fri, 28 Jan 2022 12:09:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643400541; cv=none; d=google.com; s=arc-20160816; b=FPUrjFWu2d6IXCbXvQnNbratBogcqCQqLws1YC78Of9FFG7IV4yOqcfN+obfRRqZNS ctSU7og+E57GuVQvKH15nHCf5NS6vaLTD66WJLpY6og8cZtU/f+BuoG6DsD4fKRLn0Qw ChkdXNXtB4cjG1KGOmyBBYYuekYcXZ/tAskWGUCkfbwNSd8+AlxOfz0CcwrKGi9W8/pd rzwK7WWw4G6qXovOsTgpx7LWlYsWKdhJjBXQE5srJyQenTu+Jph4b7YPYt+f8THUrzZZ Awvxrm4nVyXPtK9jvCbAVwm8nIT4apo/tO/7AcJHQFTywafU44rFb7LVurZ+uWMoJN+O xUlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=5lVYljSlrYyiMxe1JNAvg1c/1sU44jgnI+DWgyaye5M=; b=m7Fgph2EPswm8WV4fcxhqVDV2GMBpSW4VJB5AdHvVbl6gBn4f1Ney8V+DyjhU/UFQ/ GLBktZprg/qnvNTsU4fOe22D9iUtvOmsI00sROmMainpkeO/7pYDoDklszQFkDSs8664 F119w5OVuDkt8McseMhL+pOQmf6bwvX+PNVskQhrUfGwPCrHSSLka1u8lI0qbWfLjYvn 7eHnTNmRTFwcQua7pqlRzt25CU2M9Ww71mehVhXe+iOilJo8/FHyhOFpy4WNbmXSo87w G5/id8VQLA39tSSubqpfr1ckdi3YnSi8mKxTVB4rMY92uvy9I1EPJBs721UsKPOJB68p F2vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XTSllgX2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx21si3377329edb.60.2022.01.28.12.08.37; Fri, 28 Jan 2022 12:09:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XTSllgX2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344489AbiA0Voi (ORCPT + 99 others); Thu, 27 Jan 2022 16:44:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344463AbiA0Voe (ORCPT ); Thu, 27 Jan 2022 16:44:34 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 601AAC061714 for ; Thu, 27 Jan 2022 13:44:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2A21EB821D8 for ; Thu, 27 Jan 2022 21:44:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DD29C340E4; Thu, 27 Jan 2022 21:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643319872; bh=eqIY/p2JsHWz+a3b8tVHnFVm3Fi/G+8oFQo0afV+PmE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=XTSllgX2C96iME5mnaMGWx3yvsDhJSpXQDY7tR7aDiVd01tXrdCXRXI50qp0V88r6 1dfmLR5TVhV4McRGVPLVcIKldW5WSBr0oWuDIco/pPcnh92WFZGwh8sHVQ86MB96+A TmIBrsVWwlE4LzlJ8hAA+mGV1Vgvd9VyXnKaEBRWlteBHOFYVdmQXL8yYmP3rlDo5h 5bMx/4S+y4KYDwDziD99Ki5HoW1dn1fDzjH2FlUTV0FS0Rgz6+40e9R1LrRFKgNAia GL5NwqOeM0LByjaHS57dXud9wp4q4wQRpUwA2VY/lPQ1xx33QUheQ2i7Khy0jICb+I xNY3jm4ERIBLw== From: Tom Zanussi To: rostedt@goodmis.org Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org, Tom Zanussi Subject: [PATCH 3/7] tracing: Propagate is_signed to expression Date: Thu, 27 Jan 2022 15:44:17 -0600 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During expression parsing, a new expression field is created which should inherit the properties of the operands, such as size and is_signed. is_signed propagation was missing, causing spurious errors with signed operands. Add it in parse_expr() and parse_unary() to fix the problem. Reported-by: Yordan Karadzhov BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215513 Signed-off-by: Tom Zanussi --- kernel/trace/trace_events_hist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index b894d68082ea..ada87bfb5bb8 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -2503,6 +2503,8 @@ static struct hist_field *parse_unary(struct hist_trigger_data *hist_data, (HIST_FIELD_FL_TIMESTAMP | HIST_FIELD_FL_TIMESTAMP_USECS); expr->fn = hist_field_unary_minus; expr->operands[0] = operand1; + expr->size = operand1->size; + expr->is_signed = operand1->is_signed; expr->operator = FIELD_OP_UNARY_MINUS; expr->name = expr_str(expr, 0); expr->type = kstrdup_const(operand1->type, GFP_KERNEL); @@ -2719,6 +2721,7 @@ static struct hist_field *parse_expr(struct hist_trigger_data *hist_data, /* The operand sizes should be the same, so just pick one */ expr->size = operand1->size; + expr->is_signed = operand1->is_signed; expr->operator = field_op; expr->type = kstrdup_const(operand1->type, GFP_KERNEL); -- 2.17.1