All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <compudj@krystal.dyndns.org>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org,
	"Frank Ch. Eigler" <fche@redhat.com>,
	Christoph Hellwig <hch@infradead.org>,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: Linux Kernel Markers - Coding Style Fixes
Date: Sun, 30 Sep 2007 10:04:37 -0400	[thread overview]
Message-ID: <20070930140437.GA18803@Krystal> (raw)
In-Reply-To: <20070930140013.GB16981@Krystal>

* Mathieu Desnoyers (mathieu.desnoyers@polymtl.ca) wrote:
> Linux Kernel Markers - Coding Style Fixes
> 
> - Use struct marker instead of struct __mark_marker.
> - Change a "private_data" parameter name for "private".
> - DEFINE_MUTEX(markers_mutex) is made static.
> 
> This patch applies after linux-kernel-markers.patch.
> 

Hi Andrew,

Just to be precise wrt what you have, it applies right after:
linux-kernel-markers-checkpatch-fixes.patch
in your series.

Mathieu

> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
> CC: Rusty Russell <rusty@rustcorp.com.au>
> ---
>  include/linux/marker.h |   18 +++++++++---------
>  include/linux/module.h |    2 +-
>  kernel/marker.c        |   22 ++++++++++------------
>  3 files changed, 20 insertions(+), 22 deletions(-)
> 
> Index: linux-2.6-lttng/include/linux/marker.h
> ===================================================================
> --- linux-2.6-lttng.orig/include/linux/marker.h	2007-09-30 09:33:48.000000000 -0400
> +++ linux-2.6-lttng/include/linux/marker.h	2007-09-30 09:35:13.000000000 -0400
> @@ -15,11 +15,11 @@
>  #include <linux/types.h>
>  
>  struct module;
> -struct __mark_marker;
> +struct marker;
>  
>  /**
>   * marker_probe_func - Type of a marker probe function
> - * @mdata: pointer of type struct __mark_marker
> + * @mdata: pointer of type struct marker
>   * @private_data: caller site private data
>   * @fmt: format string
>   * @...: variable argument list
> @@ -27,10 +27,10 @@ struct __mark_marker;
>   * Type of marker probe functions. They receive the mdata and need to parse the
>   * format string to recover the variable argument list.
>   */
> -typedef void marker_probe_func(const struct __mark_marker *mdata,
> +typedef void marker_probe_func(const struct marker *mdata,
>  	void *private_data, const char *fmt, ...);
>  
> -struct __mark_marker {
> +struct marker {
>  	const char *name;	/* Marker name */
>  	const char *format;	/* Marker format string, describing the
>  				 * variable argument list.
> @@ -57,7 +57,7 @@ struct __mark_marker {
>  		static const char __mstrtab_format_##name[]		\
>  		__attribute__((section("__markers_strings")))		\
>  		= format;						\
> -		static struct __mark_marker __mark_##name		\
> +		static struct marker __mark_##name			\
>  		__attribute__((section("__markers"))) =			\
>  		{ __mstrtab_name_##name, __mstrtab_format_##name,	\
>  		0, __mark_empty_function, NULL };			\
> @@ -72,13 +72,13 @@ struct __mark_marker {
>  		}							\
>  	} while (0)
>  
> -extern void marker_update_probe_range(struct __mark_marker *begin,
> -	struct __mark_marker *end, struct module *probe_module, int *refcount);
> +extern void marker_update_probe_range(struct marker *begin,
> +	struct marker *end, struct module *probe_module, int *refcount);
>  #else /* !CONFIG_MARKERS */
>  #define __trace_mark(name, call_data, format, args...) \
>  		__mark_check_format(format, ## args)
> -static inline void marker_update_probe_range(struct __mark_marker *begin,
> -	struct __mark_marker *end, struct module *probe_module, int *refcount)
> +static inline void marker_update_probe_range(struct marker *begin,
> +	struct marker *end, struct module *probe_module, int *refcount)
>  { }
>  #endif /* CONFIG_MARKERS */
>  
> Index: linux-2.6-lttng/include/linux/module.h
> ===================================================================
> --- linux-2.6-lttng.orig/include/linux/module.h	2007-09-30 09:35:26.000000000 -0400
> +++ linux-2.6-lttng/include/linux/module.h	2007-09-30 09:35:35.000000000 -0400
> @@ -372,7 +372,7 @@ struct module
>  	   keeping pointers to this stuff */
>  	char *args;
>  #ifdef CONFIG_MARKERS
> -	struct __mark_marker *markers;
> +	struct marker *markers;
>  	unsigned int num_markers;
>  #endif
>  };
> Index: linux-2.6-lttng/kernel/marker.c
> ===================================================================
> --- linux-2.6-lttng.orig/kernel/marker.c	2007-09-30 09:35:48.000000000 -0400
> +++ linux-2.6-lttng/kernel/marker.c	2007-09-30 09:44:14.000000000 -0400
> @@ -24,14 +24,14 @@
>  #include <linux/marker.h>
>  #include <linux/err.h>
>  
> -extern struct __mark_marker __start___markers[];
> -extern struct __mark_marker __stop___markers[];
> +extern struct marker __start___markers[];
> +extern struct marker __stop___markers[];
>  
>  /*
>   * module_mutex nests inside markers_mutex. Markers mutex protects the builtin
>   * and module markers, the hash table and deferred_sync.
>   */
> -DEFINE_MUTEX(markers_mutex);
> +static DEFINE_MUTEX(markers_mutex);
>  
>  /*
>   * Marker deferred synchronization.
> @@ -63,7 +63,7 @@ static struct hlist_head marker_table[MA
>  
>  /**
>   * __mark_empty_function - Empty probe callback
> - * @mdata: pointer of type const struct __mark_marker
> + * @mdata: pointer of type const struct marker
>   * @fmt: format string
>   * @...: variable argument list
>   *
> @@ -72,8 +72,7 @@ static struct hlist_head marker_table[MA
>   * though the function pointer change and the marker enabling are two distinct
>   * operations that modifies the execution flow of preemptible code.
>   */
> -void __mark_empty_function(const struct __mark_marker *mdata,
> -	void *private_data,
> +void __mark_empty_function(const struct marker *mdata, void *private,
>  	const char *fmt, ...)
>  {
>  }
> @@ -207,8 +206,7 @@ static int marker_set_format(struct mark
>  /*
>   * Sets the probe callback corresponding to one marker.
>   */
> -static int set_marker(struct marker_entry **entry,
> -			struct __mark_marker *elem)
> +static int set_marker(struct marker_entry **entry, struct marker *elem)
>  {
>  	int ret;
>  	WARN_ON(strcmp((*entry)->name, elem->name) != 0);
> @@ -240,7 +238,7 @@ static int set_marker(struct marker_entr
>   * empty function insures that the original callback is not used anymore. This
>   * insured by preemption disabling around the call site.
>   */
> -static void disable_marker(struct __mark_marker *elem)
> +static void disable_marker(struct marker *elem)
>  {
>  	elem->state = 0;
>  	elem->call = __mark_empty_function;
> @@ -261,11 +259,11 @@ static void disable_marker(struct __mark
>   * Updates the probe callback corresponding to a range of markers.
>   * Must be called with markers_mutex held.
>   */
> -void marker_update_probe_range(struct __mark_marker *begin,
> -	struct __mark_marker *end, struct module *probe_module,
> +void marker_update_probe_range(struct marker *begin,
> +	struct marker *end, struct module *probe_module,
>  	int *refcount)
>  {
> -	struct __mark_marker *iter;
> +	struct marker *iter;
>  	struct marker_entry *mark_entry;
>  
>  	for (iter = begin; iter < end; iter++) {
> -- 
> Mathieu Desnoyers
> Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
> OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

  reply	other threads:[~2007-09-30 14:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-28 14:28 [patch 0/5] Linux Kernel Markers for 2.6.23-rc8-mm2 Mathieu Desnoyers
2007-09-28 14:28 ` [patch 1/5] Combine instrumentation menus in kernel/Kconfig.instrumentation Mathieu Desnoyers
2007-09-28 14:28 ` [patch 2/5] Linux Kernel Markers Mathieu Desnoyers
2007-09-30  1:35   ` Rusty Russell
2007-09-30 14:00     ` Linux Kernel Markers - Coding Style Fixes Mathieu Desnoyers
2007-09-30 14:04       ` Mathieu Desnoyers [this message]
2007-10-02 12:10       ` [PATCH] Linux Kernel Markers - Alignment Fix Mathieu Desnoyers
2007-10-01 16:01     ` [PATCH] Change struct marker users Mathieu Desnoyers
2007-09-28 14:28 ` [patch 3/5] Add samples subdir Mathieu Desnoyers
2007-09-28 15:47   ` Randy Dunlap
2007-09-28 16:24     ` Mathieu Desnoyers
2007-09-28 14:28 ` [patch 4/5] Linux Kernel Markers - Samples Mathieu Desnoyers
2007-09-30 14:07   ` [PATCH] Linux Kernel Markers - Samples Coding Style Fix Mathieu Desnoyers
2007-10-11  9:13   ` [patch 4/5] Linux Kernel Markers - Samples Andrew Morton
2007-10-11 13:27     ` Mathieu Desnoyers
2007-10-11 18:32       ` Andrew Morton
2007-09-28 14:28 ` [patch 5/5] Linux Kernel Markers - Documentation Mathieu Desnoyers

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=20070930140437.GA18803@Krystal \
    --to=compudj@krystal.dyndns.org \
    --cc=akpm@linux-foundation.org \
    --cc=fche@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.