mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Zanussi <zanussi@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>,
	Colin Ian King <colin.king@canonical.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: tracing: Add support for dynamic strings to synthetic events
Date: Wed, 07 Oct 2020 09:27:39 -0500	[thread overview]
Message-ID: <004cd4075f81c092a72a201da9b9170ccf6ff94a.camel@kernel.org> (raw)
In-Reply-To: <20201007093036.423a1b72@gandalf.local.home>

On Wed, 2020-10-07 at 09:30 -0400, Steven Rostedt wrote:
> On Wed, 7 Oct 2020 14:08:38 +0100
> Colin Ian King <colin.king@canonical.com> 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 <zanussi@kernel.org>
> > 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 <zanussi@kernel.org>


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


      parent reply	other threads:[~2020-10-07 14:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07 13:08 Colin Ian King
2020-10-07 13:30 ` Steven Rostedt
2020-10-07 13:35   ` Colin Ian King
2020-10-07 14:27   ` Tom Zanussi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=004cd4075f81c092a72a201da9b9170ccf6ff94a.camel@kernel.org \
    --to=zanussi@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome