Re: Segmentation fault running lttctl on SH4 target.

Mathieu Desnoyers <[email protected]> Wed, 14 Nov 2007 08:19:27 -0500
Newsgroups gmane.linux.kernel.tracing
Message-ID <20071114131927.GA22095@Krystal>
* Giuseppe Cavallaro ([email protected]) wrote:
> Mathieu,
> it was not an LTT issue but a system-wide memory resource problem.
> Indeed, using the kernel debugger and reducing, at runtime, the subbuf_size
> from 1M to 64K (see gdb log below) I was able to trace the system without
> any segmentation fault.
> 
> ----------------------------------------------------------------------------------------------------------
> (gdb)
> Continuing.
> 
> Breakpoint 6, ltt_relay_create_channel (trace_name=0x87b44010 "trace",
>     trace=0x84577200, dir=0x87264098, channel_name=0x842fd414 "cpu",
>     ltt_chan=0x84577360, subbuf_size=1048576, n_subbufs=2, overwrite=0)
>     at ltt/ltt-relay.c:491
> 491             if (!tmpname)
> (gdb) set subbuf_size=65536
> (gdb) c
> Continuing.
> -----------------------------------------------------------------------------------------------------------
> 
> Note that I actually work in an embedded system where some resources are
> limited (e.g. memory is 32M).
> 
> So I wonder how I can tune that within LTT.
> Maybe, do I need to modify the LTT_DEFAULT_SUBBUF_SIZE_HIGH macro?
> Is it worth making arch dependent these kind of macros?
> Please, let me know.
> Please remember that I'm not familiar with the ltt internals.
> 

Nope, see lttctl --help, it will show you that you can tweak the
subbuffer size and number of subbuffers dynamically at trace creation.

I'm glad you found the cause of your bug.

However, I would have preferred lttctl to give a significant error
message rather than segfault. I should look into
ltt_relay_create_channel to see where the lacking memory ressource code
path is wrong.

Thanks,

Mathieu

> Ciao
> Giuseppe

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68