Skip to content

Commit

Permalink
Merge branch 'master' into branch-fix-typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Opdenacker authored Nov 15, 2023
2 parents 47b4cc2 + 4f804ed commit 1a28748
Show file tree
Hide file tree
Showing 48 changed files with 229 additions and 198 deletions.
2 changes: 1 addition & 1 deletion agenda/yocto.inc
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@
\def \onsitelabtimeratio{60}

% Ubuntu version
\def \ubuntuversion{22.04 / 20.04}
\def \ubuntuversion{22.04}
4 changes: 2 additions & 2 deletions common/agenda.sty
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
\item Un ordinateur sur chaque bureau (pour une ou deux
personnes), avec au moins un processeur Intel Core i5, 8
Go de RAM et Ubuntu Linux \ubuntuversion{} installé dans une {\bf
partition dédiée d'au moins 50 Go}.
partition dédiée d'au moins 100 Go}.
}{
\item Un ordinateur sur chaque bureau (pour une ou deux
personnes), avec au moins 8 Go de RAM et Ubuntu Linux
Expand All @@ -277,7 +277,7 @@
\item One PC computer on each desk (for one or two persons)
with at least an Intel Core i5 processor, 8 GB of RAM, and
Ubuntu Linux \ubuntuversion{} installed in a {\bf free partition of
at least 50 GB}
at least 100 GB}
}{
\item One PC computer on each desk (for one or two persons) with
at least 8 GB of RAM, and Ubuntu Linux \ubuntuversion{} installed in a
Expand Down
10 changes: 5 additions & 5 deletions common/gdb.tex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
\begin{itemize}
\item GDB is used mainly to debug a process by starting it with {\em gdb}
\begin{itemize}
\item \code{$ gdb <program>}
\item \code{$ gdb <program> <args>}
\end{itemize}
\item GDB can also be attached to running processes using the program PID
\begin{itemize}
Expand Down Expand Up @@ -129,11 +129,11 @@
Display the source code associated to the current program counter location.
\item \code{disassemble <location,start_offset,end_offset>} (\code{disas})\\
Display the assembly code that is currently executed.
\item \code{p $newvar = value}\\
Declare a new gdb variable that can be used locally or in command sequence
\item \code{p function(arguments)}\\
Execute a function using GDB. NOTE: be careful of any side effects that
may happen when executing the function
\item \code{p $newvar = value}\\
Declare a new gdb variable that can be used locally or in command sequence
\item \code{define <command_name>}\\
Define a new command sequence. GDB will prompt for the sequence of
commands.
Expand Down Expand Up @@ -179,10 +179,10 @@ \subsection{Remote debugging}
\begin{itemize}
\item On the target, run a program through \code{gdbserver}.\\
Program execution will not start immediately.\\
\code{gdbserver localhost:<port> <executable> <args>}
\code{gdbserver :<port> <executable> <args>}
\code{gdbserver /dev/ttyS0 <executable> <args>}
\item Otherwise, attach \code{gdbserver} to an already running program:\\
\code{gdbserver --attach localhost:<port> <pid>}
\code{gdbserver --attach :<port> <pid>}
\item Then, on the host, start \code{ARCH-linux-gdb <executable>},\\
and use the following \code{gdb} commands:
\begin{itemize}
Expand Down
1 change: 0 additions & 1 deletion common/ltrace.tex
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
0.15 0.016819 646 26 av_dict_get
0.15 0.016753 440 38 strchr
0.13 0.014536 581 25 memset
0.09 0.009762 9762 1 avcodec_send_packet
...
------ ----------- ----------- --------- --------------------
100.00 11.318773 4762 total
Expand Down
4 changes: 3 additions & 1 deletion common/scheduling-classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
\item \ksym{SCHED_BATCH}: Similar to \code{SCHED_OTHER}, but designed for CPU-intensive loads that affect the wakeup time
\item \ksym{SCHED_IDLE}: Very low priority class. Tasks with this policy will run only if nothing else needs to run.
\item \code{SCHED_OTHER} and \ksym{SCHED_BATCH} use the \textbf{nice} value to increase or decrease their scheduling frequency
\item A higher nice value means that the tasks gets scheduled \textbf{less} often
\begin{itemize}
\item A higher nice value means that the tasks gets scheduled \textbf{less} often
\end{itemize}
\end{itemize}
\end{frame}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ \section{Cachegrind \& Callgrind}
The execution will take some time and a \code{cachegrind.out.<pid>} will be
generated. Once finished, on the host, fix the permissions on the
\code{callgrind.out.*} file to be able to open it with \code{Kcachegrind}:
\code{cachegrind.out.*} file to be able to open it with \code{Kcachegrind}:
\begin{bashinput}
$ sudo chown $USER:$USER cachegrind.out.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ \section{LTTng}
\code{lttng-gen-tp}:
\begin{bashinput}
export CC=${CROSS_COMPILE}gcc
CC=${CROSS_COMPILE}gcc

crc_random: crc_random.c crc_random-tp.o
${CC} $^ -g3 -llttng-ust -o $@
crc_random-tp.o: crc_random-tp.tp
lttng-gen-tp $<
CC=${CC} lttng-gen-tp $<
\end{bashinput}
You can then use the new tracepoints in your program to trace specific points
Expand Down
27 changes: 15 additions & 12 deletions labs/kernel-serial-dma/kernel-serial-dma.tex
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,19 @@ \section{Preparing the driver}

Before going further, re-compile and test your driver.

The \code{serial_write} callback can now be renamed \code{serial_write_pio},
while we will implement a new callback named
\code{serial_write_dma}. Remember to also update the \code{.write}
member of \code{serial_fops} to run the DMA variant. If you want to
avoid warnings because \code{serial_write_pio} would now be unused, you
can temporarily define it with the \code{__maybe_unused} keyword, until
we re-use it again (see below).
The \code{serial_write} callback and \code{serial_fops} can now be renamed \code{serial_write_pio} and \code{serial_fops_pio},
while we will implement a new callback named \code{serial_write_dma} and a new
set of file operations called \code{serial_fops_dma} which uses this callback
for \code{.write} and keeps the same values for other fields. This new set of
file operations should be used by default.

Let's now create two helpers supposed to initialize and cleanup our DMA
setup. We will call \code{serial_init_dma()} right before registering
the \code{misc} device. In the \code{->probe()} error path and in the
remove callback, we will call \code{serial_cleanup_dma()}.
remove callback, we will call \code{serial_cleanup_dma()}. Make sure that errors
are handled correctly and returned to the caller. A special case should be
handled when no DMA channel is available (with the \code{-ENODEV} code returned)
in order to fallback to the the \code{serial_fops_pio} file operations.

\section{Prepare the DMA controller}

Expand All @@ -64,10 +65,12 @@ \section{Prepare the DMA controller}
channel properties and their names. While uart2 seem to be connected to
the DMA controller through two different channels (one for each
direction), uart4 is not. Hence, when requesting the channels with
\kfunc{dma_request_chan()}, we must take care of not erroring-out upon the
absence of channel. Mind the return value which is a \kstruct{dma_chan}
pointer, it must be checked with the \code{IS_ERR()} macro. You may
display the corresponding error string with {\tt \%pe}!
\kfunc{dma_request_chan()}, we must take care to check and return the error code
wrapped in the returned \kstruct{dma_chan} pointer. This can be done with the
\code{IS_ERR()} and \code{PTR_ERR()} macros. You may display the corresponding
error string with {\tt \%pe}! Also make sure that this case is correctly handled
both in the calling code to fallback to the \code{serial_fops_pio} file
operations and in the DMA cleanup function.

This channel will be used by all the \code{dmaengine} helpers, so better
save it in our \code{serial_dev} structure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ \subsection{Accessing your board through SSH}
simple:
\begin{itemize}
\item If you don't have an SSH key yet (look at \code{~/.ssh/},
\item If you don't have an SSH key yet (look at \code{~/.ssh/}),
generate a password-less one with the \code{ssh-keygen} command.
By defaults, this creates two files in \code{~/.ssh/}:
By default, this creates two files in \code{~/.ssh/}:
\code{id_rsa} (private key) and \code{id_rsa.pub} (public key).
\item Then create the \code{/root/.ssh} directory {\bf on the target}
and in it, create an \code{authorized_keys} file with the line in
Expand Down
5 changes: 3 additions & 2 deletions labs/sysdev-thirdparty-stm32/sysdev-thirdparty-stm32.tex
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,9 @@ \subsection{Testing libgpiod}
Again, we can see that GPIOE is represented by \code{gpiochip4}.
We can then get details on GPIOE GPIOs by running \code{gpioinfo
gpiochip4} or on all GPIOs by simply running \code{gpioinfo}.
We can then get details on GPIOE GPIOs by running
\code{gpioinfo -c gpiochip4} or on all GPIOs by simply running
\code{gpioinfo}.
You can now read the state of your GPIO PE1:
Expand Down
4 changes: 2 additions & 2 deletions labs/sysdev-toolchain/sysdev-toolchain.tex
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ \section{Testing the toolchain}
\fi
What's happening is that \ifdefstring{\labboard}{beagleplay}{\code{qemu-aarch64}}
{\code{qemu-arm}} is missing the shared C library
{\code{qemu-arm}} is missing the shared library loader
(compiled for \ifdefstring{\labboard}{beagleplay}{AARCH64}{ARM}) that this
binary uses. Let's find it in our newly compiled toolchain:
binary relies on. Let's find it in our newly compiled toolchain:
\begin{bashinput}
$ find ~/x-tools -name %\ifdefstring{\labboard}{beagleplay}{ld-musl-aarch64.so.1}{ld-musl-armhf.so.1}%
Expand Down
2 changes: 1 addition & 1 deletion labs/sysdev-u-boot-bbb/sysdev-u-boot-bbb.tex
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ \section{Preparing a bootable micro-SD card}
\footnote{Ubuntu uses version 4.2 of \code{mkfs.vfat} and the FAT
generated by this version of the command is incompatible with what
the TI AM335x romcode expects. Passing the \code{-a} option
a workaround described on on a \href{https://bootlin.com/blog/workaround-for-creating-bootable-fat-partition-for-beagle-bone-am335x-on-recent-distros/}
is a workaround as described on a \href{https://bootlin.com/blog/workaround-for-creating-bootable-fat-partition-for-beagle-bone-am335x-on-recent-distros/}
{Bootlin blog post}.}
\begin{bashinput}
sudo mkfs.vfat -a -F 32 -n boot /dev/mmcblk0p1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ \section{Choose a package variant}
bitbake -vn virtual/kernel
\end{verbatim}

You can now rebuild the whole Yocto project, with \code{bitbake
core-image-minimal}

Tip: you need to define the more specific information here to be sure it is the
one used. The \code{MACHINE} variable can help here.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ \section{Choose a package variant}
bitbake -vn virtual/kernel
\end{verbatim}

You can now rebuild the whole Yocto project, with \code{bitbake
core-image-minimal}

Tip: you may need to define the more specific information here to be sure
it is the one used. The \code{MACHINE} variable can help here.

Expand Down
2 changes: 1 addition & 1 deletion labs/yocto-first-build-stm32/yocto-first-build-stm32.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ \section{Setup}
Install the required packages:
\begin{bashinput}
sudo apt install bc build-essential chrpath cpio diffstat gawk git python3 texinfo wget gdisk libssl-dev
sudo apt install bc build-essential chrpath cpio diffstat gawk git python3 texinfo wget gdisk libssl-dev lz4
\end{bashinput}
\section{Download Yocto}
Expand Down
2 changes: 1 addition & 1 deletion labs/yocto-first-build/yocto-first-build.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ \section{Setup}
Install the required packages:
\begin{bashinput}
sudo apt install bc build-essential chrpath cpio diffstat gawk git python3 texinfo wget
sudo apt install bc build-essential chrpath cpio diffstat gawk git python3 texinfo wget lz4
\end{bashinput}
\section{Download Yocto}
Expand Down
2 changes: 1 addition & 1 deletion slides/audio-alsa-lib/audio-alsa-lib.tex
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ \subsection{alsa-lib}
\item This can be specified as a hardware device. The three
arguments (in order: CARD,DEV,SUBDEV) specify card number or
identifier, device number and subdevice number (-1 means any). For
example: \code{hw:0} or \code{hw:1,0}. Instea of the index, the
example: \code{hw:0} or \code{hw:1,0}. Instead of the index, the
card name can be used: \code{hw:STM32MP15DK,0}
\item Or through the \code{plug} plugin: \code{plug:mypcmdef},
\code{plug:hw:0,0}.
Expand Down
2 changes: 1 addition & 1 deletion slides/audio-asoc-cpu/audio-asoc-cpu.tex
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ \subsection{CPU DAI driver}
\begin{itemize}
\item When a peripheral DMA controller is used, this is more
complex.
\item The driver will have to handle all th aspects of the PCM
\item The driver will have to handle all the aspects of the PCM
stream life cycle.
\item Understandable example in \kfile{sound/soc/atmel/atmel-pcm-pdc.c}
\end{itemize}
Expand Down
4 changes: 2 additions & 2 deletions slides/audio-debugging/audio-debugging.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ \section{Troubleshooting}
\begin{frame}{Troubleshooting: no sound}
Audio seems to play for the correct duration but there is no sound:
\begin{itemize}
\item Unmute \code{Master} and the relevant widgets
\item Unmute \code{Master} and the relevant controls
\item Turn up the volume
\item Check the codec analog muxing and mixing (use alsamixer)
\item Check the amplifier configuration
Expand Down Expand Up @@ -60,7 +60,7 @@ \section{Troubleshooting}

\begin{frame}{Troubleshooting: going further}
\begin{itemize}
\item Use \code{speaker-test} to generate audio an play tones.
\item Use \code{speaker-test} to generate audio and play tones.
\item Be careful with the 440Hz tone, it may not expose all the
errors. Rather play something that is not commonly divisible (e.g.
441Hz)
Expand Down
2 changes: 1 addition & 1 deletion slides/audio-regmap/audio-regmap.tex
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ \subsection{regmap}
\item \code{writeable_reg}, \code{readable_reg},
\code{volatile_reg}, \code{precious_reg}: Optional callbacks
returning true if the register is writeable, readable, volatile or
precious. volatile registers wont be cached. precious registers
precious. volatile registers won't be cached. precious registers
will not be read unless the driver explicitly calls a read
function. There are also tables in the \code{struct regmap_config}
for the same purpose.
Expand Down
8 changes: 4 additions & 4 deletions slides/audio-sound/audio-sound.tex
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ \section{Sound and its representation}
\item The sample size, in bits, then defines the resolution.
\item Common sample sizes are 16 and 24 bits.
\item 8 bits is getting very rare due to the poor audio quality and
32 bits samples can be used when specific alignment is required
32 bits samples can be used when specific alignment is required.
\end{itemize}
\end{frame}

\begin{frame}{Sound digitization - sample format}
There are multiple ways to store samples in memory or on disk:
\begin{itemize}
\item as signed integers
\item as unsigned integer
\item as unsigned integers
\item as floating points
\end{itemize}
Also, they can be stored in little-endian or big-endian order.
Expand All @@ -90,7 +90,7 @@ \section{Sound and its representation}
\item We can then store sound as a sequence of samples and the
specific sample rate that was used.
\item This method is called Linear Pulse-code modulation or LPCM.
\item A sampling rate of 40~kHz is needed.
\item A sampling rate of about 40kHz is needed.
\end{itemize}
\end{frame}

Expand All @@ -108,7 +108,7 @@ \section{Sound and its representation}
17-20 & 16 & Length of format data, 16 for PCM \\
21-22 & 1 & Audio format, 1 for PCM \\
23-24 & 2 & Number of channels \\
25-28 & 44800 & Sample rate \\
25-28 & 48000 & Sample rate \\
29-32 & 176400 & Byte rate = (Sample rate * BitsPerSample * channels) / 8. \\
33-34 & 4 & BlockAlign = (BitsPerSample * Channels) / 8 \\
35-36 & 16 & Bits per sample \\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ \section{Application Debugging}
\item Thanks to \code{signal()} (\href{https://man7.org/linux/man-pages/man7/signal.7.html}{man signal(3)})
we can add hooks on specific signals to print our backtrace
\begin{itemize}
\item This is for example very useful to catch \code{SIGSEV} signal to dump our current backtrace
\item This is for example very useful to catch \code{SIGSEGV} signal to dump our current backtrace
\end{itemize}
\begin{block}{}
\begin{minted}[fontsize=\small]{c}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,32 +132,32 @@ \section{Application Profiling}
\frametitle{Massif report}
\begin{block}{}
\begin{minted}[fontsize=\tiny]{console}
KB
547.0^ # :: : :@ : :: :
| @:#:::::::@::::::::@
| ::@:#:::::::@::::::::@::
| :::::@:#:::::::@::::::::@:::::
| :::::::@:#:::::::@::::::::@:::::::
| :::::::@:#:::::::@::::::::@:::::::
| :::::::@:#:::::::@::::::::@:::::::
| :::::::@:#:::::::@::::::::@:::::::
| @@@@@@@@:::::::@:#:::::::@::::::::@:::::::
| @ :::::::@:#:::::::@::::::::@:::::::
| @ :::::::@:#:::::::@::::::::@:::::::
| :::::::@ :::::::@:#:::::::@::::::::@:::::::
| : @ :::::::@:#:::::::@::::::::@:::::::
| ::::::: @ :::::::@:#:::::::@::::::::@:::::::
| : : @ :::::::@:#:::::::@::::::::@:::::::
| :::::: : @ :::::::@:#:::::::@::::::::@:::::::
| : : : @ :::::::@:#:::::::@::::::::@:::::::
| ::::: : : @ :::::::@:#:::::::@::::::::@:::::::
| :::: : : : @ :::::::@:#:::::::@::::::::@:::::::
| :::: : : : : @ :::::::@:#:::::::@::::::::@:::::::
0 +----------------------------------------------------------------------->KB
0 830.5
KB
547.0^ # :: : :@ : :: :
| @:#:::::::@::::::::@
| ::@:#:::::::@::::::::@::
| :::::@:#:::::::@::::::::@:::::
| :::::::@:#:::::::@::::::::@:::::::
| :::::::@:#:::::::@::::::::@:::::::
| :::::::@:#:::::::@::::::::@:::::::
| :::::::@:#:::::::@::::::::@:::::::
| @@@@@@@@:::::::@:#:::::::@::::::::@:::::::
| @ :::::::@:#:::::::@::::::::@:::::::
| @ :::::::@:#:::::::@::::::::@:::::::
| :::::::@ :::::::@:#:::::::@::::::::@:::::::
| : @ :::::::@:#:::::::@::::::::@:::::::
| ::::::: @ :::::::@:#:::::::@::::::::@:::::::
| : : @ :::::::@:#:::::::@::::::::@:::::::
| :::::: : @ :::::::@:#:::::::@::::::::@:::::::
| : : : @ :::::::@:#:::::::@::::::::@:::::::
| ::::: : : @ :::::::@:#:::::::@::::::::@:::::::
| :::: : : : @ :::::::@:#:::::::@::::::::@:::::::
| :::: : : : : @ :::::::@:#:::::::@::::::::@:::::::
0 +----------------------------------------------------------------------->KB
0 830.5

Number of snapshots: 52
Detailed snapshots: [9, 19, 22 (peak), 32, 42]
Detailed snapshots: [9, 19, 22 (peak), 32, 42]
\end{minted}
\end{block}
\end{frame}
Expand Down Expand Up @@ -261,8 +261,8 @@ \section{Application Profiling}
hardware resources are used.
\item Many hardware elements can have an impact on the program execution:
\begin{itemize}
\item Cache performance can be degraded by an application without memory
spatial locality.
\item CPU cache performance can be degraded by an application without
memory spatial locality.
\item Page miss due to using too much memory without spatial locality.
\item Alignment faults when doing misaligned accesses.
\end{itemize}
Expand Down
Loading

0 comments on commit 1a28748

Please sign in to comment.