Michael Opdenacker michael.opdenacker at free-electrons.com
Tue Dec 31 08:03:19 CET 2013

Repository : git://git.free-electrons.com/training-materials.git

On branch  : master

>---------------------------------------------------------------

commit 70ec2bdbe5dbb68857884e5a3082d847b220a7f5
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date:   Tue Dec 31 06:12:04 2013 +0100

- Explain how to compute an upper limit to the
savings from this costly technique.

Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>

>---------------------------------------------------------------

70ec2bdbe5dbb68857884e5a3082d847b220a7f5
.../boottime-application/boottime-application.tex  |   39 ++++++++++++++++----
1 file changed, 31 insertions(+), 8 deletions(-)

diff --git a/slides/boottime-application/boottime-application.tex b/slides/boottime-application/boottime-application.tex
index 5f20a90..5e6f9ff 100644
--- a/slides/boottime-application/boottime-application.tex
+++ b/slides/boottime-application/boottime-application.tex
@@ -239,23 +239,46 @@ the same results as compiling everything with Buildroot.
\end{frame}

\begin{frame}
Group application code used at startup
\begin{itemize}
\item Find the functions called during startup, for example using
-                the \code{-finstrument-functions} gcc option.
+              the \code{-finstrument-functions} gcc option.
\item Create a custom linker script to reorder those functions in
-                the call order. You can acheive that by putting each function
-                in their own section using the \code{-ffunction-sections} gcc
-                option.
+              the call order. You can achieve that by putting each function
+              in their own section using the \code{-ffunction-sections} gcc
+              option.
\item Particularly useful for flash storage with rather big MTD
\end{itemize}
-See \url{http://blogs.linux.ie/caolan/2007/04/24/controlling-symbol-ordering/}
+Details:
+{\scriptsize
+\url{http://blogs.linux.ie/caolan/2007/04/24/controlling-symbol-ordering/}}
\end{frame}

\begin{frame}
+\begin{itemize}
+\item Here's a very simple way to find the maximum savings you can expect
+      from this technique:
+      \begin{itemize}
+      \item Start the application once and measure its startup time.
+      \item Start the application and measure its startup time again.
+            Its code should still be in the Linux file cache,
+      \end{itemize}
+\item You now know how much time it took to load the application code
+      (and its libraries) the first time. Linker optimizations will
+      save less than this upper limit.
+\item You can then decide whether this could be worth the effort.
+      Such optimizations are costly, as the way you compile your
+      applications has be be modified.
+\end{itemize}
+\end{frame}
+
+
+\begin{frame}