Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [ltt-dev] [PATCH 12/13] enable text output for ltt-relay
@ 2009-01-13  9:09 Lai Jiangshan
  2009-01-15 20:08 ` Mathieu Desnoyers
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2009-01-13  9:09 UTC (permalink / raw)



all done, enable text output for ltt-relay

Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
---
 ltt-relay.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff --git a/ltt/ltt-relay.c b/ltt/ltt-relay.c
index 6d222c6..806558f
--- a/ltt/ltt-relay.c
+++ b/ltt/ltt-relay.c
@@ -699,6 +717,7 @@ static void ltt_relay_print_buffer_errors(struct ltt_channel_struct *ltt_chan,
 
 static void ltt_relay_remove_dirs(struct ltt_trace_struct *trace)
 {
+	ltt_txt_remove_dir(trace);
 	debugfs_remove(trace->dentry.trace_root);
 }
 
@@ -819,9 +838,16 @@ static int ltt_relay_create_channel(const char *trace_name,
 		goto relay_open_error;
 	}
 
+	ltt_chan->buf_access_ops = &ltt_channel_buf_accesser;
+	ltt_chan->txt_entry = ltt_txt_create(trace, ltt_chan);
+	if (!ltt_chan->txt_entry)
+		goto relay_txt_error;
+
 	err = 0;
 	goto end;
 
+relay_txt_error:
+	ltt_relay_close(ltt_chan->trans_channel_data);
 relay_open_error:
 	percpu_free(ltt_chan->buf);
 ltt_percpu_alloc_error:
@@ -833,11 +859,15 @@ end:
 
 static int ltt_relay_create_dirs(struct ltt_trace_struct *new_trace)
 {
+	if (ltt_txt_create_dir(new_trace))
+		return EEXIST;
+
 	new_trace->dentry.trace_root = debugfs_create_dir(new_trace->trace_name,
 			get_ltt_root());
 	if (new_trace->dentry.trace_root == NULL) {
 		printk(KERN_ERR "LTT : Trace directory name %s already taken\n",
 				new_trace->trace_name);
+		ltt_txt_remove_dir(new_trace);
 		return EEXIST;
 	}
 
@@ -901,6 +931,7 @@ static void ltt_relay_remove_channel(struct ltt_channel_struct *channel)
 {
 	struct rchan *rchan = channel->trans_channel_data;
 
+	ltt_txt_remove(channel, channel->txt_entry);
 	ltt_relay_close(rchan);
 	kref_put(&channel->kref, ltt_relay_release_channel);
 }
@@ -1316,6 +1347,10 @@ static notrace int ltt_relay_reserve_slot(struct ltt_trace_struct *trace,
 		local_inc(&ltt_buf->events_lost);
 		return -EPERM;
 	}
+
+	if (atomic_read(&ltt_channel->channel_disabled))
+		return -EBUSY;
+
 	do {
 		if (ltt_relay_try_reserve(ltt_channel, ltt_buf,
 				rchan, buf, &offsets, data_size, tsc, rflags,






^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ltt-dev] [PATCH 12/13] enable text output for ltt-relay
  2009-01-13  9:09 [ltt-dev] [PATCH 12/13] enable text output for ltt-relay Lai Jiangshan
@ 2009-01-15 20:08 ` Mathieu Desnoyers
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2009-01-15 20:08 UTC (permalink / raw)


* Lai Jiangshan (laijs at cn.fujitsu.com) wrote:
> 
> all done, enable text output for ltt-relay
> 
> Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
> ---
>  ltt-relay.c |   17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> diff --git a/ltt/ltt-relay.c b/ltt/ltt-relay.c
> index 6d222c6..806558f
> --- a/ltt/ltt-relay.c
> +++ b/ltt/ltt-relay.c
> @@ -699,6 +717,7 @@ static void ltt_relay_print_buffer_errors(struct ltt_channel_struct *ltt_chan,
>  
>  static void ltt_relay_remove_dirs(struct ltt_trace_struct *trace)
>  {
> +	ltt_txt_remove_dir(trace);
>  	debugfs_remove(trace->dentry.trace_root);
>  }
>  
> @@ -819,9 +838,16 @@ static int ltt_relay_create_channel(const char *trace_name,
>  		goto relay_open_error;
>  	}
>  
> +	ltt_chan->buf_access_ops = &ltt_channel_buf_accesser;
> +	ltt_chan->txt_entry = ltt_txt_create(trace, ltt_chan);
> +	if (!ltt_chan->txt_entry)
> +		goto relay_txt_error;
> +
>  	err = 0;
>  	goto end;
>  
> +relay_txt_error:
> +	ltt_relay_close(ltt_chan->trans_channel_data);
>  relay_open_error:
>  	percpu_free(ltt_chan->buf);
>  ltt_percpu_alloc_error:
> @@ -833,11 +859,15 @@ end:
>  
>  static int ltt_relay_create_dirs(struct ltt_trace_struct *new_trace)
>  {
> +	if (ltt_txt_create_dir(new_trace))
> +		return EEXIST;
> +
>  	new_trace->dentry.trace_root = debugfs_create_dir(new_trace->trace_name,
>  			get_ltt_root());
>  	if (new_trace->dentry.trace_root == NULL) {
>  		printk(KERN_ERR "LTT : Trace directory name %s already taken\n",
>  				new_trace->trace_name);
> +		ltt_txt_remove_dir(new_trace);
>  		return EEXIST;
>  	}
>  
> @@ -901,6 +931,7 @@ static void ltt_relay_remove_channel(struct ltt_channel_struct *channel)
>  {
>  	struct rchan *rchan = channel->trans_channel_data;
>  
> +	ltt_txt_remove(channel, channel->txt_entry);
>  	ltt_relay_close(rchan);
>  	kref_put(&channel->kref, ltt_relay_release_channel);
>  }
> @@ -1316,6 +1347,10 @@ static notrace int ltt_relay_reserve_slot(struct ltt_trace_struct *trace,
>  		local_inc(&ltt_buf->events_lost);
>  		return -EPERM;
>  	}
> +
> +	if (atomic_read(&ltt_channel->channel_disabled))
> +		return -EBUSY;
> +

Don't we already have a test for this in both ltt-serializer.c and
ltt-type-serializer.c :

               if (unlikely(!trace->active))
                  continue;
? That seems duplicated. Do we really want to be able to disable a
single channel or is stopping the whole trace enough ?

And notice that if we require that the whole trace should be stopped
when we read a flight recorder channel, we don't have to worry about the
writer overwriting our data for non-overwrite channels, because the
writer disard events on buffer full condition.

Mathieu

>  	do {
>  		if (ltt_relay_try_reserve(ltt_channel, ltt_buf,
>  				rchan, buf, &offsets, data_size, tsc, rflags,
> 
> 
> 
> 
> _______________________________________________
> 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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-15 20:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-13  9:09 [ltt-dev] [PATCH 12/13] enable text output for ltt-relay Lai Jiangshan
2009-01-15 20:08 ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox