public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Li Zefan <lizf@cn.fujitsu.com>,
	Mathieu Desnoyers <compudj@krystal.dyndns.org>
Subject: Re: [PATCH 2/3] tracing/profile: add ref count for registering profile events
Date: Fri, 11 Sep 2009 16:09:43 +0200	[thread overview]
Message-ID: <1252678183.7126.34.camel@laptop> (raw)
In-Reply-To: <1252677861.7126.32.camel@laptop>

On Fri, 2009-09-11 at 16:04 +0200, Peter Zijlstra wrote:
> On Fri, 2009-09-11 at 09:54 -0400, Steven Rostedt wrote:
> 
> > +#ifdef MODULE
> > +# define event_trace_up_ref()					\
> > +	do {							\
> > +		if (!try_module_get(THIS_MODULE)) {		\
> > +			atomic_dec(&event_call->profile_count);	\
> > +			return -ENOENT;				\
> > +		}						\
> > +	} while (0)
> > +# define event_trace_down_ref() module_put(THIS_MODULE)
> > +#else
> > +# define event_trace_up_ref() do { } while (0)
> > +# define event_trace_down_ref() do { } while (0)
> > +#endif
> 
> That's like truely gruesomely ugly.
> 
> At the very least write it like:
> 
> int event_trace_up_ref(struct ftrace_event_call *call)
> {
> 	if (!try_module_get(THIS_MODULE)) {
> 		atomic_dev(&call->profile_count);
> 		return -ENOENT;
> 	}
> 	return 0;
> }

Or we can go with Li's original patch, that was less ugly.

I still think tracepoints/markers should sort this out, because we now
have a sematic difference between the two wrt modules.




  reply	other threads:[~2009-09-11 14:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 13:54 [PATCH 0/3] [GIT PULL] tracing: various updates Steven Rostedt
2009-09-11 13:54 ` [PATCH 1/3] x86/tracing: comment need for atomic nop Steven Rostedt
2009-09-11 13:54 ` [PATCH 2/3] tracing/profile: add ref count for registering profile events Steven Rostedt
2009-09-11 14:04   ` Peter Zijlstra
2009-09-11 14:09     ` Peter Zijlstra [this message]
2009-09-11 14:33       ` Steven Rostedt
2009-09-11 14:37         ` Peter Zijlstra
2009-09-11 14:52           ` Steven Rostedt
2009-09-12 14:14           ` Mathieu Desnoyers
2009-09-11 14:40       ` Steven Rostedt
2009-09-11 14:12     ` Steven Rostedt
2009-09-11 13:54 ` [PATCH 3/3] tracing: add latency format to function_graph tracer Steven Rostedt
2009-09-11 14:55   ` Frederic Weisbecker
2009-09-11 15:11     ` Steven Rostedt
2009-09-11 15:18       ` Frederic Weisbecker
2009-09-11 15:38         ` Török Edwin
2009-09-11 15:43           ` Frederic Weisbecker
2009-09-11 15:50           ` Steven Rostedt
2009-09-11 16:08             ` Török Edwin
2009-09-12 10:25               ` Matt Fleming

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=1252678183.7126.34.camel@laptop \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=compudj@krystal.dyndns.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mingo@elte.hu \
    --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