From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7CDDC4363D for ; Wed, 7 Oct 2020 14:27:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6384A212CC for ; Wed, 7 Oct 2020 14:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602080863; bh=8z6QdvP0rN7EuzDy+NiuR8Fqj4BMkmiL3zk2HD4xKv0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:List-ID:From; b=wRy8/55IRZBCbkaceyeYPLDQxesipJR3MJ61ECfLpOXhJ89qw85OcaXVrq2PxMAVW cELT87jnBBR5pRldafsJbO09pASumQ2yKbvUvEh9GY89f9gSjfFuHo3+NNZpKEKQNP WIPUilZ1zpMY6wL3mdrCfPYGPJbwKdgEqrSZ3QEw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728629AbgJGO1m (ORCPT ); Wed, 7 Oct 2020 10:27:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:34518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728604AbgJGO1l (ORCPT ); Wed, 7 Oct 2020 10:27:41 -0400 Received: from tzanussi-mobl (c-73-209-127-30.hsd1.il.comcast.net [73.209.127.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E57B12076C; Wed, 7 Oct 2020 14:27:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602080861; bh=8z6QdvP0rN7EuzDy+NiuR8Fqj4BMkmiL3zk2HD4xKv0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=g2NTYLGsRPvX5KG91knYvl87qiskCJOKBQ6hDXmYKsp3UyzlsXS/dXeYzqwrwQSw8 TNVmgLdrvdGxEe27jjRqO8QzRZlxkyXxhg32yLUrViTpB2MywZ1yCH4Epii8unbjfE XuisOgERJVllFo0781mLgBQU/qC4NfdNdo7R2eL4= Message-ID: <004cd4075f81c092a72a201da9b9170ccf6ff94a.camel@kernel.org> Subject: Re: tracing: Add support for dynamic strings to synthetic events From: Tom Zanussi To: Steven Rostedt , Colin Ian King Cc: Ingo Molnar , "linux-kernel@vger.kernel.org" Date: Wed, 07 Oct 2020 09:27:39 -0500 In-Reply-To: <20201007093036.423a1b72@gandalf.local.home> References: <20201007093036.423a1b72@gandalf.local.home> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-10-07 at 09:30 -0400, Steven Rostedt wrote: > On Wed, 7 Oct 2020 14:08:38 +0100 > Colin Ian King wrote: > > > Hi, > > > > Static analysis with Coverity has detected a duplicated condition > > in an > > if statement in the following commit in source > > kernel/trace/trace_events_synth.c > > > > commit bd82631d7ccdc894af2738e47abcba2cb6e7dea9 > > Author: Tom Zanussi > > Date: Sun Oct 4 17:14:06 2020 -0500 > > > > tracing: Add support for dynamic strings to synthetic events > > > > Analysis is as follows: > > > > 493 for (i = 0; i < event->n_fields; i++) { > > > > Same on both sides (CONSTANT_EXPRESSION_RESULT) > > pointless_expression: The expression event->fields[i]->is_dynamic > > && > > event->fields[i]->is_dynamic does not accomplish anything because > > it > > evaluates to either of its identical operands, event->fields[i]- > > >is_dynamic. > > > > Did you intend the operands to be different? > > > > 494 if (event->fields[i]->is_dynamic && > > 495 event->fields[i]->is_dynamic) > > Bah, I believe that was suppose to be: > > if (event->fields[i]->is_string && > event->fields[i]->is_dynamic) > > I'll go and fix that. > Yep, thanks for fixing that. Acked-by: Tom Zanussi Tom > -- Steve > > > 496 pos += snprintf(buf + pos, LEN_OR_ZERO, > > 497 ", __get_str(%s)", > > event->fields[i]->name); > > 498 else > > 499 pos += snprintf(buf + pos, LEN_OR_ZERO, > > 500 ", REC->%s", > > event->fields[i]->name); > > 501 } > > > > Colin > >