From mboxrd@z Thu Jan 1 00:00:00 1970 From: gausinghnsit@gmail.com (Gaurav Singh) Date: Tue, 10 Feb 2009 12:05:39 +0530 Subject: [ltt-dev] Arming only a few markers in LTTng In-Reply-To: <3cc7a0df0902092231y298ef59dmbf817f276af85c46@mail.gmail.com> References: <3cc7a0df0902020256gfa80be0vb953e8b44e358034@mail.gmail.com> <49870368.1040100@polymtl.ca> <20090202161001.GA5266@Krystal> <3cc7a0df0902092231y298ef59dmbf817f276af85c46@mail.gmail.com> Message-ID: <3cc7a0df0902092235w70475502s7124ba99332dd20d@mail.gmail.com> Hi Mathieu, Pierre, others, As Mathieu suggested GDB pinpointed the segfault to lttv_trace_hook_remove_all function in tracecontext.c - the patch given before has been tested for traces with all markers enabled and traces with a few mrakers enabled. Pierre - I could not find any dependencies to hinder my analysis. Thanks again :) Regards Gaurav On Tue, Feb 10, 2009 at 12:01 PM, Gaurav Singh wrote: > Hi Mathieu, Pierre and others, > > Following is a script ltt-arm which I use to arm only few markers for > tracing. Please check if this is the correct implementation. > > Usage: ltt-arm -m > > #!/bin/sh > mflag=0 > startflag=0 > zero=0 > while getopts 'm:h' OPTION > do > case $OPTION in > m) mflag=1 > if [ $startflag = $zero ] > then > echo Connecting internal_kernel_sched_schedule > echo "connect internal_kernel_sched_schedule > scheduler" > /proc/ltt > MARKERS=`cat /proc/ltt|grep -v %k|awk '{print > $2}'|sort -u|grep -v ^core_|grep -v ^locking_ |grep -v ^internal_` > startflag=1 > fi > for a in $MARKERS; do if [ $a = $OPTARG ]; then > echo Connecting $OPTARG > echo "connect $OPTARG default" > /proc/ltt > fi; > done; > ;; > h) printf "Help \n arguments : \n-m seperated by spaces>\n" > ;; > ?) printf "error" > exit 2 > ;; > esac > done > shift $(($OPTIND - 1)) > if [ "$mflag" ] > then > for a in $*; do for b in $MARKERS; do if [ $a = $b ]; then echo > Connecting $a; echo "connect $a default" > /proc/ltt;fi; done; done; > fi > > also following is the patch for LTTV to solve the seg fault that I was > getting. Again grateful if you can suggest any changes: > > diff -uprN lttv_orig/lttv-0.10.0-pre11-10032008/lttv/lttv/tracecontext.c > lttv-0.10.0-pre11-10032008/lttv/lttv/tracecontext.c > --- > lttv_orig/lttv-0.10.0-pre11-10032008/lttv/lttv/tracecontext.c 2007-11-12 > 10:03:20.000000000 +0530 > +++ lttv-0.10.0-pre11-10032008/lttv/lttv/tracecontext.c 2009-02-10 > 11:44:24.000000000 +0530 > @@ -1038,10 +1038,14 @@ skip_marker: > void lttv_trace_hook_remove_all(GArray **th) > { > int i; > + if((*th)->len!=0) > + { > for(i=0; i<(*th)->len; i++) { > g_ptr_array_free(g_array_index(*th, LttvTraceHook, i).fields, TRUE); > } > + > *th = g_array_remove_range(*th, 0, (*th)->len); > + } > } > > Thanks Pierre and Mathieu > Regards > Gaurav Singh > > > > > On Mon, Feb 2, 2009 at 9:40 PM, Mathieu Desnoyers < > compudj at krystal.dyndns.org> wrote: > >> * Pierre-Marc Fournier (pierre-marc.fournier at polymtl.ca) wrote: >> > Hi Gaurav, >> > >> > Please tell us what tracepoints from the standard ones you tried to >> > enable. LTTV has some analyses that are pretty tied to some of them and >> > it might not digest well that some are absent. >> > >> > Does it work in text dump? >> > lttv.real -m textDump -t /tmp/your/trace >> > >> > Does it work in gui when the only loaded plugin is the event viewer? >> > lttv.real -m lttvwindow -m guievents -t /tmp/your/trace >> > >> > If so, you might try enabling other views until it segfaults to find the >> > culprit. >> > >> >> Hi Gaurav, >> >> LTTV *should* support the fact that probes are missing. If you can, >> please compile with : >> >> ./configure CFLAGS="-g" >> make >> make install >> >> and run through gdb >> >> gdb path_to/lttv.real >> set args -m textDump -t /tmp/trace >> or >> set args -m guicontrolflow -t /tmp/trace >> >> So you can report the backtrace (bt full) when it segfaults. >> >> Thanks, >> >> Mathieu >> >> > Thanks >> > >> > pmf >> > >> > >> > Gaurav Singh wrote: >> > > Hi, >> > > >> > > Just a small query on ltt-armall. I tried enabling only a few markers >> at >> > > runtime instead of running ltt-armall. The trace was successfully >> > > collected but viewing the trace in LTTV is giving a segmentation >> fault. >> > > Has anyone tried this before? >> > > >> > > Regards >> > > Gaurav >> > > >> > > >> > > >> ------------------------------------------------------------------------ >> > > >> > > _______________________________________________ >> > > 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 >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: