[ltt-dev] [PATCH v3 4/4] Move ltt_root_dentry to ltt-core.c and export it

Mathieu Desnoyers compudj at krystal.dyndns.org
Wed Nov 12 00:09:47 EST 2008


* Zhaolei (zhaolei at cn.fujitsu.com) wrote:
> ltt_root_dentry is necessary for ltt-trace-control to create
> subdirs in ltt's debugfs dir.
> Todo:
>   Create ltt_root_dentry in ltt-core.c or ltt-trace.c
>   (now in ltt-relay.c)
> 

Hrm, that won't work. You can compile in ltt-relay-locked.ko but not
ltt-relay.ko. In this case, ltt-relay-locked will try to use an
uninitialized ltt_root_dentry. It really has to be initialized in
ltt-core.c.

Mathieu

> Signed-off-by: Zhao Lei <zhaolei at cn.fujitsu.com>
> ---
>  include/linux/ltt-core.h |    5 +++++
>  ltt/ltt-core.c           |    3 +++
>  ltt/ltt-relay-locked.c   |    1 -
>  ltt/ltt-relay.c          |    1 -
>  4 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/ltt-core.h b/include/linux/ltt-core.h
> index 7e5ee8b..26ce779 100644
> --- a/include/linux/ltt-core.h
> +++ b/include/linux/ltt-core.h
> @@ -24,6 +24,11 @@ struct ltt_traces {
>  
>  extern struct ltt_traces ltt_traces;
>  
> +/*
> + * exported ltt's debugfs dir for other control interface module
> + */
> +extern struct dentry *ltt_root_dentry;
> +
>  /* Keep track of trap nesting inside LTT */
>  DECLARE_PER_CPU(unsigned int, ltt_nesting);
>  
> diff --git a/ltt/ltt-core.c b/ltt/ltt-core.c
> index aaad358..6b73a2f 100644
> --- a/ltt/ltt-core.c
> +++ b/ltt/ltt-core.c
> @@ -20,6 +20,9 @@ EXPORT_SYMBOL(ltt_traces);
>  /* Traces list writer locking */
>  static DEFINE_MUTEX(ltt_traces_mutex);
>  
> +struct dentry *ltt_root_dentry;
> +EXPORT_SYMBOL_GPL(ltt_root_dentry);
> +
>  void ltt_lock_traces(void)
>  {
>  	mutex_lock(&ltt_traces_mutex);
> diff --git a/ltt/ltt-relay-locked.c b/ltt/ltt-relay-locked.c
> index 393097e..04c5450 100644
> --- a/ltt/ltt-relay-locked.c
> +++ b/ltt/ltt-relay-locked.c
> @@ -122,7 +122,6 @@ static inline int last_tsc_overflow(struct ltt_channel_buf_struct *ltt_buf,
>  }
>  #endif
>  
> -static struct dentry *ltt_root_dentry;
>  static struct file_operations ltt_file_operations;
>  
>  /*
> diff --git a/ltt/ltt-relay.c b/ltt/ltt-relay.c
> index 379018d..fdfadb4 100644
> --- a/ltt/ltt-relay.c
> +++ b/ltt/ltt-relay.c
> @@ -131,7 +131,6 @@ static inline int last_tsc_overflow(struct ltt_channel_buf_struct *ltt_buf,
>  }
>  #endif
>  
> -static struct dentry *ltt_root_dentry;
>  static struct file_operations ltt_file_operations;
>  
>  /*
> -- 
> 1.5.5.3
> 
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

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




More information about the lttng-dev mailing list