* [ltt-dev] Arming only a few markers in LTTng
2009-02-10 6:31 ` Gaurav Singh
@ 2009-02-10 6:35 ` Gaurav Singh
2009-02-11 7:36 ` Mathieu Desnoyers
1 sibling, 0 replies; 6+ messages in thread
From: Gaurav Singh @ 2009-02-10 6:35 UTC (permalink / raw)
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 <gausinghnsit at gmail.com>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 <names of markers to be armed>
>
> #!/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 <names of markers
> 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: <http://lists.casi.polymtl.ca/pipermail/lttng-dev/attachments/20090210/1c853dac/attachment-0003.htm>
^ permalink raw reply [flat|nested] 6+ messages in thread* [ltt-dev] Arming only a few markers in LTTng
2009-02-10 6:31 ` Gaurav Singh
2009-02-10 6:35 ` Gaurav Singh
@ 2009-02-11 7:36 ` Mathieu Desnoyers
1 sibling, 0 replies; 6+ messages in thread
From: Mathieu Desnoyers @ 2009-02-11 7:36 UTC (permalink / raw)
* Gaurav Singh (gausinghnsit at gmail.com) 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 <names of markers to be armed>
>
> #!/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 <names of markers 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
>
Hrm, given we now have the debugfs interface, I am not sure it's needed
anymore.
> 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);
> + }
> }
It's already fixed by commit
r2929 | pmf | 2008-05-30 11:15:26 -0400 (Fri, 30 May 2008) | 2 lines
lttv: don't crash on empty trace
Therefore current LTTV should not be affected.
Thanks,
Mathieu
>
> 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
> >
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 6+ messages in thread