[ltt-dev] simple userspace tracing with LTTng 0.9.10

Mathieu Desnoyers compudj at krystal.dyndns.org
Thu Jan 29 14:30:38 EST 2009


* Akyurek, Ali (EXT) (ali.akyurek.ext at siemens.com) wrote:
> 
> Hi,
> 
> Since there is no specialized trace concept in legacy LTTng 0.9.10, 
> 
> I'm thinking of defining a new marker and use it as below. I think this would be ok, but it'll require many additions.
> 
> What if i use an existing trace_mark like kernel_printk below, instead of defining a new marker. 
> I know this is ugly and tricky, but can i make it work?
> 
> Thanks.
> 
> 
> 
> static ssize_t write_event(struct file *file, const char __user *user_buf,
> 		size_t count, loff_t *ppos)
> {
> .
> ..
> ...
> -	marker = &GET_MARKER(userspace, event);
> -	ltt_specialized_trace(marker, marker->single.probe_private,
> -		page, count + 1, sizeof(char));
> 
> +	trace_mark(userspace_event,"%s",string_from_user_buf);
> 

Never pass a __user pointer to a marker. First do a copy_from_user.

Mathieu

> ...
> ..
> .
> }
> 
>  
> 
> -----Ursprüngliche Nachricht-----
> Von: Mathieu Desnoyers [mailto:compudj at krystal.dyndns.org] 
> Gesendet: Mittwoch, 28. Januar 2009 16:57
> An: Akyurek, Ali (EXT)
> Cc: ltt-dev at lists.casi.polymtl.ca
> Betreff: Re: [ltt-dev] simple userspace tracing with LTTng 0.9.10
> 
> * Akyurek, Ali (EXT) (ali.akyurek.ext at siemens.com) wrote:
> > Hi all,
> >  
> > I've used simple userspace event tracing with the latest version by
> > writing to the  mnt/debugfs/ltt/write_event.
> > But now i'm using an old LTTng (because i have to), 0.9.10. 
> > 
> > Is it possible to port this simple uspace tracing feature to the old
> > lttng versions?
> > 
> > Or it is not possible because of some architectural restrictions of
> > kernel or LTTng?
> > Thanks.
> > 
> 
> That should be easily doable, as long as you have a kernel with debugfs.
> 
> The main patch concerned is :
> lttng-userspace-write-event.patch
> 
> Mathieu
> 
> > _______________________________________________
> > 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
> 

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




More information about the lttng-dev mailing list