> I am newbie to ctf. We applied ctfconvert/ctfmerge to our (10Gbps)networking
> driver(and the size almost doubled). Wondering if adding ctf will have any
> performance impact on the code execution path?
> 
> Any doc. on what ctf actually does to the obj./bin.?
> 
> TIA,
> Raghu

Great question: in terms of performance, there is no impact.  We specifically
designed CTF to not affect object code generation in any fashion.  In order
to do that, you have to be sure that the compiler options you pass to generate
debug information do not result in lowering optimization -- after that, all
things related to CTF are simply manipulating debug data (e.g. converting
DWARF to CTF), and don't do anything to touch any of your object code.

Often, compilers make the -g flag secretly disable optimizations when -g and -O
are combined.  For example, the Sun compiler disables tail-call optimization
when -g and -O are combined (whereas it is enabled with only -O), and this is
a very important optimization especially in the kernel.  So if you look at the
SPARC CTF_* compiler flags in usr/src/Makefile.master, you'll see:

        -g -Wc,-Qiselect-T1

where -Qiselect-T1 is re-enabling tail-call optimizations.  If you're
developing code outside of the Solaris gate, look at these CTF compilation
flags and re-use them to be sure you're not losing any optimization.

As for on-disk space and size of debug information, we handle that in the
base Solaris by using ctfmerge to merge everything against genunix, which
contains nearly all the shared types in the kernel.  This makes leaf driver
modules use very few additional new types.  However, to do that, you gain
a dependency on that particular module in order to have the merged type IDs
line up -- so for external drivers you can't do it because otherwise when
Solaris patches are added you may run into issues.  So for now we eat some
extra space for those in return for improved debugging w/ mdb and DTrace.

-Mike

-- 
Mike Shapiro, Solaris Kernel Development. blogs.sun.com/mws/

Reply via email to