mirror of
https://git.yoctoproject.org/poky
synced 2026-01-31 13:58:42 +01:00
Compare commits
94 Commits
styhead
...
yocto-3.2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
943ef2fad8 | ||
|
|
76dac9d657 | ||
|
|
333f24caec | ||
|
|
e5bd9b93b4 | ||
|
|
a4ff9dd2dc | ||
|
|
2d3224bf20 | ||
|
|
e6f6420d98 | ||
|
|
f0b8b3a960 | ||
|
|
fef73fcd3a | ||
|
|
d12e2d67c9 | ||
|
|
eeb98ec6ae | ||
|
|
3f2bc0a2e1 | ||
|
|
cbd023e0db | ||
|
|
307146220b | ||
|
|
d754cd3a49 | ||
|
|
3d5309b736 | ||
|
|
369b6e0192 | ||
|
|
e03e489758 | ||
|
|
321e17803e | ||
|
|
086ed4af2a | ||
|
|
67ff1d9ffb | ||
|
|
8de9b33e14 | ||
|
|
afe59c8e1d | ||
|
|
f6434fde67 | ||
|
|
e46465c718 | ||
|
|
e4156f232b | ||
|
|
bfa254bd1a | ||
|
|
4315a12330 | ||
|
|
9b58e1d1a8 | ||
|
|
f4ff33fd11 | ||
|
|
f9f50c5638 | ||
|
|
23eef02eff | ||
|
|
bef1f4761e | ||
|
|
8b9bdf1d1e | ||
|
|
1a4b81a392 | ||
|
|
c111b692cc | ||
|
|
701e43727a | ||
|
|
dedca9ecb7 | ||
|
|
d890775c90 | ||
|
|
fd3e68b355 | ||
|
|
678eafa74d | ||
|
|
c2014927f2 | ||
|
|
c5b7872dab | ||
|
|
2691a54e91 | ||
|
|
e2de476001 | ||
|
|
45c8a7e583 | ||
|
|
4d2fd8ddd3 | ||
|
|
ea0af53e2a | ||
|
|
2d342da2a3 | ||
|
|
f1b304df93 | ||
|
|
b569f2a414 | ||
|
|
411f541288 | ||
|
|
83477f0280 | ||
|
|
7e7893983f | ||
|
|
e3a67d60cc | ||
|
|
23a0428069 | ||
|
|
b74901b816 | ||
|
|
010625f35a | ||
|
|
0647439a0a | ||
|
|
87a05c7316 | ||
|
|
5c33ee311c | ||
|
|
3ad92d4d09 | ||
|
|
5e5a7fd73d | ||
|
|
3269613984 | ||
|
|
b955cbdcfb | ||
|
|
58e47e1b70 | ||
|
|
bb0524e189 | ||
|
|
7d58c8bed6 | ||
|
|
5232b03e22 | ||
|
|
e2312cd887 | ||
|
|
f552970178 | ||
|
|
d59e28ea73 | ||
|
|
61642ef429 | ||
|
|
7f6f1519b9 | ||
|
|
528de6bc4f | ||
|
|
0ccf16fab3 | ||
|
|
4e513e2b86 | ||
|
|
1272d1b8fc | ||
|
|
686396e3dc | ||
|
|
2fa7fde32f | ||
|
|
72050b72e2 | ||
|
|
2fa97151cd | ||
|
|
e67a7af07c | ||
|
|
2306702899 | ||
|
|
f652c4d1b8 | ||
|
|
ca1ed50ab3 | ||
|
|
46db037b1f | ||
|
|
70761072f5 | ||
|
|
efa68c6490 | ||
|
|
3daa976efb | ||
|
|
4d35e4b168 | ||
|
|
dff89518bd | ||
|
|
cdae385f7d | ||
|
|
b7a7dde44a |
35
bitbake/doc/Makefile
Normal file
35
bitbake/doc/Makefile
Normal file
@@ -0,0 +1,35 @@
|
||||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line, and also
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?=
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
SOURCEDIR = .
|
||||
BUILDDIR = _build
|
||||
DESTDIR = final
|
||||
|
||||
ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0)
|
||||
$(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed")
|
||||
endif
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile clean publish
|
||||
|
||||
publish: Makefile html singlehtml
|
||||
rm -rf $(BUILDDIR)/$(DESTDIR)/
|
||||
mkdir -p $(BUILDDIR)/$(DESTDIR)/
|
||||
cp -r $(BUILDDIR)/html/* $(BUILDDIR)/$(DESTDIR)/
|
||||
cp $(BUILDDIR)/singlehtml/index.html $(BUILDDIR)/$(DESTDIR)/singleindex.html
|
||||
sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html
|
||||
|
||||
clean:
|
||||
@rm -rf $(BUILDDIR)
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
@@ -1,180 +0,0 @@
|
||||
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
|
||||
|
||||
**********************
|
||||
Using the Command Line
|
||||
**********************
|
||||
|
||||
Recall that earlier the manual discussed how to use an existing
|
||||
toolchain tarball that had been installed into the default installation
|
||||
directory, ``/opt/poky/DISTRO``, which is outside of the :term:`Build Directory`
|
||||
(see the section
|
||||
"`Using a Cross-Toolchain
|
||||
Tarball) <#using-an-existing-toolchain-tarball>`__". And, that sourcing
|
||||
your architecture-specific environment setup script initializes a
|
||||
suitable cross-toolchain development environment.
|
||||
|
||||
During this setup, locations for the compiler, QEMU scripts, QEMU
|
||||
binary, a special version of ``pkgconfig`` and other useful utilities
|
||||
are added to the ``PATH`` variable. Also, variables to assist
|
||||
``pkgconfig`` and ``autotools`` are also defined so that, for example,
|
||||
``configure.sh`` can find pre-generated test results for tests that need
|
||||
target hardware on which to run. You can see the "`Setting Up the
|
||||
Cross-Development
|
||||
Environment <#setting-up-the-cross-development-environment>`__" section
|
||||
for the list of cross-toolchain environment variables established by the
|
||||
script.
|
||||
|
||||
Collectively, these conditions allow you to easily use the toolchain
|
||||
outside of the OpenEmbedded build environment on both Autotools-based
|
||||
projects and Makefile-based projects. This chapter provides information
|
||||
for both these types of projects.
|
||||
|
||||
Autotools-Based Projects
|
||||
========================
|
||||
|
||||
Once you have a suitable cross-toolchain installed, it is very easy to
|
||||
develop a project outside of the OpenEmbedded build system. This section
|
||||
presents a simple "Helloworld" example that shows how to set up,
|
||||
compile, and run the project.
|
||||
|
||||
Creating and Running a Project Based on GNU Autotools
|
||||
-----------------------------------------------------
|
||||
|
||||
Follow these steps to create a simple Autotools-based project:
|
||||
|
||||
1. *Create your directory:* Create a clean directory for your project
|
||||
and then make that directory your working location: $ mkdir
|
||||
$HOME/helloworld $ cd $HOME/helloworld
|
||||
|
||||
2. *Populate the directory:* Create ``hello.c``, ``Makefile.am``, and
|
||||
``configure.in`` files as follows:
|
||||
|
||||
- For ``hello.c``, include these lines: #include <stdio.h> main() {
|
||||
printf("Hello World!\n"); }
|
||||
|
||||
- For ``Makefile.am``, include these lines: bin_PROGRAMS = hello
|
||||
hello_SOURCES = hello.c
|
||||
|
||||
- For ``configure.in``, include these lines: AC_INIT(hello.c)
|
||||
AM_INIT_AUTOMAKE(hello,0.1) AC_PROG_CC AC_PROG_INSTALL
|
||||
AC_OUTPUT(Makefile)
|
||||
|
||||
3. *Source the cross-toolchain environment setup file:* Installation of
|
||||
the cross-toolchain creates a cross-toolchain environment setup
|
||||
script in the directory that the ADT was installed. Before you can
|
||||
use the tools to develop your project, you must source this setup
|
||||
script. The script begins with the string "environment-setup" and
|
||||
contains the machine architecture, which is followed by the string
|
||||
"poky-linux". Here is an example that sources a script from the
|
||||
default ADT installation directory that uses the 32-bit Intel x86
|
||||
Architecture and the DISTRO_NAME Yocto Project release: $ source
|
||||
/opt/poky/DISTRO/environment-setup-i586-poky-linux
|
||||
|
||||
4. *Generate the local aclocal.m4 files and create the configure
|
||||
script:* The following GNU Autotools generate the local
|
||||
``aclocal.m4`` files and create the configure script: $ aclocal $
|
||||
autoconf
|
||||
|
||||
5. *Generate files needed by GNU coding standards:* GNU coding
|
||||
standards require certain files in order for the project to be
|
||||
compliant. This command creates those files: $ touch NEWS README
|
||||
AUTHORS ChangeLog
|
||||
|
||||
6. *Generate the configure file:* This command generates the
|
||||
``configure``: $ automake -a
|
||||
|
||||
7. *Cross-compile the project:* This command compiles the project using
|
||||
the cross-compiler. The
|
||||
:term:`CONFIGURE_FLAGS`
|
||||
environment variable provides the minimal arguments for GNU
|
||||
configure: $ ./configure ${CONFIGURE_FLAGS}
|
||||
|
||||
8. *Make and install the project:* These two commands generate and
|
||||
install the project into the destination directory: $ make $ make
|
||||
install DESTDIR=./tmp
|
||||
|
||||
9. *Verify the installation:* This command is a simple way to verify
|
||||
the installation of your project. Running the command prints the
|
||||
architecture on which the binary file can run. This architecture
|
||||
should be the same architecture that the installed cross-toolchain
|
||||
supports. $ file ./tmp/usr/local/bin/hello
|
||||
|
||||
10. *Execute your project:* To execute the project in the shell, simply
|
||||
enter the name. You could also copy the binary to the actual target
|
||||
hardware and run the project there as well: $ ./hello As expected,
|
||||
the project displays the "Hello World!" message.
|
||||
|
||||
Passing Host Options
|
||||
--------------------
|
||||
|
||||
For an Autotools-based project, you can use the cross-toolchain by just
|
||||
passing the appropriate host option to ``configure.sh``. The host option
|
||||
you use is derived from the name of the environment setup script found
|
||||
in the directory in which you installed the cross-toolchain. For
|
||||
example, the host option for an ARM-based target that uses the GNU EABI
|
||||
is ``armv5te-poky-linux-gnueabi``. You will notice that the name of the
|
||||
script is ``environment-setup-armv5te-poky-linux-gnueabi``. Thus, the
|
||||
following command works to update your project and rebuild it using the
|
||||
appropriate cross-toolchain tools: $ ./configure
|
||||
--host=armv5te-poky-linux-gnueabi \\ --with-libtool-sysroot=sysroot_dir
|
||||
|
||||
.. note::
|
||||
|
||||
If the
|
||||
configure
|
||||
script results in problems recognizing the
|
||||
--with-libtool-sysroot=
|
||||
sysroot-dir
|
||||
option, regenerate the script to enable the support by doing the
|
||||
following and then run the script again:
|
||||
::
|
||||
|
||||
$ libtoolize --automake
|
||||
$ aclocal -I ${OECORE_NATIVE_SYSROOT}/usr/share/aclocal \
|
||||
[-I dir_containing_your_project-specific_m4_macros]
|
||||
$ autoconf
|
||||
$ autoheader
|
||||
$ automake -a
|
||||
|
||||
|
||||
Makefile-Based Projects
|
||||
=======================
|
||||
|
||||
For Makefile-based projects, the cross-toolchain environment variables
|
||||
established by running the cross-toolchain environment setup script are
|
||||
subject to general ``make`` rules.
|
||||
|
||||
To illustrate this, consider the following four cross-toolchain
|
||||
environment variables:
|
||||
:term:`CC`\ =i586-poky-linux-gcc -m32
|
||||
-march=i586 --sysroot=/opt/poky/1.8/sysroots/i586-poky-linux
|
||||
:term:`LD`\ =i586-poky-linux-ld
|
||||
--sysroot=/opt/poky/1.8/sysroots/i586-poky-linux
|
||||
:term:`CFLAGS`\ =-O2 -pipe -g
|
||||
-feliminate-unused-debug-types
|
||||
:term:`CXXFLAGS`\ =-O2 -pipe -g
|
||||
-feliminate-unused-debug-types Now, consider the following three cases:
|
||||
|
||||
- *Case 1 - No Variables Set in the ``Makefile``:* Because these
|
||||
variables are not specifically set in the ``Makefile``, the variables
|
||||
retain their values based on the environment.
|
||||
|
||||
- *Case 2 - Variables Set in the ``Makefile``:* Specifically setting
|
||||
variables in the ``Makefile`` during the build results in the
|
||||
environment settings of the variables being overwritten.
|
||||
|
||||
- *Case 3 - Variables Set when the ``Makefile`` is Executed from the
|
||||
Command Line:* Executing the ``Makefile`` from the command line
|
||||
results in the variables being overwritten with command-line content
|
||||
regardless of what is being set in the ``Makefile``. In this case,
|
||||
environment variables are not considered unless you use the "-e" flag
|
||||
during the build: $ make -e file If you use this flag, then the
|
||||
environment values of the variables override any variables
|
||||
specifically set in the ``Makefile``.
|
||||
|
||||
.. note::
|
||||
|
||||
For the list of variables set up by the cross-toolchain environment
|
||||
setup script, see the "
|
||||
Setting Up the Cross-Development Environment
|
||||
" section.
|
||||
@@ -1,138 +0,0 @@
|
||||
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
|
||||
|
||||
*****************************************
|
||||
The Application Development Toolkit (ADT)
|
||||
*****************************************
|
||||
|
||||
Part of the Yocto Project development solution is an Application
|
||||
Development Toolkit (ADT). The ADT provides you with a custom-built,
|
||||
cross-development platform suited for developing a user-targeted product
|
||||
application.
|
||||
|
||||
Fundamentally, the ADT consists of the following:
|
||||
|
||||
- An architecture-specific cross-toolchain and matching sysroot both
|
||||
built by the :term:`OpenEmbedded Build System`.
|
||||
The toolchain and
|
||||
sysroot are based on a `Metadata <&YOCTO_DOCS_DEV_URL;#metadata>`__
|
||||
configuration and extensions, which allows you to cross-develop on
|
||||
the host machine for the target hardware.
|
||||
|
||||
- The Eclipse IDE Yocto Plug-in.
|
||||
|
||||
- The Quick EMUlator (QEMU), which lets you simulate target hardware.
|
||||
|
||||
- Various user-space tools that greatly enhance your application
|
||||
development experience.
|
||||
|
||||
The Cross-Development Toolchain
|
||||
===============================
|
||||
|
||||
The `Cross-Development
|
||||
Toolchain <&YOCTO_DOCS_DEV_URL;#cross-development-toolchain>`__ consists
|
||||
of a cross-compiler, cross-linker, and cross-debugger that are used to
|
||||
develop user-space applications for targeted hardware. This toolchain is
|
||||
created either by running the ADT Installer script, a toolchain
|
||||
installer script, or through a :term:`Build Directory`
|
||||
that is based on
|
||||
your Metadata configuration or extension for your targeted device. The
|
||||
cross-toolchain works with a matching target sysroot.
|
||||
|
||||
Sysroot
|
||||
=======
|
||||
|
||||
The matching target sysroot contains needed headers and libraries for
|
||||
generating binaries that run on the target architecture. The sysroot is
|
||||
based on the target root filesystem image that is built by the
|
||||
OpenEmbedded build system and uses the same Metadata configuration used
|
||||
to build the cross-toolchain.
|
||||
|
||||
.. _eclipse-overview:
|
||||
|
||||
Eclipse Yocto Plug-in
|
||||
=====================
|
||||
|
||||
The Eclipse IDE is a popular development environment and it fully
|
||||
supports development using the Yocto Project. When you install and
|
||||
configure the Eclipse Yocto Project Plug-in into the Eclipse IDE, you
|
||||
maximize your Yocto Project experience. Installing and configuring the
|
||||
Plug-in results in an environment that has extensions specifically
|
||||
designed to let you more easily develop software. These extensions allow
|
||||
for cross-compilation, deployment, and execution of your output into a
|
||||
QEMU emulation session. You can also perform cross-debugging and
|
||||
profiling. The environment also supports a suite of tools that allows
|
||||
you to perform remote profiling, tracing, collection of power data,
|
||||
collection of latency data, and collection of performance data.
|
||||
|
||||
For information about the application development workflow that uses the
|
||||
Eclipse IDE and for a detailed example of how to install and configure
|
||||
the Eclipse Yocto Project Plug-in, see the "`Working Within
|
||||
Eclipse <&YOCTO_DOCS_DEV_URL;#adt-eclipse>`__" section of the Yocto
|
||||
Project Development Manual.
|
||||
|
||||
The QEMU Emulator
|
||||
=================
|
||||
|
||||
The QEMU emulator allows you to simulate your hardware while running
|
||||
your application or image. QEMU is made available a number of ways:
|
||||
|
||||
- If you use the ADT Installer script to install ADT, you can specify
|
||||
whether or not to install QEMU.
|
||||
|
||||
- If you have cloned the ``poky`` Git repository to create a
|
||||
:term:`Source Directory` and you have
|
||||
sourced the environment setup script, QEMU is installed and
|
||||
automatically available.
|
||||
|
||||
- If you have downloaded a Yocto Project release and unpacked it to
|
||||
create a :term:`Source Directory`
|
||||
and you have sourced the environment setup script, QEMU is installed
|
||||
and automatically available.
|
||||
|
||||
- If you have installed the cross-toolchain tarball and you have
|
||||
sourced the toolchain's setup environment script, QEMU is also
|
||||
installed and automatically available.
|
||||
|
||||
User-Space Tools
|
||||
================
|
||||
|
||||
User-space tools are included as part of the Yocto Project. You will
|
||||
find these tools helpful during development. The tools include
|
||||
LatencyTOP, PowerTOP, OProfile, Perf, SystemTap, and Lttng-ust. These
|
||||
tools are common development tools for the Linux platform.
|
||||
|
||||
- *LatencyTOP:* LatencyTOP focuses on latency that causes skips in
|
||||
audio, stutters in your desktop experience, or situations that
|
||||
overload your server even when you have plenty of CPU power left.
|
||||
|
||||
- *PowerTOP:* Helps you determine what software is using the most
|
||||
power. You can find out more about PowerTOP at
|
||||
https://01.org/powertop/.
|
||||
|
||||
- *OProfile:* A system-wide profiler for Linux systems that is capable
|
||||
of profiling all running code at low overhead. You can find out more
|
||||
about OProfile at http://oprofile.sourceforge.net/about/. For
|
||||
examples on how to setup and use this tool, see the
|
||||
"`OProfile <&YOCTO_DOCS_PROF_URL;#profile-manual-oprofile>`__"
|
||||
section in the Yocto Project Profiling and Tracing Manual.
|
||||
|
||||
- *Perf:* Performance counters for Linux used to keep track of certain
|
||||
types of hardware and software events. For more information on these
|
||||
types of counters see https://perf.wiki.kernel.org/. For
|
||||
examples on how to setup and use this tool, see the
|
||||
"`perf <&YOCTO_DOCS_PROF_URL;#profile-manual-perf>`__" section in the
|
||||
Yocto Project Profiling and Tracing Manual.
|
||||
|
||||
- *SystemTap:* A free software infrastructure that simplifies
|
||||
information gathering about a running Linux system. This information
|
||||
helps you diagnose performance or functional problems. SystemTap is
|
||||
not available as a user-space tool through the Eclipse IDE Yocto
|
||||
Plug-in. See http://sourceware.org/systemtap for more
|
||||
information on SystemTap. For examples on how to setup and use this
|
||||
tool, see the
|
||||
"`SystemTap <&YOCTO_DOCS_PROF_URL;#profile-manual-systemtap>`__"
|
||||
section in the Yocto Project Profiling and Tracing Manual.
|
||||
|
||||
- *Lttng-ust:* A User-space Tracer designed to provide detailed
|
||||
information on user-space activity. See http://lttng.org/ust
|
||||
for more information on Lttng-ust.
|
||||
@@ -1,24 +0,0 @@
|
||||
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
|
||||
|
||||
************
|
||||
Introduction
|
||||
************
|
||||
|
||||
Welcome to the Yocto Project Application Developer's Guide. This manual
|
||||
provides information that lets you begin developing applications using
|
||||
the Yocto Project.
|
||||
|
||||
The Yocto Project provides an application development environment based
|
||||
on an Application Development Toolkit (ADT) and the availability of
|
||||
stand-alone cross-development toolchains and other tools. This manual
|
||||
describes the ADT and how you can configure and install it, how to
|
||||
access and use the cross-development toolchains, how to customize the
|
||||
development packages installation, how to use command-line development
|
||||
for both Autotools-based and Makefile-based projects, and an
|
||||
introduction to the Eclipse IDE Yocto Plug-in.
|
||||
|
||||
.. note::
|
||||
|
||||
The ADT is distribution-neutral and does not require the Yocto
|
||||
Project reference distribution, which is called Poky. This manual,
|
||||
however, uses examples that use the Poky distribution.
|
||||
@@ -1,17 +0,0 @@
|
||||
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
|
||||
|
||||
===========================================
|
||||
Yocto Project Application Developer's Guide
|
||||
===========================================
|
||||
|
||||
|
|
||||
|
||||
.. toctree::
|
||||
:caption: Table of Contents
|
||||
:numbered:
|
||||
|
||||
adt-manual-intro
|
||||
adt-intro
|
||||
adt-prepare
|
||||
adt-package
|
||||
adt-command
|
||||
@@ -1,70 +0,0 @@
|
||||
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
|
||||
|
||||
************************************************************
|
||||
Optionally Customizing the Development Packages Installation
|
||||
************************************************************
|
||||
|
||||
Because the Yocto Project is suited for embedded Linux development, it
|
||||
is likely that you will need to customize your development packages
|
||||
installation. For example, if you are developing a minimal image, then
|
||||
you might not need certain packages (e.g. graphics support packages).
|
||||
Thus, you would like to be able to remove those packages from your
|
||||
target sysroot.
|
||||
|
||||
Package Management Systems
|
||||
==========================
|
||||
|
||||
The OpenEmbedded build system supports the generation of sysroot files
|
||||
using three different Package Management Systems (PMS):
|
||||
|
||||
- *OPKG:* A less well known PMS whose use originated in the
|
||||
OpenEmbedded and OpenWrt embedded Linux projects. This PMS works with
|
||||
files packaged in an ``.ipk`` format. See
|
||||
http://en.wikipedia.org/wiki/Opkg for more information about
|
||||
OPKG.
|
||||
|
||||
- *RPM:* A more widely known PMS intended for GNU/Linux distributions.
|
||||
This PMS works with files packaged in an ``.rpm`` format. The build
|
||||
system currently installs through this PMS by default. See
|
||||
http://en.wikipedia.org/wiki/RPM_Package_Manager for more
|
||||
information about RPM.
|
||||
|
||||
- *Debian:* The PMS for Debian-based systems is built on many PMS
|
||||
tools. The lower-level PMS tool ``dpkg`` forms the base of the Debian
|
||||
PMS. For information on dpkg see
|
||||
http://en.wikipedia.org/wiki/Dpkg.
|
||||
|
||||
Configuring the PMS
|
||||
===================
|
||||
|
||||
Whichever PMS you are using, you need to be sure that the
|
||||
:term:`PACKAGE_CLASSES`
|
||||
variable in the ``conf/local.conf`` file is set to reflect that system.
|
||||
The first value you choose for the variable specifies the package file
|
||||
format for the root filesystem at sysroot. Additional values specify
|
||||
additional formats for convenience or testing. See the
|
||||
``conf/local.conf`` configuration file for details.
|
||||
|
||||
.. note::
|
||||
|
||||
For build performance information related to the PMS, see the "
|
||||
package.bbclass
|
||||
" section in the Yocto Project Reference Manual.
|
||||
|
||||
As an example, consider a scenario where you are using OPKG and you want
|
||||
to add the ``libglade`` package to the target sysroot.
|
||||
|
||||
First, you should generate the IPK file for the ``libglade`` package and
|
||||
add it into a working ``opkg`` repository. Use these commands: $ bitbake
|
||||
libglade $ bitbake package-index
|
||||
|
||||
Next, source the cross-toolchain environment setup script found in the
|
||||
:term:`Source Directory`. Follow
|
||||
that by setting up the installation destination to point to your sysroot
|
||||
as sysroot_dir. Finally, have an OPKG configuration file conf_file that
|
||||
corresponds to the ``opkg`` repository you have just created. The
|
||||
following command forms should now work: $ opkg-cl –f conf_file -o
|
||||
sysroot_dir update $ opkg-cl –f cconf_file -o sysroot_dir \\
|
||||
--force-overwrite install libglade $ opkg-cl –f cconf_file -o
|
||||
sysroot_dir \\ --force-overwrite install libglade-dbg $ opkg-cl –f
|
||||
conf_file> -osysroot_dir> \\ --force-overwrite install libglade-dev
|
||||
@@ -1,752 +0,0 @@
|
||||
.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
|
||||
|
||||
*************************************
|
||||
Preparing for Application Development
|
||||
*************************************
|
||||
|
||||
In order to develop applications, you need set up your host development
|
||||
system. Several ways exist that allow you to install cross-development
|
||||
tools, QEMU, the Eclipse Yocto Plug-in, and other tools. This chapter
|
||||
describes how to prepare for application development.
|
||||
|
||||
.. _installing-the-adt:
|
||||
|
||||
Installing the ADT and Toolchains
|
||||
=================================
|
||||
|
||||
The following list describes installation methods that set up varying
|
||||
degrees of tool availability on your system. Regardless of the
|
||||
installation method you choose, you must ``source`` the cross-toolchain
|
||||
environment setup script, which establishes several key environment
|
||||
variables, before you use a toolchain. See the "`Setting Up the
|
||||
Cross-Development
|
||||
Environment <#setting-up-the-cross-development-environment>`__" section
|
||||
for more information.
|
||||
|
||||
.. note::
|
||||
|
||||
Avoid mixing installation methods when installing toolchains for
|
||||
different architectures. For example, avoid using the ADT Installer
|
||||
to install some toolchains and then hand-installing cross-development
|
||||
toolchains by running the toolchain installer for different
|
||||
architectures. Mixing installation methods can result in situations
|
||||
where the ADT Installer becomes unreliable and might not install the
|
||||
toolchain.
|
||||
|
||||
If you must mix installation methods, you might avoid problems by
|
||||
deleting ``/var/lib/opkg``, thus purging the ``opkg`` package
|
||||
metadata.
|
||||
|
||||
- *Use the ADT installer script:* This method is the recommended way to
|
||||
install the ADT because it automates much of the process for you. For
|
||||
example, you can configure the installation to install the QEMU
|
||||
emulator and the user-space NFS, specify which root filesystem
|
||||
profiles to download, and define the target sysroot location.
|
||||
|
||||
- *Use an existing toolchain:* Using this method, you select and
|
||||
download an architecture-specific toolchain installer and then run
|
||||
the script to hand-install the toolchain. If you use this method, you
|
||||
just get the cross-toolchain and QEMU - you do not get any of the
|
||||
other mentioned benefits had you run the ADT Installer script.
|
||||
|
||||
- *Use the toolchain from within the Build Directory:* If you already
|
||||
have a :term:`Build Directory`,
|
||||
you can build the cross-toolchain within the directory. However, like
|
||||
the previous method mentioned, you only get the cross-toolchain and
|
||||
QEMU - you do not get any of the other benefits without taking
|
||||
separate steps.
|
||||
|
||||
Using the ADT Installer
|
||||
-----------------------
|
||||
|
||||
To run the ADT Installer, you need to get the ADT Installer tarball, be
|
||||
sure you have the necessary host development packages that support the
|
||||
ADT Installer, and then run the ADT Installer Script.
|
||||
|
||||
For a list of the host packages needed to support ADT installation and
|
||||
use, see the "ADT Installer Extras" lists in the "`Required Packages for
|
||||
the Host Development
|
||||
System <&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system>`__"
|
||||
section of the Yocto Project Reference Manual.
|
||||
|
||||
Getting the ADT Installer Tarball
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ADT Installer is contained in the ADT Installer tarball. You can get
|
||||
the tarball using either of these methods:
|
||||
|
||||
- *Download the Tarball:* You can download the tarball from
|
||||
` <&YOCTO_ADTINSTALLER_DL_URL;>`__ into any directory.
|
||||
|
||||
- *Build the Tarball:* You can use
|
||||
:term:`BitBake` to generate the
|
||||
tarball inside an existing :term:`Build Directory`.
|
||||
|
||||
If you use BitBake to generate the ADT Installer tarball, you must
|
||||
``source`` the environment setup script
|
||||
(````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ or
|
||||
```oe-init-build-env-memres`` <&YOCTO_DOCS_REF_URL;#structure-memres-core-script>`__)
|
||||
located in the Source Directory before running the ``bitbake``
|
||||
command that creates the tarball.
|
||||
|
||||
The following example commands establish the
|
||||
:term:`Source Directory`, check out the
|
||||
current release branch, set up the build environment while also
|
||||
creating the default Build Directory, and run the ``bitbake`` command
|
||||
that results in the tarball
|
||||
``poky/build/tmp/deploy/sdk/adt_installer.tar.bz2``:
|
||||
|
||||
.. note::
|
||||
|
||||
Before using BitBake to build the ADT tarball, be sure to make
|
||||
sure your
|
||||
local.conf
|
||||
file is properly configured. See the "
|
||||
User Configuration
|
||||
" section in the Yocto Project Reference Manual for general
|
||||
configuration information.
|
||||
|
||||
$ cd ~ $ git clone git://git.yoctoproject.org/poky $ cd poky $ git
|
||||
checkout -b DISTRO_NAME origin/DISTRO_NAME $ source oe-init-build-env $
|
||||
bitbake adt-installer
|
||||
|
||||
Configuring and Running the ADT Installer Script
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Before running the ADT Installer script, you need to unpack the tarball.
|
||||
You can unpack the tarball in any directory you wish. For example, this
|
||||
command copies the ADT Installer tarball from where it was built into
|
||||
the home directory and then unpacks the tarball into a top-level
|
||||
directory named ``adt-installer``: $ cd ~ $ cp
|
||||
poky/build/tmp/deploy/sdk/adt_installer.tar.bz2 $HOME $ tar -xjf
|
||||
adt_installer.tar.bz2 Unpacking it creates the directory
|
||||
``adt-installer``, which contains the ADT Installer script
|
||||
(``adt_installer``) and its configuration file (``adt_installer.conf``).
|
||||
|
||||
Before you run the script, however, you should examine the ADT Installer
|
||||
configuration file and be sure you are going to get what you want. Your
|
||||
configurations determine which kernel and filesystem image are
|
||||
downloaded.
|
||||
|
||||
The following list describes the configurations you can define for the
|
||||
ADT Installer. For configuration values and restrictions, see the
|
||||
comments in the ``adt-installer.conf`` file:
|
||||
|
||||
- ``YOCTOADT_REPO``: This area includes the IPKG-based packages and the
|
||||
root filesystem upon which the installation is based. If you want to
|
||||
set up your own IPKG repository pointed to by ``YOCTOADT_REPO``, you
|
||||
need to be sure that the directory structure follows the same layout
|
||||
as the reference directory set up at
|
||||
http://adtrepo.yoctoproject.org. Also, your repository needs
|
||||
to be accessible through HTTP.
|
||||
|
||||
- ``YOCTOADT_TARGETS``: The machine target architectures for which you
|
||||
want to set up cross-development environments.
|
||||
|
||||
- ``YOCTOADT_QEMU``: Indicates whether or not to install the emulator
|
||||
QEMU.
|
||||
|
||||
- ``YOCTOADT_NFS_UTIL``: Indicates whether or not to install user-mode
|
||||
NFS. If you plan to use the Eclipse IDE Yocto plug-in against QEMU,
|
||||
you should install NFS.
|
||||
|
||||
.. note::
|
||||
|
||||
To boot QEMU images using our userspace NFS server, you need to be
|
||||
running
|
||||
portmap
|
||||
or
|
||||
rpcbind
|
||||
. If you are running
|
||||
rpcbind
|
||||
, you will also need to add the
|
||||
-i
|
||||
option when
|
||||
rpcbind
|
||||
starts up. Please make sure you understand the security
|
||||
implications of doing this. You might also have to modify your
|
||||
firewall settings to allow NFS booting to work.
|
||||
|
||||
- ``YOCTOADT_ROOTFS_``\ arch: The root filesystem images you want to
|
||||
download from the ``YOCTOADT_IPKG_REPO`` repository.
|
||||
|
||||
- ``YOCTOADT_TARGET_SYSROOT_IMAGE_``\ arch: The particular root
|
||||
filesystem used to extract and create the target sysroot. The value
|
||||
of this variable must have been specified with
|
||||
``YOCTOADT_ROOTFS_``\ arch. For example, if you downloaded both
|
||||
``minimal`` and ``sato-sdk`` images by setting
|
||||
``YOCTOADT_ROOTFS_``\ arch to "minimal sato-sdk", then
|
||||
``YOCTOADT_ROOTFS_``\ arch must be set to either "minimal" or
|
||||
"sato-sdk".
|
||||
|
||||
- ``YOCTOADT_TARGET_SYSROOT_LOC_``\ arch: The location on the
|
||||
development host where the target sysroot is created.
|
||||
|
||||
After you have configured the ``adt_installer.conf`` file, run the
|
||||
installer using the following command: $ cd adt-installer $
|
||||
./adt_installer Once the installer begins to run, you are asked to enter
|
||||
the location for cross-toolchain installation. The default location is
|
||||
``/opt/poky/``\ release. After either accepting the default location or
|
||||
selecting your own location, you are prompted to run the installation
|
||||
script interactively or in silent mode. If you want to closely monitor
|
||||
the installation, choose "I" for interactive mode rather than "S" for
|
||||
silent mode. Follow the prompts from the script to complete the
|
||||
installation.
|
||||
|
||||
Once the installation completes, the ADT, which includes the
|
||||
cross-toolchain, is installed in the selected installation directory.
|
||||
You will notice environment setup files for the cross-toolchain in the
|
||||
installation directory, and image tarballs in the ``adt-installer``
|
||||
directory according to your installer configurations, and the target
|
||||
sysroot located according to the ``YOCTOADT_TARGET_SYSROOT_LOC_``\ arch
|
||||
variable also in your configuration file.
|
||||
|
||||
.. _using-an-existing-toolchain-tarball:
|
||||
|
||||
Using a Cross-Toolchain Tarball
|
||||
-------------------------------
|
||||
|
||||
If you want to simply install a cross-toolchain by hand, you can do so
|
||||
by running the toolchain installer. The installer includes the pre-built
|
||||
cross-toolchain, the ``runqemu`` script, and support files. If you use
|
||||
this method to install the cross-toolchain, you might still need to
|
||||
install the target sysroot by installing and extracting it separately.
|
||||
For information on how to install the sysroot, see the "`Extracting the
|
||||
Root Filesystem <#extracting-the-root-filesystem>`__" section.
|
||||
|
||||
Follow these steps:
|
||||
|
||||
1. *Get your toolchain installer using one of the following methods:*
|
||||
|
||||
- Go to ` <&YOCTO_TOOLCHAIN_DL_URL;>`__ and find the folder that
|
||||
matches your host development system (i.e. ``i686`` for 32-bit
|
||||
machines or ``x86_64`` for 64-bit machines).
|
||||
|
||||
Go into that folder and download the toolchain installer whose
|
||||
name includes the appropriate target architecture. The toolchains
|
||||
provided by the Yocto Project are based off of the
|
||||
``core-image-sato`` image and contain libraries appropriate for
|
||||
developing against that image. For example, if your host
|
||||
development system is a 64-bit x86 system and you are going to use
|
||||
your cross-toolchain for a 32-bit x86 target, go into the
|
||||
``x86_64`` folder and download the following installer:
|
||||
poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
|
||||
|
||||
- Build your own toolchain installer. For cases where you cannot use
|
||||
an installer from the download area, you can build your own as
|
||||
described in the "`Optionally Building a Toolchain
|
||||
Installer <#optionally-building-a-toolchain-installer>`__"
|
||||
section.
|
||||
|
||||
2. *Once you have the installer, run it to install the toolchain:*
|
||||
|
||||
.. note::
|
||||
|
||||
You must change the permissions on the toolchain installer script
|
||||
so that it is executable.
|
||||
|
||||
The following command shows how to run the installer given a
|
||||
toolchain tarball for a 64-bit x86 development host system and a
|
||||
32-bit x86 target architecture. The example assumes the toolchain
|
||||
installer is located in ``~/Downloads/``. $
|
||||
~/Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
|
||||
The first thing the installer prompts you for is the directory into
|
||||
which you want to install the toolchain. The default directory used
|
||||
is ``/opt/poky/DISTRO``. If you do not have write permissions for the
|
||||
directory into which you are installing the toolchain, the toolchain
|
||||
installer notifies you and exits. Be sure you have write permissions
|
||||
in the directory and run the installer again.
|
||||
|
||||
When the script finishes, the cross-toolchain is installed. You will
|
||||
notice environment setup files for the cross-toolchain in the
|
||||
installation directory.
|
||||
|
||||
.. _using-the-toolchain-from-within-the-build-tree:
|
||||
|
||||
Using BitBake and the Build Directory
|
||||
-------------------------------------
|
||||
|
||||
A final way of making the cross-toolchain available is to use BitBake to
|
||||
generate the toolchain within an existing :term:`Build Directory`.
|
||||
This method does
|
||||
not install the toolchain into the default ``/opt`` directory. As with
|
||||
the previous method, if you need to install the target sysroot, you must
|
||||
do that separately as well.
|
||||
|
||||
Follow these steps to generate the toolchain into the Build Directory:
|
||||
|
||||
1. *Set up the Build Environment:* Source the OpenEmbedded build
|
||||
environment setup script (i.e.
|
||||
````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ or
|
||||
```oe-init-build-env-memres`` <&YOCTO_DOCS_REF_URL;#structure-memres-core-script>`__)
|
||||
located in the :term:`Source Directory`.
|
||||
|
||||
2. *Check your Local Configuration File:* At this point, you should be
|
||||
sure that the :term:`MACHINE`
|
||||
variable in the ``local.conf`` file found in the ``conf`` directory
|
||||
of the Build Directory is set for the target architecture. Comments
|
||||
within the ``local.conf`` file list the values you can use for the
|
||||
``MACHINE`` variable. If you do not change the ``MACHINE`` variable,
|
||||
the OpenEmbedded build system uses ``qemux86`` as the default target
|
||||
machine when building the cross-toolchain.
|
||||
|
||||
.. note::
|
||||
|
||||
You can populate the Build Directory with the cross-toolchains for
|
||||
more than a single architecture. You just need to edit the
|
||||
MACHINE
|
||||
variable in the
|
||||
local.conf
|
||||
file and re-run the
|
||||
bitbake
|
||||
command.
|
||||
|
||||
3. *Make Sure Your Layers are Enabled:* Examine the
|
||||
``conf/bblayers.conf`` file and make sure that you have enabled all
|
||||
the compatible layers for your target machine. The OpenEmbedded build
|
||||
system needs to be aware of each layer you want included when
|
||||
building images and cross-toolchains. For information on how to
|
||||
enable a layer, see the "`Enabling Your
|
||||
Layer <&YOCTO_DOCS_DEV_URL;#enabling-your-layer>`__" section in the
|
||||
Yocto Project Development Manual.
|
||||
|
||||
4. *Generate the Cross-Toolchain:* Run ``bitbake meta-ide-support`` to
|
||||
complete the cross-toolchain generation. Once the ``bitbake`` command
|
||||
finishes, the cross-toolchain is generated and populated within the
|
||||
Build Directory. You will notice environment setup files for the
|
||||
cross-toolchain that contain the string "``environment-setup``" in
|
||||
the Build Directory's ``tmp`` folder.
|
||||
|
||||
Be aware that when you use this method to install the toolchain, you
|
||||
still need to separately extract and install the sysroot filesystem.
|
||||
For information on how to do this, see the "`Extracting the Root
|
||||
Filesystem <#extracting-the-root-filesystem>`__" section.
|
||||
|
||||
Setting Up the Cross-Development Environment
|
||||
============================================
|
||||
|
||||
Before you can develop using the cross-toolchain, you need to set up the
|
||||
cross-development environment by sourcing the toolchain's environment
|
||||
setup script. If you used the ADT Installer or hand-installed
|
||||
cross-toolchain, then you can find this script in the directory you
|
||||
chose for installation. For this release, the default installation
|
||||
directory is ````. If you installed the toolchain in the
|
||||
:term:`Build Directory`, you can find the
|
||||
environment setup script for the toolchain in the Build Directory's
|
||||
``tmp`` directory.
|
||||
|
||||
Be sure to run the environment setup script that matches the
|
||||
architecture for which you are developing. Environment setup scripts
|
||||
begin with the string "``environment-setup``" and include as part of
|
||||
their name the architecture. For example, the toolchain environment
|
||||
setup script for a 64-bit IA-based architecture installed in the default
|
||||
installation directory would be the following:
|
||||
YOCTO_ADTPATH_DIR/environment-setup-x86_64-poky-linux When you run the
|
||||
setup script, many environment variables are defined:
|
||||
:term:`SDKTARGETSYSROOT` -
|
||||
The path to the sysroot used for cross-compilation
|
||||
:term:`PKG_CONFIG_PATH` - The
|
||||
path to the target pkg-config files
|
||||
:term:`CONFIG_SITE` - A GNU
|
||||
autoconf site file preconfigured for the target
|
||||
:term:`CC` - The minimal command and
|
||||
arguments to run the C compiler
|
||||
:term:`CXX` - The minimal command and
|
||||
arguments to run the C++ compiler
|
||||
:term:`CPP` - The minimal command and
|
||||
arguments to run the C preprocessor
|
||||
:term:`AS` - The minimal command and
|
||||
arguments to run the assembler :term:`LD`
|
||||
- The minimal command and arguments to run the linker
|
||||
:term:`GDB` - The minimal command and
|
||||
arguments to run the GNU Debugger
|
||||
:term:`STRIP` - The minimal command and
|
||||
arguments to run 'strip', which strips symbols
|
||||
:term:`RANLIB` - The minimal command
|
||||
and arguments to run 'ranlib'
|
||||
:term:`OBJCOPY` - The minimal command
|
||||
and arguments to run 'objcopy'
|
||||
:term:`OBJDUMP` - The minimal command
|
||||
and arguments to run 'objdump' :term:`AR`
|
||||
- The minimal command and arguments to run 'ar'
|
||||
:term:`NM` - The minimal command and
|
||||
arguments to run 'nm'
|
||||
:term:`TARGET_PREFIX` - The
|
||||
toolchain binary prefix for the target tools
|
||||
:term:`CROSS_COMPILE` - The
|
||||
toolchain binary prefix for the target tools
|
||||
:term:`CONFIGURE_FLAGS` - The
|
||||
minimal arguments for GNU configure
|
||||
:term:`CFLAGS` - Suggested C flags
|
||||
:term:`CXXFLAGS` - Suggested C++
|
||||
flags :term:`LDFLAGS` - Suggested
|
||||
linker flags when you use CC to link
|
||||
:term:`CPPFLAGS` - Suggested
|
||||
preprocessor flags
|
||||
|
||||
Securing Kernel and Filesystem Images
|
||||
=====================================
|
||||
|
||||
You will need to have a kernel and filesystem image to boot using your
|
||||
hardware or the QEMU emulator. Furthermore, if you plan on booting your
|
||||
image using NFS or you want to use the root filesystem as the target
|
||||
sysroot, you need to extract the root filesystem.
|
||||
|
||||
Getting the Images
|
||||
------------------
|
||||
|
||||
To get the kernel and filesystem images, you either have to build them
|
||||
or download pre-built versions. For an example of how to build these
|
||||
images, see the "`Buiding
|
||||
Images <&YOCTO_DOCS_QS_URL;#qs-buiding-images>`__" section of the Yocto
|
||||
Project Quick Start. For an example of downloading pre-build versions,
|
||||
see the "`Example Using Pre-Built Binaries and
|
||||
QEMU <#using-pre-built>`__" section.
|
||||
|
||||
The Yocto Project ships basic kernel and filesystem images for several
|
||||
architectures (``x86``, ``x86-64``, ``mips``, ``powerpc``, and ``arm``)
|
||||
that you can use unaltered in the QEMU emulator. These kernel images
|
||||
reside in the release area - ` <&YOCTO_MACHINES_DL_URL;>`__ and are
|
||||
ideal for experimentation using Yocto Project. For information on the
|
||||
image types you can build using the OpenEmbedded build system, see the
|
||||
":ref:`ref-manual/ref-images:Images`" chapter in the Yocto
|
||||
Project Reference Manual.
|
||||
|
||||
If you are planning on developing against your image and you are not
|
||||
building or using one of the Yocto Project development images (e.g.
|
||||
``core-image-*-dev``), you must be sure to include the development
|
||||
packages as part of your image recipe.
|
||||
|
||||
If you plan on remotely deploying and debugging your application from
|
||||
within the Eclipse IDE, you must have an image that contains the Yocto
|
||||
Target Communication Framework (TCF) agent (``tcf-agent``). You can do
|
||||
this by including the ``eclipse-debug`` image feature.
|
||||
|
||||
.. note::
|
||||
|
||||
See the "
|
||||
Image Features
|
||||
" section in the Yocto Project Reference Manual for information on
|
||||
image features.
|
||||
|
||||
To include the ``eclipse-debug`` image feature, modify your
|
||||
``local.conf`` file in the :term:`Build Directory`
|
||||
so that the
|
||||
:term:`EXTRA_IMAGE_FEATURES`
|
||||
variable includes the "eclipse-debug" feature. After modifying the
|
||||
configuration file, you can rebuild the image. Once the image is
|
||||
rebuilt, the ``tcf-agent`` will be included in the image and is launched
|
||||
automatically after the boot.
|
||||
|
||||
Extracting the Root Filesystem
|
||||
------------------------------
|
||||
|
||||
If you install your toolchain by hand or build it using BitBake and you
|
||||
need a root filesystem, you need to extract it separately. If you use
|
||||
the ADT Installer to install the ADT, the root filesystem is
|
||||
automatically extracted and installed.
|
||||
|
||||
Here are some cases where you need to extract the root filesystem:
|
||||
|
||||
- You want to boot the image using NFS.
|
||||
|
||||
- You want to use the root filesystem as the target sysroot. For
|
||||
example, the Eclipse IDE environment with the Eclipse Yocto Plug-in
|
||||
installed allows you to use QEMU to boot under NFS.
|
||||
|
||||
- You want to develop your target application using the root filesystem
|
||||
as the target sysroot.
|
||||
|
||||
To extract the root filesystem, first ``source`` the cross-development
|
||||
environment setup script to establish necessary environment variables.
|
||||
If you built the toolchain in the Build Directory, you will find the
|
||||
toolchain environment script in the ``tmp`` directory. If you installed
|
||||
the toolchain by hand, the environment setup script is located in
|
||||
``/opt/poky/DISTRO``.
|
||||
|
||||
After sourcing the environment script, use the ``runqemu-extract-sdk``
|
||||
command and provide the filesystem image.
|
||||
|
||||
Following is an example. The second command sets up the environment. In
|
||||
this case, the setup script is located in the ``/opt/poky/DISTRO``
|
||||
directory. The third command extracts the root filesystem from a
|
||||
previously built filesystem that is located in the ``~/Downloads``
|
||||
directory. Furthermore, this command extracts the root filesystem into
|
||||
the ``qemux86-sato`` directory: $ cd ~ $ source
|
||||
/opt/poky/DISTRO/environment-setup-i586-poky-linux $ runqemu-extract-sdk
|
||||
\\ ~/Downloads/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2
|
||||
\\ $HOME/qemux86-sato You could now point to the target sysroot at
|
||||
``qemux86-sato``.
|
||||
|
||||
Optionally Building a Toolchain Installer
|
||||
=========================================
|
||||
|
||||
As an alternative to locating and downloading a toolchain installer, you
|
||||
can build the toolchain installer if you have a :term:`Build Directory`.
|
||||
|
||||
.. note::
|
||||
|
||||
Although not the preferred method, it is also possible to use
|
||||
bitbake meta-toolchain
|
||||
to build the toolchain installer. If you do use this method, you must
|
||||
separately install and extract the target sysroot. For information on
|
||||
how to install the sysroot, see the "
|
||||
Extracting the Root Filesystem
|
||||
" section.
|
||||
|
||||
To build the toolchain installer and populate the SDK image, use the
|
||||
following command: $ bitbake image -c populate_sdk The command results
|
||||
in a toolchain installer that contains the sysroot that matches your
|
||||
target root filesystem.
|
||||
|
||||
Another powerful feature is that the toolchain is completely
|
||||
self-contained. The binaries are linked against their own copy of
|
||||
``libc``, which results in no dependencies on the target system. To
|
||||
achieve this, the pointer to the dynamic loader is configured at install
|
||||
time since that path cannot be dynamically altered. This is the reason
|
||||
for a wrapper around the ``populate_sdk`` archive.
|
||||
|
||||
Another feature is that only one set of cross-canadian toolchain
|
||||
binaries are produced per architecture. This feature takes advantage of
|
||||
the fact that the target hardware can be passed to ``gcc`` as a set of
|
||||
compiler options. Those options are set up by the environment script and
|
||||
contained in variables such as :term:`CC`
|
||||
and :term:`LD`. This reduces the space
|
||||
needed for the tools. Understand, however, that a sysroot is still
|
||||
needed for every target since those binaries are target-specific.
|
||||
|
||||
Remember, before using any BitBake command, you must source the build
|
||||
environment setup script (i.e.
|
||||
````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ or
|
||||
```oe-init-build-env-memres`` <&YOCTO_DOCS_REF_URL;#structure-memres-core-script>`__)
|
||||
located in the Source Directory and you must make sure your
|
||||
``conf/local.conf`` variables are correct. In particular, you need to be
|
||||
sure the :term:`MACHINE` variable
|
||||
matches the architecture for which you are building and that the
|
||||
:term:`SDKMACHINE` variable is
|
||||
correctly set if you are building a toolchain designed to run on an
|
||||
architecture that differs from your current development host machine
|
||||
(i.e. the build machine).
|
||||
|
||||
When the ``bitbake`` command completes, the toolchain installer will be
|
||||
in ``tmp/deploy/sdk`` in the Build Directory.
|
||||
|
||||
.. note::
|
||||
|
||||
By default, this toolchain does not build static binaries. If you
|
||||
want to use the toolchain to build these types of libraries, you need
|
||||
to be sure your image has the appropriate static development
|
||||
libraries. Use the
|
||||
IMAGE_INSTALL
|
||||
variable inside your
|
||||
local.conf
|
||||
file to install the appropriate library packages. Following is an
|
||||
example using
|
||||
glibc
|
||||
static development libraries:
|
||||
::
|
||||
|
||||
IMAGE_INSTALL_append = " glibc-staticdev"
|
||||
|
||||
|
||||
Optionally Using an External Toolchain
|
||||
======================================
|
||||
|
||||
You might want to use an external toolchain as part of your development.
|
||||
If this is the case, the fundamental steps you need to accomplish are as
|
||||
follows:
|
||||
|
||||
- Understand where the installed toolchain resides. For cases where you
|
||||
need to build the external toolchain, you would need to take separate
|
||||
steps to build and install the toolchain.
|
||||
|
||||
- Make sure you add the layer that contains the toolchain to your
|
||||
``bblayers.conf`` file through the
|
||||
:term:`BBLAYERS` variable.
|
||||
|
||||
- Set the
|
||||
:term:`EXTERNAL_TOOLCHAIN`
|
||||
variable in your ``local.conf`` file to the location in which you
|
||||
installed the toolchain.
|
||||
|
||||
A good example of an external toolchain used with the Yocto Project is
|
||||
Mentor Graphics Sourcery G++ Toolchain. You can see information on how
|
||||
to use that particular layer in the ``README`` file at
|
||||
http://github.com/MentorEmbedded/meta-sourcery/. You can find
|
||||
further information by reading about the
|
||||
:term:`TCMODE` variable in the Yocto
|
||||
Project Reference Manual's variable glossary.
|
||||
|
||||
.. _using-pre-built:
|
||||
|
||||
Example Using Pre-Built Binaries and QEMU
|
||||
=========================================
|
||||
|
||||
If hardware, libraries and services are stable, you can get started by
|
||||
using a pre-built binary of the filesystem image, kernel, and toolchain
|
||||
and run it using the QEMU emulator. This scenario is useful for
|
||||
developing application software.
|
||||
|
||||
|Using a Pre-Built Image|
|
||||
|
||||
For this scenario, you need to do several things:
|
||||
|
||||
- Install the appropriate stand-alone toolchain tarball.
|
||||
|
||||
- Download the pre-built image that will boot with QEMU. You need to be
|
||||
sure to get the QEMU image that matches your target machine's
|
||||
architecture (e.g. x86, ARM, etc.).
|
||||
|
||||
- Download the filesystem image for your target machine's architecture.
|
||||
|
||||
- Set up the environment to emulate the hardware and then start the
|
||||
QEMU emulator.
|
||||
|
||||
Installing the Toolchain
|
||||
------------------------
|
||||
|
||||
You can download a tarball installer, which includes the pre-built
|
||||
toolchain, the ``runqemu`` script, and support files from the
|
||||
appropriate directory under ` <&YOCTO_TOOLCHAIN_DL_URL;>`__. Toolchains
|
||||
are available for 32-bit and 64-bit x86 development systems from the
|
||||
``i686`` and ``x86_64`` directories, respectively. The toolchains the
|
||||
Yocto Project provides are based off the ``core-image-sato`` image and
|
||||
contain libraries appropriate for developing against that image. Each
|
||||
type of development system supports five or more target architectures.
|
||||
|
||||
The names of the tarball installer scripts are such that a string
|
||||
representing the host system appears first in the filename and then is
|
||||
immediately followed by a string representing the target architecture.
|
||||
|
||||
::
|
||||
|
||||
poky-glibc-host_system-image_type-arch-toolchain-release_version.sh
|
||||
|
||||
Where:
|
||||
host_system is a string representing your development system:
|
||||
|
||||
i686 or x86_64.
|
||||
|
||||
image_type is a string representing the image you wish to
|
||||
develop a Software Development Toolkit (SDK) for use against.
|
||||
The Yocto Project builds toolchain installers using the
|
||||
following BitBake command:
|
||||
|
||||
bitbake core-image-sato -c populate_sdk
|
||||
|
||||
arch is a string representing the tuned target architecture:
|
||||
|
||||
i586, x86_64, powerpc, mips, armv7a or armv5te
|
||||
|
||||
release_version is a string representing the release number of the
|
||||
Yocto Project:
|
||||
|
||||
DISTRO, DISTRO+snapshot
|
||||
|
||||
|
||||
For example, the following toolchain installer is for a 64-bit
|
||||
development host system and a i586-tuned target architecture based off
|
||||
the SDK for ``core-image-sato``:
|
||||
poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
|
||||
|
||||
Toolchains are self-contained and by default are installed into
|
||||
``/opt/poky``. However, when you run the toolchain installer, you can
|
||||
choose an installation directory.
|
||||
|
||||
The following command shows how to run the installer given a toolchain
|
||||
tarball for a 64-bit x86 development host system and a 32-bit x86 target
|
||||
architecture. You must change the permissions on the toolchain installer
|
||||
script so that it is executable.
|
||||
|
||||
The example assumes the toolchain installer is located in
|
||||
``~/Downloads/``.
|
||||
|
||||
.. note::
|
||||
|
||||
If you do not have write permissions for the directory into which you
|
||||
are installing the toolchain, the toolchain installer notifies you
|
||||
and exits. Be sure you have write permissions in the directory and
|
||||
run the installer again.
|
||||
|
||||
$ ~/Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
|
||||
|
||||
For more information on how to install tarballs, see the "`Using a
|
||||
Cross-Toolchain
|
||||
Tarball <&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball>`__"
|
||||
and "`Using BitBake and the Build
|
||||
Directory <&YOCTO_DOCS_ADT_URL;#using-the-toolchain-from-within-the-build-tree>`__"
|
||||
sections in the Yocto Project Application Developer's Guide.
|
||||
|
||||
Downloading the Pre-Built Linux Kernel
|
||||
--------------------------------------
|
||||
|
||||
You can download the pre-built Linux kernel suitable for running in the
|
||||
QEMU emulator from ` <&YOCTO_QEMU_DL_URL;>`__. Be sure to use the kernel
|
||||
that matches the architecture you want to simulate. Download areas exist
|
||||
for the five supported machine architectures: ``qemuarm``, ``qemumips``,
|
||||
``qemuppc``, ``qemux86``, and ``qemux86-64``.
|
||||
|
||||
Most kernel files have one of the following forms: \*zImage-qemuarch.bin
|
||||
vmlinux-qemuarch.bin Where: arch is a string representing the target
|
||||
architecture: x86, x86-64, ppc, mips, or arm.
|
||||
|
||||
You can learn more about downloading a Yocto Project kernel in the
|
||||
"`Yocto Project Kernel <&YOCTO_DOCS_DEV_URL;#local-kernel-files>`__"
|
||||
bulleted item in the Yocto Project Development Manual.
|
||||
|
||||
Downloading the Filesystem
|
||||
--------------------------
|
||||
|
||||
You can also download the filesystem image suitable for your target
|
||||
architecture from ` <&YOCTO_QEMU_DL_URL;>`__. Again, be sure to use the
|
||||
filesystem that matches the architecture you want to simulate.
|
||||
|
||||
The filesystem image has two tarball forms: ``ext3`` and ``tar``. You
|
||||
must use the ``ext3`` form when booting an image using the QEMU
|
||||
emulator. The ``tar`` form can be flattened out in your host development
|
||||
system and used for build purposes with the Yocto Project.
|
||||
core-image-profile-qemuarch.ext3 core-image-profile-qemuarch.tar.bz2
|
||||
Where: profile is the filesystem image's profile: lsb, lsb-dev, lsb-sdk,
|
||||
lsb-qt3, minimal, minimal-dev, sato, sato-dev, or sato-sdk. For
|
||||
information on these types of image profiles, see the
|
||||
":ref:`ref-manual/ref-images:Images`" chapter in the Yocto
|
||||
Project Reference Manual. arch is a string representing the target
|
||||
architecture: x86, x86-64, ppc, mips, or arm.
|
||||
|
||||
Setting Up the Environment and Starting the QEMU Emulator
|
||||
---------------------------------------------------------
|
||||
|
||||
Before you start the QEMU emulator, you need to set up the emulation
|
||||
environment. The following command form sets up the emulation
|
||||
environment. $ source
|
||||
YOCTO_ADTPATH_DIR/environment-setup-arch-poky-linux-if Where: arch is a
|
||||
string representing the target architecture: i586, x86_64, ppc603e,
|
||||
mips, or armv5te. if is a string representing an embedded application
|
||||
binary interface. Not all setup scripts include this string.
|
||||
|
||||
Finally, this command form invokes the QEMU emulator $ runqemu qemuarch
|
||||
kernel-image filesystem-image Where: qemuarch is a string representing
|
||||
the target architecture: qemux86, qemux86-64, qemuppc, qemumips, or
|
||||
qemuarm. kernel-image is the architecture-specific kernel image.
|
||||
filesystem-image is the .ext3 filesystem image.
|
||||
|
||||
Continuing with the example, the following two commands setup the
|
||||
emulation environment and launch QEMU. This example assumes the root
|
||||
filesystem (``.ext3`` file) and the pre-built kernel image file both
|
||||
reside in your home directory. The kernel and filesystem are for a
|
||||
32-bit target architecture. $ cd $HOME $ source
|
||||
YOCTO_ADTPATH_DIR/environment-setup-i586-poky-linux $ runqemu qemux86
|
||||
bzImage-qemux86.bin \\ core-image-sato-qemux86.ext3
|
||||
|
||||
The environment in which QEMU launches varies depending on the
|
||||
filesystem image and on the target architecture. For example, if you
|
||||
source the environment for the ARM target architecture and then boot the
|
||||
minimal QEMU image, the emulator comes up in a new shell in command-line
|
||||
mode. However, if you boot the SDK image, QEMU comes up with a GUI.
|
||||
|
||||
.. note::
|
||||
|
||||
Booting the PPC image results in QEMU launching in the same shell in
|
||||
command-line mode.
|
||||
|
||||
.. |Using a Pre-Built Image| image:: figures/using-a-pre-built-image.png
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
@@ -16,7 +16,7 @@ import os
|
||||
import sys
|
||||
import datetime
|
||||
|
||||
current_version = "dev"
|
||||
current_version = "3.2.1"
|
||||
|
||||
# String used in sidebar
|
||||
version = 'Version: ' + current_version
|
||||
@@ -53,8 +53,7 @@ templates_path = ['_templates']
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'boilerplate.rst',
|
||||
'adt-manual/*.rst']
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'boilerplate.rst']
|
||||
|
||||
# master document name. The default changed from contents to index. so better
|
||||
# set it ourselves.
|
||||
@@ -83,7 +82,7 @@ extlinks = {
|
||||
|
||||
# Intersphinx config to use cross reference with Bitbake user manual
|
||||
intersphinx_mapping = {
|
||||
'bitbake': ('https://docs.yoctoproject.org/bitbake/', None)
|
||||
'bitbake': ('https://docs.yoctoproject.org/bitbake/1.48', None)
|
||||
}
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
@@ -1,63 +1,15 @@
|
||||
DISTRO : "3.1"
|
||||
DISTRO_COMPRESSED : "31"
|
||||
DISTRO_NAME_NO_CAP : "dunfell"
|
||||
DISTRO_NAME : "Dunfell"
|
||||
DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus"
|
||||
DISTRO_NAME_MINUS_ONE : "Zeus"
|
||||
YOCTO_DOC_VERSION : "3.1"
|
||||
YOCTO_DOC_VERSION_MINUS_ONE : "3.0.2"
|
||||
DISTRO_REL_TAG : "yocto-3.1"
|
||||
METAINTELVERSION : "12.0"
|
||||
REL_MONTH_YEAR : "April 2020"
|
||||
META_INTEL_REL_TAG : "&METAINTELVERSION;-&DISTRO_NAME_NO_CAP;-&YOCTO_DOC_VERSION;"
|
||||
POKYVERSION : "23.0.0"
|
||||
POKYVERSION_COMPRESSED : "2300"
|
||||
DISTRO : "3.2.1"
|
||||
DISTRO_NAME_NO_CAP : "gatesgarth"
|
||||
DISTRO_NAME : "Gatesgarth"
|
||||
DISTRO_NAME_NO_CAP_MINUS_ONE : "dunfell"
|
||||
YOCTO_DOC_VERSION : "3.2.1"
|
||||
YOCTO_DOC_VERSION_MINUS_ONE : "3.1.3"
|
||||
DISTRO_REL_TAG : "yocto-3.2.1"
|
||||
POKYVERSION : "24.0.1"
|
||||
YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
|
||||
COPYRIGHT_YEAR : "2010-2020"
|
||||
ORGNAME : "The Yocto Project"
|
||||
ORGEMAIL : "docs@lists.yoctoproject.org"
|
||||
YOCTO_DL_URL : "https://downloads.yoctoproject.org"
|
||||
YOCTO_HOME_URL : "https://www.yoctoproject.org"
|
||||
YOCTO_LISTS_URL : "https://lists.yoctoproject.org"
|
||||
YOCTO_BUGZILLA_URL : "https://bugzilla.yoctoproject.org"
|
||||
YOCTO_WIKI_URL : "https://wiki.yoctoproject.org"
|
||||
YOCTO_AB_URL : "https://autobuilder.yoctoproject.org"
|
||||
YOCTO_GIT_URL : "https://git.yoctoproject.org"
|
||||
YOCTO_ADTREPO_URL : "http://adtrepo.yoctoproject.org"
|
||||
OE_HOME_URL : "https://www.openembedded.org"
|
||||
OE_LISTS_URL : "https://lists.openembedded.org"
|
||||
OE_DOCS_URL : "https://docs.openembedded.org"
|
||||
OH_HOME_URL : "http://o-hand.com"
|
||||
BITBAKE_HOME_URL : "http://developer.berlios.de/projects/bitbake/"
|
||||
YOCTO_DOCS_URL : "&YOCTO_HOME_URL;/docs"
|
||||
YOCTO_SOURCES_URL : "&YOCTO_HOME_URL;/sources/"
|
||||
YOCTO_AB_PORT_URL : "https://autobuilder.yocto.io/"
|
||||
YOCTO_AB_NIGHTLY_URL : "&YOCTO_AB_PORT_URL;/pub/nightly/"
|
||||
YOCTO_POKY_URL : "&YOCTO_DL_URL;/releases/poky/"
|
||||
YOCTO_RELEASE_DL_URL : "&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;"
|
||||
YOCTO_TOOLCHAIN_DL_URL : "&YOCTO_RELEASE_DL_URL;/toolchain/"
|
||||
YOCTO_ADTINSTALLER_DL_URL : "&YOCTO_RELEASE_DL_URL;/adt-installer"
|
||||
YOCTO_POKY_DL_URL : "&YOCTO_RELEASE_DL_URL;/&YOCTO_POKY;.tar.bz2"
|
||||
YOCTO_MACHINES_DL_URL : "&YOCTO_RELEASE_DL_URL;/machines"
|
||||
YOCTO_QEMU_DL_URL : "&YOCTO_MACHINES_DL_URL;/qemu"
|
||||
YOCTO_PYTHON-i686_DL_URL : "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-i686.tar.bz2"
|
||||
YOCTO_PYTHON-x86_64_DL_URL : "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-x86_64.tar.bz2"
|
||||
YOCTO_DOCS_QS_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/yocto-project-qs/yocto-project-qs.html"
|
||||
YOCTO_DOCS_ADT_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/adt-manual/adt-manual.html"
|
||||
YOCTO_DOCS_REF_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/ref-manual/ref-manual.html"
|
||||
YOCTO_DOCS_BSP_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bsp-guide/bsp-guide.html"
|
||||
YOCTO_DOCS_DEV_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/dev-manual/dev-manual.html"
|
||||
YOCTO_DOCS_KERNEL_DEV_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/kernel-dev/kernel-dev.html"
|
||||
YOCTO_DOCS_PROF_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/profile-manual/profile-manual.html"
|
||||
YOCTO_DOCS_MM_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/mega-manual/mega-manual.html"
|
||||
YOCTO_DOCS_BB_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bitbake-user-manual/bitbake-user-manual.html"
|
||||
YOCTO_DOCS_TOAST_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/toaster-manual/toaster-manual.html"
|
||||
YOCTO_DOCS_SDK_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/sdk-manual/sdk-manual.html"
|
||||
YOCTO_DOCS_OM_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/overview-manual/overview-manual.html"
|
||||
YOCTO_DOCS_BRIEF_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/brief-yoctoprojectqs/brief-yoctoprojectqs.html"
|
||||
YOCTO_ADTPATH_DIR : "/opt/poky/&DISTRO;"
|
||||
YOCTO_POKY_TARBALL : "&YOCTO_POKY;.tar.bz2"
|
||||
OE_INIT_PATH : "&YOCTO_POKY;/oe-init-build-env"
|
||||
UBUNTU_HOST_PACKAGES_ESSENTIAL : "gawk wget git-core diffstat unzip texinfo gcc-multilib \
|
||||
build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
|
||||
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
Current Release Manuals
|
||||
=========================
|
||||
|
||||
*******************************
|
||||
3.2 'gatesgarth' Release Series
|
||||
*******************************
|
||||
|
||||
- :yocto_docs:`3.2 Documentation </3.2>`
|
||||
|
||||
****************************
|
||||
3.1 'dunfell' Release Series
|
||||
****************************
|
||||
@@ -11,6 +17,7 @@
|
||||
- :yocto_docs:`3.1 Documentation </3.1>`
|
||||
- :yocto_docs:`3.1.1 Documentation </3.1.1>`
|
||||
- :yocto_docs:`3.1.2 Documentation </3.1.2>`
|
||||
- :yocto_docs:`3.1.3 Documentation </3.1.3>`
|
||||
|
||||
==========================
|
||||
Previous Release Manuals
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
'use strict';
|
||||
|
||||
var all_versions = {
|
||||
'dev': 'dev (3.2)',
|
||||
'dev': 'dev (3.3)',
|
||||
'3.2': '3.2',
|
||||
'3.1.3': '3.1.3',
|
||||
'3.0.4': '3.0.4',
|
||||
'2.7.4': '2.7.4',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
DISTRO_VERSION = "3.2"
|
||||
DISTRO_VERSION = "3.2.1"
|
||||
DISTRO_CODENAME = "gatesgarth"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}', 'snapshot')}"
|
||||
|
||||
@@ -208,6 +208,9 @@ def check_cves(d, patched_cves):
|
||||
"""
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
pn = d.getVar("PN")
|
||||
real_pv = d.getVar("PV")
|
||||
|
||||
cves_unpatched = []
|
||||
# CVE_PRODUCT can contain more than one product (eg. curl/libcurl)
|
||||
products = d.getVar("CVE_PRODUCT").split()
|
||||
@@ -217,7 +220,7 @@ def check_cves(d, patched_cves):
|
||||
pv = d.getVar("CVE_VERSION").split("+git")[0]
|
||||
|
||||
# If the recipe has been whitlisted we return empty lists
|
||||
if d.getVar("PN") in d.getVar("CVE_CHECK_PN_WHITELIST").split():
|
||||
if pn in d.getVar("CVE_CHECK_PN_WHITELIST").split():
|
||||
bb.note("Recipe has been whitelisted, skipping check")
|
||||
return ([], [], [])
|
||||
|
||||
@@ -286,12 +289,12 @@ def check_cves(d, patched_cves):
|
||||
vulnerable = vulnerable_start or vulnerable_end
|
||||
|
||||
if vulnerable:
|
||||
bb.note("%s-%s is vulnerable to %s" % (product, pv, cve))
|
||||
bb.note("%s-%s is vulnerable to %s" % (pn, real_pv, cve))
|
||||
cves_unpatched.append(cve)
|
||||
break
|
||||
|
||||
if not vulnerable:
|
||||
bb.note("%s-%s is not vulnerable to %s" % (product, pv, cve))
|
||||
bb.note("%s-%s is not vulnerable to %s" % (pn, real_pv, cve))
|
||||
# TODO: not patched but not vulnerable
|
||||
patched_cves.add(cve)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ export LDCXXSHARED = "${CXX} -shared"
|
||||
export CCSHARED = "-fPIC -DPIC"
|
||||
# LINKFORSHARED are the flags passed to the $(CC) command that links
|
||||
# the python executable
|
||||
export LINKFORSHARED = "{SECURITY_CFLAGS} -Xlinker -export-dynamic"
|
||||
export LINKFORSHARED = "${SECURITY_CFLAGS} -Xlinker -export-dynamic"
|
||||
|
||||
FILES_${PN} += "${libdir}/* ${libdir}/${PYTHON_DIR}/*"
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ python split_kernel_module_packages () {
|
||||
files = d.getVar('FILES_%s' % pkg)
|
||||
files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename)
|
||||
d.setVar('FILES_%s' % pkg, files)
|
||||
d.setVar('CONFFILES_%s' % pkg, files)
|
||||
|
||||
if "description" in vals:
|
||||
old_desc = d.getVar('DESCRIPTION_' + pkg) or ""
|
||||
|
||||
@@ -383,6 +383,10 @@ do_compile_kernelmodules() {
|
||||
# other kernel modules and will look at this
|
||||
# file to do symbol lookups
|
||||
cp ${B}/Module.symvers ${STAGING_KERNEL_BUILDDIR}/
|
||||
# 5.10+ kernels have module.lds that we need to copy for external module builds
|
||||
if [ -e "${B}/scripts/module.lds" ]; then
|
||||
install -Dm 0644 ${B}/scripts/module.lds ${STAGING_KERNEL_BUILDDIR}/scripts/module.lds
|
||||
fi
|
||||
else
|
||||
bbnote "no modules to compile"
|
||||
fi
|
||||
@@ -586,7 +590,7 @@ addtask savedefconfig after do_configure
|
||||
|
||||
inherit cml1
|
||||
|
||||
KCONFIG_CONFIG_COMMAND_append = " HOSTLDFLAGS='${BUILD_LDFLAGS}'"
|
||||
KCONFIG_CONFIG_COMMAND_append = " LD='${KERNEL_LD}' HOSTLDFLAGS='${BUILD_LDFLAGS}'"
|
||||
|
||||
EXPORT_FUNCTIONS do_compile do_install do_configure
|
||||
|
||||
|
||||
@@ -125,7 +125,6 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
|
||||
|
||||
licenses = os.listdir(pkg_license_dir)
|
||||
for lic in licenses:
|
||||
rootfs_license = os.path.join(rootfs_license_dir, lic)
|
||||
pkg_license = os.path.join(pkg_license_dir, lic)
|
||||
pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic)
|
||||
|
||||
@@ -144,6 +143,8 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
|
||||
bad_licenses) == False:
|
||||
continue
|
||||
|
||||
# Make sure we use only canonical name for the license file
|
||||
rootfs_license = os.path.join(rootfs_license_dir, "generic_%s" % generic_lic)
|
||||
if not os.path.exists(rootfs_license):
|
||||
oe.path.copyhardlink(pkg_license, rootfs_license)
|
||||
|
||||
|
||||
@@ -2340,7 +2340,7 @@ python do_package () {
|
||||
# cache. This is useful if an item this class depends on changes in a
|
||||
# way that the output of this class changes. rpmdeps is a good example
|
||||
# as any change to rpmdeps requires this to be rerun.
|
||||
# PACKAGE_BBCLASS_VERSION = "2"
|
||||
# PACKAGE_BBCLASS_VERSION = "4"
|
||||
|
||||
# Init cachedpath
|
||||
global cpath
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
# QB_NETWORK_DEVICE_prepend might be used, since Qemu enumerates the eth*
|
||||
# devices in reverse order to -device arguments.
|
||||
#
|
||||
# QB_TAP_OPT: netowrk option for 'tap' mode, e.g.,
|
||||
# QB_TAP_OPT: network option for 'tap' mode, e.g.,
|
||||
# "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
|
||||
# Note, runqemu will replace "@TAP@" with the one which is used, such as tap0, tap1 ...
|
||||
#
|
||||
|
||||
@@ -7,7 +7,7 @@ ROOTFS_PKGMANAGE = "dpkg apt"
|
||||
do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
|
||||
do_populate_sdk[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot bzip2-native:do_populate_sysroot"
|
||||
do_rootfs[recrdeptask] += "do_package_write_deb do_package_qa"
|
||||
do_rootfs[vardeps] += "PACKAGE_FEED_URIS"
|
||||
do_rootfs[vardeps] += "PACKAGE_FEED_URIS PACKAGE_FEED_BASE_PATHS PACKAGE_FEED_ARCHS"
|
||||
|
||||
do_rootfs[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
|
||||
do_populate_sdk[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
|
||||
|
||||
@@ -11,7 +11,7 @@ ROOTFS_PKGMANAGE = "opkg ${EXTRAOPKGCONFIG}"
|
||||
do_rootfs[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
|
||||
do_populate_sdk[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
|
||||
do_rootfs[recrdeptask] += "do_package_write_ipk do_package_qa"
|
||||
do_rootfs[vardeps] += "PACKAGE_FEED_URIS"
|
||||
do_rootfs[vardeps] += "PACKAGE_FEED_URIS PACKAGE_FEED_BASE_PATHS PACKAGE_FEED_ARCHS"
|
||||
|
||||
do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
|
||||
do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock"
|
||||
|
||||
@@ -24,7 +24,7 @@ do_rootfs[depends] += "${RPMROOTFSDEPENDS}"
|
||||
do_populate_sdk[depends] += "${RPMROOTFSDEPENDS}"
|
||||
|
||||
do_rootfs[recrdeptask] += "do_package_write_rpm do_package_qa"
|
||||
do_rootfs[vardeps] += "PACKAGE_FEED_URIS"
|
||||
do_rootfs[vardeps] += "PACKAGE_FEED_URIS PACKAGE_FEED_BASE_PATHS PACKAGE_FEED_ARCHS"
|
||||
|
||||
python () {
|
||||
if d.getVar('BUILD_IMAGES_FROM_FEEDS'):
|
||||
|
||||
@@ -367,6 +367,7 @@ def testimage_main(d):
|
||||
package_extraction(d, tc.suites)
|
||||
|
||||
results = None
|
||||
complete = False
|
||||
orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception)
|
||||
try:
|
||||
# We need to check if runqemu ends unexpectedly
|
||||
@@ -378,6 +379,7 @@ def testimage_main(d):
|
||||
except ValueError:
|
||||
pass
|
||||
results = tc.runTests()
|
||||
complete = True
|
||||
except (KeyboardInterrupt, BlockingIOError) as err:
|
||||
if isinstance(err, KeyboardInterrupt):
|
||||
bb.error('testimage interrupted, shutting down...')
|
||||
@@ -385,20 +387,21 @@ def testimage_main(d):
|
||||
bb.error('runqemu failed, shutting down...')
|
||||
if results:
|
||||
results.stop()
|
||||
results = None
|
||||
results = tc.results
|
||||
finally:
|
||||
signal.signal(signal.SIGTERM, orig_sigterm_handler)
|
||||
tc.target.stop()
|
||||
|
||||
# Show results (if we have them)
|
||||
if not results:
|
||||
if results:
|
||||
configuration = get_testimage_configuration(d, 'runtime', machine)
|
||||
results.logDetails(get_testimage_json_result_dir(d),
|
||||
configuration,
|
||||
get_testimage_result_id(configuration),
|
||||
dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
|
||||
results.logSummary(pn)
|
||||
if not results or not complete:
|
||||
bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True)
|
||||
configuration = get_testimage_configuration(d, 'runtime', machine)
|
||||
results.logDetails(get_testimage_json_result_dir(d),
|
||||
configuration,
|
||||
get_testimage_result_id(configuration),
|
||||
dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
|
||||
results.logSummary(pn)
|
||||
if not results.wasSuccessful():
|
||||
bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True)
|
||||
|
||||
|
||||
@@ -12,4 +12,4 @@ OELAYOUT_ABI = "14"
|
||||
# a reset of the equivalence, for example when reproducibility issues break the
|
||||
# existing match data. Distros can also append to this value for the same effect.
|
||||
#
|
||||
HASHEQUIV_HASH_VERSION = "3"
|
||||
HASHEQUIV_HASH_VERSION = "4"
|
||||
|
||||
@@ -5,7 +5,9 @@ You can now run 'bitbake <target>'
|
||||
|
||||
Common targets are:
|
||||
core-image-minimal
|
||||
core-image-full-cmdline
|
||||
core-image-sato
|
||||
core-image-weston
|
||||
meta-toolchain
|
||||
meta-ide-support
|
||||
|
||||
|
||||
@@ -104,4 +104,4 @@ SSTATE_EXCLUDEDEPS_SYSROOT += ".*->autoconf-archive-native"
|
||||
# We need to keep bitbake tools in PATH
|
||||
# Avoid empty path entries
|
||||
BITBAKEPATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}"
|
||||
PATH := "${@'${BITBAKEPATH}:' if '${BITBAKEPATH}' is not '' else ''}${HOSTTOOLS_DIR}"
|
||||
PATH := "${@'${BITBAKEPATH}:' if '${BITBAKEPATH}' != '' else ''}${HOSTTOOLS_DIR}"
|
||||
|
||||
43
meta/files/common-licenses/bzip2-1.0.4
Normal file
43
meta/files/common-licenses/bzip2-1.0.4
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
This program, "bzip2", the associated library "libbzip2", and all
|
||||
documentation, are copyright (C) 1996-2006 Julian R Seward. All
|
||||
rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
3. Altered source versions must be plainly marked as such, and must
|
||||
not be misrepresented as being the original software.
|
||||
|
||||
4. The name of the author may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Julian Seward, Cambridge, UK.
|
||||
jseward@bzip.org
|
||||
bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
@@ -41,7 +41,7 @@ ${includedir} 0755 root root true 0644 root root
|
||||
${oldincludedir} 0755 root root true 0644 root root
|
||||
|
||||
# Cleanup debug src
|
||||
/usr/src/debug 0755 root root true - root root
|
||||
/usr/src/debug 0755 root root true 0644 root root
|
||||
|
||||
# Items from base-files
|
||||
# Links
|
||||
|
||||
@@ -41,7 +41,7 @@ ${includedir} 0755 root root true 0644 root root
|
||||
${oldincludedir} 0755 root root true 0644 root root
|
||||
|
||||
# Cleanup debug src
|
||||
/usr/src/debug 0755 root root true - root root
|
||||
/usr/src/debug 0755 root root true 0644 root root
|
||||
|
||||
# Items from base-files
|
||||
# Links
|
||||
|
||||
@@ -31,6 +31,9 @@ class OETestContext(object):
|
||||
self._registry = {}
|
||||
self._registry['cases'] = collections.OrderedDict()
|
||||
|
||||
self.results = unittest.TestResult()
|
||||
unittest.registerResult(self.results)
|
||||
|
||||
def _read_modules_from_manifest(self, manifest):
|
||||
if not os.path.exists(manifest):
|
||||
raise OEQAMissingManifest("Manifest does not exist on %s" % manifest)
|
||||
@@ -82,6 +85,7 @@ class OETestContext(object):
|
||||
self.skipTests(skips)
|
||||
|
||||
self._run_start_time = time.time()
|
||||
self._run_end_time = self._run_start_time
|
||||
if not processes:
|
||||
self.runner.buffer = True
|
||||
result = self.runner.run(self.prepareSuite(self.suites, processes))
|
||||
|
||||
@@ -19,11 +19,15 @@ Among other issues, this fixes:
|
||||
|
||||
Fixes: CVE-2020-14308
|
||||
|
||||
Upstream-Status: Backport [commit f725fa7cb2ece547c5af01eeeecfe8d95802ed41
|
||||
from https://git.savannah.gnu.org/git/grub.git]
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2020-14308
|
||||
|
||||
Reference to upstream patch:
|
||||
https://git.savannah.gnu.org/cgit/grub.git/commit/?id=f725fa7cb2ece547c5af01eeeecfe8d95802ed41
|
||||
|
||||
[YL: don't patch on grub-core/lib/json/json.c, which is not existing in grub 2.04]
|
||||
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
|
||||
---
|
||||
@@ -26,11 +26,15 @@ Among other issues, this fixes:
|
||||
|
||||
Fixes: CVE-2020-14309, CVE-2020-14310, CVE-2020-14311
|
||||
|
||||
Upstream-Status: Backport [commit 3f05d693d1274965ffbe4ba99080dc2c570944c6
|
||||
from https://git.savannah.gnu.org/git/grub.git]
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2020-14309, CVE-2020-14310, CVE-2020-14311
|
||||
|
||||
Reference to upstream patch:
|
||||
https://git.savannah.gnu.org/cgit/grub.git/commit/?id=3f05d693d1274965ffbe4ba99080dc2c570944c6
|
||||
|
||||
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
|
||||
---
|
||||
grub-core/commands/legacycfg.c | 29 +++++++++++++++++++-----
|
||||
@@ -19,11 +19,15 @@ dependent on the current behaviour without being broken.
|
||||
|
||||
Fixes: CVE-2020-15706
|
||||
|
||||
Upstream-Status: Backport [commit 426f57383d647406ae9c628c472059c27cd6e040
|
||||
from https://git.savannah.gnu.org/git/grub.git]
|
||||
|
||||
Signed-off-by: Chris Coulson <chris.coulson@canonical.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2020-15706
|
||||
|
||||
Reference to upstream patch:
|
||||
https://git.savannah.gnu.org/cgit/grub.git/commit/?id=426f57383d647406ae9c628c472059c27cd6e040
|
||||
|
||||
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
|
||||
---
|
||||
grub-core/script/execute.c | 2 ++
|
||||
@@ -7,12 +7,16 @@ These could be triggered by a crafted filesystem with very large files.
|
||||
|
||||
Fixes: CVE-2020-15707
|
||||
|
||||
Upstream-Status: Backport [commit e7b8856f8be3292afdb38d2e8c70ad8d62a61e10
|
||||
from https://git.savannah.gnu.org/git/grub.git]
|
||||
|
||||
Signed-off-by: Colin Watson <cjwatson@debian.org>
|
||||
Reviewed-by: Jan Setje-Eilers <jan.setjeeilers@oracle.com>
|
||||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2020-15707
|
||||
|
||||
Reference to upstream patch:
|
||||
https://git.savannah.gnu.org/cgit/grub.git/commit/?id=e7b8856f8be3292afdb38d2e8c70ad8d62a61e10
|
||||
|
||||
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
|
||||
---
|
||||
grub-core/loader/linux.c | 74 +++++++++++++++++++++++++++++++++++-------------
|
||||
@@ -19,14 +19,14 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
|
||||
file://grub-module-explicitly-keeps-symbole-.module_license.patch \
|
||||
file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
|
||||
file://CVE-2020-10713.patch \
|
||||
file://0001-calloc-Make-sure-we-always-have-an-overflow-checking.patch \
|
||||
file://0002-lvm-Add-LVM-cache-logical-volume-handling.patch \
|
||||
file://0003-calloc-Use-calloc-at-most-places.patch \
|
||||
file://0004-safemath-Add-some-arithmetic-primitives-that-check-f.patch \
|
||||
file://0005-malloc-Use-overflow-checking-primitives-where-we-do-.patch \
|
||||
file://0006-script-Remove-unused-fields-from-grub_script_functio.patch \
|
||||
file://0007-script-Avoid-a-use-after-free-when-redefining-a-func.patch \
|
||||
file://0008-linux-Fix-integer-overflows-in-initrd-size-handling.patch \
|
||||
file://calloc-Make-sure-we-always-have-an-overflow-checking.patch \
|
||||
file://lvm-Add-LVM-cache-logical-volume-handling.patch \
|
||||
file://CVE-2020-14308-calloc-Use-calloc-at-most-places.patch \
|
||||
file://safemath-Add-some-arithmetic-primitives-that-check-f.patch \
|
||||
file://CVE-2020-14309-CVE-2020-14310-CVE-2020-14311-malloc-Use-overflow-checking-primitives-where-we-do-.patch \
|
||||
file://script-Remove-unused-fields-from-grub_script_functio.patch \
|
||||
file://CVE-2020-15706-script-Avoid-a-use-after-free-when-redefining-a-func.patch \
|
||||
file://CVE-2020-15707-linux-Fix-integer-overflows-in-initrd-size-handling.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "5ce674ca6b2612d8939b9e6abed32934"
|
||||
SRC_URI[sha256sum] = "f10c85ae3e204dbaec39ae22fa3c5e99f0665417e91c2cb49b7e5031658ba6ea"
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From ecdcf0df6c28c65ca6d1e5638726e13e373c76c5 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 11 Nov 2020 22:58:55 -0800
|
||||
Subject: [PATCH] Fix cross compilation using autoconf detected AR
|
||||
|
||||
currently its using 'ar' program from build host, which is not expected,
|
||||
we need to respect AR passed in environment
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
configure.in | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index 4ddbe8b..b7c3c31 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -84,6 +84,13 @@ AC_ARG_ENABLE(syslog,
|
||||
])
|
||||
|
||||
dnl Checks for programs.
|
||||
+m4_ifndef([AC_PROG_AR],[dnl
|
||||
+ AN_MAKEVAR([AR], [AC_PROG_AR])
|
||||
+ AN_PROGRAM([ar], [AC_PROG_AR])
|
||||
+ AC_DEFUN([AC_PROG_AR],
|
||||
+ [AC_CHECK_TOOL(AR, ar, :)])
|
||||
+])
|
||||
+AC_PROG_AR
|
||||
AC_PROG_CC
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
dnl AC_PROG_INSTALL included in AM_INIT_AUTOMAKE
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -19,6 +19,7 @@ SRC_URI = "http://www.ohse.de/uwe/releases/lrzsz-${PV}.tar.gz \
|
||||
file://lrzsz-check-locale.h.patch \
|
||||
file://cve-2018-10195.patch \
|
||||
file://include.patch \
|
||||
file://0001-Fix-cross-compilation-using-autoconf-detected-AR.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "b5ce6a74abc9b9eb2af94dffdfd372a4"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require bluez5.inc
|
||||
|
||||
SRC_URI[md5sum] = "e637feb2dbb7582bbbff1708367a847c"
|
||||
SRC_URI[sha256sum] = "68cdab9e63e8832b130d5979dc8c96fdb087b31278f342874d992af3e56656dc"
|
||||
SRC_URI[md5sum] = "94972b8bc7ade60c72b0ffa6ccff2c0a"
|
||||
SRC_URI[sha256sum] = "8863717113c4897e2ad3271fc808ea245319e6fd95eed2e934fae8e0894e9b88"
|
||||
|
||||
# noinst programs in Makefile.tools that are conditional on READLINE
|
||||
# support
|
||||
@@ -27,6 +27,10 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
|
||||
"
|
||||
SRC_URI[sha256sum] = "f2befbe0472fe7eb75d23340eb17531cb6b3aac24075e2066b41f814e12387b2"
|
||||
|
||||
# This CVE is specific to OpenSSH server, as used in Fedora and Red Hat Enterprise Linux 7
|
||||
# and when running in a Kerberos environment. As such it is not relevant to OpenEmbedded
|
||||
CVE_CHECK_WHITELIST += "CVE-2014-9278"
|
||||
|
||||
PAM_SRC_URI = "file://sshd"
|
||||
|
||||
inherit manpages useradd update-rc.d update-alternatives systemd
|
||||
|
||||
@@ -5,10 +5,11 @@ BUGTRACKER = "https://bugs.busybox.net/"
|
||||
|
||||
DEPENDS += "kern-tools-native virtual/crypt"
|
||||
|
||||
# bzip2 applet in busybox is based on lightly-modified bzip2 source
|
||||
# bzip2 applet in busybox is based on lightly-modified bzip2-1.0.4 source
|
||||
# the GPL is version 2 only
|
||||
LICENSE = "GPLv2 & bzip2-1.0.6"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb"
|
||||
LICENSE = "GPLv2 & bzip2-1.0.4"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb \
|
||||
file://archival/libarchive/bz/LICENSE;md5=28e3301eae987e8cfe19988e98383dae"
|
||||
|
||||
SECTION = "base"
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ RDEPENDS_${PN}-ptest += "\
|
||||
${PN}-locale-th \
|
||||
python3-core \
|
||||
python3-modules \
|
||||
python3-dbusmock \
|
||||
${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-dbusmock', '', d)} \
|
||||
${PN}-codegen \
|
||||
"
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ IMAGE_FSTYPES = "wic.vmdk"
|
||||
|
||||
inherit core-image module-base setuptools3
|
||||
|
||||
SRCREV ?= "1dfd37d30953208fd998cef79483f371330a754e"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky \
|
||||
SRCREV ?= "76dac9d657f3b2864dec3bfcd2ee392fafdcdfe6"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=gatesgarth \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
file://README_VirtualBox_Guest_Additions.txt \
|
||||
|
||||
@@ -63,7 +63,7 @@ startup() {
|
||||
stty onlcr 0>&1
|
||||
|
||||
# Limit stack size for startup scripts
|
||||
[ "$STACK_SIZE" == "" ] || ulimit -S -s $STACK_SIZE
|
||||
[ "$STACK_SIZE" = "" ] || ulimit -S -s $STACK_SIZE
|
||||
|
||||
# Now find out what the current and what the previous runlevel are.
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ case "$1" in
|
||||
kill_udevd > "/dev/null" 2>&1
|
||||
|
||||
# trigger the sorted events
|
||||
[ -e /proc/sys/kernel/hotplug ] && echo -e '\000' >/proc/sys/kernel/hotplug
|
||||
[ -e /proc/sys/kernel/hotplug ] && printf '\0\n' >/proc/sys/kernel/hotplug
|
||||
@UDEVD@ -d
|
||||
|
||||
udevadm control --env=STARTUP=1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 1ad21140787a6b8b0f774f75b50444d2c30a56f6 Mon Sep 17 00:00:00 2001
|
||||
From 96d23fc57d1ff9c851d563d6d6a6c4752dc4f1b6 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex.kanavin@gmail.com>
|
||||
Date: Thu, 21 May 2020 20:28:12 +0000
|
||||
Subject: [PATCH] Do not configure packages on installation
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From b18d7aa7d71b53b86bac21cd1d8c3accabb28f2b Mon Sep 17 00:00:00 2001
|
||||
From bf45c314867e5fb12141803fba06f3e45679d628 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex.kanavin@gmail.com>
|
||||
Date: Fri, 10 May 2019 16:47:38 +0200
|
||||
Subject: [PATCH] Do not init tables from dpkg configuration
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 742fbb243f99e940c3e6b31296f7f416f550a57a Mon Sep 17 00:00:00 2001
|
||||
From 34700bebc52659e7e3eecd252f65bd36e669eee8 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex.kanavin@gmail.com>
|
||||
Date: Thu, 21 May 2020 20:13:25 +0000
|
||||
Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 28e389a0d1275e7693df84a7d4a58b28364be1a9 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex.kanavin@gmail.com>
|
||||
Date: Thu, 22 Oct 2020 17:33:38 +0200
|
||||
Subject: [PATCH] test/libapt: do not use gtest from the host
|
||||
|
||||
This really does not work when cross-compiling.
|
||||
|
||||
Upstream-Status: Inappropriate [oe-core specific]
|
||||
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
||||
---
|
||||
test/libapt/CMakeLists.txt | 16 ----------------
|
||||
1 file changed, 16 deletions(-)
|
||||
|
||||
diff --git a/test/libapt/CMakeLists.txt b/test/libapt/CMakeLists.txt
|
||||
index 035ff07..280b83c 100644
|
||||
--- a/test/libapt/CMakeLists.txt
|
||||
+++ b/test/libapt/CMakeLists.txt
|
||||
@@ -6,22 +6,6 @@ find_path(GTEST_ROOT src/gtest.cc
|
||||
find_package(GTest)
|
||||
set(GTEST_DEPENDENCIES)
|
||||
|
||||
-if(NOT GTEST_FOUND AND EXISTS ${GTEST_ROOT})
|
||||
- include(ExternalProject)
|
||||
- ExternalProject_Add(gtest PREFIX ./gtest
|
||||
- SOURCE_DIR ${GTEST_ROOT}
|
||||
- INSTALL_COMMAND true)
|
||||
-
|
||||
- link_directories(${CMAKE_CURRENT_BINARY_DIR}/gtest/src/gtest-build)
|
||||
-
|
||||
- set(GTEST_LIBRARIES "-lgtest")
|
||||
- set(GTEST_DEPENDENCIES "gtest")
|
||||
- set(GTEST_FOUND TRUE)
|
||||
- find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${GTEST_ROOT}/include)
|
||||
-
|
||||
- message(STATUS "Found GTest at ${GTEST_ROOT}, headers at ${GTEST_INCLUDE_DIRS}")
|
||||
-endif()
|
||||
-
|
||||
if(GTEST_FOUND)
|
||||
# gtest produces some warnings with the set of warnings we activate,
|
||||
# so disable the offending warnings while compiling tests for now
|
||||
@@ -8,6 +8,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \
|
||||
file://0001-Disable-documentation-directory-altogether.patch \
|
||||
file://0001-Fix-musl-build.patch \
|
||||
file://0001-CMakeLists.txt-avoid-changing-install-paths-based-on.patch \
|
||||
file://0001-test-libapt-do-not-use-gtest-from-the-host.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_class-native = " \
|
||||
|
||||
@@ -41,5 +41,7 @@ SRC_URI = "\
|
||||
file://0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
|
||||
file://0015-sync-with-OE-libtool-changes.patch \
|
||||
file://0016-Check-for-clang-before-checking-gcc-version.patch \
|
||||
file://0017-gas-improve-reproducibility-for-stabs-debugging-data.patch \
|
||||
file://0001-aarch64-Return-an-error-on-conditional-branch-to-an-.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
From c7cd291722779c9d4703ed0010388fe394c644c8 Mon Sep 17 00:00:00 2001
|
||||
From: Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
|
||||
Date: Tue, 1 Sep 2020 14:25:52 +0530
|
||||
Subject: [PATCH] aarch64: Return an error on conditional branch to an undefined symbol
|
||||
|
||||
The fix in 7e05773767820b441b23a16628b55c98cb1aef46 introduced a PLT
|
||||
for conditional jumps when the target symbol is undefined. This is
|
||||
incorrect because conditional branch relocations are not allowed to
|
||||
clobber IP0/IP1 and hence, should not result in a dynamic relocation.
|
||||
|
||||
Revert that change and in its place, issue an error when the target
|
||||
symbol is undefined.
|
||||
|
||||
bfd/
|
||||
|
||||
2020-09-10 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
|
||||
|
||||
* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Revert
|
||||
changes in 7e05773767820b441b23a16628b55c98cb1aef46. Set
|
||||
error for undefined symbol in BFD_RELOC_AARCH64_BRANCH19 and
|
||||
BFD_RELOC_AARCH64_TSTBR14 relocations.
|
||||
|
||||
ld/
|
||||
|
||||
2020-09-10 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
|
||||
|
||||
* testsuite/ld-aarch64/emit-relocs-560.d: Expect error instead
|
||||
of valid output.
|
||||
---
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c7cd291722779c9d4703ed0010388fe394c644c8]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
bfd/ChangeLog | 7 +++++
|
||||
bfd/elfnn-aarch64.c | 37 ++++++++++++-----------
|
||||
ld/ChangeLog | 5 +++
|
||||
ld/testsuite/ld-aarch64/emit-relocs-560.d | 7 +----
|
||||
4 files changed, 32 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
|
||||
index 5b4c189b593..a9924e7ec56 100644
|
||||
--- a/bfd/elfnn-aarch64.c
|
||||
+++ b/bfd/elfnn-aarch64.c
|
||||
@@ -5447,7 +5447,6 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
|
||||
bfd_vma orig_value = value;
|
||||
bfd_boolean resolved_to_zero;
|
||||
bfd_boolean abs_symbol_p;
|
||||
- bfd_boolean via_plt_p;
|
||||
|
||||
globals = elf_aarch64_hash_table (info);
|
||||
|
||||
@@ -5469,8 +5468,6 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
|
||||
: bfd_is_und_section (sym_sec));
|
||||
abs_symbol_p = h != NULL && bfd_is_abs_symbol (&h->root);
|
||||
|
||||
- via_plt_p = (globals->root.splt != NULL && h != NULL
|
||||
- && h->plt.offset != (bfd_vma) - 1);
|
||||
|
||||
/* Since STT_GNU_IFUNC symbol must go through PLT, we handle
|
||||
it here if it is defined in a non-shared object. */
|
||||
@@ -5806,23 +5803,12 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
|
||||
value += signed_addend;
|
||||
break;
|
||||
|
||||
- case BFD_RELOC_AARCH64_BRANCH19:
|
||||
- case BFD_RELOC_AARCH64_TSTBR14:
|
||||
- /* A conditional branch to an undefined weak symbol is converted to a
|
||||
- branch to itself. */
|
||||
- if (weak_undef_p && !via_plt_p)
|
||||
- {
|
||||
- value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type,
|
||||
- place, value,
|
||||
- signed_addend,
|
||||
- weak_undef_p);
|
||||
- break;
|
||||
- }
|
||||
- /* Fall through. */
|
||||
case BFD_RELOC_AARCH64_CALL26:
|
||||
case BFD_RELOC_AARCH64_JUMP26:
|
||||
{
|
||||
asection *splt = globals->root.splt;
|
||||
+ bfd_boolean via_plt_p =
|
||||
+ splt != NULL && h != NULL && h->plt.offset != (bfd_vma) - 1;
|
||||
|
||||
/* A call to an undefined weak symbol is converted to a jump to
|
||||
the next instruction unless a PLT entry will be created.
|
||||
@@ -5903,6 +5889,23 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return bfd_reloc_notsupported;
|
||||
}
|
||||
+ value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type,
|
||||
+ place, value,
|
||||
+ signed_addend,
|
||||
+ weak_undef_p);
|
||||
+ break;
|
||||
+
|
||||
+ case BFD_RELOC_AARCH64_BRANCH19:
|
||||
+ case BFD_RELOC_AARCH64_TSTBR14:
|
||||
+ if (h && h->root.type == bfd_link_hash_undefined)
|
||||
+ {
|
||||
+ _bfd_error_handler
|
||||
+ /* xgettext:c-format */
|
||||
+ (_("%pB: conditional branch to undefined symbol `%s' "
|
||||
+ "not allowed"), input_bfd, h->root.root.string);
|
||||
+ bfd_set_error (bfd_error_bad_value);
|
||||
+ return bfd_reloc_notsupported;
|
||||
+ }
|
||||
/* Fall through. */
|
||||
|
||||
case BFD_RELOC_AARCH64_16:
|
||||
@@ -7968,8 +7971,6 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
break;
|
||||
}
|
||||
|
||||
- case BFD_RELOC_AARCH64_BRANCH19:
|
||||
- case BFD_RELOC_AARCH64_TSTBR14:
|
||||
case BFD_RELOC_AARCH64_CALL26:
|
||||
case BFD_RELOC_AARCH64_JUMP26:
|
||||
/* If this is a local symbol then we resolve it
|
||||
diff --git a/ld/testsuite/ld-aarch64/emit-relocs-560.d b/ld/testsuite/ld-aarch64/emit-relocs-560.d
|
||||
index 153532457b4..8751b743bd4 100644
|
||||
--- a/ld/testsuite/ld-aarch64/emit-relocs-560.d
|
||||
+++ b/ld/testsuite/ld-aarch64/emit-relocs-560.d
|
||||
@@ -1,8 +1,3 @@
|
||||
#source: emit-relocs-560.s
|
||||
#ld: -shared
|
||||
-#readelf: -r
|
||||
-
|
||||
-Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 2 entries:
|
||||
- Offset Info Type Sym. Value Sym. Name \+ Addend
|
||||
-[0-9a-f]+ 000100000402 R_AARCH64_JUMP_SL 0000000000000000 baz \+ 0
|
||||
-[0-9a-f]+ 000200000402 R_AARCH64_JUMP_SL 0000000000000000 bar \+ 0
|
||||
+#error: .*: conditional branch to undefined symbol `bar' not allowed
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From aa6586e80fc6fcd739aa959a71e4cf064cdef072 Mon Sep 17 00:00:00 2001
|
||||
From: Denys Zagorui <dzagorui@cisco.com>
|
||||
Date: Mon, 9 Nov 2020 15:39:10 +0000
|
||||
Subject: [PATCH] gas: improve reproducibility for stabs debugging data format
|
||||
|
||||
* config/obj-elf (obj_elf_init_stab_section): Improve
|
||||
reproducibility for stabs debugging data format
|
||||
|
||||
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0541201782c006c09d029d18a45c6e743cfea906]
|
||||
---
|
||||
gas/config/obj-elf.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
|
||||
index de22b5a1da..2025df8542 100644
|
||||
--- a/gas/config/obj-elf.c
|
||||
+++ b/gas/config/obj-elf.c
|
||||
@@ -2374,12 +2374,13 @@ obj_elf_init_stab_section (segT seg)
|
||||
p = frag_more (12);
|
||||
/* Zero it out. */
|
||||
memset (p, 0, 12);
|
||||
- file = as_where (NULL);
|
||||
+ file = remap_debug_filename (as_where (NULL));
|
||||
stabstr_name = concat (segment_name (seg), "str", (char *) NULL);
|
||||
stroff = get_stab_string_offset (file, stabstr_name, TRUE);
|
||||
know (stroff == 1 || (stroff == 0 && file[0] == '\0'));
|
||||
md_number_to_chars (p, stroff, 4);
|
||||
seg_info (seg)->stabu.p = p;
|
||||
+ xfree ((char *) file);
|
||||
}
|
||||
|
||||
#endif
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -27,3 +27,5 @@ LDFLAGS += "${TOOLCHAIN_OPTIONS}"
|
||||
do_install_ptest() {
|
||||
cp -r ${S}/testing ${D}${PTEST_PATH}
|
||||
}
|
||||
|
||||
BBCLASSEXTEND = "nativesdk"
|
||||
|
||||
@@ -125,6 +125,8 @@ do_compile_ptest() {
|
||||
}
|
||||
|
||||
do_install_ptest() {
|
||||
# This file's permissions depends on the host umask so be deterministic
|
||||
chmod 0644 ${B}/tests/test_data.tmp
|
||||
cp -R --no-dereference --preserve=mode,links -v ${B}/tests ${D}${PTEST_PATH}/test
|
||||
cp -R --no-dereference --preserve=mode,links -v ${S}/tests/* ${D}${PTEST_PATH}/test
|
||||
sed -e 's!../e2fsck/e2fsck!e2fsck!g' \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
SUMMARY = "Library providing simplified C and Python API to libsolv"
|
||||
LICENSE = "LGPLv2.1"
|
||||
LICENSE = "LGPLv2.1+"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
|
||||
|
||||
SRC_URI = "git://github.com/rpm-software-management/libdnf;branch=dnf-4-master \
|
||||
|
||||
71
meta/recipes-devtools/python/python3/CVE-2020-27619.patch
Normal file
71
meta/recipes-devtools/python/python3/CVE-2020-27619.patch
Normal file
@@ -0,0 +1,71 @@
|
||||
From 6c6c256df3636ff6f6136820afaefa5a10a3ac33 Mon Sep 17 00:00:00 2001
|
||||
From: "Miss Skeleton (bot)" <31488909+miss-islington@users.noreply.github.com>
|
||||
Date: Tue, 6 Oct 2020 05:38:54 -0700
|
||||
Subject: [PATCH] bpo-41944: No longer call eval() on content received via HTTP
|
||||
in the CJK codec tests (GH-22566) (GH-22577)
|
||||
|
||||
(cherry picked from commit 2ef5caa58febc8968e670e39e3d37cf8eef3cab8)
|
||||
|
||||
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
||||
|
||||
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/6c6c256df3636ff6f6136820afaefa5a10a3ac33]
|
||||
CVE: CVE-2020-27619
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
|
||||
---
|
||||
Lib/test/multibytecodec_support.py | 22 +++++++------------
|
||||
.../2020-10-05-17-43-46.bpo-41944.rf1dYb.rst | 1 +
|
||||
2 files changed, 9 insertions(+), 14 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Tests/2020-10-05-17-43-46.bpo-41944.rf1dYb.rst
|
||||
|
||||
diff --git a/Lib/test/multibytecodec_support.py b/Lib/test/multibytecodec_support.py
|
||||
index cca8af67d6d1d..f76c0153f5ecf 100644
|
||||
--- a/Lib/test/multibytecodec_support.py
|
||||
+++ b/Lib/test/multibytecodec_support.py
|
||||
@@ -305,29 +305,23 @@ def test_mapping_file(self):
|
||||
self._test_mapping_file_plain()
|
||||
|
||||
def _test_mapping_file_plain(self):
|
||||
- unichrs = lambda s: ''.join(map(chr, map(eval, s.split('+'))))
|
||||
+ def unichrs(s):
|
||||
+ return ''.join(chr(int(x, 16)) for x in s.split('+'))
|
||||
+
|
||||
urt_wa = {}
|
||||
|
||||
with self.open_mapping_file() as f:
|
||||
for line in f:
|
||||
if not line:
|
||||
break
|
||||
- data = line.split('#')[0].strip().split()
|
||||
+ data = line.split('#')[0].split()
|
||||
if len(data) != 2:
|
||||
continue
|
||||
|
||||
- csetval = eval(data[0])
|
||||
- if csetval <= 0x7F:
|
||||
- csetch = bytes([csetval & 0xff])
|
||||
- elif csetval >= 0x1000000:
|
||||
- csetch = bytes([(csetval >> 24), ((csetval >> 16) & 0xff),
|
||||
- ((csetval >> 8) & 0xff), (csetval & 0xff)])
|
||||
- elif csetval >= 0x10000:
|
||||
- csetch = bytes([(csetval >> 16), ((csetval >> 8) & 0xff),
|
||||
- (csetval & 0xff)])
|
||||
- elif csetval >= 0x100:
|
||||
- csetch = bytes([(csetval >> 8), (csetval & 0xff)])
|
||||
- else:
|
||||
+ if data[0][:2] != '0x':
|
||||
+ self.fail(f"Invalid line: {line!r}")
|
||||
+ csetch = bytes.fromhex(data[0][2:])
|
||||
+ if len(csetch) == 1 and 0x80 <= csetch[0]:
|
||||
continue
|
||||
|
||||
unich = unichrs(data[1])
|
||||
diff --git a/Misc/NEWS.d/next/Tests/2020-10-05-17-43-46.bpo-41944.rf1dYb.rst b/Misc/NEWS.d/next/Tests/2020-10-05-17-43-46.bpo-41944.rf1dYb.rst
|
||||
new file mode 100644
|
||||
index 0000000000000..4f9782f1c85af
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Tests/2020-10-05-17-43-46.bpo-41944.rf1dYb.rst
|
||||
@@ -0,0 +1 @@
|
||||
+Tests for CJK codecs no longer call ``eval()`` on content received via HTTP.
|
||||
@@ -32,6 +32,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
|
||||
file://0001-configure.ac-fix-LIBPL.patch \
|
||||
file://0001-python3-Do-not-hardcode-lib-for-distutils.patch \
|
||||
file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \
|
||||
file://CVE-2020-27619.patch \
|
||||
"
|
||||
|
||||
SRC_URI_append_class-native = " \
|
||||
@@ -49,6 +50,8 @@ UPSTREAM_CHECK_URI = "https://www.python.org/downloads/source/"
|
||||
|
||||
CVE_PRODUCT = "python"
|
||||
|
||||
# Upstream consider this expected behaviour
|
||||
CVE_CHECK_WHITELIST += "CVE-2007-4559"
|
||||
# This is not exploitable when glibc has CVE-2016-10739 fixed.
|
||||
CVE_CHECK_WHITELIST += "CVE-2019-18348"
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
|
||||
file://find_datadir.patch \
|
||||
file://usb-fix-setup_len-init.patch \
|
||||
file://0001-target-mips-Increase-number-of-TLB-entries-on-the-34.patch \
|
||||
file://CVE-2020-24352.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
|
||||
|
||||
|
||||
52
meta/recipes-devtools/qemu/qemu/CVE-2020-24352.patch
Normal file
52
meta/recipes-devtools/qemu/qemu/CVE-2020-24352.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From ca1f9cbfdce4d63b10d57de80fef89a89d92a540 Mon Sep 17 00:00:00 2001
|
||||
From: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Date: Wed, 21 Oct 2020 16:08:18 +0530
|
||||
Subject: [PATCH 1/1] ati: check x y display parameter values
|
||||
|
||||
The source and destination x,y display parameters in ati_2d_blt()
|
||||
may run off the vga limits if either of s->regs.[src|dst]_[xy] is
|
||||
zero. Check the parameter values to avoid potential crash.
|
||||
|
||||
Reported-by: Gaoning Pan <pgn@zju.edu.cn>
|
||||
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Message-id: 20201021103818.1704030-1-ppandit@redhat.com
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
|
||||
Upstream-Status: Backport [ https://git.qemu.org/?p=qemu.git;a=commitdiff;h=ca1f9cbfdce4d63b10d57de80fef89a89d92a540;hp=2ddafce7f797082ad216657c830afd4546f16e37 ]
|
||||
CVE: CVE-2020-24352
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
hw/display/ati_2d.c | 10 ++++++----
|
||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c
|
||||
index 23a8ae0..4dc10ea 100644
|
||||
--- a/hw/display/ati_2d.c
|
||||
+++ b/hw/display/ati_2d.c
|
||||
@@ -75,8 +75,9 @@ void ati_2d_blt(ATIVGAState *s)
|
||||
dst_stride *= bpp;
|
||||
}
|
||||
uint8_t *end = s->vga.vram_ptr + s->vga.vram_size;
|
||||
- if (dst_bits >= end || dst_bits + dst_x + (dst_y + s->regs.dst_height) *
|
||||
- dst_stride >= end) {
|
||||
+ if (dst_x > 0x3fff || dst_y > 0x3fff || dst_bits >= end
|
||||
+ || dst_bits + dst_x
|
||||
+ + (dst_y + s->regs.dst_height) * dst_stride >= end) {
|
||||
qemu_log_mask(LOG_UNIMP, "blt outside vram not implemented\n");
|
||||
return;
|
||||
}
|
||||
@@ -107,8 +108,9 @@ void ati_2d_blt(ATIVGAState *s)
|
||||
src_bits += s->regs.crtc_offset & 0x07ffffff;
|
||||
src_stride *= bpp;
|
||||
}
|
||||
- if (src_bits >= end || src_bits + src_x +
|
||||
- (src_y + s->regs.dst_height) * src_stride >= end) {
|
||||
+ if (src_x > 0x3fff || src_y > 0x3fff || src_bits >= end
|
||||
+ || src_bits + src_x
|
||||
+ + (src_y + s->regs.dst_height) * src_stride >= end) {
|
||||
qemu_log_mask(LOG_UNIMP, "blt outside vram not implemented\n");
|
||||
return;
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
40
meta/recipes-devtools/ruby/ruby/CVE-2020-25613.patch
Normal file
40
meta/recipes-devtools/ruby/ruby/CVE-2020-25613.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From 8946bb38b4d87549f0d99ed73c62c41933f97cc7 Mon Sep 17 00:00:00 2001
|
||||
From: Yusuke Endoh <mame@ruby-lang.org>
|
||||
Date: Tue, 29 Sep 2020 13:15:58 +0900
|
||||
Subject: [PATCH] Make it more strict to interpret some headers
|
||||
|
||||
Some regexps were too tolerant.
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://github.com/ruby/webrick/commit/8946bb38b4d87549f0d99ed73c62c41933f97cc7]
|
||||
CVE: CVE-2020-25613
|
||||
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
|
||||
---
|
||||
lib/webrick/httprequest.rb | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb
|
||||
index 294bd91..d34eac7 100644
|
||||
--- a/lib/webrick/httprequest.rb
|
||||
+++ b/lib/webrick/httprequest.rb
|
||||
@@ -227,9 +227,9 @@ def parse(socket=nil)
|
||||
raise HTTPStatus::BadRequest, "bad URI `#{@unparsed_uri}'."
|
||||
end
|
||||
|
||||
- if /close/io =~ self["connection"]
|
||||
+ if /\Aclose\z/io =~ self["connection"]
|
||||
@keep_alive = false
|
||||
- elsif /keep-alive/io =~ self["connection"]
|
||||
+ elsif /\Akeep-alive\z/io =~ self["connection"]
|
||||
@keep_alive = true
|
||||
elsif @http_version < "1.1"
|
||||
@keep_alive = false
|
||||
@@ -508,7 +508,7 @@ def read_body(socket, block)
|
||||
return unless socket
|
||||
if tc = self['transfer-encoding']
|
||||
case tc
|
||||
- when /chunked/io then read_chunked(socket, block)
|
||||
+ when /\Achunked\z/io then read_chunked(socket, block)
|
||||
else raise HTTPStatus::NotImplemented, "Transfer-Encoding: #{tc}."
|
||||
end
|
||||
elsif self['content-length'] || @remaining_size
|
||||
@@ -6,6 +6,7 @@ SRC_URI += " \
|
||||
file://remove_has_include_macros.patch \
|
||||
file://run-ptest \
|
||||
file://0001-Modify-shebang-of-libexec-y2racc-and-libexec-racc2y.patch \
|
||||
file://CVE-2020-25613.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "debb9c325bf65021214451660f46e909"
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
From cdec010444df5a4328e90d07a2024fdeefcc74b5 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Floyd <paulf@free.fr>
|
||||
Date: Wed, 18 Nov 2020 12:49:20 -0400
|
||||
Subject: [PATCH] helgrind: Intercept libc functions
|
||||
|
||||
PTH_FUNC definition needs to be modified in order to
|
||||
intercept posix thread functions in both libc and
|
||||
libpthread. In order to handle this in helgrind, weak alias
|
||||
the pthread functions in glibc.
|
||||
|
||||
Upstream-Status: Submitted
|
||||
|
||||
Signed-off-by: Paul Floyd <paulf@free.fr>
|
||||
Signed-off-by: Stacy Gaikovaia <stacy.gaikovaia@windriver.com>
|
||||
---
|
||||
helgrind/hg_intercepts.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c
|
||||
index a10c3a4a3..316140ca6 100644
|
||||
--- a/helgrind/hg_intercepts.c
|
||||
+++ b/helgrind/hg_intercepts.c
|
||||
@@ -77,6 +77,11 @@
|
||||
/*--- ---*/
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
+#define hg_expand(tok) #tok
|
||||
+#define hg_str(tok) hg_expand(tok)
|
||||
+# define hg_weak_alias(name, aliasname) \
|
||||
+ extern __typeof (name) aliasname __attribute__ ((weak, alias(hg_str(name))))
|
||||
+
|
||||
#if defined(VGO_solaris)
|
||||
/* On Solaris, libpthread is just a filter library on top of libc.
|
||||
* Threading and synchronization functions in runtime linker are not
|
||||
@@ -91,9 +96,16 @@
|
||||
#define CREQ_PTHREAD_T Word
|
||||
#define SEM_ERROR ret
|
||||
#else
|
||||
+#ifdef MUSL_LIBC
|
||||
+#define PTH_FUNC(ret_ty, f, args...) \
|
||||
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \
|
||||
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args)
|
||||
+#else
|
||||
#define PTH_FUNC(ret_ty, f, args...) \
|
||||
ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \
|
||||
+ hg_weak_alias(I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f), I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)); \
|
||||
ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args)
|
||||
+#endif
|
||||
#define CREQ_PTHREAD_T pthread_t
|
||||
#define SEM_ERROR errno
|
||||
#endif /* VGO_solaris */
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -42,6 +42,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
|
||||
file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
|
||||
file://0001-drd-Port-to-Fedora-33.patch \
|
||||
file://0001-drd-musl-fix.patch \
|
||||
file://0001-helgrind-Intercept-libc-functions.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "d1b153f1ab17cf1f311705e7a83ef589"
|
||||
SRC_URI[sha256sum] = "c91f3a2f7b02db0f3bc99479861656154d241d2fdb265614ba918cc6720a33ca"
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 207b94e37c84007b294e57878c913271aad544ef Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 11 Nov 2020 23:13:23 -0800
|
||||
Subject: [PATCH] Use cross AR during compile
|
||||
|
||||
If AR is specifcied then it should be used instead of defaulting to 'ar'
|
||||
from host
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
configure.ac | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 31364ab..4804f7b 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -92,6 +92,13 @@ GAWK_CANONICAL_HOST
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
dnl checks for programs
|
||||
+m4_ifndef([AC_PROG_AR],[dnl
|
||||
+ AN_MAKEVAR([AR], [AC_PROG_AR])
|
||||
+ AN_PROGRAM([ar], [AC_PROG_AR])
|
||||
+ AC_DEFUN([AC_PROG_AR],
|
||||
+ [AC_CHECK_TOOL(AR, ar, :)])
|
||||
+])
|
||||
+AC_PROG_AR
|
||||
AC_PROG_EGREP
|
||||
AC_PROG_YACC
|
||||
AC_PROG_LN_S
|
||||
--
|
||||
2.29.2
|
||||
|
||||
@@ -17,6 +17,7 @@ PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
|
||||
|
||||
SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
|
||||
file://run-ptest \
|
||||
file://0001-Use-cross-AR-during-compile.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "f719bc9966df28e67fc6ebc405e7ea03"
|
||||
|
||||
@@ -6,6 +6,8 @@ inherit clutter features_check upstream-version-is-even gobject-introspection
|
||||
# depends on clutter-1.0 which depends on cogl-1.0
|
||||
REQUIRED_DISTRO_FEATURES ?= "opengl"
|
||||
|
||||
export GST_PLUGIN_SCANNER_1_0="${S}/gst-plugin-scanner-dummy"
|
||||
|
||||
SRC_URI += "file://0001-Install-example-binary-needed-for-core-image-clutter.patch"
|
||||
|
||||
DEPENDS = "gstreamer1.0-plugins-base gstreamer1.0-plugins-bad clutter-1.0 libgudev"
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
From a3bab162b2ae616074c8877a04556932998aeacd Mon Sep 17 00:00:00 2001
|
||||
From: Werner Lemberg <wl@gnu.org>
|
||||
Date: Mon, 19 Oct 2020 23:45:28 +0200
|
||||
Subject: [PATCH] [sfnt] Fix heap buffer overflow (#59308).
|
||||
|
||||
This is CVE-2020-15999.
|
||||
|
||||
* src/sfnt/pngshim.c (Load_SBit_Png): Test bitmap size earlier.
|
||||
|
||||
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=a3bab162b2ae616074c8877a04556932998aeacd]
|
||||
|
||||
Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
|
||||
---
|
||||
src/sfnt/pngshim.c | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c
|
||||
index 2e64e5846..f55016122 100644
|
||||
--- a/src/sfnt/pngshim.c
|
||||
+++ b/src/sfnt/pngshim.c
|
||||
@@ -332,6 +332,13 @@
|
||||
|
||||
if ( populate_map_and_metrics )
|
||||
{
|
||||
+ /* reject too large bitmaps similarly to the rasterizer */
|
||||
+ if ( imgHeight > 0x7FFF || imgWidth > 0x7FFF )
|
||||
+ {
|
||||
+ error = FT_THROW( Array_Too_Large );
|
||||
+ goto DestroyExit;
|
||||
+ }
|
||||
+
|
||||
metrics->width = (FT_UShort)imgWidth;
|
||||
metrics->height = (FT_UShort)imgHeight;
|
||||
|
||||
@@ -340,13 +347,6 @@
|
||||
map->pixel_mode = FT_PIXEL_MODE_BGRA;
|
||||
map->pitch = (int)( map->width * 4 );
|
||||
map->num_grays = 256;
|
||||
-
|
||||
- /* reject too large bitmaps similarly to the rasterizer */
|
||||
- if ( map->rows > 0x7FFF || map->width > 0x7FFF )
|
||||
- {
|
||||
- error = FT_THROW( Array_Too_Large );
|
||||
- goto DestroyExit;
|
||||
- }
|
||||
}
|
||||
|
||||
/* convert palette/gray image to rgb */
|
||||
--
|
||||
2.18.4
|
||||
|
||||
@@ -14,6 +14,7 @@ LIC_FILES_CHKSUM = "file://docs/LICENSE.TXT;md5=4af6221506f202774ef74f64932878a1
|
||||
|
||||
SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/${BPN}/${BP}.tar.xz \
|
||||
file://use-right-libtool.patch \
|
||||
file://0001-sfnt-Fix-heap-buffer-overflow-59308.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "7c0d5a39f232d7eb9f9d7da76bf08074"
|
||||
SRC_URI[sha256sum] = "1543d61025d2e6312e0a1c563652555f17378a204a61e99928c9fcef030a2d8b"
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# HG changeset patch
|
||||
# User Sam Lantinga <slouken@libsdl.org>
|
||||
# Date 1590793369 25200
|
||||
# Node ID a90089f75990e8b07a1dcf931c5f8a580ae343bf
|
||||
# Parent a9b4bd264f3cbedc4f3287b3ec6b32311370ba85
|
||||
Fixed bug 5146 - SDL_RenderFillRect doesn't work in DirectFB
|
||||
|
||||
Lacky
|
||||
|
||||
It looks like refactoring of SDL2 internal API has broken SDL_RenderFillRect for DirectFB. In new version function SDL_RenderFillRect returns 0, but rectangle is not visible.
|
||||
|
||||
Replacing "count" with "len" in the argument list for SDL_memcpy in DirectFB_QueueFillRects fixes problem.
|
||||
|
||||
--
|
||||
|
||||
The patch was imported from the libsdl Mercurial repository
|
||||
(https://hg.libsdl.org/SDL) as of changeset id a90089f75990.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Signed-off-by: Mark Jonas <toertel@gmail.com>
|
||||
|
||||
diff -r a9b4bd264f3c -r a90089f75990 src/video/directfb/SDL_DirectFB_render.c
|
||||
--- a/src/video/directfb/SDL_DirectFB_render.c Thu May 21 00:06:09 2020 -0400
|
||||
+++ b/src/video/directfb/SDL_DirectFB_render.c Fri May 29 16:02:49 2020 -0700
|
||||
@@ -626,7 +626,7 @@
|
||||
}
|
||||
|
||||
cmd->data.draw.count = count;
|
||||
- SDL_memcpy(verts, rects, count);
|
||||
+ SDL_memcpy(verts, rects, len);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
# HG changeset patch
|
||||
# User Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
# Date 1585069551 25200
|
||||
# Node ID 769f800952179633ec6c3e6bc1bc1d40e401750a
|
||||
# Parent 63387e8920f58f608288f247824ec5f4c286691f
|
||||
src/video/directfb/SDL_DirectFB_render.c: fix build
|
||||
Build with directfb is broken due to a spurious '}' and a missing 'E'
|
||||
since version 2.0.12 and https://hg.libsdl.org/SDL/rev/2d5b5a5ccbfb:
|
||||
|
||||
/home/buildroot/autobuild/run/instance-2/output-1/build/sdl2-2.0.12/src/video/directfb/SDL_DirectFB_render.c: In function 'SetBlendMode':
|
||||
/home/buildroot/autobuild/run/instance-2/output-1/build/sdl2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:202:9: error: case label not within a switch statement
|
||||
202 | case SDL_BLENDMODE_MUL:
|
||||
| ^~~~
|
||||
|
||||
/home/buildroot/autobuild/run/instance-2/output-1/build/sdl2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:205:67: error: 'DSBF_DSTCOLOR' undeclared (first use in this function); did you mean 'DSBF_DESTCOLOR'?
|
||||
205 | SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DSTCOLOR));
|
||||
| ^~~~~~~~~~~~~
|
||||
|
||||
Fixes:
|
||||
- http://autobuild.buildroot.org/results/83ccefee68c2800c0544e6f40fa8bc8ee6b67b77
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
|
||||
--
|
||||
|
||||
The patch was imported from the libsdl Mercurial repository
|
||||
(https://hg.libsdl.org/SDL) as of changeset id 769f80095217.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Signed-off-by: Mark Jonas <toertel@gmail.com>
|
||||
|
||||
|
||||
diff -r 63387e8920f5 -r 769f80095217 src/video/directfb/SDL_DirectFB_render.c
|
||||
--- a/src/video/directfb/SDL_DirectFB_render.c Mon Mar 23 14:10:25 2020 -0700
|
||||
+++ b/src/video/directfb/SDL_DirectFB_render.c Tue Mar 24 10:05:51 2020 -0700
|
||||
@@ -198,11 +198,10 @@
|
||||
SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_SRCCOLOR));
|
||||
|
||||
break;
|
||||
- }
|
||||
case SDL_BLENDMODE_MUL:
|
||||
data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
|
||||
data->drawFlags = DSDRAW_BLEND;
|
||||
- SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DSTCOLOR));
|
||||
+ SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DESTCOLOR));
|
||||
SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA));
|
||||
|
||||
break;
|
||||
@@ -18,6 +18,8 @@ PROVIDES = "virtual/libsdl2"
|
||||
|
||||
SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
|
||||
file://more-gen-depends.patch \
|
||||
file://directfb-spurious-curly-brace-missing-e.patch \
|
||||
file://directfb-renderfillrect-fix.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/SDL2-${PV}"
|
||||
|
||||
@@ -51,7 +51,7 @@ do_install() {
|
||||
fi
|
||||
|
||||
if [ "${@bb.utils.contains('PACKAGECONFIG', 'no-idle-timeout', 'yes', 'no', d)}" = "yes" ]; then
|
||||
echo "idle-time=0" >> ${D}${sysconfdir}/xdg/weston/weston.ini
|
||||
sed -i -e "/^\[core\]/a idle-time=0" ${D}${sysconfdir}/xdg/weston/weston.ini
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -501,6 +501,7 @@ FILES_${PN}-nvidia-license = "${nonarch_base_libdir}/firmware/LICENCE.nvidia"
|
||||
|
||||
RDEPENDS_${PN}-nvidia-gpu += "${PN}-nvidia-license"
|
||||
RDEPENDS_${PN}-nvidia-tegra += "${PN}-nvidia-license"
|
||||
RDEPENDS_${PN}-nvidia-tegra-k1 += "${PN}-nvidia-license"
|
||||
|
||||
# For rtl
|
||||
LICENSE_${PN}-rtl8188 = "Firmware-rtlwifi_firmware"
|
||||
|
||||
@@ -86,6 +86,12 @@ do_install() {
|
||||
# be dealt with.
|
||||
# cp -a scripts $kerneldir/build
|
||||
|
||||
# although module.lds can be regenerated on target via 'make modules_prepare'
|
||||
# there are several places where 'makes scripts prepare' is done, and that won't
|
||||
# regenerate the file. So we copy it onto the target as a migration to using
|
||||
# modules_prepare
|
||||
cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || :
|
||||
|
||||
if [ -d arch/${ARCH}/scripts ]; then
|
||||
cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
|
||||
fi
|
||||
@@ -113,6 +119,10 @@ do_install() {
|
||||
# but without this file, we get a forced syncconfig run in v5.8+, which prompts and
|
||||
# breaks workflows.
|
||||
cp -a --parents include/generated/autoconf.h $kerneldir/build 2>/dev/null || :
|
||||
|
||||
if [ -e $kerneldir/include/generated/.vdso-offsets.h.cmd ]; then
|
||||
rm $kerneldir/include/generated/.vdso-offsets.h.cmd
|
||||
fi
|
||||
)
|
||||
|
||||
# now grab the chunks from the source tree that we need
|
||||
|
||||
@@ -30,7 +30,7 @@ SRC_URI = "git://git.yoctoproject.org/linux-yocto-dev.git;branch=${KBRANCH};name
|
||||
SRCREV_machine ?= '${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "${AUTOREV}", "29594404d7fe73cd80eaa4ee8c43dcc53970c60e", d)}'
|
||||
SRCREV_meta ?= '${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "${AUTOREV}", "29594404d7fe73cd80eaa4ee8c43dcc53970c60e", d)}'
|
||||
|
||||
LINUX_VERSION ?= "5.9-rc+"
|
||||
LINUX_VERSION ?= "5.10-rc+"
|
||||
LINUX_VERSION_EXTENSION ?= "-yoctodev-${LINUX_KERNEL_TYPE}"
|
||||
PV = "${LINUX_VERSION}+git${SRCPV}"
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ python () {
|
||||
raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
|
||||
}
|
||||
|
||||
SRCREV_machine ?= "3a5f7e9a874f0a6e9ad599b4fc6c491db231dd6f"
|
||||
SRCREV_meta ?= "7f765dcb29003bafc9c0ac770147940be6c420b2"
|
||||
SRCREV_machine ?= "97576fb7447efba82eb025bde3ae9ceb29939d5e"
|
||||
SRCREV_meta ?= "d626f9108d590d41e82b97cbffc380aa699e86e1"
|
||||
|
||||
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}"
|
||||
|
||||
LINUX_VERSION ?= "5.4.69"
|
||||
LINUX_VERSION ?= "5.4.78"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ python () {
|
||||
raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
|
||||
}
|
||||
|
||||
SRCREV_machine ?= "5981001bf03f0d0c1cf641a2287ab6368baf628a"
|
||||
SRCREV_meta ?= "34775c20bc4f4ac32ac7eded79f9dc8ca77e4277"
|
||||
SRCREV_machine ?= "3c5d210805d61bea8f8a8081e0e3a89ea8a61f3f"
|
||||
SRCREV_meta ?= "7883b60d324029d26020c0b3f826b35c52fd9674"
|
||||
|
||||
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.8;destsuffix=${KMETA}"
|
||||
|
||||
LINUX_VERSION ?= "5.8.13"
|
||||
LINUX_VERSION ?= "5.8.18"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ KCONFIG_MODE = "--allnoconfig"
|
||||
|
||||
require recipes-kernel/linux/linux-yocto.inc
|
||||
|
||||
LINUX_VERSION ?= "5.4.69"
|
||||
LINUX_VERSION ?= "5.4.78"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
@@ -15,9 +15,9 @@ DEPENDS += "openssl-native util-linux-native"
|
||||
KMETA = "kernel-meta"
|
||||
KCONF_BSP_AUDIT_LEVEL = "2"
|
||||
|
||||
SRCREV_machine_qemuarm ?= "58f39df46d9daf12a095ffe225032ec325612960"
|
||||
SRCREV_machine ?= "cfcdd63145c0d741e57ee3e3e58f794229c6c09c"
|
||||
SRCREV_meta ?= "7f765dcb29003bafc9c0ac770147940be6c420b2"
|
||||
SRCREV_machine_qemuarm ?= "6cf3b1d30bc7ac9bd86190129b3cbbdd04b8b236"
|
||||
SRCREV_machine ?= "370ef947d5b1470e858bae5a300110566c994b9f"
|
||||
SRCREV_meta ?= "d626f9108d590d41e82b97cbffc380aa699e86e1"
|
||||
|
||||
PV = "${LINUX_VERSION}+git${SRCPV}"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ KCONFIG_MODE = "--allnoconfig"
|
||||
|
||||
require recipes-kernel/linux/linux-yocto.inc
|
||||
|
||||
LINUX_VERSION ?= "5.8.13"
|
||||
LINUX_VERSION ?= "5.8.18"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
@@ -15,9 +15,9 @@ DEPENDS += "openssl-native util-linux-native"
|
||||
KMETA = "kernel-meta"
|
||||
KCONF_BSP_AUDIT_LEVEL = "2"
|
||||
|
||||
SRCREV_machine_qemuarm ?= "627cc1717f47c4d9bc9d58f88b1764990d982a99"
|
||||
SRCREV_machine ?= "5981001bf03f0d0c1cf641a2287ab6368baf628a"
|
||||
SRCREV_meta ?= "34775c20bc4f4ac32ac7eded79f9dc8ca77e4277"
|
||||
SRCREV_machine_qemuarm ?= "9509db6e3ed6a23b1f7495b53248d1cbfe22710b"
|
||||
SRCREV_machine ?= "3c5d210805d61bea8f8a8081e0e3a89ea8a61f3f"
|
||||
SRCREV_meta ?= "7883b60d324029d26020c0b3f826b35c52fd9674"
|
||||
|
||||
PV = "${LINUX_VERSION}+git${SRCPV}"
|
||||
|
||||
|
||||
@@ -12,16 +12,16 @@ KBRANCH_qemux86 ?= "v5.4/standard/base"
|
||||
KBRANCH_qemux86-64 ?= "v5.4/standard/base"
|
||||
KBRANCH_qemumips64 ?= "v5.4/standard/mti-malta64"
|
||||
|
||||
SRCREV_machine_qemuarm ?= "561d4f6eb1de32e1448451db86656826cf406eb5"
|
||||
SRCREV_machine_qemuarm64 ?= "cfcdd63145c0d741e57ee3e3e58f794229c6c09c"
|
||||
SRCREV_machine_qemumips ?= "e421f3f2399c153c4d58241cb6d1be926f7efc45"
|
||||
SRCREV_machine_qemuppc ?= "cfcdd63145c0d741e57ee3e3e58f794229c6c09c"
|
||||
SRCREV_machine_qemuriscv64 ?= "cfcdd63145c0d741e57ee3e3e58f794229c6c09c"
|
||||
SRCREV_machine_qemux86 ?= "cfcdd63145c0d741e57ee3e3e58f794229c6c09c"
|
||||
SRCREV_machine_qemux86-64 ?= "cfcdd63145c0d741e57ee3e3e58f794229c6c09c"
|
||||
SRCREV_machine_qemumips64 ?= "72d2f11b5f171e196d6b9824b82575d9a7b59e6f"
|
||||
SRCREV_machine ?= "cfcdd63145c0d741e57ee3e3e58f794229c6c09c"
|
||||
SRCREV_meta ?= "7f765dcb29003bafc9c0ac770147940be6c420b2"
|
||||
SRCREV_machine_qemuarm ?= "b3bafed66cf1be24caaa9c876d7d9a8298df831b"
|
||||
SRCREV_machine_qemuarm64 ?= "370ef947d5b1470e858bae5a300110566c994b9f"
|
||||
SRCREV_machine_qemumips ?= "36c2a0b1caef0b2dd6b5777d1939c383238536a8"
|
||||
SRCREV_machine_qemuppc ?= "370ef947d5b1470e858bae5a300110566c994b9f"
|
||||
SRCREV_machine_qemuriscv64 ?= "370ef947d5b1470e858bae5a300110566c994b9f"
|
||||
SRCREV_machine_qemux86 ?= "370ef947d5b1470e858bae5a300110566c994b9f"
|
||||
SRCREV_machine_qemux86-64 ?= "370ef947d5b1470e858bae5a300110566c994b9f"
|
||||
SRCREV_machine_qemumips64 ?= "971a3cedf9a2a7774fa072b9a13380fb59fd605b"
|
||||
SRCREV_machine ?= "370ef947d5b1470e858bae5a300110566c994b9f"
|
||||
SRCREV_meta ?= "d626f9108d590d41e82b97cbffc380aa699e86e1"
|
||||
|
||||
# remap qemuarm to qemuarma15 for the 5.4 kernel
|
||||
# KMACHINE_qemuarm ?= "qemuarma15"
|
||||
@@ -30,7 +30,7 @@ SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRA
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA}"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
|
||||
LINUX_VERSION ?= "5.4.69"
|
||||
LINUX_VERSION ?= "5.4.78"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
DEPENDS += "openssl-native util-linux-native"
|
||||
|
||||
@@ -12,16 +12,16 @@ KBRANCH_qemux86 ?= "v5.8/standard/base"
|
||||
KBRANCH_qemux86-64 ?= "v5.8/standard/base"
|
||||
KBRANCH_qemumips64 ?= "v5.8/standard/mti-malta64"
|
||||
|
||||
SRCREV_machine_qemuarm ?= "41542e01d0deb5a38c190809f4fd01a442769938"
|
||||
SRCREV_machine_qemuarm64 ?= "5981001bf03f0d0c1cf641a2287ab6368baf628a"
|
||||
SRCREV_machine_qemumips ?= "36e642d5b6c5b1d05f6172a75df172ad8fefc30b"
|
||||
SRCREV_machine_qemuppc ?= "5981001bf03f0d0c1cf641a2287ab6368baf628a"
|
||||
SRCREV_machine_qemuriscv64 ?= "5981001bf03f0d0c1cf641a2287ab6368baf628a"
|
||||
SRCREV_machine_qemux86 ?= "5981001bf03f0d0c1cf641a2287ab6368baf628a"
|
||||
SRCREV_machine_qemux86-64 ?= "5981001bf03f0d0c1cf641a2287ab6368baf628a"
|
||||
SRCREV_machine_qemumips64 ?= "5538a54afd2525803729c85a40609cae292cb242"
|
||||
SRCREV_machine ?= "5981001bf03f0d0c1cf641a2287ab6368baf628a"
|
||||
SRCREV_meta ?= "34775c20bc4f4ac32ac7eded79f9dc8ca77e4277"
|
||||
SRCREV_machine_qemuarm ?= "14b463d0e5c1e2ff354244420f9bbc7f0ab80533"
|
||||
SRCREV_machine_qemuarm64 ?= "3c5d210805d61bea8f8a8081e0e3a89ea8a61f3f"
|
||||
SRCREV_machine_qemumips ?= "8d8d9afb396f154f366f32948fdff3cf4e269841"
|
||||
SRCREV_machine_qemuppc ?= "3c5d210805d61bea8f8a8081e0e3a89ea8a61f3f"
|
||||
SRCREV_machine_qemuriscv64 ?= "3c5d210805d61bea8f8a8081e0e3a89ea8a61f3f"
|
||||
SRCREV_machine_qemux86 ?= "3c5d210805d61bea8f8a8081e0e3a89ea8a61f3f"
|
||||
SRCREV_machine_qemux86-64 ?= "3c5d210805d61bea8f8a8081e0e3a89ea8a61f3f"
|
||||
SRCREV_machine_qemumips64 ?= "01a02b058f9a8941032b298b8d25c673526152f4"
|
||||
SRCREV_machine ?= "3c5d210805d61bea8f8a8081e0e3a89ea8a61f3f"
|
||||
SRCREV_meta ?= "7883b60d324029d26020c0b3f826b35c52fd9674"
|
||||
|
||||
# remap qemuarm to qemuarma15 for the 5.8 kernel
|
||||
# KMACHINE_qemuarm ?= "qemuarma15"
|
||||
@@ -30,7 +30,7 @@ SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRA
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.8;destsuffix=${KMETA}"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
|
||||
LINUX_VERSION ?= "5.8.13"
|
||||
LINUX_VERSION ?= "5.8.18"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
|
||||
DEPENDS += "openssl-native util-linux-native"
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
From ff4d1d7e85be94ef43709cd698f0ec9a12f247d1 Mon Sep 17 00:00:00 2001
|
||||
From: Beniamin Sandu <beniaminsandu@gmail.com>
|
||||
Date: Thu, 13 Aug 2020 16:24:39 +0300
|
||||
Subject: [PATCH 01/10] Kconfig: fix dependency issue when building in-tree
|
||||
without CONFIG_FTRACE
|
||||
|
||||
When building in-tree, one could disable CONFIG_FTRACE from kernel
|
||||
config which will leave CONFIG_TRACEPOINTS selected by LTTNG modules,
|
||||
but generate a lot of linker errors like below because it leaves out
|
||||
other stuff, e.g.:
|
||||
|
||||
trace.c:(.text+0xd86b): undefined reference to `trace_event_buffer_reserve'
|
||||
ld: trace.c:(.text+0xd8de): undefined reference to `trace_event_buffer_commit'
|
||||
ld: trace.c:(.text+0xd926): undefined reference to `event_triggers_call'
|
||||
ld: trace.c:(.text+0xd942): undefined reference to `trace_event_ignore_this_pid'
|
||||
ld: net/mac80211/trace.o: in function `trace_event_raw_event_drv_tdls_cancel_channel_switch':
|
||||
|
||||
It appears to be caused by the fact that TRACE_EVENT macros in the Linux
|
||||
kernel depend on the Ftrace ring buffer as soon as CONFIG_TRACEPOINTS is
|
||||
enabled.
|
||||
|
||||
Steps to reproduce:
|
||||
|
||||
- Get a clone of an upstream stable kernel and use scripts/built-in.sh on it
|
||||
|
||||
- Configure a standard x86-64 build, enable built-in LTTNG but disable
|
||||
CONFIG_FTRACE from Kernel Hacking-->Tracers using menuconfig
|
||||
|
||||
- Build will fail at linking stage
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
---
|
||||
Kconfig | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Kconfig b/Kconfig
|
||||
index acdab73..10eccff 100644
|
||||
--- a/Kconfig
|
||||
+++ b/Kconfig
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
config LTTNG
|
||||
tristate "LTTng support"
|
||||
- select TRACEPOINTS
|
||||
+ select TRACING
|
||||
help
|
||||
LTTng is an open source tracing framework for Linux.
|
||||
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -0,0 +1,318 @@
|
||||
From e13a7d262928984154fcf89feb14098e0cd1ad31 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Tue, 27 Oct 2020 11:42:23 -0400
|
||||
Subject: [PATCH 04/11] fix: btrfs: tracepoints: output proper root owner for
|
||||
trace_find_free_extent() (v5.10)
|
||||
|
||||
See upstream commit :
|
||||
|
||||
commit 437490fed3b0c9ae21af8f70e0f338d34560842b
|
||||
Author: Qu Wenruo <wqu@suse.com>
|
||||
Date: Tue Jul 28 09:42:49 2020 +0800
|
||||
|
||||
btrfs: tracepoints: output proper root owner for trace_find_free_extent()
|
||||
|
||||
The current trace event always output result like this:
|
||||
|
||||
find_free_extent: root=2(EXTENT_TREE) len=16384 empty_size=0 flags=4(METADATA)
|
||||
find_free_extent: root=2(EXTENT_TREE) len=16384 empty_size=0 flags=4(METADATA)
|
||||
find_free_extent: root=2(EXTENT_TREE) len=8192 empty_size=0 flags=1(DATA)
|
||||
find_free_extent: root=2(EXTENT_TREE) len=8192 empty_size=0 flags=1(DATA)
|
||||
find_free_extent: root=2(EXTENT_TREE) len=4096 empty_size=0 flags=1(DATA)
|
||||
find_free_extent: root=2(EXTENT_TREE) len=4096 empty_size=0 flags=1(DATA)
|
||||
|
||||
T's saying we're allocating data extent for EXTENT tree, which is not
|
||||
even possible.
|
||||
|
||||
It's because we always use EXTENT tree as the owner for
|
||||
trace_find_free_extent() without using the @root from
|
||||
btrfs_reserve_extent().
|
||||
|
||||
This patch will change the parameter to use proper @root for
|
||||
trace_find_free_extent():
|
||||
|
||||
Now it looks much better:
|
||||
|
||||
find_free_extent: root=5(FS_TREE) len=16384 empty_size=0 flags=36(METADATA|DUP)
|
||||
find_free_extent: root=5(FS_TREE) len=8192 empty_size=0 flags=1(DATA)
|
||||
find_free_extent: root=5(FS_TREE) len=16384 empty_size=0 flags=1(DATA)
|
||||
find_free_extent: root=5(FS_TREE) len=4096 empty_size=0 flags=1(DATA)
|
||||
find_free_extent: root=5(FS_TREE) len=8192 empty_size=0 flags=1(DATA)
|
||||
find_free_extent: root=5(FS_TREE) len=16384 empty_size=0 flags=36(METADATA|DUP)
|
||||
find_free_extent: root=7(CSUM_TREE) len=16384 empty_size=0 flags=36(METADATA|DUP)
|
||||
find_free_extent: root=2(EXTENT_TREE) len=16384 empty_size=0 flags=36(METADATA|DUP)
|
||||
find_free_extent: root=1(ROOT_TREE) len=16384 empty_size=0 flags=36(METADATA|DUP)
|
||||
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
Change-Id: I1d674064d29b31417e2acffdeb735f5052a87032
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Signed-off-by: He Zhe <zhe.he@windriver.com>
|
||||
---
|
||||
instrumentation/events/lttng-module/btrfs.h | 206 ++++++++++++--------
|
||||
1 file changed, 122 insertions(+), 84 deletions(-)
|
||||
|
||||
diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h
|
||||
index 7b29008..52fcfd0 100644
|
||||
--- a/instrumentation/events/lttng-module/btrfs.h
|
||||
+++ b/instrumentation/events/lttng-module/btrfs.h
|
||||
@@ -1856,7 +1856,29 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_f
|
||||
|
||||
#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
|
||||
|
||||
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0) || \
|
||||
+ LTTNG_KERNEL_RANGE(5,9,6, 5,10,0) || \
|
||||
+ LTTNG_KERNEL_RANGE(5,4,78, 5,5,0))
|
||||
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
+
|
||||
+ btrfs_find_free_extent,
|
||||
+
|
||||
+ TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
|
||||
+ u64 data),
|
||||
+
|
||||
+ TP_ARGS(root, num_bytes, empty_size, data),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_array(u8, fsid, root->lttng_fs_info_fsid, BTRFS_UUID_SIZE)
|
||||
+ ctf_integer(u64, root_objectid, root->root_key.objectid)
|
||||
+ ctf_integer(u64, num_bytes, num_bytes)
|
||||
+ ctf_integer(u64, empty_size, empty_size)
|
||||
+ ctf_integer(u64, data, data)
|
||||
+ )
|
||||
+)
|
||||
+
|
||||
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
|
||||
+
|
||||
LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
|
||||
btrfs_find_free_extent,
|
||||
@@ -1874,6 +1896,105 @@ LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
)
|
||||
)
|
||||
|
||||
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
|
||||
+
|
||||
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
+
|
||||
+ btrfs_find_free_extent,
|
||||
+
|
||||
+ TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
|
||||
+ u64 data),
|
||||
+
|
||||
+ TP_ARGS(fs_info, num_bytes, empty_size, data),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
|
||||
+ ctf_integer(u64, num_bytes, num_bytes)
|
||||
+ ctf_integer(u64, empty_size, empty_size)
|
||||
+ ctf_integer(u64, data, data)
|
||||
+ )
|
||||
+)
|
||||
+
|
||||
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
|
||||
+
|
||||
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
+
|
||||
+ btrfs_find_free_extent,
|
||||
+
|
||||
+ TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
|
||||
+ u64 data),
|
||||
+
|
||||
+ TP_ARGS(fs_info, num_bytes, empty_size, data),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
|
||||
+ ctf_integer(u64, num_bytes, num_bytes)
|
||||
+ ctf_integer(u64, empty_size, empty_size)
|
||||
+ ctf_integer(u64, data, data)
|
||||
+ )
|
||||
+)
|
||||
+
|
||||
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
|
||||
+
|
||||
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
+
|
||||
+ btrfs_find_free_extent,
|
||||
+
|
||||
+ TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
|
||||
+ u64 data),
|
||||
+
|
||||
+ TP_ARGS(fs_info, num_bytes, empty_size, data),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
|
||||
+ ctf_integer(u64, num_bytes, num_bytes)
|
||||
+ ctf_integer(u64, empty_size, empty_size)
|
||||
+ ctf_integer(u64, data, data)
|
||||
+ )
|
||||
+)
|
||||
+
|
||||
+#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
|
||||
+ LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
|
||||
+ LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
|
||||
+ LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
|
||||
+
|
||||
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
+
|
||||
+ btrfs_find_free_extent,
|
||||
+
|
||||
+ TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
|
||||
+ u64 data),
|
||||
+
|
||||
+ TP_ARGS(root, num_bytes, empty_size, data),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_integer(u64, root_objectid, root->root_key.objectid)
|
||||
+ ctf_integer(u64, num_bytes, num_bytes)
|
||||
+ ctf_integer(u64, empty_size, empty_size)
|
||||
+ ctf_integer(u64, data, data)
|
||||
+ )
|
||||
+)
|
||||
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
|
||||
+
|
||||
+LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
+
|
||||
+ btrfs_find_free_extent,
|
||||
+
|
||||
+ TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
|
||||
+ u64 data),
|
||||
+
|
||||
+ TP_ARGS(root, num_bytes, empty_size, data),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_integer(u64, root_objectid, root->root_key.objectid)
|
||||
+ ctf_integer(u64, num_bytes, num_bytes)
|
||||
+ ctf_integer(u64, empty_size, empty_size)
|
||||
+ ctf_integer(u64, data, data)
|
||||
+ )
|
||||
+)
|
||||
+#endif
|
||||
+
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
|
||||
LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
|
||||
|
||||
TP_PROTO(const struct btrfs_block_group *block_group, u64 start,
|
||||
@@ -1907,22 +2028,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
|
||||
)
|
||||
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
|
||||
-LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
-
|
||||
- btrfs_find_free_extent,
|
||||
-
|
||||
- TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
|
||||
- u64 data),
|
||||
-
|
||||
- TP_ARGS(fs_info, num_bytes, empty_size, data),
|
||||
-
|
||||
- TP_FIELDS(
|
||||
- ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
|
||||
- ctf_integer(u64, num_bytes, num_bytes)
|
||||
- ctf_integer(u64, empty_size, empty_size)
|
||||
- ctf_integer(u64, data, data)
|
||||
- )
|
||||
-)
|
||||
|
||||
LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
|
||||
|
||||
@@ -1957,22 +2062,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
|
||||
)
|
||||
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
|
||||
-LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
-
|
||||
- btrfs_find_free_extent,
|
||||
-
|
||||
- TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
|
||||
- u64 data),
|
||||
-
|
||||
- TP_ARGS(fs_info, num_bytes, empty_size, data),
|
||||
-
|
||||
- TP_FIELDS(
|
||||
- ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
|
||||
- ctf_integer(u64, num_bytes, num_bytes)
|
||||
- ctf_integer(u64, empty_size, empty_size)
|
||||
- ctf_integer(u64, data, data)
|
||||
- )
|
||||
-)
|
||||
|
||||
LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
|
||||
|
||||
@@ -2011,23 +2100,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
|
||||
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
|
||||
|
||||
-LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
-
|
||||
- btrfs_find_free_extent,
|
||||
-
|
||||
- TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size,
|
||||
- u64 data),
|
||||
-
|
||||
- TP_ARGS(fs_info, num_bytes, empty_size, data),
|
||||
-
|
||||
- TP_FIELDS(
|
||||
- ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
|
||||
- ctf_integer(u64, num_bytes, num_bytes)
|
||||
- ctf_integer(u64, empty_size, empty_size)
|
||||
- ctf_integer(u64, data, data)
|
||||
- )
|
||||
-)
|
||||
-
|
||||
LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
|
||||
|
||||
TP_PROTO(struct btrfs_fs_info *fs_info,
|
||||
@@ -2066,23 +2138,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
|
||||
LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
|
||||
LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
|
||||
|
||||
-LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
-
|
||||
- btrfs_find_free_extent,
|
||||
-
|
||||
- TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
|
||||
- u64 data),
|
||||
-
|
||||
- TP_ARGS(root, num_bytes, empty_size, data),
|
||||
-
|
||||
- TP_FIELDS(
|
||||
- ctf_integer(u64, root_objectid, root->root_key.objectid)
|
||||
- ctf_integer(u64, num_bytes, num_bytes)
|
||||
- ctf_integer(u64, empty_size, empty_size)
|
||||
- ctf_integer(u64, data, data)
|
||||
- )
|
||||
-)
|
||||
-
|
||||
LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
|
||||
|
||||
TP_PROTO(const struct btrfs_root *root,
|
||||
@@ -2120,23 +2175,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_clus
|
||||
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
|
||||
|
||||
-LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
|
||||
-
|
||||
- btrfs_find_free_extent,
|
||||
-
|
||||
- TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
|
||||
- u64 data),
|
||||
-
|
||||
- TP_ARGS(root, num_bytes, empty_size, data),
|
||||
-
|
||||
- TP_FIELDS(
|
||||
- ctf_integer(u64, root_objectid, root->root_key.objectid)
|
||||
- ctf_integer(u64, num_bytes, num_bytes)
|
||||
- ctf_integer(u64, empty_size, empty_size)
|
||||
- ctf_integer(u64, data, data)
|
||||
- )
|
||||
-)
|
||||
-
|
||||
LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
|
||||
|
||||
TP_PROTO(struct btrfs_root *root,
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
From e10ab43dd0e425df5bc0ac763447664ed075ba05 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Mon, 10 Aug 2020 11:22:05 -0400
|
||||
Subject: [PATCH 02/10] fix: Move mmutrace.h into the mmu/ sub-directory (v5.9)
|
||||
|
||||
commit 33e3042dac6bcc33b80835f7d7b502b1d74c457c
|
||||
Author: Sean Christopherson <sean.j.christopherson@intel.com>
|
||||
Date: Mon Jun 22 13:20:29 2020 -0700
|
||||
|
||||
KVM: x86/mmu: Move mmu_audit.c and mmutrace.h into the mmu/ sub-directory
|
||||
|
||||
Move mmu_audit.c and mmutrace.h under mmu/ where they belong.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Change-Id: I582525ccca34e1e3bd62870364108a7d3e9df2e4
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
---
|
||||
probes/lttng-probe-kvm-x86-mmu.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/probes/lttng-probe-kvm-x86-mmu.c b/probes/lttng-probe-kvm-x86-mmu.c
|
||||
index 37384a2..5a7ef1e 100644
|
||||
--- a/probes/lttng-probe-kvm-x86-mmu.c
|
||||
+++ b/probes/lttng-probe-kvm-x86-mmu.c
|
||||
@@ -24,7 +24,11 @@
|
||||
*/
|
||||
#include <wrapper/tracepoint.h>
|
||||
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0))
|
||||
+#include <../../arch/x86/kvm/mmu/mmutrace.h>
|
||||
+#else
|
||||
#include <../../arch/x86/kvm/mmutrace.h>
|
||||
+#endif
|
||||
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
#undef TRACE_INCLUDE_FILE
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
From f16315cc45c4c6b880de541bb092ca18a13952b7 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Mon, 10 Aug 2020 11:36:03 -0400
|
||||
Subject: [PATCH 03/10] fix: KVM: x86/mmu: Make kvm_mmu_page definition and
|
||||
accessor internal-only (v5.9)
|
||||
|
||||
commit 985ab2780164698ec6e7d73fad523d50449261dd
|
||||
Author: Sean Christopherson <sean.j.christopherson@intel.com>
|
||||
Date: Mon Jun 22 13:20:32 2020 -0700
|
||||
|
||||
KVM: x86/mmu: Make kvm_mmu_page definition and accessor internal-only
|
||||
|
||||
Make 'struct kvm_mmu_page' MMU-only, nothing outside of the MMU should
|
||||
be poking into the gory details of shadow pages.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Change-Id: Ia5c1b9c49c2b00dad1d5b17c50c3dc730dafda20
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
---
|
||||
probes/lttng-probe-kvm-x86-mmu.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/probes/lttng-probe-kvm-x86-mmu.c b/probes/lttng-probe-kvm-x86-mmu.c
|
||||
index 5a7ef1e..8f98186 100644
|
||||
--- a/probes/lttng-probe-kvm-x86-mmu.c
|
||||
+++ b/probes/lttng-probe-kvm-x86-mmu.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <wrapper/tracepoint.h>
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0))
|
||||
+#include <../../arch/x86/kvm/mmu/mmu_internal.h>
|
||||
#include <../../arch/x86/kvm/mmu/mmutrace.h>
|
||||
#else
|
||||
#include <../../arch/x86/kvm/mmutrace.h>
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
From 8fe742807e65af29dac3fea568ff93cbc5dd9a56 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Mon, 24 Aug 2020 15:26:04 -0400
|
||||
Subject: [PATCH 04/10] fix: ext4: limit the length of per-inode prealloc list
|
||||
(v5.9)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
See upstream commit:
|
||||
|
||||
commit 27bc446e2def38db3244a6eb4bb1d6312936610a
|
||||
Author: brookxu <brookxu.cn@gmail.com>
|
||||
Date: Mon Aug 17 15:36:15 2020 +0800
|
||||
|
||||
ext4: limit the length of per-inode prealloc list
|
||||
|
||||
In the scenario of writing sparse files, the per-inode prealloc list may
|
||||
be very long, resulting in high overhead for ext4_mb_use_preallocated().
|
||||
To circumvent this problem, we limit the maximum length of per-inode
|
||||
prealloc list to 512 and allow users to modify it.
|
||||
|
||||
After patching, we observed that the sys ratio of cpu has dropped, and
|
||||
the system throughput has increased significantly. We created a process
|
||||
to write the sparse file, and the running time of the process on the
|
||||
fixed kernel was significantly reduced, as follows:
|
||||
|
||||
Running time on unfixed kernel:
|
||||
[root@TENCENT64 ~]# time taskset 0x01 ./sparse /data1/sparce.dat
|
||||
real 0m2.051s
|
||||
user 0m0.008s
|
||||
sys 0m2.026s
|
||||
|
||||
Running time on fixed kernel:
|
||||
[root@TENCENT64 ~]# time taskset 0x01 ./sparse /data1/sparce.dat
|
||||
real 0m0.471s
|
||||
user 0m0.004s
|
||||
sys 0m0.395s
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
Change-Id: I5169cb24853d4da32e2862a6626f1f058689b053
|
||||
---
|
||||
instrumentation/events/lttng-module/ext4.h | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/instrumentation/events/lttng-module/ext4.h b/instrumentation/events/lttng-module/ext4.h
|
||||
index 5f7ab28..72ad4c9 100644
|
||||
--- a/instrumentation/events/lttng-module/ext4.h
|
||||
+++ b/instrumentation/events/lttng-module/ext4.h
|
||||
@@ -460,6 +460,20 @@ LTTNG_TRACEPOINT_EVENT(ext4_mb_release_group_pa,
|
||||
)
|
||||
#endif
|
||||
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0))
|
||||
+LTTNG_TRACEPOINT_EVENT(ext4_discard_preallocations,
|
||||
+ TP_PROTO(struct inode *inode, unsigned int len, unsigned int needed),
|
||||
+
|
||||
+ TP_ARGS(inode, len, needed),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_integer(dev_t, dev, inode->i_sb->s_dev)
|
||||
+ ctf_integer(ino_t, ino, inode->i_ino)
|
||||
+ ctf_integer(unsigned int, len, len)
|
||||
+ ctf_integer(unsigned int, needed, needed)
|
||||
+ )
|
||||
+)
|
||||
+#else
|
||||
LTTNG_TRACEPOINT_EVENT(ext4_discard_preallocations,
|
||||
TP_PROTO(struct inode *inode),
|
||||
|
||||
@@ -470,6 +484,7 @@ LTTNG_TRACEPOINT_EVENT(ext4_discard_preallocations,
|
||||
ctf_integer(ino_t, ino, inode->i_ino)
|
||||
)
|
||||
)
|
||||
+#endif
|
||||
|
||||
LTTNG_TRACEPOINT_EVENT(ext4_mb_discard_preallocations,
|
||||
TP_PROTO(struct super_block *sb, int needed),
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
From 52563d02a9234215b62c5f519aa1b5d8589ccd0a Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Mon, 24 Aug 2020 15:37:50 -0400
|
||||
Subject: [PATCH 05/10] =?UTF-8?q?fix:=20ext4:=20indicate=20via=20a=20block?=
|
||||
=?UTF-8?q?=20bitmap=20read=20is=20prefetched=E2=80=A6=20(v5.9)?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
See upstream commit:
|
||||
|
||||
commit ab74c7b23f3770935016e3eb3ecdf1e42b73efaa
|
||||
Author: Theodore Ts'o <tytso@mit.edu>
|
||||
Date: Wed Jul 15 11:48:55 2020 -0400
|
||||
|
||||
ext4: indicate via a block bitmap read is prefetched via a tracepoint
|
||||
|
||||
Modify the ext4_read_block_bitmap_load tracepoint so that it tells us
|
||||
whether a block bitmap is being prefetched.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
Change-Id: I0e5e2c5b8004223d0928235c092449ee16a940e1
|
||||
---
|
||||
instrumentation/events/lttng-module/ext4.h | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/instrumentation/events/lttng-module/ext4.h b/instrumentation/events/lttng-module/ext4.h
|
||||
index 72ad4c9..4476abb 100644
|
||||
--- a/instrumentation/events/lttng-module/ext4.h
|
||||
+++ b/instrumentation/events/lttng-module/ext4.h
|
||||
@@ -893,12 +893,26 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
|
||||
TP_ARGS(sb, group)
|
||||
)
|
||||
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0))
|
||||
+LTTNG_TRACEPOINT_EVENT(ext4_read_block_bitmap_load,
|
||||
+ TP_PROTO(struct super_block *sb, unsigned long group, bool prefetch),
|
||||
+
|
||||
+ TP_ARGS(sb, group, prefetch),
|
||||
+
|
||||
+ TP_FIELDS(
|
||||
+ ctf_integer(dev_t, dev, sb->s_dev)
|
||||
+ ctf_integer(__u32, group, group)
|
||||
+ ctf_integer(bool, prefetch, prefetch)
|
||||
+ )
|
||||
+)
|
||||
+#else
|
||||
LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__bitmap_load, ext4_read_block_bitmap_load,
|
||||
|
||||
TP_PROTO(struct super_block *sb, unsigned long group),
|
||||
|
||||
TP_ARGS(sb, group)
|
||||
)
|
||||
+#endif
|
||||
|
||||
LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__bitmap_load, ext4_load_inode_bitmap,
|
||||
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -1,391 +0,0 @@
|
||||
From 57ccbfa6a8a79c7b84394c2097efaf7935607aa5 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Tue, 25 Aug 2020 10:56:29 -0400
|
||||
Subject: [PATCH 06/10] fix: removal of [smp_]read_barrier_depends (v5.9)
|
||||
|
||||
See upstream commits:
|
||||
|
||||
commit 76ebbe78f7390aee075a7f3768af197ded1bdfbb
|
||||
Author: Will Deacon <will@kernel.org>
|
||||
Date: Tue Oct 24 11:22:47 2017 +0100
|
||||
|
||||
locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()
|
||||
|
||||
In preparation for the removal of lockless_dereference(), which is the
|
||||
same as READ_ONCE() on all architectures other than Alpha, add an
|
||||
implicit smp_read_barrier_depends() to READ_ONCE() so that it can be
|
||||
used to head dependency chains on all architectures.
|
||||
|
||||
commit 76ebbe78f7390aee075a7f3768af197ded1bdfbb
|
||||
Author: Will Deacon <will.deacon@arm.com>
|
||||
Date: Tue Oct 24 11:22:47 2017 +0100
|
||||
|
||||
locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()
|
||||
|
||||
In preparation for the removal of lockless_dereference(), which is the
|
||||
same as READ_ONCE() on all architectures other than Alpha, add an
|
||||
implicit smp_read_barrier_depends() to READ_ONCE() so that it can be
|
||||
used to head dependency chains on all architectures.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Change-Id: Ife8880bd9378dca2972da8838f40fc35ccdfaaac
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
---
|
||||
instrumentation/events/lttng-module/i2c.h | 4 ++--
|
||||
lib/ringbuffer/backend.h | 2 +-
|
||||
lib/ringbuffer/backend_internal.h | 2 +-
|
||||
lib/ringbuffer/frontend.h | 4 ++--
|
||||
lib/ringbuffer/ring_buffer_frontend.c | 4 ++--
|
||||
lib/ringbuffer/ring_buffer_iterator.c | 2 +-
|
||||
lttng-events.c | 8 ++++----
|
||||
probes/lttng-kprobes.c | 6 +++---
|
||||
probes/lttng-kretprobes.c | 6 +++---
|
||||
probes/lttng-tracepoint-event-impl.h | 12 ++++++------
|
||||
probes/lttng-uprobes.c | 6 +++---
|
||||
wrapper/compiler.h | 18 ++++++++++++++++++
|
||||
wrapper/trace-clock.h | 15 +++++----------
|
||||
13 files changed, 51 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/instrumentation/events/lttng-module/i2c.h b/instrumentation/events/lttng-module/i2c.h
|
||||
index dcbabf6..131d134 100644
|
||||
--- a/instrumentation/events/lttng-module/i2c.h
|
||||
+++ b/instrumentation/events/lttng-module/i2c.h
|
||||
@@ -23,7 +23,7 @@ LTTNG_TRACEPOINT_EVENT_CODE(i2c_write,
|
||||
|
||||
TP_code_pre(
|
||||
tp_locvar->extract_sensitive_payload =
|
||||
- READ_ONCE(extract_sensitive_payload);
|
||||
+ LTTNG_READ_ONCE(extract_sensitive_payload);
|
||||
),
|
||||
|
||||
TP_FIELDS(
|
||||
@@ -78,7 +78,7 @@ LTTNG_TRACEPOINT_EVENT_CODE(i2c_reply,
|
||||
|
||||
TP_code_pre(
|
||||
tp_locvar->extract_sensitive_payload =
|
||||
- READ_ONCE(extract_sensitive_payload);
|
||||
+ LTTNG_READ_ONCE(extract_sensitive_payload);
|
||||
),
|
||||
|
||||
TP_FIELDS(
|
||||
diff --git a/lib/ringbuffer/backend.h b/lib/ringbuffer/backend.h
|
||||
index da937f2..43e1d47 100644
|
||||
--- a/lib/ringbuffer/backend.h
|
||||
+++ b/lib/ringbuffer/backend.h
|
||||
@@ -156,7 +156,7 @@ size_t lib_ring_buffer_do_strcpy(const struct lib_ring_buffer_config *config,
|
||||
* Only read source character once, in case it is
|
||||
* modified concurrently.
|
||||
*/
|
||||
- c = READ_ONCE(src[count]);
|
||||
+ c = LTTNG_READ_ONCE(src[count]);
|
||||
if (!c)
|
||||
break;
|
||||
lib_ring_buffer_do_copy(config, &dest[count], &c, 1);
|
||||
diff --git a/lib/ringbuffer/backend_internal.h b/lib/ringbuffer/backend_internal.h
|
||||
index 2d6a345..1226fd8 100644
|
||||
--- a/lib/ringbuffer/backend_internal.h
|
||||
+++ b/lib/ringbuffer/backend_internal.h
|
||||
@@ -367,7 +367,7 @@ void lib_ring_buffer_clear_noref(const struct lib_ring_buffer_config *config,
|
||||
* Performing a volatile access to read the sb_pages, because we want to
|
||||
* read a coherent version of the pointer and the associated noref flag.
|
||||
*/
|
||||
- id = READ_ONCE(bufb->buf_wsb[idx].id);
|
||||
+ id = LTTNG_READ_ONCE(bufb->buf_wsb[idx].id);
|
||||
for (;;) {
|
||||
/* This check is called on the fast path for each record. */
|
||||
if (likely(!subbuffer_id_is_noref(config, id))) {
|
||||
diff --git a/lib/ringbuffer/frontend.h b/lib/ringbuffer/frontend.h
|
||||
index 6f516d9..41382fe 100644
|
||||
--- a/lib/ringbuffer/frontend.h
|
||||
+++ b/lib/ringbuffer/frontend.h
|
||||
@@ -79,7 +79,7 @@ void *channel_destroy(struct channel *chan);
|
||||
#define for_each_channel_cpu(cpu, chan) \
|
||||
for ((cpu) = -1; \
|
||||
({ (cpu) = cpumask_next(cpu, (chan)->backend.cpumask); \
|
||||
- smp_read_barrier_depends(); (cpu) < nr_cpu_ids; });)
|
||||
+ smp_rmb(); (cpu) < nr_cpu_ids; });)
|
||||
|
||||
extern struct lib_ring_buffer *channel_get_ring_buffer(
|
||||
const struct lib_ring_buffer_config *config,
|
||||
@@ -155,7 +155,7 @@ static inline
|
||||
int lib_ring_buffer_is_finalized(const struct lib_ring_buffer_config *config,
|
||||
struct lib_ring_buffer *buf)
|
||||
{
|
||||
- int finalized = READ_ONCE(buf->finalized);
|
||||
+ int finalized = LTTNG_READ_ONCE(buf->finalized);
|
||||
/*
|
||||
* Read finalized before counters.
|
||||
*/
|
||||
diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c
|
||||
index 3cab365..4980d20 100644
|
||||
--- a/lib/ringbuffer/ring_buffer_frontend.c
|
||||
+++ b/lib/ringbuffer/ring_buffer_frontend.c
|
||||
@@ -1074,7 +1074,7 @@ int lib_ring_buffer_snapshot(struct lib_ring_buffer *buf,
|
||||
int finalized;
|
||||
|
||||
retry:
|
||||
- finalized = READ_ONCE(buf->finalized);
|
||||
+ finalized = LTTNG_READ_ONCE(buf->finalized);
|
||||
/*
|
||||
* Read finalized before counters.
|
||||
*/
|
||||
@@ -1245,7 +1245,7 @@ int lib_ring_buffer_get_subbuf(struct lib_ring_buffer *buf,
|
||||
return -EBUSY;
|
||||
}
|
||||
retry:
|
||||
- finalized = READ_ONCE(buf->finalized);
|
||||
+ finalized = LTTNG_READ_ONCE(buf->finalized);
|
||||
/*
|
||||
* Read finalized before counters.
|
||||
*/
|
||||
diff --git a/lib/ringbuffer/ring_buffer_iterator.c b/lib/ringbuffer/ring_buffer_iterator.c
|
||||
index d25db72..7b4f20a 100644
|
||||
--- a/lib/ringbuffer/ring_buffer_iterator.c
|
||||
+++ b/lib/ringbuffer/ring_buffer_iterator.c
|
||||
@@ -46,7 +46,7 @@ restart:
|
||||
switch (iter->state) {
|
||||
case ITER_GET_SUBBUF:
|
||||
ret = lib_ring_buffer_get_next_subbuf(buf);
|
||||
- if (ret && !READ_ONCE(buf->finalized)
|
||||
+ if (ret && !LTTNG_READ_ONCE(buf->finalized)
|
||||
&& config->alloc == RING_BUFFER_ALLOC_GLOBAL) {
|
||||
/*
|
||||
* Use "pull" scheme for global buffers. The reader
|
||||
diff --git a/lttng-events.c b/lttng-events.c
|
||||
index be7e389..d719294 100644
|
||||
--- a/lttng-events.c
|
||||
+++ b/lttng-events.c
|
||||
@@ -1719,7 +1719,7 @@ int lttng_metadata_printf(struct lttng_session *session,
|
||||
size_t len;
|
||||
va_list ap;
|
||||
|
||||
- WARN_ON_ONCE(!READ_ONCE(session->active));
|
||||
+ WARN_ON_ONCE(!LTTNG_READ_ONCE(session->active));
|
||||
|
||||
va_start(ap, fmt);
|
||||
str = kvasprintf(GFP_KERNEL, fmt, ap);
|
||||
@@ -2305,7 +2305,7 @@ int _lttng_event_metadata_statedump(struct lttng_session *session,
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
- if (event->metadata_dumped || !READ_ONCE(session->active))
|
||||
+ if (event->metadata_dumped || !LTTNG_READ_ONCE(session->active))
|
||||
return 0;
|
||||
if (chan->channel_type == METADATA_CHANNEL)
|
||||
return 0;
|
||||
@@ -2377,7 +2377,7 @@ int _lttng_channel_metadata_statedump(struct lttng_session *session,
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
- if (chan->metadata_dumped || !READ_ONCE(session->active))
|
||||
+ if (chan->metadata_dumped || !LTTNG_READ_ONCE(session->active))
|
||||
return 0;
|
||||
|
||||
if (chan->channel_type == METADATA_CHANNEL)
|
||||
@@ -2604,7 +2604,7 @@ int _lttng_session_metadata_statedump(struct lttng_session *session)
|
||||
struct lttng_event *event;
|
||||
int ret = 0;
|
||||
|
||||
- if (!READ_ONCE(session->active))
|
||||
+ if (!LTTNG_READ_ONCE(session->active))
|
||||
return 0;
|
||||
|
||||
lttng_metadata_begin(session);
|
||||
diff --git a/probes/lttng-kprobes.c b/probes/lttng-kprobes.c
|
||||
index a44eaa1..38fb72e 100644
|
||||
--- a/probes/lttng-kprobes.c
|
||||
+++ b/probes/lttng-kprobes.c
|
||||
@@ -31,11 +31,11 @@ int lttng_kprobes_handler_pre(struct kprobe *p, struct pt_regs *regs)
|
||||
int ret;
|
||||
unsigned long data = (unsigned long) p->addr;
|
||||
|
||||
- if (unlikely(!READ_ONCE(chan->session->active)))
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(chan->session->active)))
|
||||
return 0;
|
||||
- if (unlikely(!READ_ONCE(chan->enabled)))
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(chan->enabled)))
|
||||
return 0;
|
||||
- if (unlikely(!READ_ONCE(event->enabled)))
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(event->enabled)))
|
||||
return 0;
|
||||
|
||||
lib_ring_buffer_ctx_init(&ctx, chan->chan, <tng_probe_ctx, sizeof(data),
|
||||
diff --git a/probes/lttng-kretprobes.c b/probes/lttng-kretprobes.c
|
||||
index ab98ff2..a6bcd21 100644
|
||||
--- a/probes/lttng-kretprobes.c
|
||||
+++ b/probes/lttng-kretprobes.c
|
||||
@@ -51,11 +51,11 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
|
||||
unsigned long parent_ip;
|
||||
} payload;
|
||||
|
||||
- if (unlikely(!READ_ONCE(chan->session->active)))
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(chan->session->active)))
|
||||
return 0;
|
||||
- if (unlikely(!READ_ONCE(chan->enabled)))
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(chan->enabled)))
|
||||
return 0;
|
||||
- if (unlikely(!READ_ONCE(event->enabled)))
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(event->enabled)))
|
||||
return 0;
|
||||
|
||||
payload.ip = (unsigned long) krpi->rp->kp.addr;
|
||||
diff --git a/probes/lttng-tracepoint-event-impl.h b/probes/lttng-tracepoint-event-impl.h
|
||||
index 77b8638..72a669e 100644
|
||||
--- a/probes/lttng-tracepoint-event-impl.h
|
||||
+++ b/probes/lttng-tracepoint-event-impl.h
|
||||
@@ -1132,11 +1132,11 @@ static void __event_probe__##_name(void *__data, _proto) \
|
||||
\
|
||||
if (!_TP_SESSION_CHECK(session, __session)) \
|
||||
return; \
|
||||
- if (unlikely(!READ_ONCE(__session->active))) \
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(__session->active))) \
|
||||
return; \
|
||||
- if (unlikely(!READ_ONCE(__chan->enabled))) \
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(__chan->enabled))) \
|
||||
return; \
|
||||
- if (unlikely(!READ_ONCE(__event->enabled))) \
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(__event->enabled))) \
|
||||
return; \
|
||||
__lf = lttng_rcu_dereference(__session->pid_tracker.p); \
|
||||
if (__lf && likely(!lttng_id_tracker_lookup(__lf, current->tgid))) \
|
||||
@@ -1225,11 +1225,11 @@ static void __event_probe__##_name(void *__data) \
|
||||
\
|
||||
if (!_TP_SESSION_CHECK(session, __session)) \
|
||||
return; \
|
||||
- if (unlikely(!READ_ONCE(__session->active))) \
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(__session->active))) \
|
||||
return; \
|
||||
- if (unlikely(!READ_ONCE(__chan->enabled))) \
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(__chan->enabled))) \
|
||||
return; \
|
||||
- if (unlikely(!READ_ONCE(__event->enabled))) \
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(__event->enabled))) \
|
||||
return; \
|
||||
__lf = lttng_rcu_dereference(__session->pid_tracker.p); \
|
||||
if (__lf && likely(!lttng_id_tracker_lookup(__lf, current->tgid))) \
|
||||
diff --git a/probes/lttng-uprobes.c b/probes/lttng-uprobes.c
|
||||
index bc10128..bda1d9b 100644
|
||||
--- a/probes/lttng-uprobes.c
|
||||
+++ b/probes/lttng-uprobes.c
|
||||
@@ -40,11 +40,11 @@ int lttng_uprobes_handler_pre(struct uprobe_consumer *uc, struct pt_regs *regs)
|
||||
unsigned long ip;
|
||||
} payload;
|
||||
|
||||
- if (unlikely(!READ_ONCE(chan->session->active)))
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(chan->session->active)))
|
||||
return 0;
|
||||
- if (unlikely(!READ_ONCE(chan->enabled)))
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(chan->enabled)))
|
||||
return 0;
|
||||
- if (unlikely(!READ_ONCE(event->enabled)))
|
||||
+ if (unlikely(!LTTNG_READ_ONCE(event->enabled)))
|
||||
return 0;
|
||||
|
||||
lib_ring_buffer_ctx_init(&ctx, chan->chan, <tng_probe_ctx,
|
||||
diff --git a/wrapper/compiler.h b/wrapper/compiler.h
|
||||
index 1496f33..b9f8c51 100644
|
||||
--- a/wrapper/compiler.h
|
||||
+++ b/wrapper/compiler.h
|
||||
@@ -9,6 +9,7 @@
|
||||
#define _LTTNG_WRAPPER_COMPILER_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
+#include <linux/version.h>
|
||||
|
||||
/*
|
||||
* Don't allow compiling with buggy compiler.
|
||||
@@ -39,4 +40,21 @@
|
||||
# define WRITE_ONCE(x, val) ({ ACCESS_ONCE(x) = val; })
|
||||
#endif
|
||||
|
||||
+/*
|
||||
+ * In v4.15 a smp read barrier was added to READ_ONCE to replace
|
||||
+ * lockless_dereference(), replicate this behavior on prior kernels
|
||||
+ * and remove calls to smp_read_barrier_depends which was dropped
|
||||
+ * in v5.9.
|
||||
+ */
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
|
||||
+#define LTTNG_READ_ONCE(x) READ_ONCE(x)
|
||||
+#else
|
||||
+#define LTTNG_READ_ONCE(x) \
|
||||
+({ \
|
||||
+ typeof(x) __val = READ_ONCE(x); \
|
||||
+ smp_read_barrier_depends(); \
|
||||
+ __val; \
|
||||
+})
|
||||
+#endif
|
||||
+
|
||||
#endif /* _LTTNG_WRAPPER_COMPILER_H */
|
||||
diff --git a/wrapper/trace-clock.h b/wrapper/trace-clock.h
|
||||
index 9f4e366..187fc82 100644
|
||||
--- a/wrapper/trace-clock.h
|
||||
+++ b/wrapper/trace-clock.h
|
||||
@@ -160,33 +160,30 @@ static inline void put_trace_clock(void)
|
||||
|
||||
static inline u64 trace_clock_read64(void)
|
||||
{
|
||||
- struct lttng_trace_clock *ltc = READ_ONCE(lttng_trace_clock);
|
||||
+ struct lttng_trace_clock *ltc = LTTNG_READ_ONCE(lttng_trace_clock);
|
||||
|
||||
if (likely(!ltc)) {
|
||||
return trace_clock_read64_monotonic();
|
||||
} else {
|
||||
- read_barrier_depends(); /* load ltc before content */
|
||||
return ltc->read64();
|
||||
}
|
||||
}
|
||||
|
||||
static inline u64 trace_clock_freq(void)
|
||||
{
|
||||
- struct lttng_trace_clock *ltc = READ_ONCE(lttng_trace_clock);
|
||||
+ struct lttng_trace_clock *ltc = LTTNG_READ_ONCE(lttng_trace_clock);
|
||||
|
||||
if (!ltc) {
|
||||
return trace_clock_freq_monotonic();
|
||||
} else {
|
||||
- read_barrier_depends(); /* load ltc before content */
|
||||
return ltc->freq();
|
||||
}
|
||||
}
|
||||
|
||||
static inline int trace_clock_uuid(char *uuid)
|
||||
{
|
||||
- struct lttng_trace_clock *ltc = READ_ONCE(lttng_trace_clock);
|
||||
+ struct lttng_trace_clock *ltc = LTTNG_READ_ONCE(lttng_trace_clock);
|
||||
|
||||
- read_barrier_depends(); /* load ltc before content */
|
||||
/* Use default UUID cb when NULL */
|
||||
if (!ltc || !ltc->uuid) {
|
||||
return trace_clock_uuid_monotonic(uuid);
|
||||
@@ -197,24 +194,22 @@ static inline int trace_clock_uuid(char *uuid)
|
||||
|
||||
static inline const char *trace_clock_name(void)
|
||||
{
|
||||
- struct lttng_trace_clock *ltc = READ_ONCE(lttng_trace_clock);
|
||||
+ struct lttng_trace_clock *ltc = LTTNG_READ_ONCE(lttng_trace_clock);
|
||||
|
||||
if (!ltc) {
|
||||
return trace_clock_name_monotonic();
|
||||
} else {
|
||||
- read_barrier_depends(); /* load ltc before content */
|
||||
return ltc->name();
|
||||
}
|
||||
}
|
||||
|
||||
static inline const char *trace_clock_description(void)
|
||||
{
|
||||
- struct lttng_trace_clock *ltc = READ_ONCE(lttng_trace_clock);
|
||||
+ struct lttng_trace_clock *ltc = LTTNG_READ_ONCE(lttng_trace_clock);
|
||||
|
||||
if (!ltc) {
|
||||
return trace_clock_description_monotonic();
|
||||
} else {
|
||||
- read_barrier_depends(); /* load ltc before content */
|
||||
return ltc->description();
|
||||
}
|
||||
}
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
From eae02feb58064eee5ce15a9f6bdffd107c47da05 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Mon, 31 Aug 2020 11:41:38 -0400
|
||||
Subject: [PATCH 07/10] fix: writeback: Drop I_DIRTY_TIME_EXPIRE (v5.9)
|
||||
|
||||
See upstream commit:
|
||||
|
||||
commit 5fcd57505c002efc5823a7355e21f48dd02d5a51
|
||||
Author: Jan Kara <jack@suse.cz>
|
||||
Date: Fri May 29 16:24:43 2020 +0200
|
||||
|
||||
writeback: Drop I_DIRTY_TIME_EXPIRE
|
||||
|
||||
The only use of I_DIRTY_TIME_EXPIRE is to detect in
|
||||
__writeback_single_inode() that inode got there because flush worker
|
||||
decided it's time to writeback the dirty inode time stamps (either
|
||||
because we are syncing or because of age). However we can detect this
|
||||
directly in __writeback_single_inode() and there's no need for the
|
||||
strange propagation with I_DIRTY_TIME_EXPIRE flag.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
Change-Id: I92e37c2ff3ec36d431e8f9de5c8e37c5a2da55ea
|
||||
---
|
||||
instrumentation/events/lttng-module/writeback.h | 16 +++++++++++++++-
|
||||
1 file changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/instrumentation/events/lttng-module/writeback.h b/instrumentation/events/lttng-module/writeback.h
|
||||
index affb4eb..ece67ad 100644
|
||||
--- a/instrumentation/events/lttng-module/writeback.h
|
||||
+++ b/instrumentation/events/lttng-module/writeback.h
|
||||
@@ -46,7 +46,21 @@ static inline struct backing_dev_info *lttng_inode_to_bdi(struct inode *inode)
|
||||
|
||||
#endif
|
||||
|
||||
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0))
|
||||
+#define show_inode_state(state) \
|
||||
+ __print_flags(state, "|", \
|
||||
+ {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \
|
||||
+ {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \
|
||||
+ {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \
|
||||
+ {I_NEW, "I_NEW"}, \
|
||||
+ {I_WILL_FREE, "I_WILL_FREE"}, \
|
||||
+ {I_FREEING, "I_FREEING"}, \
|
||||
+ {I_CLEAR, "I_CLEAR"}, \
|
||||
+ {I_SYNC, "I_SYNC"}, \
|
||||
+ {I_DIRTY_TIME, "I_DIRTY_TIME"}, \
|
||||
+ {I_REFERENCED, "I_REFERENCED"} \
|
||||
+ )
|
||||
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0))
|
||||
#define show_inode_state(state) \
|
||||
__print_flags(state, "|", \
|
||||
{I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
From 87b2affc3eb06f3fb2d0923f18af37713eb6814b Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Mon, 31 Aug 2020 14:16:01 -0400
|
||||
Subject: [PATCH 08/10] fix: writeback: Fix sync livelock due to b_dirty_time
|
||||
processing (v5.9)
|
||||
|
||||
See upstream commit:
|
||||
|
||||
commit f9cae926f35e8230330f28c7b743ad088611a8de
|
||||
Author: Jan Kara <jack@suse.cz>
|
||||
Date: Fri May 29 16:08:58 2020 +0200
|
||||
|
||||
writeback: Fix sync livelock due to b_dirty_time processing
|
||||
|
||||
When we are processing writeback for sync(2), move_expired_inodes()
|
||||
didn't set any inode expiry value (older_than_this). This can result in
|
||||
writeback never completing if there's steady stream of inodes added to
|
||||
b_dirty_time list as writeback rechecks dirty lists after each writeback
|
||||
round whether there's more work to be done. Fix the problem by using
|
||||
sync(2) start time is inode expiry value when processing b_dirty_time
|
||||
list similarly as for ordinarily dirtied inodes. This requires some
|
||||
refactoring of older_than_this handling which simplifies the code
|
||||
noticeably as a bonus.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Change-Id: I8b894b13ccc14d9b8983ee4c2810a927c319560b
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
---
|
||||
.../events/lttng-module/writeback.h | 39 ++++++++++++-------
|
||||
1 file changed, 26 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/instrumentation/events/lttng-module/writeback.h b/instrumentation/events/lttng-module/writeback.h
|
||||
index ece67ad..e9018dd 100644
|
||||
--- a/instrumentation/events/lttng-module/writeback.h
|
||||
+++ b/instrumentation/events/lttng-module/writeback.h
|
||||
@@ -384,34 +384,48 @@ LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_wait, writeback_wbc_balanc
|
||||
#endif
|
||||
LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writepage, writeback_wbc_writepage)
|
||||
|
||||
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0))
|
||||
+LTTNG_TRACEPOINT_EVENT(writeback_queue_io,
|
||||
+ TP_PROTO(struct bdi_writeback *wb,
|
||||
+ struct wb_writeback_work *work,
|
||||
+ unsigned long dirtied_before,
|
||||
+ int moved),
|
||||
+ TP_ARGS(wb, work, dirtied_before, moved),
|
||||
+ TP_FIELDS(
|
||||
+ ctf_array_text(char, name, dev_name(wb->bdi->dev), 32)
|
||||
+ ctf_integer(unsigned long, older, dirtied_before)
|
||||
+ ctf_integer(int, moved, moved)
|
||||
+ )
|
||||
+)
|
||||
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
|
||||
LTTNG_TRACEPOINT_EVENT(writeback_queue_io,
|
||||
TP_PROTO(struct bdi_writeback *wb,
|
||||
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
|
||||
struct wb_writeback_work *work,
|
||||
-#else
|
||||
- unsigned long *older_than_this,
|
||||
-#endif
|
||||
int moved),
|
||||
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
|
||||
TP_ARGS(wb, work, moved),
|
||||
-#else
|
||||
+ TP_FIELDS(
|
||||
+ ctf_array_text(char, name, dev_name(wb->bdi->dev), 32)
|
||||
+ ctf_integer(int, moved, moved)
|
||||
+ )
|
||||
+)
|
||||
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
|
||||
+LTTNG_TRACEPOINT_EVENT(writeback_queue_io,
|
||||
+ TP_PROTO(struct bdi_writeback *wb,
|
||||
+ unsigned long *older_than_this,
|
||||
+ int moved),
|
||||
TP_ARGS(wb, older_than_this, moved),
|
||||
-#endif
|
||||
TP_FIELDS(
|
||||
ctf_array_text(char, name, dev_name(wb->bdi->dev), 32)
|
||||
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
|
||||
-#else
|
||||
ctf_integer(unsigned long, older,
|
||||
older_than_this ? *older_than_this : 0)
|
||||
ctf_integer(long, age,
|
||||
older_than_this ?
|
||||
(jiffies - *older_than_this) * 1000 / HZ
|
||||
: -1)
|
||||
-#endif
|
||||
ctf_integer(int, moved, moved)
|
||||
)
|
||||
)
|
||||
+#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0))
|
||||
LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state,
|
||||
@@ -460,7 +474,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state,
|
||||
ctf_integer(unsigned long, dirty_limit, global_dirty_limit)
|
||||
)
|
||||
)
|
||||
-#else
|
||||
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
|
||||
LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state,
|
||||
|
||||
writeback_global_dirty_state,
|
||||
@@ -485,7 +499,6 @@ LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state,
|
||||
)
|
||||
)
|
||||
#endif
|
||||
-#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
|
||||
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
From b74b25f349e92d7b5bdc8684e406d6a889f13773 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Jeanson <mjeanson@efficios.com>
|
||||
Date: Fri, 4 Sep 2020 11:52:51 -0400
|
||||
Subject: [PATCH 09/10] fix: version ranges for ext4_discard_preallocations and
|
||||
writeback_queue_io
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
Change-Id: Id4fa53cb2e713cbda651e1a75deed91013115592
|
||||
---
|
||||
instrumentation/events/lttng-module/ext4.h | 3 ++-
|
||||
instrumentation/events/lttng-module/writeback.h | 8 +++++++-
|
||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/instrumentation/events/lttng-module/ext4.h b/instrumentation/events/lttng-module/ext4.h
|
||||
index 4476abb..b172c8d 100644
|
||||
--- a/instrumentation/events/lttng-module/ext4.h
|
||||
+++ b/instrumentation/events/lttng-module/ext4.h
|
||||
@@ -460,7 +460,8 @@ LTTNG_TRACEPOINT_EVENT(ext4_mb_release_group_pa,
|
||||
)
|
||||
#endif
|
||||
|
||||
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) || \
|
||||
+ LTTNG_KERNEL_RANGE(5,8,6, 5,9,0))
|
||||
LTTNG_TRACEPOINT_EVENT(ext4_discard_preallocations,
|
||||
TP_PROTO(struct inode *inode, unsigned int len, unsigned int needed),
|
||||
|
||||
diff --git a/instrumentation/events/lttng-module/writeback.h b/instrumentation/events/lttng-module/writeback.h
|
||||
index e9018dd..09637d7 100644
|
||||
--- a/instrumentation/events/lttng-module/writeback.h
|
||||
+++ b/instrumentation/events/lttng-module/writeback.h
|
||||
@@ -384,7 +384,13 @@ LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_wait, writeback_wbc_balanc
|
||||
#endif
|
||||
LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writepage, writeback_wbc_writepage)
|
||||
|
||||
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0))
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) || \
|
||||
+ LTTNG_KERNEL_RANGE(5,8,6, 5,9,0) || \
|
||||
+ LTTNG_KERNEL_RANGE(5,4,62, 5,5,0) || \
|
||||
+ LTTNG_KERNEL_RANGE(4,19,143, 4,20,0) || \
|
||||
+ LTTNG_KERNEL_RANGE(4,14,196, 4,15,0) || \
|
||||
+ LTTNG_KERNEL_RANGE(4,9,235, 4,10,0) || \
|
||||
+ LTTNG_KERNEL_RANGE(4,4,235, 4,5,0))
|
||||
LTTNG_TRACEPOINT_EVENT(writeback_queue_io,
|
||||
TP_PROTO(struct bdi_writeback *wb,
|
||||
struct wb_writeback_work *work,
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -1,918 +0,0 @@
|
||||
From ad594e3a953db1b0c3c059fde45b5a5494f6be78 Mon Sep 17 00:00:00 2001
|
||||
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
Date: Tue, 28 Jan 2020 16:02:44 -0500
|
||||
Subject: [PATCH 10/10] Fix: system call filter table
|
||||
|
||||
The system call filter table has effectively been unused for a long
|
||||
time due to system call name prefix mismatch. This means the overhead of
|
||||
selective system call tracing was larger than it should have been because
|
||||
the event payload preparation would be done for all system calls as soon
|
||||
as a single system call is traced.
|
||||
|
||||
However, fixing this underlying issue unearths several issues that crept
|
||||
unnoticed when the "enabler" concept was introduced (after the original
|
||||
implementation of the system call filter table).
|
||||
|
||||
Here is a list of the issues which are resolved here:
|
||||
|
||||
- Split lttng_syscalls_unregister into an unregister and destroy
|
||||
function, thus awaiting for a grace period (and therefore quiescence
|
||||
of the users) after unregistering the system call tracepoints before
|
||||
freeing the system call filter data structures. This effectively fixes
|
||||
a use-after-free.
|
||||
|
||||
- The state for enabling "all" system calls vs enabling specific system
|
||||
calls (and sequences of enable-disable) was incorrect with respect to
|
||||
the "enablers" semantic. This is solved by always tracking the
|
||||
bitmap of enabled system calls, and keeping this bitmap even when
|
||||
enabling all system calls. The sc_filter is now always allocated
|
||||
before system call tracing is registered to tracepoints, which means
|
||||
it does not need to be RCU dereferenced anymore.
|
||||
|
||||
Padding fields in the ABI are reserved to select whether to:
|
||||
|
||||
- Trace either native or compat system call (or both, which is the
|
||||
behavior currently implemented),
|
||||
- Trace either system call entry or exit (or both, which is the
|
||||
behavior currently implemented),
|
||||
- Select the system call to trace by name (behavior currently
|
||||
implemented) or by system call number,
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||||
---
|
||||
lttng-abi.c | 43 ++++++
|
||||
lttng-abi.h | 26 ++++
|
||||
lttng-events.c | 112 +++++++++++++--
|
||||
lttng-events.h | 31 ++++-
|
||||
lttng-syscalls.c | 348 +++++++++++++++++++++++++----------------------
|
||||
5 files changed, 380 insertions(+), 180 deletions(-)
|
||||
|
||||
diff --git a/lttng-abi.c b/lttng-abi.c
|
||||
index 64ea99d..b33879d 100644
|
||||
--- a/lttng-abi.c
|
||||
+++ b/lttng-abi.c
|
||||
@@ -1264,6 +1264,46 @@ nomem:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static
|
||||
+int lttng_abi_validate_event_param(struct lttng_kernel_event *event_param)
|
||||
+{
|
||||
+ /* Limit ABI to implemented features. */
|
||||
+ switch (event_param->instrumentation) {
|
||||
+ case LTTNG_KERNEL_SYSCALL:
|
||||
+ switch (event_param->u.syscall.entryexit) {
|
||||
+ case LTTNG_KERNEL_SYSCALL_ENTRYEXIT:
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ switch (event_param->u.syscall.abi) {
|
||||
+ case LTTNG_KERNEL_SYSCALL_ABI_ALL:
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ switch (event_param->u.syscall.match) {
|
||||
+ case LTTNG_SYSCALL_MATCH_NAME:
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case LTTNG_KERNEL_TRACEPOINT: /* Fallthrough */
|
||||
+ case LTTNG_KERNEL_KPROBE: /* Fallthrough */
|
||||
+ case LTTNG_KERNEL_KRETPROBE: /* Fallthrough */
|
||||
+ case LTTNG_KERNEL_NOOP: /* Fallthrough */
|
||||
+ case LTTNG_KERNEL_UPROBE:
|
||||
+ break;
|
||||
+
|
||||
+ case LTTNG_KERNEL_FUNCTION: /* Fallthrough */
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static
|
||||
int lttng_abi_create_event(struct file *channel_file,
|
||||
struct lttng_kernel_event *event_param)
|
||||
@@ -1305,6 +1345,9 @@ int lttng_abi_create_event(struct file *channel_file,
|
||||
ret = -EOVERFLOW;
|
||||
goto refcount_error;
|
||||
}
|
||||
+ ret = lttng_abi_validate_event_param(event_param);
|
||||
+ if (ret)
|
||||
+ goto event_error;
|
||||
if (event_param->instrumentation == LTTNG_KERNEL_TRACEPOINT
|
||||
|| event_param->instrumentation == LTTNG_KERNEL_SYSCALL) {
|
||||
struct lttng_enabler *enabler;
|
||||
diff --git a/lttng-abi.h b/lttng-abi.h
|
||||
index 1d356ab..51d60e5 100644
|
||||
--- a/lttng-abi.h
|
||||
+++ b/lttng-abi.h
|
||||
@@ -90,6 +90,31 @@ struct lttng_kernel_event_callsite {
|
||||
} u;
|
||||
} __attribute__((packed));
|
||||
|
||||
+enum lttng_kernel_syscall_entryexit {
|
||||
+ LTTNG_KERNEL_SYSCALL_ENTRYEXIT = 0,
|
||||
+ LTTNG_KERNEL_SYSCALL_ENTRY = 1, /* Not implemented. */
|
||||
+ LTTNG_KERNEL_SYSCALL_EXIT = 2, /* Not implemented. */
|
||||
+};
|
||||
+
|
||||
+enum lttng_kernel_syscall_abi {
|
||||
+ LTTNG_KERNEL_SYSCALL_ABI_ALL = 0,
|
||||
+ LTTNG_KERNEL_SYSCALL_ABI_NATIVE = 1, /* Not implemented. */
|
||||
+ LTTNG_KERNEL_SYSCALL_ABI_COMPAT = 2, /* Not implemented. */
|
||||
+};
|
||||
+
|
||||
+enum lttng_kernel_syscall_match {
|
||||
+ LTTNG_SYSCALL_MATCH_NAME = 0,
|
||||
+ LTTNG_SYSCALL_MATCH_NR = 1, /* Not implemented. */
|
||||
+};
|
||||
+
|
||||
+struct lttng_kernel_syscall {
|
||||
+ uint8_t entryexit; /* enum lttng_kernel_syscall_entryexit */
|
||||
+ uint8_t abi; /* enum lttng_kernel_syscall_abi */
|
||||
+ uint8_t match; /* enum lttng_kernel_syscall_match */
|
||||
+ uint8_t padding;
|
||||
+ uint32_t nr; /* For LTTNG_SYSCALL_MATCH_NR */
|
||||
+} __attribute__((packed));
|
||||
+
|
||||
/*
|
||||
* For syscall tracing, name = "*" means "enable all".
|
||||
*/
|
||||
@@ -106,6 +131,7 @@ struct lttng_kernel_event {
|
||||
struct lttng_kernel_kprobe kprobe;
|
||||
struct lttng_kernel_function_tracer ftrace;
|
||||
struct lttng_kernel_uprobe uprobe;
|
||||
+ struct lttng_kernel_syscall syscall;
|
||||
char padding[LTTNG_KERNEL_EVENT_PADDING2];
|
||||
} u;
|
||||
} __attribute__((packed));
|
||||
diff --git a/lttng-events.c b/lttng-events.c
|
||||
index d719294..4c0b04a 100644
|
||||
--- a/lttng-events.c
|
||||
+++ b/lttng-events.c
|
||||
@@ -201,6 +201,10 @@ void lttng_session_destroy(struct lttng_session *session)
|
||||
WARN_ON(ret);
|
||||
}
|
||||
synchronize_trace(); /* Wait for in-flight events to complete */
|
||||
+ list_for_each_entry(chan, &session->chan, list) {
|
||||
+ ret = lttng_syscalls_destroy(chan);
|
||||
+ WARN_ON(ret);
|
||||
+ }
|
||||
list_for_each_entry_safe(enabler, tmpenabler,
|
||||
&session->enablers_head, node)
|
||||
lttng_enabler_destroy(enabler);
|
||||
@@ -740,6 +744,28 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan,
|
||||
event->enabled = 0;
|
||||
event->registered = 0;
|
||||
event->desc = event_desc;
|
||||
+ switch (event_param->u.syscall.entryexit) {
|
||||
+ case LTTNG_KERNEL_SYSCALL_ENTRYEXIT:
|
||||
+ ret = -EINVAL;
|
||||
+ goto register_error;
|
||||
+ case LTTNG_KERNEL_SYSCALL_ENTRY:
|
||||
+ event->u.syscall.entryexit = LTTNG_SYSCALL_ENTRY;
|
||||
+ break;
|
||||
+ case LTTNG_KERNEL_SYSCALL_EXIT:
|
||||
+ event->u.syscall.entryexit = LTTNG_SYSCALL_EXIT;
|
||||
+ break;
|
||||
+ }
|
||||
+ switch (event_param->u.syscall.abi) {
|
||||
+ case LTTNG_KERNEL_SYSCALL_ABI_ALL:
|
||||
+ ret = -EINVAL;
|
||||
+ goto register_error;
|
||||
+ case LTTNG_KERNEL_SYSCALL_ABI_NATIVE:
|
||||
+ event->u.syscall.abi = LTTNG_SYSCALL_ABI_NATIVE;
|
||||
+ break;
|
||||
+ case LTTNG_KERNEL_SYSCALL_ABI_COMPAT:
|
||||
+ event->u.syscall.abi = LTTNG_SYSCALL_ABI_COMPAT;
|
||||
+ break;
|
||||
+ }
|
||||
if (!event->desc) {
|
||||
ret = -EINVAL;
|
||||
goto register_error;
|
||||
@@ -826,8 +852,7 @@ void register_event(struct lttng_event *event)
|
||||
event);
|
||||
break;
|
||||
case LTTNG_KERNEL_SYSCALL:
|
||||
- ret = lttng_syscall_filter_enable(event->chan,
|
||||
- desc->name);
|
||||
+ ret = lttng_syscall_filter_enable(event->chan, event);
|
||||
break;
|
||||
case LTTNG_KERNEL_KPROBE:
|
||||
case LTTNG_KERNEL_UPROBE:
|
||||
@@ -870,8 +895,7 @@ int _lttng_event_unregister(struct lttng_event *event)
|
||||
ret = 0;
|
||||
break;
|
||||
case LTTNG_KERNEL_SYSCALL:
|
||||
- ret = lttng_syscall_filter_disable(event->chan,
|
||||
- desc->name);
|
||||
+ ret = lttng_syscall_filter_disable(event->chan, event);
|
||||
break;
|
||||
case LTTNG_KERNEL_NOOP:
|
||||
ret = 0;
|
||||
@@ -1203,39 +1227,87 @@ int lttng_desc_match_enabler(const struct lttng_event_desc *desc,
|
||||
struct lttng_enabler *enabler)
|
||||
{
|
||||
const char *desc_name, *enabler_name;
|
||||
+ bool compat = false, entry = false;
|
||||
|
||||
enabler_name = enabler->event_param.name;
|
||||
switch (enabler->event_param.instrumentation) {
|
||||
case LTTNG_KERNEL_TRACEPOINT:
|
||||
desc_name = desc->name;
|
||||
+ switch (enabler->type) {
|
||||
+ case LTTNG_ENABLER_STAR_GLOB:
|
||||
+ return lttng_match_enabler_star_glob(desc_name, enabler_name);
|
||||
+ case LTTNG_ENABLER_NAME:
|
||||
+ return lttng_match_enabler_name(desc_name, enabler_name);
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
break;
|
||||
case LTTNG_KERNEL_SYSCALL:
|
||||
desc_name = desc->name;
|
||||
- if (!strncmp(desc_name, "compat_", strlen("compat_")))
|
||||
+ if (!strncmp(desc_name, "compat_", strlen("compat_"))) {
|
||||
desc_name += strlen("compat_");
|
||||
+ compat = true;
|
||||
+ }
|
||||
if (!strncmp(desc_name, "syscall_exit_",
|
||||
strlen("syscall_exit_"))) {
|
||||
desc_name += strlen("syscall_exit_");
|
||||
} else if (!strncmp(desc_name, "syscall_entry_",
|
||||
strlen("syscall_entry_"))) {
|
||||
desc_name += strlen("syscall_entry_");
|
||||
+ entry = true;
|
||||
} else {
|
||||
WARN_ON_ONCE(1);
|
||||
return -EINVAL;
|
||||
}
|
||||
+ switch (enabler->event_param.u.syscall.entryexit) {
|
||||
+ case LTTNG_KERNEL_SYSCALL_ENTRYEXIT:
|
||||
+ break;
|
||||
+ case LTTNG_KERNEL_SYSCALL_ENTRY:
|
||||
+ if (!entry)
|
||||
+ return 0;
|
||||
+ break;
|
||||
+ case LTTNG_KERNEL_SYSCALL_EXIT:
|
||||
+ if (entry)
|
||||
+ return 0;
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ switch (enabler->event_param.u.syscall.abi) {
|
||||
+ case LTTNG_KERNEL_SYSCALL_ABI_ALL:
|
||||
+ break;
|
||||
+ case LTTNG_KERNEL_SYSCALL_ABI_NATIVE:
|
||||
+ if (compat)
|
||||
+ return 0;
|
||||
+ break;
|
||||
+ case LTTNG_KERNEL_SYSCALL_ABI_COMPAT:
|
||||
+ if (!compat)
|
||||
+ return 0;
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ switch (enabler->event_param.u.syscall.match) {
|
||||
+ case LTTNG_SYSCALL_MATCH_NAME:
|
||||
+ switch (enabler->type) {
|
||||
+ case LTTNG_ENABLER_STAR_GLOB:
|
||||
+ return lttng_match_enabler_star_glob(desc_name, enabler_name);
|
||||
+ case LTTNG_ENABLER_NAME:
|
||||
+ return lttng_match_enabler_name(desc_name, enabler_name);
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_MATCH_NR:
|
||||
+ return -EINVAL; /* Not implemented. */
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
break;
|
||||
default:
|
||||
WARN_ON_ONCE(1);
|
||||
return -EINVAL;
|
||||
}
|
||||
- switch (enabler->type) {
|
||||
- case LTTNG_ENABLER_STAR_GLOB:
|
||||
- return lttng_match_enabler_star_glob(desc_name, enabler_name);
|
||||
- case LTTNG_ENABLER_NAME:
|
||||
- return lttng_match_enabler_name(desc_name, enabler_name);
|
||||
- default:
|
||||
- return -EINVAL;
|
||||
- }
|
||||
}
|
||||
|
||||
static
|
||||
@@ -1361,9 +1433,21 @@ void lttng_create_event_if_missing(struct lttng_enabler *enabler)
|
||||
static
|
||||
int lttng_enabler_ref_events(struct lttng_enabler *enabler)
|
||||
{
|
||||
- struct lttng_session *session = enabler->chan->session;
|
||||
+ struct lttng_channel *chan = enabler->chan;
|
||||
+ struct lttng_session *session = chan->session;
|
||||
struct lttng_event *event;
|
||||
|
||||
+ if (enabler->event_param.instrumentation == LTTNG_KERNEL_SYSCALL &&
|
||||
+ enabler->event_param.u.syscall.entryexit == LTTNG_KERNEL_SYSCALL_ENTRYEXIT &&
|
||||
+ enabler->event_param.u.syscall.abi == LTTNG_KERNEL_SYSCALL_ABI_ALL &&
|
||||
+ enabler->event_param.u.syscall.match == LTTNG_SYSCALL_MATCH_NAME &&
|
||||
+ !strcmp(enabler->event_param.name, "*")) {
|
||||
+ if (enabler->enabled)
|
||||
+ WRITE_ONCE(chan->syscall_all, 1);
|
||||
+ else
|
||||
+ WRITE_ONCE(chan->syscall_all, 0);
|
||||
+ }
|
||||
+
|
||||
/* First ensure that probe events are created for this enabler. */
|
||||
lttng_create_event_if_missing(enabler);
|
||||
|
||||
diff --git a/lttng-events.h b/lttng-events.h
|
||||
index a36a312..d4d9976 100644
|
||||
--- a/lttng-events.h
|
||||
+++ b/lttng-events.h
|
||||
@@ -292,6 +292,16 @@ struct lttng_uprobe_handler {
|
||||
struct list_head node;
|
||||
};
|
||||
|
||||
+enum lttng_syscall_entryexit {
|
||||
+ LTTNG_SYSCALL_ENTRY,
|
||||
+ LTTNG_SYSCALL_EXIT,
|
||||
+};
|
||||
+
|
||||
+enum lttng_syscall_abi {
|
||||
+ LTTNG_SYSCALL_ABI_NATIVE,
|
||||
+ LTTNG_SYSCALL_ABI_COMPAT,
|
||||
+};
|
||||
+
|
||||
/*
|
||||
* lttng_event structure is referred to by the tracing fast path. It must be
|
||||
* kept small.
|
||||
@@ -318,6 +328,11 @@ struct lttng_event {
|
||||
struct inode *inode;
|
||||
struct list_head head;
|
||||
} uprobe;
|
||||
+ struct {
|
||||
+ char *syscall_name;
|
||||
+ enum lttng_syscall_entryexit entryexit;
|
||||
+ enum lttng_syscall_abi abi;
|
||||
+ } syscall;
|
||||
} u;
|
||||
struct list_head list; /* Event list in session */
|
||||
unsigned int metadata_dumped:1;
|
||||
@@ -457,10 +472,10 @@ struct lttng_channel {
|
||||
struct lttng_syscall_filter *sc_filter;
|
||||
int header_type; /* 0: unset, 1: compact, 2: large */
|
||||
enum channel_type channel_type;
|
||||
+ int syscall_all;
|
||||
unsigned int metadata_dumped:1,
|
||||
sys_enter_registered:1,
|
||||
sys_exit_registered:1,
|
||||
- syscall_all:1,
|
||||
tstate:1; /* Transient enable state */
|
||||
};
|
||||
|
||||
@@ -653,10 +668,11 @@ void lttng_clock_unref(void);
|
||||
#if defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
|
||||
int lttng_syscalls_register(struct lttng_channel *chan, void *filter);
|
||||
int lttng_syscalls_unregister(struct lttng_channel *chan);
|
||||
+int lttng_syscalls_destroy(struct lttng_channel *chan);
|
||||
int lttng_syscall_filter_enable(struct lttng_channel *chan,
|
||||
- const char *name);
|
||||
+ struct lttng_event *event);
|
||||
int lttng_syscall_filter_disable(struct lttng_channel *chan,
|
||||
- const char *name);
|
||||
+ struct lttng_event *event);
|
||||
long lttng_channel_syscall_mask(struct lttng_channel *channel,
|
||||
struct lttng_kernel_syscall_mask __user *usyscall_mask);
|
||||
#else
|
||||
@@ -670,14 +686,19 @@ static inline int lttng_syscalls_unregister(struct lttng_channel *chan)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static inline int lttng_syscalls_destroy(struct lttng_channel *chan)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static inline int lttng_syscall_filter_enable(struct lttng_channel *chan,
|
||||
- const char *name)
|
||||
+ struct lttng_event *event);
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline int lttng_syscall_filter_disable(struct lttng_channel *chan,
|
||||
- const char *name)
|
||||
+ struct lttng_event *event);
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
diff --git a/lttng-syscalls.c b/lttng-syscalls.c
|
||||
index 97f1ba9..26cead6 100644
|
||||
--- a/lttng-syscalls.c
|
||||
+++ b/lttng-syscalls.c
|
||||
@@ -367,8 +367,10 @@ const struct trace_syscall_entry compat_sc_exit_table[] = {
|
||||
#undef CREATE_SYSCALL_TABLE
|
||||
|
||||
struct lttng_syscall_filter {
|
||||
- DECLARE_BITMAP(sc, NR_syscalls);
|
||||
- DECLARE_BITMAP(sc_compat, NR_compat_syscalls);
|
||||
+ DECLARE_BITMAP(sc_entry, NR_syscalls);
|
||||
+ DECLARE_BITMAP(sc_exit, NR_syscalls);
|
||||
+ DECLARE_BITMAP(sc_compat_entry, NR_compat_syscalls);
|
||||
+ DECLARE_BITMAP(sc_compat_exit, NR_compat_syscalls);
|
||||
};
|
||||
|
||||
static void syscall_entry_unknown(struct lttng_event *event,
|
||||
@@ -391,29 +393,23 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
|
||||
size_t table_len;
|
||||
|
||||
if (unlikely(in_compat_syscall())) {
|
||||
- struct lttng_syscall_filter *filter;
|
||||
-
|
||||
- filter = lttng_rcu_dereference(chan->sc_filter);
|
||||
- if (filter) {
|
||||
- if (id < 0 || id >= NR_compat_syscalls
|
||||
- || !test_bit(id, filter->sc_compat)) {
|
||||
- /* System call filtered out. */
|
||||
- return;
|
||||
- }
|
||||
+ struct lttng_syscall_filter *filter = chan->sc_filter;
|
||||
+
|
||||
+ if (id < 0 || id >= NR_compat_syscalls
|
||||
+ || (!READ_ONCE(chan->syscall_all) && !test_bit(id, filter->sc_compat_entry))) {
|
||||
+ /* System call filtered out. */
|
||||
+ return;
|
||||
}
|
||||
table = compat_sc_table;
|
||||
table_len = ARRAY_SIZE(compat_sc_table);
|
||||
unknown_event = chan->sc_compat_unknown;
|
||||
} else {
|
||||
- struct lttng_syscall_filter *filter;
|
||||
-
|
||||
- filter = lttng_rcu_dereference(chan->sc_filter);
|
||||
- if (filter) {
|
||||
- if (id < 0 || id >= NR_syscalls
|
||||
- || !test_bit(id, filter->sc)) {
|
||||
- /* System call filtered out. */
|
||||
- return;
|
||||
- }
|
||||
+ struct lttng_syscall_filter *filter = chan->sc_filter;
|
||||
+
|
||||
+ if (id < 0 || id >= NR_syscalls
|
||||
+ || (!READ_ONCE(chan->syscall_all) && !test_bit(id, filter->sc_entry))) {
|
||||
+ /* System call filtered out. */
|
||||
+ return;
|
||||
}
|
||||
table = sc_table;
|
||||
table_len = ARRAY_SIZE(sc_table);
|
||||
@@ -545,29 +541,23 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
|
||||
|
||||
id = syscall_get_nr(current, regs);
|
||||
if (unlikely(in_compat_syscall())) {
|
||||
- struct lttng_syscall_filter *filter;
|
||||
-
|
||||
- filter = lttng_rcu_dereference(chan->sc_filter);
|
||||
- if (filter) {
|
||||
- if (id < 0 || id >= NR_compat_syscalls
|
||||
- || !test_bit(id, filter->sc_compat)) {
|
||||
- /* System call filtered out. */
|
||||
- return;
|
||||
- }
|
||||
+ struct lttng_syscall_filter *filter = chan->sc_filter;
|
||||
+
|
||||
+ if (id < 0 || id >= NR_compat_syscalls
|
||||
+ || (!READ_ONCE(chan->syscall_all) && !test_bit(id, filter->sc_compat_exit))) {
|
||||
+ /* System call filtered out. */
|
||||
+ return;
|
||||
}
|
||||
table = compat_sc_exit_table;
|
||||
table_len = ARRAY_SIZE(compat_sc_exit_table);
|
||||
unknown_event = chan->compat_sc_exit_unknown;
|
||||
} else {
|
||||
- struct lttng_syscall_filter *filter;
|
||||
-
|
||||
- filter = lttng_rcu_dereference(chan->sc_filter);
|
||||
- if (filter) {
|
||||
- if (id < 0 || id >= NR_syscalls
|
||||
- || !test_bit(id, filter->sc)) {
|
||||
- /* System call filtered out. */
|
||||
- return;
|
||||
- }
|
||||
+ struct lttng_syscall_filter *filter = chan->sc_filter;
|
||||
+
|
||||
+ if (id < 0 || id >= NR_syscalls
|
||||
+ || (!READ_ONCE(chan->syscall_all) && !test_bit(id, filter->sc_exit))) {
|
||||
+ /* System call filtered out. */
|
||||
+ return;
|
||||
}
|
||||
table = sc_exit_table;
|
||||
table_len = ARRAY_SIZE(sc_exit_table);
|
||||
@@ -713,27 +703,23 @@ int fill_table(const struct trace_syscall_entry *table, size_t table_len,
|
||||
memset(&ev, 0, sizeof(ev));
|
||||
switch (type) {
|
||||
case SC_TYPE_ENTRY:
|
||||
- strncpy(ev.name, SYSCALL_ENTRY_STR,
|
||||
- LTTNG_KERNEL_SYM_NAME_LEN);
|
||||
+ ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_ENTRY;
|
||||
+ ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE;
|
||||
break;
|
||||
case SC_TYPE_EXIT:
|
||||
- strncpy(ev.name, SYSCALL_EXIT_STR,
|
||||
- LTTNG_KERNEL_SYM_NAME_LEN);
|
||||
+ ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_EXIT;
|
||||
+ ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE;
|
||||
break;
|
||||
case SC_TYPE_COMPAT_ENTRY:
|
||||
- strncpy(ev.name, COMPAT_SYSCALL_ENTRY_STR,
|
||||
- LTTNG_KERNEL_SYM_NAME_LEN);
|
||||
+ ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_ENTRY;
|
||||
+ ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT;
|
||||
break;
|
||||
case SC_TYPE_COMPAT_EXIT:
|
||||
- strncpy(ev.name, COMPAT_SYSCALL_EXIT_STR,
|
||||
- LTTNG_KERNEL_SYM_NAME_LEN);
|
||||
- break;
|
||||
- default:
|
||||
- BUG_ON(1);
|
||||
+ ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_EXIT;
|
||||
+ ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT;
|
||||
break;
|
||||
}
|
||||
- strncat(ev.name, desc->name,
|
||||
- LTTNG_KERNEL_SYM_NAME_LEN - strlen(ev.name) - 1);
|
||||
+ strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN);
|
||||
ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
|
||||
ev.instrumentation = LTTNG_KERNEL_SYSCALL;
|
||||
chan_table[i] = _lttng_event_create(chan, &ev, filter,
|
||||
@@ -803,6 +789,8 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
|
||||
strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN);
|
||||
ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
|
||||
ev.instrumentation = LTTNG_KERNEL_SYSCALL;
|
||||
+ ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_ENTRY;
|
||||
+ ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE;
|
||||
chan->sc_unknown = _lttng_event_create(chan, &ev, filter,
|
||||
desc,
|
||||
ev.instrumentation);
|
||||
@@ -820,6 +808,8 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
|
||||
strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN);
|
||||
ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
|
||||
ev.instrumentation = LTTNG_KERNEL_SYSCALL;
|
||||
+ ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_ENTRY;
|
||||
+ ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT;
|
||||
chan->sc_compat_unknown = _lttng_event_create(chan, &ev, filter,
|
||||
desc,
|
||||
ev.instrumentation);
|
||||
@@ -837,6 +827,8 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
|
||||
strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN);
|
||||
ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
|
||||
ev.instrumentation = LTTNG_KERNEL_SYSCALL;
|
||||
+ ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_EXIT;
|
||||
+ ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_COMPAT;
|
||||
chan->compat_sc_exit_unknown = _lttng_event_create(chan, &ev,
|
||||
filter, desc,
|
||||
ev.instrumentation);
|
||||
@@ -854,6 +846,8 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
|
||||
strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN);
|
||||
ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
|
||||
ev.instrumentation = LTTNG_KERNEL_SYSCALL;
|
||||
+ ev.u.syscall.entryexit = LTTNG_KERNEL_SYSCALL_EXIT;
|
||||
+ ev.u.syscall.abi = LTTNG_KERNEL_SYSCALL_ABI_NATIVE;
|
||||
chan->sc_exit_unknown = _lttng_event_create(chan, &ev, filter,
|
||||
desc, ev.instrumentation);
|
||||
WARN_ON_ONCE(!chan->sc_exit_unknown);
|
||||
@@ -883,6 +877,14 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
|
||||
if (ret)
|
||||
return ret;
|
||||
#endif
|
||||
+
|
||||
+ if (!chan->sc_filter) {
|
||||
+ chan->sc_filter = kzalloc(sizeof(struct lttng_syscall_filter),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!chan->sc_filter)
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
if (!chan->sys_enter_registered) {
|
||||
ret = lttng_wrapper_tracepoint_probe_register("sys_enter",
|
||||
(void *) syscall_entry_probe, chan);
|
||||
@@ -930,7 +932,11 @@ int lttng_syscalls_unregister(struct lttng_channel *chan)
|
||||
return ret;
|
||||
chan->sys_exit_registered = 0;
|
||||
}
|
||||
- /* lttng_event destroy will be performed by lttng_session_destroy() */
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int lttng_syscalls_destroy(struct lttng_channel *chan)
|
||||
+{
|
||||
kfree(chan->sc_table);
|
||||
kfree(chan->sc_exit_table);
|
||||
#ifdef CONFIG_COMPAT
|
||||
@@ -993,136 +999,150 @@ uint32_t get_sc_tables_len(void)
|
||||
return ARRAY_SIZE(sc_table) + ARRAY_SIZE(compat_sc_table);
|
||||
}
|
||||
|
||||
-int lttng_syscall_filter_enable(struct lttng_channel *chan,
|
||||
- const char *name)
|
||||
+static
|
||||
+const char *get_syscall_name(struct lttng_event *event)
|
||||
{
|
||||
- int syscall_nr, compat_syscall_nr, ret;
|
||||
- struct lttng_syscall_filter *filter;
|
||||
+ size_t prefix_len = 0;
|
||||
|
||||
- WARN_ON_ONCE(!chan->sc_table);
|
||||
+ WARN_ON_ONCE(event->instrumentation != LTTNG_KERNEL_SYSCALL);
|
||||
|
||||
- if (!name) {
|
||||
- /* Enable all system calls by removing filter */
|
||||
- if (chan->sc_filter) {
|
||||
- filter = chan->sc_filter;
|
||||
- rcu_assign_pointer(chan->sc_filter, NULL);
|
||||
- synchronize_trace();
|
||||
- kfree(filter);
|
||||
+ switch (event->u.syscall.entryexit) {
|
||||
+ case LTTNG_SYSCALL_ENTRY:
|
||||
+ switch (event->u.syscall.abi) {
|
||||
+ case LTTNG_SYSCALL_ABI_NATIVE:
|
||||
+ prefix_len = strlen(SYSCALL_ENTRY_STR);
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_ABI_COMPAT:
|
||||
+ prefix_len = strlen(COMPAT_SYSCALL_ENTRY_STR);
|
||||
+ break;
|
||||
}
|
||||
- chan->syscall_all = 1;
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- if (!chan->sc_filter) {
|
||||
- if (chan->syscall_all) {
|
||||
- /*
|
||||
- * All syscalls are already enabled.
|
||||
- */
|
||||
- return -EEXIST;
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_EXIT:
|
||||
+ switch (event->u.syscall.abi) {
|
||||
+ case LTTNG_SYSCALL_ABI_NATIVE:
|
||||
+ prefix_len = strlen(SYSCALL_EXIT_STR);
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_ABI_COMPAT:
|
||||
+ prefix_len = strlen(COMPAT_SYSCALL_EXIT_STR);
|
||||
+ break;
|
||||
}
|
||||
- filter = kzalloc(sizeof(struct lttng_syscall_filter),
|
||||
- GFP_KERNEL);
|
||||
- if (!filter)
|
||||
- return -ENOMEM;
|
||||
- } else {
|
||||
- filter = chan->sc_filter;
|
||||
+ break;
|
||||
}
|
||||
- syscall_nr = get_syscall_nr(name);
|
||||
- compat_syscall_nr = get_compat_syscall_nr(name);
|
||||
- if (syscall_nr < 0 && compat_syscall_nr < 0) {
|
||||
- ret = -ENOENT;
|
||||
- goto error;
|
||||
+ WARN_ON_ONCE(prefix_len == 0);
|
||||
+ return event->desc->name + prefix_len;
|
||||
+}
|
||||
+
|
||||
+int lttng_syscall_filter_enable(struct lttng_channel *chan,
|
||||
+ struct lttng_event *event)
|
||||
+{
|
||||
+ struct lttng_syscall_filter *filter = chan->sc_filter;
|
||||
+ const char *syscall_name;
|
||||
+ unsigned long *bitmap;
|
||||
+ int syscall_nr;
|
||||
+
|
||||
+ WARN_ON_ONCE(!chan->sc_table);
|
||||
+
|
||||
+ syscall_name = get_syscall_name(event);
|
||||
+
|
||||
+ switch (event->u.syscall.abi) {
|
||||
+ case LTTNG_SYSCALL_ABI_NATIVE:
|
||||
+ syscall_nr = get_syscall_nr(syscall_name);
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_ABI_COMPAT:
|
||||
+ syscall_nr = get_compat_syscall_nr(syscall_name);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
}
|
||||
- if (syscall_nr >= 0) {
|
||||
- if (test_bit(syscall_nr, filter->sc)) {
|
||||
- ret = -EEXIST;
|
||||
- goto error;
|
||||
+ if (syscall_nr < 0)
|
||||
+ return -ENOENT;
|
||||
+
|
||||
+
|
||||
+ switch (event->u.syscall.entryexit) {
|
||||
+ case LTTNG_SYSCALL_ENTRY:
|
||||
+ switch (event->u.syscall.abi) {
|
||||
+ case LTTNG_SYSCALL_ABI_NATIVE:
|
||||
+ bitmap = filter->sc_entry;
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_ABI_COMPAT:
|
||||
+ bitmap = filter->sc_compat_entry;
|
||||
+ break;
|
||||
}
|
||||
- bitmap_set(filter->sc, syscall_nr, 1);
|
||||
- }
|
||||
- if (compat_syscall_nr >= 0) {
|
||||
- if (test_bit(compat_syscall_nr, filter->sc_compat)) {
|
||||
- ret = -EEXIST;
|
||||
- goto error;
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_EXIT:
|
||||
+ switch (event->u.syscall.abi) {
|
||||
+ case LTTNG_SYSCALL_ABI_NATIVE:
|
||||
+ bitmap = filter->sc_exit;
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_ABI_COMPAT:
|
||||
+ bitmap = filter->sc_compat_exit;
|
||||
+ break;
|
||||
}
|
||||
- bitmap_set(filter->sc_compat, compat_syscall_nr, 1);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
}
|
||||
- if (!chan->sc_filter)
|
||||
- rcu_assign_pointer(chan->sc_filter, filter);
|
||||
+ if (test_bit(syscall_nr, bitmap))
|
||||
+ return -EEXIST;
|
||||
+ bitmap_set(bitmap, syscall_nr, 1);
|
||||
return 0;
|
||||
-
|
||||
-error:
|
||||
- if (!chan->sc_filter)
|
||||
- kfree(filter);
|
||||
- return ret;
|
||||
}
|
||||
|
||||
int lttng_syscall_filter_disable(struct lttng_channel *chan,
|
||||
- const char *name)
|
||||
+ struct lttng_event *event)
|
||||
{
|
||||
- int syscall_nr, compat_syscall_nr, ret;
|
||||
- struct lttng_syscall_filter *filter;
|
||||
+ struct lttng_syscall_filter *filter = chan->sc_filter;
|
||||
+ const char *syscall_name;
|
||||
+ unsigned long *bitmap;
|
||||
+ int syscall_nr;
|
||||
|
||||
WARN_ON_ONCE(!chan->sc_table);
|
||||
|
||||
- if (!chan->sc_filter) {
|
||||
- if (!chan->syscall_all)
|
||||
- return -EEXIST;
|
||||
- filter = kzalloc(sizeof(struct lttng_syscall_filter),
|
||||
- GFP_KERNEL);
|
||||
- if (!filter)
|
||||
- return -ENOMEM;
|
||||
- /* Trace all system calls, then apply disable. */
|
||||
- bitmap_set(filter->sc, 0, NR_syscalls);
|
||||
- bitmap_set(filter->sc_compat, 0, NR_compat_syscalls);
|
||||
- } else {
|
||||
- filter = chan->sc_filter;
|
||||
+ syscall_name = get_syscall_name(event);
|
||||
+
|
||||
+ switch (event->u.syscall.abi) {
|
||||
+ case LTTNG_SYSCALL_ABI_NATIVE:
|
||||
+ syscall_nr = get_syscall_nr(syscall_name);
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_ABI_COMPAT:
|
||||
+ syscall_nr = get_compat_syscall_nr(syscall_name);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
}
|
||||
+ if (syscall_nr < 0)
|
||||
+ return -ENOENT;
|
||||
|
||||
- if (!name) {
|
||||
- /* Fail if all syscalls are already disabled. */
|
||||
- if (bitmap_empty(filter->sc, NR_syscalls)
|
||||
- && bitmap_empty(filter->sc_compat,
|
||||
- NR_compat_syscalls)) {
|
||||
- ret = -EEXIST;
|
||||
- goto error;
|
||||
- }
|
||||
|
||||
- /* Disable all system calls */
|
||||
- bitmap_clear(filter->sc, 0, NR_syscalls);
|
||||
- bitmap_clear(filter->sc_compat, 0, NR_compat_syscalls);
|
||||
- goto apply_filter;
|
||||
- }
|
||||
- syscall_nr = get_syscall_nr(name);
|
||||
- compat_syscall_nr = get_compat_syscall_nr(name);
|
||||
- if (syscall_nr < 0 && compat_syscall_nr < 0) {
|
||||
- ret = -ENOENT;
|
||||
- goto error;
|
||||
- }
|
||||
- if (syscall_nr >= 0) {
|
||||
- if (!test_bit(syscall_nr, filter->sc)) {
|
||||
- ret = -EEXIST;
|
||||
- goto error;
|
||||
+ switch (event->u.syscall.entryexit) {
|
||||
+ case LTTNG_SYSCALL_ENTRY:
|
||||
+ switch (event->u.syscall.abi) {
|
||||
+ case LTTNG_SYSCALL_ABI_NATIVE:
|
||||
+ bitmap = filter->sc_entry;
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_ABI_COMPAT:
|
||||
+ bitmap = filter->sc_compat_entry;
|
||||
+ break;
|
||||
}
|
||||
- bitmap_clear(filter->sc, syscall_nr, 1);
|
||||
- }
|
||||
- if (compat_syscall_nr >= 0) {
|
||||
- if (!test_bit(compat_syscall_nr, filter->sc_compat)) {
|
||||
- ret = -EEXIST;
|
||||
- goto error;
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_EXIT:
|
||||
+ switch (event->u.syscall.abi) {
|
||||
+ case LTTNG_SYSCALL_ABI_NATIVE:
|
||||
+ bitmap = filter->sc_exit;
|
||||
+ break;
|
||||
+ case LTTNG_SYSCALL_ABI_COMPAT:
|
||||
+ bitmap = filter->sc_compat_exit;
|
||||
+ break;
|
||||
}
|
||||
- bitmap_clear(filter->sc_compat, compat_syscall_nr, 1);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
}
|
||||
-apply_filter:
|
||||
- if (!chan->sc_filter)
|
||||
- rcu_assign_pointer(chan->sc_filter, filter);
|
||||
- chan->syscall_all = 0;
|
||||
- return 0;
|
||||
+ if (!test_bit(syscall_nr, bitmap))
|
||||
+ return -EEXIST;
|
||||
+ bitmap_clear(bitmap, syscall_nr, 1);
|
||||
|
||||
-error:
|
||||
- if (!chan->sc_filter)
|
||||
- kfree(filter);
|
||||
- return ret;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static
|
||||
@@ -1236,6 +1256,9 @@ const struct file_operations lttng_syscall_list_fops = {
|
||||
.release = seq_release,
|
||||
};
|
||||
|
||||
+/*
|
||||
+ * A syscall is enabled if it is traced for either entry or exit.
|
||||
+ */
|
||||
long lttng_channel_syscall_mask(struct lttng_channel *channel,
|
||||
struct lttng_kernel_syscall_mask __user *usyscall_mask)
|
||||
{
|
||||
@@ -1262,8 +1285,9 @@ long lttng_channel_syscall_mask(struct lttng_channel *channel,
|
||||
char state;
|
||||
|
||||
if (channel->sc_table) {
|
||||
- if (filter)
|
||||
- state = test_bit(bit, filter->sc);
|
||||
+ if (!READ_ONCE(channel->syscall_all) && filter)
|
||||
+ state = test_bit(bit, filter->sc_entry)
|
||||
+ || test_bit(bit, filter->sc_exit);
|
||||
else
|
||||
state = 1;
|
||||
} else {
|
||||
@@ -1275,9 +1299,11 @@ long lttng_channel_syscall_mask(struct lttng_channel *channel,
|
||||
char state;
|
||||
|
||||
if (channel->compat_sc_table) {
|
||||
- if (filter)
|
||||
+ if (!READ_ONCE(channel->syscall_all) && filter)
|
||||
state = test_bit(bit - ARRAY_SIZE(sc_table),
|
||||
- filter->sc_compat);
|
||||
+ filter->sc_compat_entry)
|
||||
+ || test_bit(bit - ARRAY_SIZE(sc_table),
|
||||
+ filter->sc_compat_exit);
|
||||
else
|
||||
state = 1;
|
||||
} else {
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -11,19 +11,10 @@ include lttng-platforms.inc
|
||||
SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \
|
||||
file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \
|
||||
file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \
|
||||
file://0001-Kconfig-fix-dependency-issue-when-building-in-tree-w.patch \
|
||||
file://0002-fix-Move-mmutrace.h-into-the-mmu-sub-directory-v5.9.patch \
|
||||
file://0003-fix-KVM-x86-mmu-Make-kvm_mmu_page-definition-and-acc.patch \
|
||||
file://0004-fix-ext4-limit-the-length-of-per-inode-prealloc-list.patch \
|
||||
file://0005-fix-ext4-indicate-via-a-block-bitmap-read-is-prefetc.patch \
|
||||
file://0006-fix-removal-of-smp_-read_barrier_depends-v5.9.patch \
|
||||
file://0007-fix-writeback-Drop-I_DIRTY_TIME_EXPIRE-v5.9.patch \
|
||||
file://0008-fix-writeback-Fix-sync-livelock-due-to-b_dirty_time-.patch \
|
||||
file://0009-fix-version-ranges-for-ext4_discard_preallocations-a.patch \
|
||||
file://0010-Fix-system-call-filter-table.patch \
|
||||
file://0001-fix-btrfs-tracepoints-output-proper-root-owner-for-t.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "df50bc3bd58679705714f17721acf619a8b0cedc694f8a97052aa5099626feca"
|
||||
SRC_URI[sha256sum] = "673ef85c9f03e9b8fed10795e09d4e68add39404b70068d08b10f7b85754d7f0"
|
||||
|
||||
export INSTALL_MOD_DIR="kernel/lttng-modules"
|
||||
|
||||
@@ -2,7 +2,8 @@ SUMMARY = "ALSA sound utilities"
|
||||
HOMEPAGE = "http://www.alsa-project.org"
|
||||
BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
|
||||
SECTION = "console/utils"
|
||||
LICENSE = "GPLv2+"
|
||||
# Some parts are GPLv2+, some are only GPLv2 (e.g. axfer, alsactl) so result is GPLv2
|
||||
LICENSE = "GPLv2"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
|
||||
file://alsactl/utils.c;beginline=3;endline=18;md5=96cc06a4cebe5eb7975688ffb0e65642"
|
||||
DEPENDS = "alsa-lib ncurses libsamplerate0"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user