\subsection{klogger}
\begin{frame}
  \frametitle{Logging}
  \begin{itemize}
  \item Logs are very important to debug a system, either live
    or after a fault occurred
  \item In a regular Linux distribution, two components are involved
    in the system's logging:
    \begin{itemize}
    \item Linux' internal mechanism, accessible with the \code{dmesg}
      command and holding the output of all the calls to \code{printk()} from
      various parts of the kernel.
    \item A syslog daemon, which handles the user space logs and
      usually stores them in the \path{/var/log} directory
    \end{itemize}
  \item From Android developers' point of view, this approach has two flaws:
    \begin{itemize}
    \item As the calls to \code{syslog()} go through as socket, they generate
      expensive task switches
    \item Every call writes to a file, which probably writes to a
      slow storage device or to a storage device where writes are expensive
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Logger}
  \begin{itemize}
  \item Android addresses these issues with \textit{logger}, which is
    a kernel driver, that uses 4 circular buffers in the kernel memory
    area.
  \item The buffers are exposed in the \path{/dev/log} directory and you can
    access them through the \textit{liblog} library, which is in turn, used by
    the Android system and applications to write to logger, and by
    the \textit{logcat} command to access them.
  \item This allows to have an extensive level of logging across the
    entire AOSP
  \end{itemize}
\end{frame}
