[ltt-dev] [PATCH 2/2] Fix LTTng build problems when modules are disabled

Mathieu Desnoyers mathieu.desnoyers at polymtl.ca
Tue Jul 7 19:37:11 EDT 2009


* Benjamin Poirier (benjamin.poirier at polymtl.ca) wrote:
> Add some #ifdef's to allow the kernel to build when LTTng is enabled and module
> support is not. Without this patch, the kernel build breaks because some of the
> code to deal with modules gets compiled regardless of CONFIG_MODULES.
> 

Merged, thanks !

Will be in the next lttng release.

Mathieu

> Signed-off-by: Benjamin Poirier <benjamin.poirier at polytml.ca>
> ---
>  kernel/immediate.c      |    4 ++++
>  kernel/marker.c         |    4 ++--
>  ltt/ltt-trace-control.c |   10 ++++++++++
>  3 files changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/immediate.c b/kernel/immediate.c
> index 963e15c..dacc034 100644
> --- a/kernel/immediate.c
> +++ b/kernel/immediate.c
> @@ -112,6 +112,8 @@ void __init imv_init_complete(void)
>  	imv_early_boot_complete = 1;
>  }
>  
> +#ifdef CONFIG_MODULES
> +
>  int imv_module_notify(struct notifier_block *self,
>  		      unsigned long val, void *data)
>  {
> @@ -139,3 +141,5 @@ static int init_imv(void)
>  	return register_module_notifier(&imv_module_nb);
>  }
>  __initcall(init_imv);
> +
> +#endif /* CONFIG_MODULES */
> diff --git a/kernel/marker.c b/kernel/marker.c
> index bb35db2..7fcd5d4 100644
> --- a/kernel/marker.c
> +++ b/kernel/marker.c
> @@ -1163,8 +1163,6 @@ void markers_compact_event_ids(void)
>  	}
>  }
>  
> -#ifdef CONFIG_MODULES
> -
>  /**
>   * marker_get_iter_range - Get a next marker iterator given a range.
>   * @marker: current markers (in), next marker (out)
> @@ -1235,6 +1233,8 @@ void marker_iter_reset(struct marker_iter *iter)
>  }
>  EXPORT_SYMBOL_GPL(marker_iter_reset);
>  
> +#ifdef CONFIG_MODULES
> +
>  int marker_module_notify(struct notifier_block *self,
>  			 unsigned long val, void *data)
>  {
> diff --git a/ltt/ltt-trace-control.c b/ltt/ltt-trace-control.c
> index 8276862..13e4d86 100644
> --- a/ltt/ltt-trace-control.c
> +++ b/ltt/ltt-trace-control.c
> @@ -898,7 +898,9 @@ static ssize_t marker_info_read(struct file *filp, char __user *ubuf,
>  				       "event_id: %hu\n"
>  				       "call: 0x%p\n"
>  				       "probe %s : 0x%p\n\n",
> +#ifdef CONFIG_MODULES
>  				       iter.module ? iter.module->name :
> +#endif
>  				       "Core Kernel",
>  				       iter.marker->format,
>  				       _imv_read(iter.marker->state),
> @@ -1163,6 +1165,7 @@ out:
>  	return err;
>  }
>  
> +#ifdef CONFIG_MODULES
>  static int remove_marker_control_dir(struct module *mod, struct marker *marker)
>  {
>  	struct dentry *channel_d, *marker_d;
> @@ -1254,6 +1257,13 @@ static int module_notify(struct notifier_block *self,
>  	}
>  	return NOTIFY_DONE;
>  }
> +#else
> +static inline int module_notify(struct notifier_block *self,
> +		unsigned long val, void *data)
> +{
> +	return 0;
> +}
> +#endif
>  
>  static struct notifier_block module_nb = {
>  	.notifier_call = module_notify,
> -- 
> 1.6.3.1
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68




More information about the lttng-dev mailing list