%!TEX root = main.tex

In this section, we perform some experiments to get a grasp on how different processes affect
power consumption. For now on, we are interested
only in PP0 and DRAM domains.

\subsection{Modulating CPU and DRAM power}

To analyze the power consumption profile of CPU-bound tasks, we ran a simple loop computing a
trigonometric function with different number of threads. The result can be seen in the upper
part of Figure~\ref{fig:power_profiles}. We can see 4 distinguishable power consumption profiles
(excluding the idle power consumption), corresponding to using 1 to 4 threads. The power
consumption using 4 and 5 threads are somewhat indistinguishable, which is no
surprise since our machine only supports 4 hardware hyperthreads.


\begin{figure}[!ht]
  \centering
  \includegraphics[scale=1]{graphs/profiles/power_profiles.pdf}
  % \includegraphics[scale=1]{graphs/profiles/mem_profile.pdf}
  % \includegraphics[scale=1]{graphs/mem_bound_memset_annotated.pdf}
  \caption{Power consumption profiles of CPU-bound tasks with different number of threads (top) and
    of the \texttt{memset} operation when setting different sizes of memory chunks, with respect to L3 cache's size, considering the notebook setup. }
  \label{fig:power_profiles}
\end{figure}

For the power consumption profile of memory-bound tasks, we measured the DRAM power consumption
when running \texttt{memset} to set different sizes of memory chunks.
We chose to use \texttt{memset} in this work because, among other memory operations like
\texttt{memcpy} and \texttt{memchr}, its impact on the DRAM power consumption was the easiest to control in our tests.
The bottom part of Figure~\ref{fig:power_profiles} shows our results.
We can clearly see that power consumption and time to complete increase together with the size of the memory chunk used.


\subsection{Benchmarks' profiles}
\label{sec:powerprofs:bench}

When evaluating the covert channel with respect to the robustness against application interference, we consider three benchmarks:
MRBench~\cite{kim2008mrbench}, Terasort~\cite{o2008terabyte}, and LINPACK~\cite{dongarra1993performance}.
The parameters used can be found at \url{https://www.ime.usp.br/~tpaiva/}.

Figure~\ref{fig:benchmark_profiles} shows the power consumption of the first 30 seconds
of each benchmark. We can see that MRBench and Terasort affect power consumption in a similar way, although
MRBench appears to stress the DRAM power slightly more.
LINPACK has a very interesting profile. In the first 5 seconds it uses all hardware threads consistently, affecting the
CPU power, but without affecting much the DRAM power. After this period, it starts stressing the DRAM power,
and the CPU power also increases by a considerable margin.


\begin{figure}[!ht]
  \centering
  \includegraphics[scale=1]{graphs/profiles/benchmark_profiles.pdf}
  \caption{Power consumption profiles of the benchmarks considering the notebook setup.}
  \label{fig:benchmark_profiles}
\end{figure}

It is important to notice that DRAM power usage appears to imply CPU power usage, but not the opposite.
This makes DRAM power, in theory, less prone to noise, making it useful for building robust covert channels.



