Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: laijs@cn.fujitsu.com (Lai Jiangshan)
Subject: [ltt-dev] [PATCH 10/13] implement text output framework
Date: Fri, 16 Jan 2009 09:32:03 +0800	[thread overview]
Message-ID: <496FE393.3030506@cn.fujitsu.com> (raw)
In-Reply-To: <20090115200439.GC2462@Krystal>

Mathieu Desnoyers wrote:
> * Lai Jiangshan (laijs at cn.fujitsu.com) wrote:
>> introduce simple framework for text output for lttng.
>>
>> Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
>> ---
>>  b/include/linux/ltt-tracer.h |   45 +++++++++++++++++++++++++++++++++++++++++++
>>  b/ltt/Kconfig                |    3 ++
>>  include/linux/ltt-channels.h |    3 ++
>>  3 files changed, 51 insertions(+)
>> diff --git a/include/linux/ltt-channels.h b/include/linux/ltt-channels.h
>> index 4a3924b..db513cb 100644
>> --- a/include/linux/ltt-channels.h
>> +++ b/include/linux/ltt-channels.h
>> @@ -10,6 +10,7 @@
>>  #include <linux/limits.h>
>>  #include <linux/kref.h>
>>  #include <linux/list.h>
>> +#include <linux/fs.h>
>>  
>>  #define EVENTS_PER_CHANNEL	65536
>>  
>> @@ -21,6 +22,7 @@ struct ltt_channel_struct {
>>  	struct ltt_trace_struct	*trace;
>>  	void *buf;
>>  	void *trans_channel_data;
>> +	atomic_t channel_disabled;
> 
> In what is channel_disabled different from "active:1" below ?
> 
> Mathieu

We need a counter.

> 
>>  	int overwrite:1;
>>  	int active:1;
>>  	unsigned int n_subbufs_order;
>> @@ -45,6 +48,7 @@ struct ltt_channel_struct {
>>  	void (*buffer_end) (struct rchan_buf *buf,
>>  			u64 tsc, unsigned int offset, unsigned int subbuf_idx);
>>  	struct kref kref;	/* Channel transport reference count */
>> +	struct dentry *txt_entry;
>>  	struct ltt_channel_buf_access_ops *buf_access_ops;
>>  	unsigned int subbuf_size;
>>  	unsigned int subbuf_cnt;
>> diff --git a/include/linux/ltt-tracer.h b/include/linux/ltt-tracer.h
>> index ece6819..b49cac2 100644
>> --- a/include/linux/ltt-tracer.h
>> +++ b/include/linux/ltt-tracer.h
>> @@ -20,6 +20,7 @@
>>  #include <linux/ltt-core.h>
>>  #include <linux/marker.h>
>>  #include <linux/trace-clock.h>
>> +#include <linux/debugfs.h>
>>  #include <asm/atomic.h>
>>  #include <asm/local.h>
>>  
>> @@ -212,6 +216,7 @@ struct ltt_trace_struct {
>>  	struct ltt_channel_setting *settings;
>>  	struct {
>>  		struct dentry			*trace_root;
>> +		struct dentry			*txt_root;
>>  	} dentry;
>>  	struct rchan_callbacks callbacks;
>>  	struct kref kref; /* Each channel has a kref of the trace struct */
>> @@ -712,6 +786,49 @@ void ltt_unlock_traces(void);
>>  
>>  extern void ltt_dump_softirq_vec(void *call_data);
>>  
>> +#ifdef CONFIG_LTT_TEXT_OUTPUT
>> +struct dentry *ltt_txt_create(struct ltt_trace_struct *trace,
>> +		struct ltt_channel_struct *ltt_channel);
>> +void ltt_txt_remove(struct ltt_channel_struct *ltt_channel, struct dentry *txt);
>> +extern struct dentry *ltt_txt_dir_dentry;
>> +
>> +static inline int ltt_txt_create_dir(struct ltt_trace_struct *new_trace)
>> +{
>> +	new_trace->dentry.txt_root = debugfs_create_dir(new_trace->trace_name,
>> +			ltt_txt_dir_dentry);
>> +	if (!new_trace->dentry.txt_root)
>> +		return -EEXIST;
>> +	return 0;
>> +}
>> +
>> +static inline void ltt_txt_remove_dir(struct ltt_trace_struct *trace)
>> +{
>> +	debugfs_remove(trace->dentry.txt_root);
>> +}
>> +
>> +#else
>> +static inline struct dentry *ltt_txt_create(struct ltt_trace_struct *trace,
>> +		struct ltt_channel_struct *ltt_channel)
>> +{
>> +	return (struct dentry *)1;
>> +}
>> +
>> +static inline
>> +void ltt_txt_remove(struct ltt_channel_struct *ltt_channel, struct dentry *txt)
>> +{
>> +}
>> +
>> +static inline int ltt_txt_create_dir(struct ltt_trace_struct *trace)
>> +{
>> +	return 0;
>> +}
>> +
>> +static inline void ltt_txt_remove_dir(struct ltt_trace_struct *trace)
>> +{
>> +}
>> +
>> +#endif
>> +
>>  #ifdef CONFIG_HAVE_LTT_DUMP_TABLES
>>  extern void ltt_dump_sys_call_table(void *call_data);
>>  extern void ltt_dump_idt_table(void *call_data);
>> diff --git a/ltt/Kconfig b/ltt/Kconfig
>> index 36548b5..91f2f05 100644
>> --- a/ltt/Kconfig
>> +++ b/ltt/Kconfig
>> @@ -65,6 +65,9 @@ config LTT_RELAY_LOCKED
>>  	  Support using the slow spinlock and interrupt disable algorithm to log
>>  	  the data obtained through LTT.
>>  
>> +config LTT_TEXT_OUTPUT
>> +	def_bool n
>> +
>>  config LTT_RELAY_CHECK_RANDOM_ACCESS
>>  	bool "Debug check for random access in ltt relay buffers"
>>  	depends on LTT_RELAY
>>
>>
>>
>>
>> _______________________________________________
>> ltt-dev mailing list
>> ltt-dev at lists.casi.polymtl.ca
>> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>>
> 






      reply	other threads:[~2009-01-16  1:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-13  9:09 Lai Jiangshan
2009-01-15 20:04 ` Mathieu Desnoyers
2009-01-16  1:32   ` Lai Jiangshan [this message]

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=496FE393.3030506@cn.fujitsu.com \
    --to=laijs@cn.fujitsu.com \
    /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