Linux Trace Kernel
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Costa Shulyupin <costa.shul@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Daniel Bristot de Oliveira <bristot@kernel.org>,
	John Kacur <jkacur@redhat.com>,
	"Luis Claudio R. Goncalves" <lgoncalv@redhat.com>,
	Eder Zulian <ezulian@redhat.com>,
	Tomas Glozar <tglozar@redhat.com>,
	Gabriele Monaco <gmonaco@redhat.com>,
	linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] Fix bug and add osnoise_trace_is_off()
Date: Wed, 15 Jan 2025 14:12:13 +0300	[thread overview]
Message-ID: <d4b0cf45-67ab-47ce-9acf-1dc934dcc50e@stanley.mountain> (raw)
In-Reply-To: <20250115081157.1274398-1-costa.shul@redhat.com>

On Wed, Jan 15, 2025 at 10:09:56AM +0200, Costa Shulyupin wrote:
> diff --git a/tools/tracing/rtla/src/osnoise.c b/tools/tracing/rtla/src/osnoise.c
> index 245e9344932bc..20275642a74cd 100644
> --- a/tools/tracing/rtla/src/osnoise.c
> +++ b/tools/tracing/rtla/src/osnoise.c
> @@ -1079,6 +1079,25 @@ struct osnoise_tool *osnoise_init_trace_tool(char *tracer)
>  	return NULL;
>  }
>  
> +int osnoise_trace_is_off(struct osnoise_tool *tool, struct osnoise_tool *record)
> +{
> +	/*
> +	 * The tool instance is always present, it is the one used to collect
> +	 * data.
> +	 */
> +	if (!tracefs_trace_is_on(tool->trace.inst))
> +		return 1;
> +
> +	/*
> +	 * The trace record instance is only enabled when -t is set. IOW, when the system
> +	 * is tracing.
> +	 */
> +	if (record && !tracefs_trace_is_on(record->trace.inst))
> +		return 1;
> +
> +	return 0;
> +}

Also this function should be declared as type bool and return true/false
instead of 1/0.

regards,
dan carpenter


      parent reply	other threads:[~2025-01-15 11:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15  8:09 [PATCH v2] Fix bug and add osnoise_trace_is_off() Costa Shulyupin
2025-01-15  9:02 ` Dan Carpenter
2025-01-15 15:26   ` Steven Rostedt
2025-01-15 11:12 ` Dan Carpenter [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=d4b0cf45-67ab-47ce-9acf-1dc934dcc50e@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=bristot@kernel.org \
    --cc=costa.shul@redhat.com \
    --cc=ezulian@redhat.com \
    --cc=gmonaco@redhat.com \
    --cc=jkacur@redhat.com \
    --cc=lgoncalv@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglozar@redhat.com \
    /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