linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tingwei Zhang <tingweiz@codeaurora.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Tingwei Zhang <tingwei@codeaurora.org>,
	Ingo Molnar <mingo@redhat.com>,
	tsoni@codeaurora.org,
	Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>,
	Mao Jinlong <jinlmao@codeaurora.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/6] tracing: add flag to control different traces
Date: Tue, 28 Jul 2020 08:29:22 +0800	[thread overview]
Message-ID: <20200728002922.GB10290@codeaurora.org> (raw)
In-Reply-To: <20200727144550.7aa40c61@oasis.local.home>

Hi Steve,
On Tue, Jul 28, 2020 at 02:45:50AM +0800, Steven Rostedt wrote:
> On Sun, 26 Jul 2020 10:59:27 +0800
> Tingwei Zhang <tingwei@codeaurora.org> wrote:
> 
> 
> > diff --git a/include/linux/trace.h b/include/linux/trace.h
> > index 7fd86d3c691f..d2fdf9be84b5 100644
> > --- a/include/linux/trace.h
> > +++ b/include/linux/trace.h
> > @@ -3,6 +3,9 @@
> >  #define _LINUX_TRACE_H
> >  
> >  #ifdef CONFIG_TRACING
> > +
> > +#define TRACE_EXPORT_FUNCTION	BIT_ULL(0)
> 
> All the flags variables below are defined as "int". Why the BIT_ULL()?
> BIT(0) should work just fine. The ULL makes one think these flags will
> be used for unsigned long variables, which it is not.
> 

That's my mistake.  Thanks for point that out. I'll fix it in next
revision.

> -- Steve
> 
> 
> > +
> 
> >  struct trace_export {
> >  	struct trace_export __rcu	*next;
> >  	void (*write)(struct trace_export *, const void *, unsigned int);
> > +	int flags;
> >  };
> >  
> >  int register_ftrace_export(struct trace_export *export);
> > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > index bb62269724d5..8f1e66831e9e 100644
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -2747,33 +2747,37 @@ trace_buffer_unlock_commit_nostack(struct
> trace_buffer *buffer,
> >  
> >  static void
> >  trace_process_export(struct trace_export *export,
> > -	       struct ring_buffer_event *event)
> > +	       struct ring_buffer_event *event, int flag)
> >  {
> >  	struct trace_entry *entry;
> >  	unsigned int size = 0;
> >  
> > -	entry = ring_buffer_event_data(event);
> > -	size = ring_buffer_event_length(event);
> > -	export->write(export, entry, size);
> > +	if (export->flags & flag) {
> > +		entry = ring_buffer_event_data(event);
> > +		size = ring_buffer_event_length(event);
> > +		export->write(export, entry, size);
> > +	}
> >  }

  reply	other threads:[~2020-07-28  0:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-26  2:59 [PATCH v2 0/6] tracing: export event trace and trace_marker Tingwei Zhang
2020-07-26  2:59 ` [PATCH v2 1/6] stm class: ftrace: change dependency to TRACING Tingwei Zhang
2020-07-26  2:59 ` [PATCH v2 2/6] tracing: add flag to control different traces Tingwei Zhang
2020-07-27 18:45   ` Steven Rostedt
2020-07-28  0:29     ` Tingwei Zhang [this message]
2020-07-26  2:59 ` [PATCH v2 3/6] tracing: add trace_export support for event trace Tingwei Zhang
2020-07-26  2:59 ` [PATCH v2 4/6] tracing: add trace_export support for trace_marker Tingwei Zhang
2020-07-26  2:59 ` [PATCH v2 5/6] stm class: ftrace: enable supported trace export flag Tingwei Zhang
2020-07-26  2:59 ` [PATCH v2 6/6] stm class: ftrace: use different channel accroding to CPU Tingwei Zhang
2020-07-27 19:08   ` Steven Rostedt
2020-07-28  0:28     ` Tingwei Zhang

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=20200728002922.GB10290@codeaurora.org \
    --to=tingweiz@codeaurora.org \
    --cc=jinlmao@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=saiprakash.ranjan@codeaurora.org \
    --cc=tingwei@codeaurora.org \
    --cc=tsoni@codeaurora.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;
as well as URLs for NNTP newsgroup(s).