Compare commits
1 Commits
master
...
ldv/travis
Author | SHA1 | Date | |
---|---|---|---|
d3fd2bff85 |
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1,2 +0,0 @@
|
||||
/* export-ignore
|
||||
/README-github_gitlab-autogenerated-archives.txt -export-ignore
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -12,11 +12,8 @@
|
||||
/.version
|
||||
/CREDITS
|
||||
/ChangeLog
|
||||
/INSTALL
|
||||
/README
|
||||
/aclocal.m4
|
||||
/autom4te.cache
|
||||
/bpf_attr_check.c
|
||||
/compile
|
||||
/config.guess
|
||||
/config.h
|
||||
@ -26,7 +23,6 @@
|
||||
/config.sub
|
||||
/configure
|
||||
/depcomp
|
||||
/gnu
|
||||
/install-sh
|
||||
/ioctl_iocdef.[ih]
|
||||
/ioctl_redefs[12].h
|
||||
@ -36,7 +32,6 @@
|
||||
/libmpers-m32.a
|
||||
/libmpers-mx32.a
|
||||
/libstrace.a
|
||||
/linux/linux
|
||||
/m32_funcs.h
|
||||
/m32_printer_decls.h
|
||||
/m32_printer_defs.h
|
||||
@ -61,7 +56,6 @@
|
||||
/strace
|
||||
/strace-*.tar.gz
|
||||
/strace-*.tar.xz
|
||||
/strace-log-merge.1
|
||||
/strace.1
|
||||
/strace.dsc
|
||||
/strace.spec
|
||||
|
@ -1,82 +0,0 @@
|
||||
image: "ubuntu:18.04"
|
||||
|
||||
before_script:
|
||||
- ci/install-dependencies.sh
|
||||
|
||||
variables:
|
||||
GIT_DEPTH: "2147483647"
|
||||
SLEEP_A_BIT: "sleep 0.2"
|
||||
VERBOSE: "1"
|
||||
|
||||
gcc-x86_64-libdw-mainline:
|
||||
stage: test
|
||||
script: ci/run-build-and-tests.sh
|
||||
variables:
|
||||
CC: "gcc"
|
||||
TARGET: "x86_64"
|
||||
STACKTRACE: "libdw"
|
||||
KHEADERS: "torvalds/linux"
|
||||
|
||||
gcc-x86_64-libdw:
|
||||
stage: test
|
||||
script: ci/run-build-and-tests.sh
|
||||
variables:
|
||||
CC: "gcc"
|
||||
TARGET: "x86_64"
|
||||
STACKTRACE: "libdw"
|
||||
|
||||
gcc-x86_64-libunwind:
|
||||
stage: test
|
||||
script: ci/run-build-and-tests.sh
|
||||
variables:
|
||||
CC: "gcc"
|
||||
TARGET: "x86_64"
|
||||
STACKTRACE: "libunwind"
|
||||
|
||||
gcc-x86_64-nounwind:
|
||||
stage: test
|
||||
script: ci/run-build-and-tests.sh
|
||||
variables:
|
||||
CC: "gcc"
|
||||
TARGET: "x86_64"
|
||||
STACKTRACE: "no"
|
||||
|
||||
gcc-x86-nounwind:
|
||||
stage: test
|
||||
script: ci/run-build-and-tests.sh
|
||||
variables:
|
||||
CC: "gcc"
|
||||
TARGET: "x86"
|
||||
STACKTRACE: "no"
|
||||
|
||||
clang-x86_64-libdw:
|
||||
stage: test
|
||||
script: ci/run-build-and-tests.sh
|
||||
variables:
|
||||
CC: "clang"
|
||||
TARGET: "x86_64"
|
||||
STACKTRACE: "libdw"
|
||||
|
||||
clang-x86_64-libunwind:
|
||||
stage: test
|
||||
script: ci/run-build-and-tests.sh
|
||||
variables:
|
||||
CC: "clang"
|
||||
TARGET: "x86_64"
|
||||
STACKTRACE: "libunwind"
|
||||
|
||||
clang-x86_64-nounwind:
|
||||
stage: test
|
||||
script: ci/run-build-and-tests.sh
|
||||
variables:
|
||||
CC: "clang"
|
||||
TARGET: "x86_64"
|
||||
STACKTRACE: "no"
|
||||
|
||||
clang-x86-nounwind:
|
||||
stage: test
|
||||
script: ci/run-build-and-tests.sh
|
||||
variables:
|
||||
CC: "clang"
|
||||
TARGET: "x86"
|
||||
STACKTRACE: "no"
|
17
.mailmap
17
.mailmap
@ -1,27 +1,12 @@
|
||||
# Map git author names and email addresses to canonical/preferred form.
|
||||
<ak@linux.intel.com> <ak@suse.de>
|
||||
Chen Jingpiao <chenjingpiao@gmail.com>
|
||||
Chen Jingpiao <chenjingpiao@gmail.com> <chenjingpiao@foxmail.com>
|
||||
<damir@altlinux.org> <damir@altlinux.ru>
|
||||
<chenjingpiao@gmail.com> <chenjingpiao@foxmail.com>
|
||||
<dgilbert@redhat.com> <dave@treblig.org>
|
||||
<edgar.iglesias@gmail.com> <edgar@axis.com>
|
||||
<holger@freyther.de> <zecke@selfish.org>
|
||||
<kirill@shutemov.name> <kirill.shutemov@linux.intel.com>
|
||||
<mark.hills@framestore.com> <Mark.Hills@framestore.com>
|
||||
<nahim+dev@naam.me> <naam@lse.epita.fr>
|
||||
<patrik.r.jakobsson@gmail.com> <patrik.jakobsson@linux.intel.com>
|
||||
<schwab@linux-m68k.org> <schwab@redhat.com>
|
||||
<schwab@linux-m68k.org> <schwab@suse.de>
|
||||
<steve@einval.com> <steve.mcintyre@linaro.org>
|
||||
<thomas.de.schampheleire@gmail.com> <thomas.de_schampheleire@nokia.com>
|
||||
<vda.linux@googlemail.com> <dvlasenk@redhat.com>
|
||||
<vincent@gentoo.org> <vincent.riera@imgtec.com>
|
||||
<Vineet.Gupta1@synopsys.com> <vgupta@synopsys.com>
|
||||
<will@williammanley.net> <william.manley@youview.com>
|
||||
Carmelo Amoroso <carmelo.amoroso@st.com>
|
||||
Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com> <edos@linux.com>
|
||||
Elvira Khabirova <lineprinter@altlinux.org> <lineprinter0@gmail.com>
|
||||
Eugene Syromyatnikov <evgsyr@gmail.com>
|
||||
Eugene Syromyatnikov <evgsyr@gmail.com> <esyr@redhat.com>
|
||||
Frederik Schüler <fs@debian.org>
|
||||
Md Haris Iqbal <haris.phnx@gmail.com>
|
||||
|
104
.travis.yml
104
.travis.yml
@ -2,9 +2,9 @@ language: c
|
||||
|
||||
dist: trusty
|
||||
|
||||
before_install: ci/install-dependencies.sh
|
||||
before_install: ./travis-install.sh
|
||||
|
||||
script: ci/run-build-and-tests.sh
|
||||
script: travis_wait 60 ./travis-build.sh
|
||||
|
||||
sudo: required
|
||||
|
||||
@ -21,55 +21,63 @@ matrix:
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- STACKTRACE=libunwind
|
||||
- CHECK=coverage
|
||||
- KHEADERS=torvalds/linux
|
||||
- compiler: gcc-8
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- STACKTRACE=libunwind
|
||||
- KHEADERS=torvalds/linux
|
||||
- CHECK=valgrind
|
||||
- TIMEOUT_DURATION=1200
|
||||
- VALGRIND_TOOLS=memcheck
|
||||
- VALGRIND_TESTDIR=tests
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- STACKTRACE=libunwind
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x32
|
||||
- STACKTRACE=no
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x86
|
||||
- STACKTRACE=no
|
||||
- compiler: clang
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- STACKTRACE=libunwind
|
||||
- compiler: musl-gcc
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- STACKTRACE=no
|
||||
- compiler: clang
|
||||
env:
|
||||
- TARGET=x86
|
||||
- STACKTRACE=no
|
||||
- compiler: musl-gcc
|
||||
env:
|
||||
- TARGET=x86
|
||||
- STACKTRACE=no
|
||||
- compiler: gcc-8
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- STACKTRACE=libunwind
|
||||
- compiler: gcc-8
|
||||
env:
|
||||
- TARGET=x32
|
||||
- STACKTRACE=no
|
||||
- compiler: gcc-8
|
||||
env:
|
||||
- TARGET=x86
|
||||
- STACKTRACE=no
|
||||
- CHECK=valgrind
|
||||
- TIMEOUT_DURATION=1200
|
||||
- VALGRIND_TOOLS=helgrind
|
||||
- VALGRIND_TESTDIR=tests
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- STACKTRACE=no
|
||||
- CHECK=valgrind
|
||||
- TIMEOUT_DURATION=1200
|
||||
- VALGRIND_TOOLS=drd
|
||||
- VALGRIND_TESTDIR=tests
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- CHECK=valgrind
|
||||
- TIMEOUT_DURATION=1200
|
||||
- VALGRIND_TOOLS=memcheck
|
||||
- VALGRIND_TESTDIR=tests-m32
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- CHECK=valgrind
|
||||
- TIMEOUT_DURATION=1200
|
||||
- VALGRIND_TOOLS=helgrind
|
||||
- VALGRIND_TESTDIR=tests-m32
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- CHECK=valgrind
|
||||
- TIMEOUT_DURATION=1200
|
||||
- VALGRIND_TOOLS=drd
|
||||
- VALGRIND_TESTDIR=tests-m32
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- CHECK=valgrind
|
||||
- TIMEOUT_DURATION=1200
|
||||
- VALGRIND_TOOLS=memcheck
|
||||
- VALGRIND_TESTDIR=tests-mx32
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- CHECK=valgrind
|
||||
- TIMEOUT_DURATION=1200
|
||||
- VALGRIND_TOOLS=helgrind
|
||||
- VALGRIND_TESTDIR=tests-mx32
|
||||
- compiler: gcc
|
||||
env:
|
||||
- TARGET=x86_64
|
||||
- CHECK=valgrind
|
||||
- TIMEOUT_DURATION=1200
|
||||
- VALGRIND_TOOLS=drd
|
||||
- VALGRIND_TESTDIR=tests-mx32
|
||||
|
32
COPYING
32
COPYING
@ -4,17 +4,27 @@ Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
|
||||
Copyright (c) 1995, 1996 Michael Elizabeth Chastain <mec@duracef.shout.net>
|
||||
Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
|
||||
Copyright (c) 1998-2001 Wichert Akkerman <wakkerma@deephackmode.org>
|
||||
Copyright (c) 2001-2018 The strace developers.
|
||||
Copyright (c) 2001-2017 The strace developers.
|
||||
All rights reserved.
|
||||
|
||||
strace is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 2.1 of the License,
|
||||
or (at your option) any later version.
|
||||
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. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
strace is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See LGPL-2.1-or-later for more details.
|
||||
|
||||
strace test suite is provided under the terms of the GNU General Public License
|
||||
version 2 or later, see tests/COPYING for more details.
|
||||
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.
|
||||
|
19
CREDITS.in
19
CREDITS.in
@ -8,9 +8,9 @@ These people have contributed to strace. Some have reported problems, others
|
||||
have contributed improvements to the documentation, actual code, provided
|
||||
information, provided resources, or helped to port strace to new systems.
|
||||
Those contributions are described in the version control logs and ChangeLog-CVS
|
||||
file. If your name has been left out, if you'd rather not be listed, or
|
||||
if you'd prefer a different address be used, please send a note to the
|
||||
strace-devel@lists.strace.io mailing list.
|
||||
file. If your name has been left out, if you'd rather not be listed, or if
|
||||
you'd prefer a different address be used, please send a note to the
|
||||
strace-devel@lists.sourceforge.net mailing list.
|
||||
|
||||
##<
|
||||
## There is no need to list here any name that appears as an Author in
|
||||
@ -19,6 +19,7 @@ strace-devel@lists.strace.io mailing list.
|
||||
##>
|
||||
Aaron Ucko ucko@vax1.rockhurst.edu
|
||||
Adrien Kunysz adrien@kunysz.be
|
||||
Anton Blanchard anton@samba.org
|
||||
Arkadiusz Miskiewicz misiek@pld.org.pl
|
||||
Bai Weidong baiwd@cn.fujitsu.com
|
||||
Bo Kullmar bk@kullmar.se
|
||||
@ -28,6 +29,7 @@ David Mosberger-Tang davidm@hpl.hp.com
|
||||
David S. Miller davem@caip.rutgers.edu
|
||||
David Wilder wilder@us.ibm.com
|
||||
David Woodhouse dwmw2@redhat.com
|
||||
Douglas Mencken dougmencken@gmail.com
|
||||
Fernando Luis Vazquez Cao fernando@oss.ntt.co.jp
|
||||
Florian Lohoff flo@rfc822.org
|
||||
Gabor Gombas gombasg@sztaki.hu
|
||||
@ -36,12 +38,12 @@ Gaël Roualland gael.roualland@iname.com
|
||||
Greg Banks gbanks@pocketpenguins.com
|
||||
Henrik Storner storner@osiris.ping.dk
|
||||
Jakub Jelinek jj@ultra.linux.cz
|
||||
Jeff Mahoney jeffm@suse.com
|
||||
Jian Zhen zhenjl@gmail.com
|
||||
Jiri Slaby jirislaby@gmail.com
|
||||
Joe Ilacqua spike@world.std.com
|
||||
Johannes Stezenbach js@sig21.net
|
||||
Jürgen Fluk louis@marco.de
|
||||
Jürgen Weigert jnweiger@immd4.informatik.uni-erlangen.de
|
||||
Ju"rgen Fluk louis@marco.de
|
||||
Juergen Weigert jnweiger@immd4.informatik.uni-erlangen.de
|
||||
Keith Thompson kst@alsys.com
|
||||
Kyle McMartin kyle@mcmartin.ca
|
||||
Lai JiangShan laijs@cn.fujitsu.com
|
||||
@ -73,6 +75,7 @@ Scott Tsai scottt958@yahoo.com.tw
|
||||
Simon Murray simon@transitive.com
|
||||
Solar Designer solar@openwall.com
|
||||
Srinivasa Ds srinivasa@in.ibm.com
|
||||
Steve Bennett steveb@workware.net.au
|
||||
Thanh Ma tma@encore.com
|
||||
Thiemo Seufer ths@networkno.de
|
||||
Thomas Bogendoerfer tsbogend@bigbug.franken.de
|
||||
@ -82,5 +85,7 @@ Tom Dyas tdyas@eden.rutgers.edu
|
||||
Tommi Rantala ext-tommi.1.rantala@nokia.com
|
||||
Topi Miettinen Topi.Miettinen@nic.fi
|
||||
Xiaoning Ding dingxn@gmail.com
|
||||
Yang Zhiguo yzgcsu@cn.fujitsu.com
|
||||
Zach Brown zach.brown@oracle.com
|
||||
Zhang Le robert.zhangle@gmail.com
|
||||
Zhang Le zhilg@users.sourceforge.net
|
||||
Марк Коренберг socketpair@gmail.com
|
||||
|
@ -15,10 +15,10 @@ Basic Installation
|
||||
Briefly, the shell command './configure && make && make install' should
|
||||
configure, build, and install this package. The following more-detailed
|
||||
instructions are generic; see the 'README' file for instructions
|
||||
specific to this package. Some packages provide this 'README-configure'
|
||||
file but do not implement all of the features documented below. The
|
||||
lack of an optional feature in a given package is not necessarily a bug.
|
||||
More recommendations for GNU packages can be found in *note Makefile
|
||||
specific to this package. Some packages provide this 'INSTALL' file but
|
||||
do not implement all of the features documented below. The lack of an
|
||||
optional feature in a given package is not necessarily a bug. More
|
||||
recommendations for GNU packages can be found in *note Makefile
|
||||
Conventions: (standards)Makefile Conventions.
|
||||
|
||||
The 'configure' shell script attempts to guess correct values for
|
@ -1,9 +1,8 @@
|
||||
Build strace from git repository
|
||||
================================
|
||||
If you use a GIT version of strace source code, there will be some files missing
|
||||
that are needed to build strace. Some of these files are generated by tools
|
||||
from the GNU Autoconf and GNU Automake packages.
|
||||
If you use the GIT version of strace there will be some files missing
|
||||
that you need to build strace. These files are generated by tools from
|
||||
the GNU Autoconf and Automake packages.
|
||||
|
||||
Note: rather than running `autoreconf` directly, please invoke `./bootstrap`
|
||||
script and follow the instructions given in [INSTALL](README-configure) file for further
|
||||
building and installation.
|
||||
Note: rather than running `autoreconf` directly, use the `./bootstrap` script
|
||||
and follow the instructions given in given in [INSTALL](INSTALL) file for further installation.
|
||||
|
@ -1,501 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom
|
||||
to share and change it. By contrast, the GNU General Public Licenses are
|
||||
intended to guarantee your freedom to share and change free software--to
|
||||
make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some specially
|
||||
designated software packages--typically libraries--of the Free Software
|
||||
Foundation and other authors who decide to use it. You can use it too,
|
||||
but we suggest you first think carefully about whether this license or
|
||||
the ordinary General Public License is the better strategy to use in
|
||||
any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get it
|
||||
if you want it; that you can change the software and use pieces of it in
|
||||
new free programs; and that you are informed that you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide complete
|
||||
object files to the recipients, so that they can relink them with the
|
||||
library after making changes to the library and recompiling it. And you
|
||||
must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that there
|
||||
is no warranty for the free library. Also, if the library is modified
|
||||
by someone else and passed on, the recipients should know that what they
|
||||
have is not the original version, so that the original author's reputation
|
||||
will not be affected by problems that might be introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot effectively
|
||||
restrict the users of a free program by obtaining a restrictive license
|
||||
from a patent holder. Therefore, we insist that any patent license
|
||||
obtained for a version of the library must be consistent with the full
|
||||
freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License. This license, the GNU Lesser General
|
||||
Public License, applies to certain designated libraries, and is quite
|
||||
different from the ordinary General Public License. We use this license
|
||||
for certain libraries in order to permit linking those libraries into
|
||||
non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using a
|
||||
shared library, the combination of the two is legally speaking a combined
|
||||
work, a derivative of the original library. The ordinary General Public
|
||||
License therefore permits such linking only if the entire combination
|
||||
fits its criteria of freedom. The Lesser General Public License permits
|
||||
more lax criteria for linking other code with the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to encourage
|
||||
the widest possible use of a certain library, so that it becomes a
|
||||
de-facto standard. To achieve this, non-free programs must be allowed
|
||||
to use the library. A more frequent case is that a free library does
|
||||
the same job as widely used non-free libraries. In this case, there
|
||||
is little to gain by limiting the free library to free software only,
|
||||
so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of free
|
||||
software. For example, permission to use the GNU C Library in non-free
|
||||
programs enables many more people to use the whole GNU operating system,
|
||||
as well as its variant, the GNU/Linux operating system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is linked
|
||||
with the Library has the freedom and the wherewithal to run that program
|
||||
using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License"). Each
|
||||
licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on
|
||||
the Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation
|
||||
is included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code
|
||||
means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of running
|
||||
a program using the Library is not restricted, and output from such
|
||||
a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided
|
||||
that you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion of
|
||||
it, thus forming a work based on the Library, and copy and distribute
|
||||
such modifications or work under the terms of Section 1 above,
|
||||
provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no charge
|
||||
to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or table,
|
||||
the facility still operates, and performs whatever part of its
|
||||
purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots
|
||||
has a purpose that is entirely well-defined independent of
|
||||
the application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square root
|
||||
function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work
|
||||
based on the Library, the distribution of the whole must be on the
|
||||
terms of this License, whose permissions for other licensees extend
|
||||
to the entire whole, and thus to each and every part regardless of
|
||||
who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is
|
||||
to exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume
|
||||
of a storage or distribution medium does not bring the other work
|
||||
under the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To
|
||||
do this, you must alter all the notices that refer to this License,
|
||||
so that they refer to the ordinary GNU General Public License,
|
||||
version 2, instead of to this License. (If a newer version than
|
||||
version 2 of the ordinary GNU General Public License has appeared,
|
||||
then you can specify that version instead if you wish.) Do not make
|
||||
any other change in these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of the
|
||||
Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or derivative
|
||||
of it, under Section 2) in object code or executable form under the
|
||||
terms of Sections 1 and 2 above provided that you accompany it with
|
||||
the complete corresponding machine-readable source code, which must
|
||||
be distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy from
|
||||
a designated place, then offering equivalent access to copy the source
|
||||
code from the same place satisfies the requirement to distribute the
|
||||
source code, even though third parties are not compelled to copy the
|
||||
source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the Library,
|
||||
but is designed to work with the Library by being compiled or linked
|
||||
with it, is called a "work that uses the Library". Such a work, in
|
||||
isolation, is not a derivative work of the Library, and therefore
|
||||
falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License. Section
|
||||
6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header
|
||||
file that is part of the Library, the object code for the work may
|
||||
be a derivative work of the Library even though the source code is
|
||||
not. Whether this is true is especially significant if the work can
|
||||
be linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data structure
|
||||
layouts and accessors, and small macros and small inline functions
|
||||
(ten lines or less in length), then the use of the object file
|
||||
is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section
|
||||
6. Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or link
|
||||
a "work that uses the Library" with the Library to produce a work
|
||||
containing portions of the Library, and distribute that work under
|
||||
terms of your choice, provided that the terms permit modification
|
||||
of the work for the customer's own use and reverse engineering for
|
||||
debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered
|
||||
by this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do
|
||||
one of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and
|
||||
(2) will operate properly with a modified version of the library,
|
||||
if the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at least three
|
||||
years, to give the same user the materials specified in Subsection
|
||||
6a, above, for a charge no more than the cost of performing this
|
||||
distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you
|
||||
cannot use both them and the Library together in an executable that
|
||||
you distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise permitted,
|
||||
and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities. This
|
||||
must be distributed under the terms of the Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute the
|
||||
Library except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense, link with, or distribute the
|
||||
Library is void, and will automatically terminate your rights under
|
||||
this License. However, parties who have received copies, or rights,
|
||||
from you under this License will not have their licenses terminated
|
||||
so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify
|
||||
or distribute the Library or its derivative works. These actions
|
||||
are prohibited by law if you do not accept this License. Therefore,
|
||||
by modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on
|
||||
the Library), the recipient automatically receives a license from
|
||||
the original licensor to copy, distribute, link with or modify the
|
||||
Library subject to these terms and conditions. You may not impose
|
||||
any further restrictions on the recipients' exercise of the rights
|
||||
granted herein. You are not responsible for enforcing compliance by
|
||||
third parties with this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement
|
||||
or otherwise) that contradict the conditions of this License, they
|
||||
do not excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence
|
||||
you may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library
|
||||
by all those who receive copies directly or indirectly through you,
|
||||
then the only way you could satisfy both it and this License would
|
||||
be to refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended
|
||||
to apply, and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of
|
||||
any such claims; this section has the sole purpose of protecting
|
||||
the integrity of the free software distribution system which
|
||||
is implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed
|
||||
to be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time. Such
|
||||
new versions will be similar in spirit to the present version, but
|
||||
may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published
|
||||
by the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free Software
|
||||
Foundation; we sometimes make exceptions for this. Our decision will
|
||||
be guided by the two goals of preserving the free status of all
|
||||
derivatives of our free software and of promoting the sharing and
|
||||
reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE
|
||||
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS
|
||||
AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF
|
||||
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO
|
||||
IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
|
||||
MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE
|
||||
TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
|
||||
THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR
|
||||
A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN
|
||||
IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES. END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of
|
||||
the ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and an idea of what it does.>
|
||||
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this library; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or
|
||||
your school, if any, to sign a "copyright disclaimer" for the library,
|
||||
if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in
|
||||
|
||||
the library `Frob' (a library for tweaking knobs) written
|
||||
|
||||
by James Random Hacker.
|
||||
|
||||
< signature of Ty Coon > , 1 April 1990
|
||||
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
318
Makefile.am
318
Makefile.am
@ -4,10 +4,30 @@
|
||||
# Copyright (c) 2006-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
# Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
|
||||
# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
|
||||
# Copyright (c) 2002-2018 The strace developers.
|
||||
# Copyright (c) 2002-2017 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# 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. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. 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.
|
||||
|
||||
if HAVE_M32_RUNTIME
|
||||
TESTS_M32 = tests-m32
|
||||
@ -18,15 +38,13 @@ endif
|
||||
SUBDIRS = . tests $(TESTS_M32) $(TESTS_MX32)
|
||||
|
||||
bin_PROGRAMS = strace
|
||||
man_MANS = strace.1 strace-log-merge.1
|
||||
man_MANS = strace.1
|
||||
bin_SCRIPTS = strace-graph strace-log-merge
|
||||
|
||||
OS = linux
|
||||
# ARCH is `i386', `m68k', `sparc', etc.
|
||||
ARCH = @arch@
|
||||
|
||||
READELF = @READELF@
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
AM_CFLAGS = $(WARN_CFLAGS)
|
||||
AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \
|
||||
@ -44,19 +62,15 @@ include xlat/Makemodule.am
|
||||
strace_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
strace_CFLAGS = $(AM_CFLAGS)
|
||||
strace_LDFLAGS =
|
||||
strace_LDADD = libstrace.a $(clock_LIBS) $(timer_LIBS)
|
||||
strace_LDADD = libstrace.a
|
||||
noinst_LIBRARIES = libstrace.a
|
||||
|
||||
libstrace_a_CPPFLAGS = $(strace_CPPFLAGS)
|
||||
libstrace_a_CFLAGS = $(strace_CFLAGS)
|
||||
libstrace_a_SOURCES = \
|
||||
fetch_indirect_syscall_args.c \
|
||||
fstatfs.c \
|
||||
fstatfs64.c \
|
||||
getpagesize.c \
|
||||
ipc.c \
|
||||
mmap_cache.c \
|
||||
mmap_cache.h \
|
||||
sigreturn.c \
|
||||
socketcall.c \
|
||||
statfs.c \
|
||||
@ -72,13 +86,11 @@ strace_SOURCES = \
|
||||
affinity.c \
|
||||
aio.c \
|
||||
alpha.c \
|
||||
arch_defs.h \
|
||||
basic_filters.c \
|
||||
bind.c \
|
||||
bjm.c \
|
||||
block.c \
|
||||
bpf.c \
|
||||
bpf_attr.h \
|
||||
bpf_filter.c \
|
||||
bpf_filter.h \
|
||||
bpf_fprog.h \
|
||||
@ -95,8 +107,6 @@ strace_SOURCES = \
|
||||
copy_file_range.c \
|
||||
count.c \
|
||||
defs.h \
|
||||
delay.c \
|
||||
delay.h \
|
||||
desc.c \
|
||||
dirent.c \
|
||||
dirent64.c \
|
||||
@ -107,10 +117,8 @@ strace_SOURCES = \
|
||||
error_prints.c \
|
||||
error_prints.h \
|
||||
evdev.c \
|
||||
evdev_mpers.c \
|
||||
eventfd.c \
|
||||
execve.c \
|
||||
f_owner_ex.h \
|
||||
fadvise.c \
|
||||
fallocate.c \
|
||||
fanotify.c \
|
||||
@ -124,18 +132,15 @@ strace_SOURCES = \
|
||||
fetch_struct_stat.c \
|
||||
fetch_struct_stat64.c \
|
||||
fetch_struct_statfs.c \
|
||||
fetch_struct_xfs_quotastat.c \
|
||||
file_handle.c \
|
||||
file_ioctl.c \
|
||||
filter.h \
|
||||
filter_qualify.c \
|
||||
filter.h \
|
||||
flock.c \
|
||||
flock.h \
|
||||
fs_x_ioctl.c \
|
||||
futex.c \
|
||||
gcc_compat.h \
|
||||
get_personality.c \
|
||||
get_personality.h \
|
||||
get_robust_list.c \
|
||||
getcpu.c \
|
||||
getcwd.c \
|
||||
@ -143,7 +148,6 @@ strace_SOURCES = \
|
||||
hdio.c \
|
||||
hostname.c \
|
||||
inotify.c \
|
||||
inotify_ioctl.c \
|
||||
io.c \
|
||||
ioctl.c \
|
||||
ioperm.c \
|
||||
@ -160,9 +164,6 @@ strace_SOURCES = \
|
||||
kexec.c \
|
||||
keyctl.c \
|
||||
keyctl_kdf_params.h \
|
||||
kill_save_errno.h \
|
||||
kvm.c \
|
||||
largefile_wrappers.h \
|
||||
ldt.c \
|
||||
link.c \
|
||||
linux/asm_stat.h \
|
||||
@ -177,8 +178,6 @@ strace_SOURCES = \
|
||||
membarrier.c \
|
||||
memfd_create.c \
|
||||
mknod.c \
|
||||
mmap_notify.c \
|
||||
mmap_notify.h \
|
||||
mmsghdr.c \
|
||||
mount.c \
|
||||
mpers_type.h \
|
||||
@ -187,16 +186,13 @@ strace_SOURCES = \
|
||||
msghdr.h \
|
||||
mtd.c \
|
||||
native_defs.h \
|
||||
nbd_ioctl.c \
|
||||
negated_errno.h \
|
||||
net.c \
|
||||
netlink.c \
|
||||
netlink.h \
|
||||
netlink_crypto.c \
|
||||
netlink_sock_diag.h \
|
||||
netlink_inet_diag.c \
|
||||
netlink_kobject_uevent.c \
|
||||
netlink_kobject_uevent.h \
|
||||
netlink_netfilter.c \
|
||||
netlink_netlink_diag.c \
|
||||
netlink_packet_diag.c \
|
||||
netlink_route.c \
|
||||
@ -204,7 +200,6 @@ strace_SOURCES = \
|
||||
netlink_selinux.c \
|
||||
netlink_smc_diag.c \
|
||||
netlink_sock_diag.c \
|
||||
netlink_sock_diag.h \
|
||||
netlink_unix_diag.c \
|
||||
nlattr.c \
|
||||
nlattr.h \
|
||||
@ -220,19 +215,14 @@ strace_SOURCES = \
|
||||
pathtrace.c \
|
||||
perf.c \
|
||||
perf_event_struct.h \
|
||||
perf_ioctl.c \
|
||||
personality.c \
|
||||
pkeys.c \
|
||||
poll.c \
|
||||
prctl.c \
|
||||
print_aio_sigset.c \
|
||||
print_dev_t.c \
|
||||
print_fields.h \
|
||||
print_group_req.c \
|
||||
print_fields.h \
|
||||
print_ifindex.c \
|
||||
print_instruction_pointer.c \
|
||||
print_kernel_version.c \
|
||||
print_mac.c \
|
||||
print_mq_attr.c \
|
||||
print_msgbuf.c \
|
||||
print_sg_req_info.c \
|
||||
@ -251,19 +241,13 @@ strace_SOURCES = \
|
||||
process_vm.c \
|
||||
ptp.c \
|
||||
ptrace.h \
|
||||
ptrace_syscall_info.c \
|
||||
ptrace_syscall_info.h \
|
||||
quota.c \
|
||||
random_ioctl.c \
|
||||
readahead.c \
|
||||
readlink.c \
|
||||
reboot.c \
|
||||
regs.h \
|
||||
renameat.c \
|
||||
resource.c \
|
||||
retval.c \
|
||||
retval.h \
|
||||
riscv.c \
|
||||
rt_sigframe.c \
|
||||
rt_sigreturn.c \
|
||||
rtc.c \
|
||||
@ -280,7 +264,6 @@ strace_SOURCES = \
|
||||
rtnl_rule.c \
|
||||
rtnl_tc.c \
|
||||
rtnl_tc_action.c \
|
||||
s390.c \
|
||||
sched.c \
|
||||
sched_attr.h \
|
||||
scsi.c \
|
||||
@ -296,19 +279,18 @@ strace_SOURCES = \
|
||||
sock.c \
|
||||
sockaddr.c \
|
||||
socketutils.c \
|
||||
sparc.c \
|
||||
sram_alloc.c \
|
||||
stat.c \
|
||||
stat.h \
|
||||
stat64.c \
|
||||
statfs.c \
|
||||
statfs.h \
|
||||
static_assert.h \
|
||||
statx.c \
|
||||
statx.h \
|
||||
strace.c \
|
||||
string_to_uint.c \
|
||||
string_to_uint.h \
|
||||
string_to_uint.c \
|
||||
supported_personalities.h \
|
||||
swapon.c \
|
||||
syscall.c \
|
||||
sysctl.c \
|
||||
@ -321,7 +303,6 @@ strace_SOURCES = \
|
||||
term.c \
|
||||
time.c \
|
||||
times.c \
|
||||
trace_event.h \
|
||||
truncate.c \
|
||||
ubi.c \
|
||||
ucopy.c \
|
||||
@ -337,40 +318,19 @@ strace_SOURCES = \
|
||||
utimes.c \
|
||||
v4l2.c \
|
||||
wait.c \
|
||||
wait.h \
|
||||
xattr.c \
|
||||
xfs_quota_stat.h \
|
||||
xlat.c \
|
||||
xlat.h \
|
||||
xmalloc.c \
|
||||
xmalloc.h \
|
||||
xstring.h \
|
||||
$(strace_SOURCES_check) \
|
||||
# end of strace_SOURCES
|
||||
|
||||
strace_SOURCES_check = bpf_attr_check.c
|
||||
|
||||
if ENABLE_STACKTRACE
|
||||
strace_SOURCES += unwind.c unwind.h
|
||||
if USE_LIBDW
|
||||
strace_SOURCES += unwind-libdw.c
|
||||
strace_CPPFLAGS += $(libdw_CPPFLAGS)
|
||||
strace_CFLAGS += $(libdw_CFLAGS)
|
||||
strace_LDFLAGS += $(libdw_LDFLAGS)
|
||||
strace_LDADD += $(libdw_LIBS)
|
||||
endif
|
||||
if USE_LIBUNWIND
|
||||
strace_SOURCES += unwind-libunwind.c
|
||||
strace_SOURCES += unwind.c
|
||||
strace_CPPFLAGS += $(libunwind_CPPFLAGS)
|
||||
strace_LDFLAGS += $(libunwind_LDFLAGS)
|
||||
strace_LDADD += $(libunwind_LIBS)
|
||||
endif
|
||||
if USE_DEMANGLE
|
||||
strace_CPPFLAGS += $(libiberty_CPPFLAGS)
|
||||
strace_LDFLAGS += $(libiberty_LDFLAGS)
|
||||
strace_LDADD += $(libiberty_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
@CODE_COVERAGE_RULES@
|
||||
CODE_COVERAGE_BRANCH_COVERAGE = 1
|
||||
@ -391,8 +351,6 @@ EXTRA_DIST = \
|
||||
CREDITS \
|
||||
ChangeLog \
|
||||
ChangeLog-CVS \
|
||||
LGPL-2.1-or-later \
|
||||
README-configure \
|
||||
README-linux-ptrace \
|
||||
debian/changelog \
|
||||
debian/compat \
|
||||
@ -408,7 +366,6 @@ EXTRA_DIST = \
|
||||
debian/strace64.install \
|
||||
debian/strace64.manpages \
|
||||
debian/watch \
|
||||
gen_bpf_attr_check.sh \
|
||||
generate_sen.sh \
|
||||
ioctl_iocdef.c \
|
||||
ioctlsort.c \
|
||||
@ -419,102 +376,120 @@ EXTRA_DIST = \
|
||||
linux/32/syscallent.h \
|
||||
linux/64/ioctls_inc.h \
|
||||
linux/64/syscallent.h \
|
||||
linux/aarch64/arch_defs_.h \
|
||||
linux/aarch64/arch_get_personality.c \
|
||||
linux/aarch64/arch_regs.c \
|
||||
linux/aarch64/arch_regs.h \
|
||||
linux/aarch64/arch_rt_sigframe.c\
|
||||
linux/aarch64/arch_sigreturn.c \
|
||||
linux/aarch64/errnoent1.h \
|
||||
linux/aarch64/get_error.c \
|
||||
linux/aarch64/get_scno.c \
|
||||
linux/aarch64/get_syscall_args.c \
|
||||
linux/aarch64/get_syscall_args.c\
|
||||
linux/aarch64/ioctls_arch0.h \
|
||||
linux/aarch64/ioctls_arch1.h \
|
||||
linux/aarch64/ioctls_inc0.h \
|
||||
linux/aarch64/ioctls_inc1.h \
|
||||
linux/aarch64/nr_prefix.c \
|
||||
linux/aarch64/raw_syscall.h \
|
||||
linux/aarch64/set_error.c \
|
||||
linux/aarch64/set_scno.c \
|
||||
linux/aarch64/shuffle_scno.c \
|
||||
linux/aarch64/signalent1.h \
|
||||
linux/aarch64/syscallent.h \
|
||||
linux/aarch64/syscallent1.h \
|
||||
linux/alpha/arch_defs_.h \
|
||||
linux/alpha/arch_getrval2.c \
|
||||
linux/alpha/arch_regs.c \
|
||||
linux/alpha/arch_regs.h \
|
||||
linux/alpha/arch_rt_sigframe.c \
|
||||
linux/alpha/arch_sigreturn.c \
|
||||
linux/alpha/errnoent.h \
|
||||
linux/alpha/get_error.c \
|
||||
linux/alpha/get_scno.c \
|
||||
linux/alpha/get_syscall_args.c \
|
||||
linux/alpha/get_syscall_result.c \
|
||||
linux/alpha/get_syscall_result.c\
|
||||
linux/alpha/ioctls_arch0.h \
|
||||
linux/alpha/ioctls_inc0.h \
|
||||
linux/alpha/raw_syscall.h \
|
||||
linux/alpha/set_error.c \
|
||||
linux/alpha/set_scno.c \
|
||||
linux/alpha/signalent.h \
|
||||
linux/alpha/syscallent.h \
|
||||
linux/alpha/userent.h \
|
||||
linux/arc/arch_regs.c \
|
||||
linux/arc/arch_regs.h \
|
||||
linux/arc/arch_rt_sigframe.c \
|
||||
linux/arc/get_error.c \
|
||||
linux/arc/get_scno.c \
|
||||
linux/arc/get_syscall_args.c \
|
||||
linux/arc/ioctls_arch0.h \
|
||||
linux/arc/ioctls_inc0.h \
|
||||
linux/arc/raw_syscall.h \
|
||||
linux/arc/set_error.c \
|
||||
linux/arc/set_scno.c \
|
||||
linux/arc/syscallent.h \
|
||||
linux/arch_defs_.h \
|
||||
linux/arch_kvm.c \
|
||||
linux/arch_regs.h \
|
||||
linux/arch_rt_sigframe.c \
|
||||
linux/arch_sigreturn.c \
|
||||
linux/arm/arch_defs_.h \
|
||||
linux/arm/arch_regs.c \
|
||||
linux/arm/arch_regs.h \
|
||||
linux/arm/arch_rt_sigframe.c \
|
||||
linux/arm/arch_sigreturn.c \
|
||||
linux/arm/get_error.c \
|
||||
linux/arm/get_scno.c \
|
||||
linux/arm/get_syscall_args.c \
|
||||
linux/arm/ioctls_arch0.h \
|
||||
linux/arm/ioctls_inc0.h \
|
||||
linux/arm/nr_prefix.c \
|
||||
linux/arm/raw_syscall.h \
|
||||
linux/arm/set_error.c \
|
||||
linux/arm/set_scno.c \
|
||||
linux/arm/shuffle_scno.c \
|
||||
linux/arm/syscallent.h \
|
||||
linux/arm/userent.h \
|
||||
linux/avr32/arch_regs.c \
|
||||
linux/avr32/arch_regs.h \
|
||||
linux/avr32/arch_rt_sigframe.c \
|
||||
linux/avr32/get_error.c \
|
||||
linux/avr32/get_scno.c \
|
||||
linux/avr32/get_syscall_args.c \
|
||||
linux/avr32/ioctls_arch0.h \
|
||||
linux/avr32/ioctls_inc0.h \
|
||||
linux/avr32/raw_syscall.h \
|
||||
linux/avr32/set_error.c \
|
||||
linux/avr32/set_scno.c \
|
||||
linux/avr32/syscallent.h \
|
||||
linux/avr32/userent.h \
|
||||
linux/bfin/arch_defs_.h \
|
||||
linux/bfin/arch_regs.c \
|
||||
linux/bfin/arch_rt_sigframe.c \
|
||||
linux/bfin/get_error.c \
|
||||
linux/bfin/get_scno.c \
|
||||
linux/bfin/get_syscall_args.c \
|
||||
linux/bfin/get_syscall_result.c \
|
||||
linux/bfin/ioctls_arch0.h \
|
||||
linux/bfin/ioctls_inc0.h \
|
||||
linux/bfin/raw_syscall.h \
|
||||
linux/bfin/rt_sigframe.h \
|
||||
linux/bfin/set_error.c \
|
||||
linux/bfin/set_scno.c \
|
||||
linux/bfin/syscallent.h \
|
||||
linux/bfin/userent.h \
|
||||
linux/check_scno.c \
|
||||
linux/crisv10/arch_regs.c \
|
||||
linux/crisv10/arch_rt_sigframe.c\
|
||||
linux/crisv10/arch_sigreturn.c \
|
||||
linux/crisv10/get_error.c \
|
||||
linux/crisv10/get_scno.c \
|
||||
linux/crisv10/get_syscall_args.c \
|
||||
linux/crisv10/get_syscall_result.c \
|
||||
linux/crisv10/rt_sigframe.h \
|
||||
linux/crisv10/set_error.c \
|
||||
linux/crisv10/set_scno.c \
|
||||
linux/crisv10/syscallent.h \
|
||||
linux/crisv10/userent.h \
|
||||
linux/crisv32/arch_regs.c \
|
||||
linux/crisv32/arch_rt_sigframe.c\
|
||||
linux/crisv32/arch_sigreturn.c \
|
||||
linux/crisv32/get_error.c \
|
||||
linux/crisv32/get_scno.c \
|
||||
linux/crisv32/get_syscall_args.c \
|
||||
linux/crisv32/get_syscall_result.c \
|
||||
linux/crisv32/rt_sigframe.h \
|
||||
linux/crisv32/set_error.c \
|
||||
linux/crisv32/set_scno.c \
|
||||
linux/crisv32/syscallent.h \
|
||||
linux/crisv32/userent.h \
|
||||
linux/dummy.h \
|
||||
linux/errnoent.h \
|
||||
linux/getregs_old.h \
|
||||
linux/hppa/arch_defs_.h \
|
||||
linux/hppa/arch_regs.c \
|
||||
linux/hppa/arch_regs.h \
|
||||
linux/hppa/arch_rt_sigframe.c \
|
||||
linux/hppa/errnoent.h \
|
||||
linux/hppa/get_error.c \
|
||||
@ -523,15 +498,13 @@ EXTRA_DIST = \
|
||||
linux/hppa/get_syscall_result.c \
|
||||
linux/hppa/ioctls_arch0.h \
|
||||
linux/hppa/ioctls_inc0.h \
|
||||
linux/hppa/raw_syscall.h \
|
||||
linux/hppa/rt_sigframe.h \
|
||||
linux/hppa/set_error.c \
|
||||
linux/hppa/set_scno.c \
|
||||
linux/hppa/signalent.h \
|
||||
linux/hppa/syscallent.h \
|
||||
linux/i386/arch_defs_.h \
|
||||
linux/i386/arch_kvm.c \
|
||||
linux/i386/arch_regs.c \
|
||||
linux/i386/arch_regs.h \
|
||||
linux/i386/arch_rt_sigframe.c \
|
||||
linux/i386/arch_sigreturn.c \
|
||||
linux/i386/get_error.c \
|
||||
@ -539,14 +512,12 @@ EXTRA_DIST = \
|
||||
linux/i386/get_syscall_args.c \
|
||||
linux/i386/ioctls_arch0.h \
|
||||
linux/i386/ioctls_inc0.h \
|
||||
linux/i386/raw_syscall.h \
|
||||
linux/i386/rt_sigframe.h \
|
||||
linux/i386/set_error.c \
|
||||
linux/i386/set_scno.c \
|
||||
linux/i386/syscallent.h \
|
||||
linux/i386/userent.h \
|
||||
linux/i386/userent0.h \
|
||||
linux/ia64/arch_defs_.h \
|
||||
linux/ia64/arch_getrval2.c \
|
||||
linux/ia64/arch_regs.c \
|
||||
linux/ia64/arch_regs.h \
|
||||
@ -556,15 +527,14 @@ EXTRA_DIST = \
|
||||
linux/ia64/get_syscall_args.c \
|
||||
linux/ia64/ioctls_arch0.h \
|
||||
linux/ia64/ioctls_inc0.h \
|
||||
linux/ia64/raw_syscall.h \
|
||||
linux/ia64/rt_sigframe.h \
|
||||
linux/ia64/set_error.c \
|
||||
linux/ia64/set_scno.c \
|
||||
linux/ia64/syscallent.h \
|
||||
linux/ia64/userent.h \
|
||||
linux/inet_diag.h \
|
||||
linux/m68k/arch_defs_.h \
|
||||
linux/m68k/arch_regs.c \
|
||||
linux/m68k/arch_regs.h \
|
||||
linux/m68k/arch_rt_sigframe.c \
|
||||
linux/m68k/arch_sigreturn.c \
|
||||
linux/m68k/get_error.c \
|
||||
@ -572,25 +542,24 @@ EXTRA_DIST = \
|
||||
linux/m68k/get_syscall_args.c \
|
||||
linux/m68k/ioctls_arch0.h \
|
||||
linux/m68k/ioctls_inc0.h \
|
||||
linux/m68k/raw_syscall.h \
|
||||
linux/m68k/rt_sigframe.h \
|
||||
linux/m68k/set_error.c \
|
||||
linux/m68k/set_scno.c \
|
||||
linux/m68k/syscallent.h \
|
||||
linux/m68k/userent.h \
|
||||
linux/metag/arch_regs.c \
|
||||
linux/metag/arch_regs.h \
|
||||
linux/metag/arch_rt_sigframe.c \
|
||||
linux/metag/get_error.c \
|
||||
linux/metag/get_scno.c \
|
||||
linux/metag/get_syscall_args.c \
|
||||
linux/metag/ioctls_arch0.h \
|
||||
linux/metag/ioctls_inc0.h \
|
||||
linux/metag/raw_syscall.h \
|
||||
linux/metag/set_error.c \
|
||||
linux/metag/set_scno.c \
|
||||
linux/metag/syscallent.h \
|
||||
linux/microblaze/arch_defs_.h \
|
||||
linux/microblaze/arch_regs.c \
|
||||
linux/microblaze/arch_rt_sigframe.c\
|
||||
linux/microblaze/arch_sigreturn.c \
|
||||
linux/microblaze/get_error.c \
|
||||
linux/microblaze/get_scno.c \
|
||||
@ -598,14 +567,14 @@ EXTRA_DIST = \
|
||||
linux/microblaze/get_syscall_result.c \
|
||||
linux/microblaze/ioctls_arch0.h \
|
||||
linux/microblaze/ioctls_inc0.h \
|
||||
linux/microblaze/raw_syscall.h \
|
||||
linux/microblaze/set_error.c \
|
||||
linux/microblaze/set_scno.c \
|
||||
linux/microblaze/syscallent.h \
|
||||
linux/microblaze/userent.h \
|
||||
linux/mips/arch_defs_.h \
|
||||
linux/mips/arch_getrval2.c \
|
||||
linux/mips/arch_regs.c \
|
||||
linux/mips/arch_regs.h \
|
||||
linux/mips/arch_rt_sigframe.c \
|
||||
linux/mips/arch_sigreturn.c \
|
||||
linux/mips/errnoent.h \
|
||||
linux/mips/genstub.sh \
|
||||
@ -614,7 +583,6 @@ EXTRA_DIST = \
|
||||
linux/mips/get_syscall_args.c \
|
||||
linux/mips/ioctls_arch0.h \
|
||||
linux/mips/ioctls_inc0.h \
|
||||
linux/mips/raw_syscall.h \
|
||||
linux/mips/rt_sigframe.h \
|
||||
linux/mips/set_error.c \
|
||||
linux/mips/set_scno.c \
|
||||
@ -625,34 +593,36 @@ EXTRA_DIST = \
|
||||
linux/mips/syscallent-o32.h \
|
||||
linux/mips/syscallent.h \
|
||||
linux/mips/userent.h \
|
||||
linux/mtd-abi.h \
|
||||
linux/netlink_diag.h \
|
||||
linux/nios2/arch_defs_.h \
|
||||
linux/nios2/arch_regs.c \
|
||||
linux/nios2/arch_regs.h \
|
||||
linux/nios2/arch_rt_sigframe.c \
|
||||
linux/nios2/get_error.c \
|
||||
linux/nios2/get_scno.c \
|
||||
linux/nios2/get_syscall_args.c \
|
||||
linux/nios2/ioctls_arch0.h \
|
||||
linux/nios2/ioctls_inc0.h \
|
||||
linux/nios2/raw_syscall.h \
|
||||
linux/nios2/set_error.c \
|
||||
linux/nios2/set_scno.c \
|
||||
linux/nios2/syscallent.h \
|
||||
linux/nr_prefix.c \
|
||||
linux/or1k/arch_regs.c \
|
||||
linux/or1k/arch_regs.h \
|
||||
linux/or1k/arch_rt_sigframe.c \
|
||||
linux/or1k/get_error.c \
|
||||
linux/or1k/get_scno.c \
|
||||
linux/or1k/get_syscall_args.c \
|
||||
linux/or1k/ioctls_arch0.h \
|
||||
linux/or1k/ioctls_inc0.h \
|
||||
linux/or1k/raw_syscall.h \
|
||||
linux/or1k/set_error.c \
|
||||
linux/or1k/set_scno.c \
|
||||
linux/or1k/syscallent.h \
|
||||
linux/or1k/userent.h \
|
||||
linux/packet_diag.h \
|
||||
linux/powerpc/arch_defs_.h \
|
||||
linux/personality.h \
|
||||
linux/powerpc/arch_regs.c \
|
||||
linux/powerpc/arch_rt_sigframe.c \
|
||||
linux/powerpc/arch_regs.h \
|
||||
linux/powerpc/arch_rt_sigframe.c\
|
||||
linux/powerpc/arch_sigreturn.c \
|
||||
linux/powerpc/errnoent.h \
|
||||
linux/powerpc/get_error.c \
|
||||
@ -662,17 +632,16 @@ EXTRA_DIST = \
|
||||
linux/powerpc/getregs_old.h \
|
||||
linux/powerpc/ioctls_arch0.h \
|
||||
linux/powerpc/ioctls_inc0.h \
|
||||
linux/powerpc/raw_syscall.h \
|
||||
linux/powerpc/set_error.c \
|
||||
linux/powerpc/set_scno.c \
|
||||
linux/powerpc/syscallent.h \
|
||||
linux/powerpc/userent.h \
|
||||
linux/powerpc64/arch_defs_.h \
|
||||
linux/powerpc64/arch_get_personality.c \
|
||||
linux/powerpc64/arch_regs.c \
|
||||
linux/powerpc64/arch_rt_sigframe.c \
|
||||
linux/powerpc64/arch_regs.h \
|
||||
linux/powerpc64/arch_rt_sigframe.c\
|
||||
linux/powerpc64/arch_sigreturn.c \
|
||||
linux/powerpc64/errnoent.h \
|
||||
linux/powerpc64/errnoent1.h \
|
||||
linux/powerpc64/get_error.c \
|
||||
linux/powerpc64/get_scno.c \
|
||||
linux/powerpc64/get_syscall_args.c \
|
||||
@ -682,18 +651,18 @@ EXTRA_DIST = \
|
||||
linux/powerpc64/ioctls_arch1.h \
|
||||
linux/powerpc64/ioctls_inc0.h \
|
||||
linux/powerpc64/ioctls_inc1.h \
|
||||
linux/powerpc64/raw_syscall.h \
|
||||
linux/powerpc64/rt_sigframe.h \
|
||||
linux/powerpc64/set_error.c \
|
||||
linux/powerpc64/set_scno.c \
|
||||
linux/powerpc64/signalent1.h \
|
||||
linux/powerpc64/syscallent.h \
|
||||
linux/powerpc64/syscallent1.h \
|
||||
linux/powerpc64/userent.h \
|
||||
linux/ptrace_pokeuser.c \
|
||||
linux/raw_syscall.h \
|
||||
linux/riscv/arch_defs_.h \
|
||||
linux/riscv/arch_get_personality.c \
|
||||
linux/ptp_clock.h \
|
||||
linux/riscv/arch_regs.c \
|
||||
linux/riscv/arch_regs.h \
|
||||
linux/riscv/arch_rt_sigframe.c \
|
||||
linux/riscv/errnoent1.h \
|
||||
linux/riscv/get_error.c \
|
||||
linux/riscv/get_scno.c \
|
||||
linux/riscv/get_syscall_args.c \
|
||||
@ -701,21 +670,21 @@ EXTRA_DIST = \
|
||||
linux/riscv/ioctls_arch1.h \
|
||||
linux/riscv/ioctls_inc0.h \
|
||||
linux/riscv/ioctls_inc1.h \
|
||||
linux/riscv/raw_syscall.h \
|
||||
linux/riscv/set_error.c \
|
||||
linux/riscv/set_scno.c \
|
||||
linux/riscv/signalent1.h \
|
||||
linux/riscv/syscallent.h \
|
||||
linux/riscv/syscallent1.h \
|
||||
linux/rt_sigframe.h \
|
||||
linux/s390/arch_defs_.h \
|
||||
linux/s390/arch_regs.c \
|
||||
linux/s390/arch_regs.h \
|
||||
linux/s390/arch_rt_sigframe.c \
|
||||
linux/s390/arch_sigreturn.c \
|
||||
linux/s390/get_error.c \
|
||||
linux/s390/get_scno.c \
|
||||
linux/s390/get_syscall_args.c \
|
||||
linux/s390/ioctls_arch0.h \
|
||||
linux/s390/ioctls_inc0.h \
|
||||
linux/s390/raw_syscall.h \
|
||||
linux/s390/rt_sigframe.h \
|
||||
linux/s390/set_error.c \
|
||||
linux/s390/set_scno.c \
|
||||
@ -723,104 +692,98 @@ EXTRA_DIST = \
|
||||
linux/s390/userent.h \
|
||||
linux/s390/userent0.h \
|
||||
linux/s390/userent1.h \
|
||||
linux/s390x/arch_defs_.h \
|
||||
linux/s390x/arch_get_personality.c \
|
||||
linux/s390x/arch_regs.c \
|
||||
linux/s390x/arch_regs.h \
|
||||
linux/s390x/arch_rt_sigframe.c \
|
||||
linux/s390x/arch_sigreturn.c \
|
||||
linux/s390x/get_error.c \
|
||||
linux/s390x/get_scno.c \
|
||||
linux/s390x/get_syscall_args.c \
|
||||
linux/s390x/ioctls_arch0.h \
|
||||
linux/s390x/ioctls_arch1.h \
|
||||
linux/s390x/ioctls_inc0.h \
|
||||
linux/s390x/ioctls_inc1.h \
|
||||
linux/s390x/raw_syscall.h \
|
||||
linux/s390x/rt_sigframe.h \
|
||||
linux/s390x/set_error.c \
|
||||
linux/s390x/set_scno.c \
|
||||
linux/s390x/syscallent.h \
|
||||
linux/s390x/syscallent1.h \
|
||||
linux/s390x/userent.h \
|
||||
linux/sh/arch_defs_.h \
|
||||
linux/sh/arch_getrval2.c \
|
||||
linux/sh/arch_regs.c \
|
||||
linux/sh/arch_rt_sigframe.c \
|
||||
linux/sh/get_error.c \
|
||||
linux/sh/get_scno.c \
|
||||
linux/sh/get_syscall_args.c \
|
||||
linux/sh/get_syscall_result.c \
|
||||
linux/sh/ioctls_arch0.h \
|
||||
linux/sh/ioctls_inc0.h \
|
||||
linux/sh/raw_syscall.h \
|
||||
linux/sh/set_error.c \
|
||||
linux/sh/set_scno.c \
|
||||
linux/sh/syscallent.h \
|
||||
linux/sh/userent.h \
|
||||
linux/sh/userent0.h \
|
||||
linux/sh64/arch_defs_.h \
|
||||
linux/sh64/arch_regs.c \
|
||||
linux/sh64/arch_regs.h \
|
||||
linux/sh64/arch_rt_sigframe.c \
|
||||
linux/sh64/get_error.c \
|
||||
linux/sh64/get_scno.c \
|
||||
linux/sh64/get_syscall_args.c \
|
||||
linux/sh64/get_syscall_result.c \
|
||||
linux/sh64/ioctls_arch0.h \
|
||||
linux/sh64/ioctls_inc0.h \
|
||||
linux/sh64/raw_syscall.h \
|
||||
linux/sh64/rt_sigframe.h \
|
||||
linux/sh64/set_error.c \
|
||||
linux/sh64/set_scno.c \
|
||||
linux/sh64/syscallent.h \
|
||||
linux/sh64/userent.h \
|
||||
linux/shuffle_scno.c \
|
||||
linux/signal.h.in \
|
||||
linux/signalent.h \
|
||||
linux/smc_diag.h \
|
||||
linux/sock_diag.h \
|
||||
linux/sparc/arch_defs_.h \
|
||||
linux/sparc/arch_getrval2.c \
|
||||
linux/sparc/arch_regs.c \
|
||||
linux/sparc/arch_regs.h \
|
||||
linux/sparc/arch_rt_sigframe.c \
|
||||
linux/sparc/arch_sigreturn.c \
|
||||
linux/sparc/errnoent.h \
|
||||
linux/sparc/gen.pl \
|
||||
linux/sparc/get_error.c \
|
||||
linux/sparc/get_scno.c \
|
||||
linux/sparc/get_syscall_args.c \
|
||||
linux/sparc/ioctls_arch0.h \
|
||||
linux/sparc/ioctls_inc0.h \
|
||||
linux/sparc/raw_syscall.h \
|
||||
linux/sparc/rt_sigframe.h \
|
||||
linux/sparc/set_error.c \
|
||||
linux/sparc/set_scno.c \
|
||||
linux/sparc/signalent.h \
|
||||
linux/sparc/syscallent.h \
|
||||
linux/sparc/userent.h \
|
||||
linux/sparc64/arch_defs_.h \
|
||||
linux/sparc64/arch_get_personality.c \
|
||||
linux/sparc64/arch_getrval2.c \
|
||||
linux/sparc64/arch_regs.c \
|
||||
linux/sparc64/arch_rt_sigframe.c \
|
||||
linux/sparc64/arch_regs.h \
|
||||
linux/sparc64/arch_rt_sigframe.c\
|
||||
linux/sparc64/arch_sigreturn.c \
|
||||
linux/sparc64/errnoent.h \
|
||||
linux/sparc64/errnoent1.h \
|
||||
linux/sparc64/get_error.c \
|
||||
linux/sparc64/get_scno.c \
|
||||
linux/sparc64/get_syscall_args.c \
|
||||
linux/sparc64/get_syscall_args.c\
|
||||
linux/sparc64/ioctls_arch0.h \
|
||||
linux/sparc64/ioctls_arch1.h \
|
||||
linux/sparc64/ioctls_inc0.h \
|
||||
linux/sparc64/ioctls_inc1.h \
|
||||
linux/sparc64/raw_syscall.h \
|
||||
linux/sparc64/rt_sigframe.h \
|
||||
linux/sparc64/set_error.c \
|
||||
linux/sparc64/set_scno.c \
|
||||
linux/sparc64/signalent.h \
|
||||
linux/sparc64/signalent1.h \
|
||||
linux/sparc64/syscallent.h \
|
||||
linux/sparc64/syscallent1.h \
|
||||
linux/sparc64/userent.h \
|
||||
linux/subcall.h \
|
||||
linux/syscall.h \
|
||||
linux/tile/arch_defs_.h \
|
||||
linux/tile/arch_get_personality.c \
|
||||
linux/tile/arch_regs.c \
|
||||
linux/tile/arch_regs.h \
|
||||
linux/tile/arch_rt_sigframe.c \
|
||||
linux/tile/arch_sigreturn.c \
|
||||
linux/tile/errnoent1.h \
|
||||
linux/tile/get_error.c \
|
||||
linux/tile/get_scno.c \
|
||||
linux/tile/get_syscall_args.c \
|
||||
@ -828,24 +791,22 @@ EXTRA_DIST = \
|
||||
linux/tile/ioctls_arch1.h \
|
||||
linux/tile/ioctls_inc0.h \
|
||||
linux/tile/ioctls_inc1.h \
|
||||
linux/tile/raw_syscall.h \
|
||||
linux/tile/rt_sigframe.h \
|
||||
linux/tile/set_error.c \
|
||||
linux/tile/set_scno.c \
|
||||
linux/tile/signalent1.h \
|
||||
linux/tile/syscallent.h \
|
||||
linux/tile/syscallent1.h \
|
||||
linux/tile/userent.h \
|
||||
linux/ubi-user.h \
|
||||
linux/unix_diag.h \
|
||||
linux/userent.h \
|
||||
linux/userent0.h \
|
||||
linux/x32/arch_defs_.h \
|
||||
linux/x32/arch_get_personality.c \
|
||||
linux/x32/arch_kvm.c \
|
||||
linux/x32/arch_regs.c \
|
||||
linux/x32/arch_regs.h \
|
||||
linux/x32/arch_rt_sigframe.c \
|
||||
linux/x32/arch_sigreturn.c \
|
||||
linux/x32/check_scno.c \
|
||||
linux/x32/errnoent1.h \
|
||||
linux/x32/get_error.c \
|
||||
linux/x32/get_scno.c \
|
||||
linux/x32/get_syscall_args.c \
|
||||
@ -853,22 +814,20 @@ EXTRA_DIST = \
|
||||
linux/x32/ioctls_arch1.h \
|
||||
linux/x32/ioctls_inc0.h \
|
||||
linux/x32/ioctls_inc1.h \
|
||||
linux/x32/ptrace_pokeuser.c \
|
||||
linux/x32/raw_syscall.h \
|
||||
linux/x32/rt_sigframe.h \
|
||||
linux/x32/set_error.c \
|
||||
linux/x32/set_scno.c \
|
||||
linux/x32/shuffle_scno.c \
|
||||
linux/x32/signalent1.h \
|
||||
linux/x32/syscallent.h \
|
||||
linux/x32/syscallent1.h \
|
||||
linux/x32/userent.h \
|
||||
linux/x86_64/arch_defs_.h \
|
||||
linux/x86_64/arch_get_personality.c \
|
||||
linux/x86_64/arch_kvm.c \
|
||||
linux/x86_64/arch_regs.c \
|
||||
linux/x86_64/arch_regs.h \
|
||||
linux/x86_64/arch_rt_sigframe.c \
|
||||
linux/x86_64/arch_sigreturn.c \
|
||||
linux/x86_64/errnoent1.h \
|
||||
linux/x86_64/errnoent2.h \
|
||||
linux/x86_64/gentab.pl \
|
||||
linux/x86_64/get_error.c \
|
||||
linux/x86_64/get_scno.c \
|
||||
linux/x86_64/get_syscall_args.c \
|
||||
@ -880,23 +839,23 @@ EXTRA_DIST = \
|
||||
linux/x86_64/ioctls_inc0.h \
|
||||
linux/x86_64/ioctls_inc1.h \
|
||||
linux/x86_64/ioctls_inc2.h \
|
||||
linux/x86_64/raw_syscall.h \
|
||||
linux/x86_64/rt_sigframe.h \
|
||||
linux/x86_64/set_error.c \
|
||||
linux/x86_64/set_scno.c \
|
||||
linux/x86_64/shuffle_scno.c \
|
||||
linux/x86_64/signalent1.h \
|
||||
linux/x86_64/signalent2.h \
|
||||
linux/x86_64/syscallent.h \
|
||||
linux/x86_64/syscallent1.h \
|
||||
linux/x86_64/syscallent2.h \
|
||||
linux/x86_64/userent.h \
|
||||
linux/xtensa/arch_regs.c \
|
||||
linux/xtensa/arch_rt_sigframe.c \
|
||||
linux/xtensa/get_error.c \
|
||||
linux/xtensa/get_scno.c \
|
||||
linux/xtensa/get_syscall_args.c \
|
||||
linux/xtensa/get_syscall_result.c \
|
||||
linux/xtensa/ioctls_arch0.h \
|
||||
linux/xtensa/ioctls_inc0.h \
|
||||
linux/xtensa/raw_syscall.h \
|
||||
linux/xtensa/set_error.c \
|
||||
linux/xtensa/set_scno.c \
|
||||
linux/xtensa/syscallent.h \
|
||||
@ -912,7 +871,7 @@ EXTRA_DIST = \
|
||||
$(XLAT_INPUT_FILES) \
|
||||
$(XLAT_HEADER_FILES) \
|
||||
xlat/gen.sh \
|
||||
# end of EXTRA_DIST
|
||||
xlate.el
|
||||
|
||||
.PHONY: check-valgrind-local
|
||||
check-valgrind-local:
|
||||
@ -924,15 +883,10 @@ srpm: dist-xz
|
||||
$(srcdir)/.version:
|
||||
$(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
|
||||
|
||||
bpf_attr_check.c: $(srcdir)/bpf_attr.h $(srcdir)/gen_bpf_attr_check.sh
|
||||
$(srcdir)/gen_bpf_attr_check.sh $< > $@-t && mv $@-t $@
|
||||
|
||||
strace_SOURCES_c = \
|
||||
$(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES))
|
||||
|
||||
sys_func_h_sources = $(filter-out $(strace_SOURCES_check),$(strace_SOURCES_c))
|
||||
|
||||
sys_func.h: $(patsubst %,$(srcdir)/%,$(sys_func_h_sources))
|
||||
sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c))
|
||||
for f in $^; do \
|
||||
sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \
|
||||
done | sort -u > $@
|
||||
@ -951,7 +905,7 @@ dist-hook:
|
||||
${AM_V_GEN}echo $(COPYRIGHT_YEAR) > $(distdir)/.year
|
||||
${AM_V_GEN}echo $(MANPAGE_DATE) > $(distdir)/.strace.1.in.date
|
||||
|
||||
today = $(shell LC_TIME=C date -u +%Y-%m-%d)
|
||||
today = $(shell date +%Y-%m-%d)
|
||||
version_regexp = $(subst .,\.,$(VERSION))
|
||||
news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))'
|
||||
|
||||
@ -1005,13 +959,11 @@ ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioc
|
||||
cat $^ > $@
|
||||
|
||||
BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \
|
||||
bpf_attr_check.c native_printer_decls.h native_printer_defs.h \
|
||||
printers.h sen.h sys_func.h .version
|
||||
native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version
|
||||
CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
|
||||
ioctl_iocdef.h ioctl_iocdef.i \
|
||||
bpf_attr_check.c native_printer_decls.h native_printer_defs.h \
|
||||
printers.h sen.h sys_func.h
|
||||
DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h linux/linux/signal.h
|
||||
native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h
|
||||
DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h
|
||||
|
||||
include scno.am
|
||||
|
||||
@ -1035,12 +987,9 @@ libmpers_CFLAGS = $(strace_CFLAGS)
|
||||
|
||||
mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
|
||||
for f in $^; do \
|
||||
READELF="$(READELF)" \
|
||||
CC="$(CC)" \
|
||||
CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
|
||||
CPP="$(CPP)" \
|
||||
CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
|
||||
$(srcdir)/mpers.sh $(mpers_NAME) $(mpers_CC_FLAGS) $$f || exit; \
|
||||
CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
|
||||
CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
|
||||
$(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \
|
||||
done
|
||||
> $@
|
||||
|
||||
@ -1111,7 +1060,6 @@ BUILT_SOURCES += $(mpers_m32_targets)
|
||||
CLEANFILES += $(mpers_m32_targets)
|
||||
|
||||
$(mpers_m32_targets): mpers_NAME = m32
|
||||
$(mpers_m32_targets): mpers_CC_FLAGS = @cc_flags_m32@
|
||||
|
||||
endif # HAVE_M32_MPERS
|
||||
|
||||
@ -1128,7 +1076,6 @@ BUILT_SOURCES += $(mpers_mx32_targets)
|
||||
CLEANFILES += $(mpers_mx32_targets)
|
||||
|
||||
$(mpers_mx32_targets): mpers_NAME = mx32
|
||||
$(mpers_mx32_targets): mpers_CC_FLAGS = @cc_flags_mx32@
|
||||
|
||||
endif # HAVE_MX32_MPERS
|
||||
|
||||
@ -1155,9 +1102,10 @@ $(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \
|
||||
( \
|
||||
cd $(srcdir); \
|
||||
sed '/^##/,$$d' CREDITS.in; \
|
||||
sed -n '1,/^##>/d; s/ */\t/; s/^./&/p' CREDITS.in \
|
||||
| maint/gen-contributors-list.sh - -e HEAD --initial \
|
||||
| sed 's/\t/ /g; s/^/\t/' \
|
||||
{ sed -n '1,/^##>/d; s/ */\t/; s/^./&/p' CREDITS.in; \
|
||||
git log --pretty=format:'%aN %aE'; \
|
||||
} | LC_ALL=C sort -u \
|
||||
| awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}'; \
|
||||
) > $@-t && mv $@-t $@
|
||||
|
||||
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX
|
||||
|
276
NEWS
276
NEWS
@ -1,281 +1,6 @@
|
||||
Noteworthy changes in release ?.?? (????-??-??)
|
||||
===============================================
|
||||
|
||||
* Improvements
|
||||
* Enhanced xlat styles support configured by -X option.
|
||||
* Updated lists of BPF_*, BTRFS_*, FAN_*, IFLA_*, KERN_*, KVM_CAP_*, NDA_*,
|
||||
NETNSA_*, NT_*, PR_*, REL_*, SECCOMP_*, SCTP_*, UDP_*, V4L2_*, and *_MAGIC
|
||||
constants.
|
||||
|
||||
* Bug fixes
|
||||
* Fixed strace-k test on alpha.
|
||||
* Fixed build on mips o32.
|
||||
* Fixed build on NOMMU architectures.
|
||||
|
||||
Noteworthy changes in release 4.26 (2018-12-26)
|
||||
===============================================
|
||||
|
||||
* License
|
||||
* The test suite is now provided under the terms of
|
||||
the GNU General Public License version 2 or later.
|
||||
* All the rest of strace is now provided under the terms of
|
||||
the GNU Lesser General Public License version 2.1 or later.
|
||||
|
||||
* Changes in behavior
|
||||
* If strace is interrupted by a signal it handles (currently
|
||||
one of HUP, INT, QUIT, PIPE, or TERM), strace terminates
|
||||
itself with this signal.
|
||||
|
||||
* Improvements
|
||||
* Implemented obtainment of system call information using
|
||||
PTRACE_GET_SYSCALL_INFO ptrace API.
|
||||
* Implemented decoding of PTRACE_GET_SYSCALL_INFO ptrace request.
|
||||
* Implemented decoding of BLKGETZONESZ, BLKGETNRZONES, and RND* ioctl
|
||||
commands.
|
||||
* Enhanced xlat styles support configured by -X option.
|
||||
* Enhanced internet address formatting in structureless contexts.
|
||||
* Enhanced decoding of getsockopt SO_ERROR option.
|
||||
* Enhanced error diagnostics when the first exec fails.
|
||||
* Added %net as a short form of %network in syscall specifications.
|
||||
* Updated lists of ABS_*, BPF_*, FAN_*, IFA_*, IFLA_*, KVM_CAP_*, NETLINK_*,
|
||||
NTF_*, PR_SPEC_*, REL_*, SOL_*, TCA_*, and V4L2_* constants.
|
||||
* Updated lists of ioctl commands from Linux 4.20.
|
||||
* Enhanced manual page.
|
||||
|
||||
* Bug fixes
|
||||
* Fixed "xlat_idx: Unexpected xlat value 0" warnings.
|
||||
* Fixed sthyi output format on s390.
|
||||
* Documented -X option in strace -h output.
|
||||
|
||||
Noteworthy changes in release 4.25 (2018-10-30)
|
||||
===============================================
|
||||
|
||||
* Improvements
|
||||
* Implemented decoding of KVM_CHECK_EXTENSION and NBD_* ioctl commands.
|
||||
* Implemented decoding of SOL_XDP socket option names.
|
||||
* Implemented decoding of AF_PACKET protocols in socket syscall.
|
||||
* Implemented decoding of AF_AX25 and AF_X25 addresses, protocols,
|
||||
and options.
|
||||
* Implemented stack trace printing on receiving signals.
|
||||
* Enhanced xlat styles support configured by -X option.
|
||||
* Enhanced decoding of IFLA_*, NETCONFA_*, and SMC_DIAG_* netlink attributes.
|
||||
* Wired up io_pgetevents syscall on arm, sparc, and sparc64.
|
||||
* Updated lists of AF_*, AUDIT_*, BPF_*, IFLA_*, IN_*, IPSTATS_*,
|
||||
IPV4_DEVCONF_*, NT_*, SCTP_*, SO_*, SOCK_*, SOL_*, and V4L2_* constants.
|
||||
* Updated lists of ioctl commands from Linux 4.19.
|
||||
|
||||
* Bug fixes
|
||||
* Fixed decoding of bit sets in evdev ioctl commands.
|
||||
* Fixed decoding of EVIOCGBIT(0, ...) ioctl commands.
|
||||
* Fixed test suite for the case when mlockall and unimplemented syscalls
|
||||
are explicitly disabled by a seccomp filter.
|
||||
|
||||
Noteworthy changes in release 4.24 (2018-08-14)
|
||||
===============================================
|
||||
|
||||
* Improvements
|
||||
* Implemented decoding of kvm vcpu exit reason (-e kvm=vcpu option),
|
||||
requires Linux kernel version 4.16.0 or higher.
|
||||
* Implemented decoding of KVM_SET_CPUID2 and KVM_GET_*_CPUID ioctl commands.
|
||||
* Enhanced decoding of corner cases of SO_LINGER, SO_PEERCRED,
|
||||
and PACKET_STATISTICS getsockopt options.
|
||||
* Wired up io_pgetevents and rseq syscalls on hppa, microblaze, mips, powerpc,
|
||||
and s390.
|
||||
* Updated lists of AUDIT_*, BPF_*, IFA_*, IFLA_*, RTA_*, RTPROT_*, TCP_*,
|
||||
TRAP_*, and UDP_* constants.
|
||||
* Updated lists of ioctl commands from Linux 4.18.
|
||||
|
||||
* Bug fixes
|
||||
* Fixed decoding of Q_XGETQSTAT on non-native personalities.
|
||||
* Fixed race condition in aio test.
|
||||
* Fixed build with Bionic libc.
|
||||
* Fixed build with glibc-2.28.
|
||||
* Fixed build in exotic systemd-nspawn based environments.
|
||||
* Fixed build on s390 with kernel headers that do not contain Linux commit
|
||||
v3.10-rc1~201^2~11.
|
||||
|
||||
Noteworthy changes in release 4.23 (2018-06-14)
|
||||
===============================================
|
||||
|
||||
* Changes in behaviour
|
||||
* On x32 personality, 64-bit syscalls (such as readv) are now shown with "#64"
|
||||
suffix instead of "64:" prefix. Unlike the old names, these new names
|
||||
can be used in syscall qualification expressions.
|
||||
* Changed error number output format: error numbers are consistently
|
||||
printed as "-1 ECONST (Error description)"
|
||||
for known errors and as "-1 (errno 123)" for unknown errors,
|
||||
regardless of -e raw qualification settings. One can specify
|
||||
-X raw for displaying raw error numbers unconditionally.
|
||||
* Unfetchable addresses inside arrays are now printed as comments.
|
||||
* Obsolete IA-32 mode syscall names are no longer printed on ia64.
|
||||
|
||||
* Improvements
|
||||
* Implemented libdw backend for -k option, configured at build time
|
||||
using --with-libdw option.
|
||||
Whether -k option is compiled is now configured at build time
|
||||
using --enable-stacktrace option.
|
||||
* Added -X option for configuring xlat output formatting (addresses
|
||||
Debian bug #692915).
|
||||
* Added support for personality designation ("64", "32", or "x32") to syscall
|
||||
qualifications in -e trace expressions.
|
||||
* Implemented injection of syscalls with no side effects as an alternative
|
||||
to injection of an invalid syscall (-e inject=SET:syscall= expression).
|
||||
* Improved support for reproducible builds (addresses Debian bug #896016).
|
||||
* Implemented decoding of BPF_PROG_QUERY and BPF_RAW_TRACEPOINT_OPEN bpf
|
||||
syscall commands.
|
||||
* Implemented decoding of INOTIFY_IOC_SETNEXTWD and PERF_EVENT_IOC_* ioctl
|
||||
commands.
|
||||
* Implemented decoding of PR_GET_SPECULATION_CTRL and PR_SET_SPECULATION_CTRL
|
||||
prctl syscall options.
|
||||
* Enhanced decoding of bpf, getsockopt, setsockopt, and socket syscalls.
|
||||
* Enhanced decoding of NETLINK_KOBJECT_UEVENT and NETLINK_ROUTE protocols.
|
||||
* Enhanced decoding of *_DIAG_MEMINFO netlink attributes.
|
||||
* Enhanced decoding of BTRFS_*, FS_IOC_*, SIOCGIFHWADDR, and SIOCSIFHWADDR
|
||||
ioctl commands.
|
||||
* Enhanced decoding of AF_BLUETOOTH socket addresses.
|
||||
* Implemented decoding of io_pgetevent syscall.
|
||||
* Wired up rseq syscall.
|
||||
* Updated lists of ADJ_*, BPF_*, BPF_F_*, BPF_PROG_TYPE_*, ETH_P_*, FPE_*,
|
||||
IFF_*, IPPROTO_*, MAP_*, MS_*, MSG_*, NETLINK_*, PACKET_*, PROT_*, SCTP_*,
|
||||
SECCOMP_FILTER_FLAG_*, SEGV_*, SEM_*, SHM_*, SW_*, V4L2_CID_*,
|
||||
V4L2_CTRL_CLASS_*, and V4L2_PIX_FMT_* constants.
|
||||
* Updated lists of ioctl commands from Linux 4.17.
|
||||
|
||||
* Bug fixes
|
||||
* Fixed decoding of msgtyp argument of msgrcv syscall.
|
||||
* Fixed fallback definitions for F_*, MCL_*, MSG_ZEROCOPY, SI_*,
|
||||
and SOL_SOCKET constants.
|
||||
* Fixed -e trace=%pure expression on mips.
|
||||
|
||||
Noteworthy changes in release 4.22 (2018-04-05)
|
||||
===============================================
|
||||
|
||||
* Changes in infrastructure
|
||||
* The mailing list was moved to strace-devel@lists.strace.io.
|
||||
* SourceForge git repository
|
||||
(https://sourceforge.net/p/strace/code/ci/master/tree/) is no longer
|
||||
maintained. Please use GitLab (https://gitlab.com/strace/strace/)
|
||||
or GitHub (https://github.com/strace/strace/) repository instead.
|
||||
|
||||
* Changes in behaviour
|
||||
* When printing string data, '8' and '9' following an octal escape sequence
|
||||
no longer lead to unabbreviated octal escape sequence output, as they used
|
||||
to do.
|
||||
* Angle brackets are now printed as octal number escape sequences
|
||||
in the output of paths associated with file descriptors.
|
||||
* Data dump for write syscalls (-e write) is performed regardless
|
||||
of successfulness of these syscall (addresses Debian bug #436284).
|
||||
* -r and -t options are now affect output independently. Previously,
|
||||
-r option led to ignoring of the -t option (addresses Debian bug #466195).
|
||||
|
||||
* Improvements
|
||||
* Implemented delay injection (-e inject=SET:delay_enter= and
|
||||
-e inject=SET:delay_exit= options).
|
||||
* Added -A option for opening output files in append mode
|
||||
(addresses Debian bug #528488).
|
||||
* IPv6 addresses shown in socket information in -yy mode are now printed
|
||||
in brackets.
|
||||
* Enhanced decoding of bpf, prctl and ptrace syscalls.
|
||||
* Enhanced decoding of BTRFS_IOC_INO_PATHS, BTRFS_IOC_LOGICAL_INO, and PTP_*
|
||||
ioctl commands.
|
||||
* Enhanced NETLINK_ROUTE protocol decoding.
|
||||
* Updated lists of signal codes.
|
||||
* Updated lists of BPF_*, BTN_*, ETH_P_*, INET_DIAG_BC_*, KEY_*, POLL*, RWF_*,
|
||||
SCHED_FLAG_*, SCTP_* and error constants.
|
||||
* Implemented block/character device number printing in -yy mode.
|
||||
* Known pixel/SDR format names are printed as comments for pixelformat fields
|
||||
in v4l2 structures.
|
||||
* Enhanced decoding of kern_features syscall.
|
||||
* Enhanced NETLINK_NETFILTER netlink protocol decoder.
|
||||
* Optimized handling of large number of tracees.
|
||||
* Improved wall clock time measurement in syscall count statistics
|
||||
(-c -w option).
|
||||
* Extended the range of allowed values in -e inject=...:retval= expression.
|
||||
* Added i18n support.
|
||||
* Updated lists of ioctl commands from Linux 4.16.
|
||||
* Enhanced manual page.
|
||||
|
||||
* Bug fixes
|
||||
* Fixed build on m68k.
|
||||
* Fixed v4l2 pixelformat decoding on big-endian architectures.
|
||||
* Fixed -O option.
|
||||
|
||||
Noteworthy changes in release 4.21 (2018-02-13)
|
||||
===============================================
|
||||
|
||||
* Changes in behaviour
|
||||
* Warning is now issued when -F option is used.
|
||||
* Warning is now issued when a tracee with unsupported personality
|
||||
is attached.
|
||||
* Unknown syscall numbers are now printed in hexadecimal form.
|
||||
|
||||
* Improvements
|
||||
* Implemented decoding of netlink descriptor attributes as file descriptors.
|
||||
* Implemented decoding of hugetlb page size selection flags.
|
||||
* Implemented decoding of BPF_PROG_TEST_RUN, BPF_PROG_GET_NEXT_ID,
|
||||
BPF_MAP_GET_NEXT_ID, BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID,
|
||||
and BPF_OBJ_GET_INFO_BY_FD commands of bpf syscall.
|
||||
* Enhanced decoding of get_thread_area, memfd_create, modify_ldt,
|
||||
perf_event_open, reboot, s390_guarded_storage, s390_pcio_mmio_read,
|
||||
s390_pci_mmio_write, s390_runtime_instr, s390_sthyi, set_thread_area,
|
||||
and shmget syscalls.
|
||||
* Implemented decoding of KVM_* and DM_LIST_DEVICES ioctl commands.
|
||||
* Implemented decoding of riscv_flush_icache syscall.
|
||||
* Enhanced decoding of getsockopt and setsockopt syscalls for SOL_NETLINK
|
||||
level.
|
||||
* Enhanced decoding of BPF_MAP_CREATE command of bpf syscall.
|
||||
* Print values returned by mq_open syscall and first arguments
|
||||
of mq_getsetattr, mq_notify, mq_timedreceive, and mq_timedsend syscalls
|
||||
as file descriptors.
|
||||
* Added decoding of get_tls syscall on arm.
|
||||
* Added -e trace=%pure option for tracing system calls with no arguments that
|
||||
never fail.
|
||||
* Updated lists of IPV6_*, MAP_*, MEMBARRIER_CMD_*, MSG_*, NT_*, PKEY_*,
|
||||
SHM_*, and TCP_* constants.
|
||||
* Added manual page for the strace-log-merge command.
|
||||
* Updated lists of ioctl commands from Linux 4.15.
|
||||
* Implemented biarch support for s390x.
|
||||
* Implemented an optional support for symbol demangling in strace -k output
|
||||
(activated by --with-libiberty configure option).
|
||||
* Information about availability of demangling and reliable personality
|
||||
decoding (on architectures with multiple personalities) is now available
|
||||
in strace -V output.
|
||||
* Added decoding of pkey_alloc, pkey_free, and pkey_mprotect syscalls on
|
||||
powerpc and powerpc64.
|
||||
* Enhanced manual page.
|
||||
|
||||
* Bug fixes
|
||||
* Fixed multi-personality support in cross builds.
|
||||
* Added mq_getsetattr, mq_notify, mq_open, mq_timedreceive, and mq_timedsend
|
||||
syscalls to %desc tracing set.
|
||||
* Fixed path tracing support for mmap syscalls with indirect arguments and
|
||||
for old select syscall.
|
||||
* Fixed decoding of arm-specific (__ARM_NR_*) syscalls.
|
||||
* Fixed open mode flags decoding.
|
||||
* Fixed corner cases in handling of strace -ff -ttt logs by strace-log-merge.
|
||||
* Error counts that exceed one billion are now printed correctly in call
|
||||
summary output.
|
||||
* Fixed call summary header for x32 personality.
|
||||
* Changes of tracee personalities are reported more reliably.
|
||||
* Fixed the case when strace attaches to a tracee being inside exec and its
|
||||
first syscall stop is syscall-exit-stop instead of syscall-enter-stop,
|
||||
which messed up all the syscall state tracking.
|
||||
* Fixed printing of higher 32 bits of the return value for x32 personality.
|
||||
|
||||
* Portability
|
||||
* A C compiler that supports "for" loop initial declarations is now required.
|
||||
* Inability to configure multiple personality support on architectures where
|
||||
multiple personalities are supported leads to configuration failure during
|
||||
build now. Use --enable-mpers=check to revert to the old behaviour.
|
||||
* Build-time requirement for the mpers support has been lowered from gawk 4
|
||||
to gawk 3.
|
||||
* Removed incomplete and non-functional support for the CRIS architecture.
|
||||
* Removed incomplete and unused support for IA-32 mode on the IA-64
|
||||
architecture.
|
||||
|
||||
Noteworthy changes in release 4.20 (2017-11-13)
|
||||
===============================================
|
||||
|
||||
* Improvements
|
||||
* Implemented decoding of NETLINK_NETFILTER netlink message types and flags.
|
||||
* Implemented decoding of SECCOMP_GET_ACTION_AVAIL operation of seccomp
|
||||
@ -283,7 +8,6 @@ Noteworthy changes in release 4.20 (2017-11-13)
|
||||
* Updated lists of ARPHRD_*, BPF_*, ETH_P_*, LOOP_*, MADV_*,
|
||||
MEMBARRIER_CMD_*, MFD_*, SECCOMP_*, SO_*, SOL_*, TCP_*, and UFFD_FEATURE_*
|
||||
constants.
|
||||
* Added decoding of statx syscall on hppa.
|
||||
* Updated lists of ioctl commands from Linux 4.14.
|
||||
|
||||
* Bug fixes
|
||||
|
24
README
Normal file
24
README
Normal file
@ -0,0 +1,24 @@
|
||||
This is strace, a system call tracer for Linux.
|
||||
|
||||
strace is released under a Berkeley-style license at the request
|
||||
of Paul Kranenburg.
|
||||
|
||||
See the file CREDITS for a list of authors and other contributors.
|
||||
See the file INSTALL for compilation and installation instructions.
|
||||
See the file NEWS for information on what has changed in recent versions.
|
||||
|
||||
The project's homepage is at
|
||||
https://strace.io
|
||||
|
||||
strace has a mailing list:
|
||||
strace-devel@lists.sourceforge.net.
|
||||
|
||||
System requirements:
|
||||
* Linux kernel >= 2.6.18 is recommended. Older versions might still work
|
||||
but they haven't been thoroughly tested with this release.
|
||||
* Linux kernel >= 2.5.46 is required.
|
||||
Older versions without a decent PTRACE_SETOPTIONS support will not work.
|
||||
* On mips, linux kernel >= 2.6.15 is required.
|
||||
Older versions without a decent PTRACE_GETREGS support will not work.
|
||||
* On s390 and s390x, linux kernel >= 2.6.27 is required.
|
||||
Older versions without a decent PTRACE_GETREGSET support will not work.
|
@ -1,11 +0,0 @@
|
||||
github/gitlab autogenerated archives are not supported
|
||||
======================================================
|
||||
|
||||
This information applies to bundles automatically generated
|
||||
by github and gitlab.
|
||||
|
||||
strace's program version is maintained using git-version-gen script, therefore,
|
||||
building strace depends on "git describe" (a full git clone is needed for this)
|
||||
or, alternatively, a .tarball-version file. Neither github nor gitlab can
|
||||
provide the latter, they also do not allow to inject a .tarball-version file
|
||||
during export archiving.
|
@ -1,7 +1,6 @@
|
||||
Requirements
|
||||
============
|
||||
If you use a GIT version of strace source code, please refer to
|
||||
INSTALL-git.md file for building and installation instructions.
|
||||
If you use the GIT version of strace, please refer to INSTALL-git.md file.
|
||||
|
||||
|
||||
No more ChangeLog file
|
||||
@ -14,28 +13,13 @@ the top-level ChangeLog file from logs at "make dist" time. As such,
|
||||
there are strict requirements on the form of the commit log messages.
|
||||
|
||||
|
||||
Commit requirements
|
||||
===================
|
||||
Each commit message should always start with a one-line summary, the second
|
||||
Commit log requirements
|
||||
=======================
|
||||
Each commit log should always start with a one-line summary, the second
|
||||
line should be blank, and the remaining lines are usually ChangeLog-style
|
||||
entries for all affected files, except the leading TABs which should
|
||||
be omitted.
|
||||
|
||||
Changes must not introduce whitespace errors in git sense (trailing
|
||||
whitespace, spaces before tabs, spaces for indentation, blank lines
|
||||
at the end of file), this can be checked with the following command:
|
||||
|
||||
git -c core.whitespace=space-before-tab,trailing-space diff-index \
|
||||
--check 4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
||||
|
||||
It is also preferred (but not required) that commit patches pass
|
||||
scripts/checkpatch.pl script from the Linux kernel[1], as currently established
|
||||
coding style quite closely resembles the one used in Linux kernel[2], with some
|
||||
exceptions.
|
||||
|
||||
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/scripts/checkpatch.pl
|
||||
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/process/coding-style.rst
|
||||
|
||||
|
||||
Documentation
|
||||
=============
|
||||
|
14
README.md
14
README.md
@ -3,22 +3,12 @@ strace - the linux syscall tracer
|
||||
|
||||
This is [strace](https://strace.io) -- a diagnostic, debugging and instructional userspace utility with a traditional command-line interface for Linux. It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as [ptrace](http://man7.org/linux/man-pages/man2/ptrace.2.html).
|
||||
|
||||
strace is released under the terms of [the GNU Lesser General Public License version 2.1 or later](LGPL-2.1-or-later); see the file [COPYING](COPYING) for details.
|
||||
strace test suite is released under the terms of [the GNU General Public License version 2 or later](tests/GPL-2.0-or-later); see the file [tests/COPYING](tests/COPYING) for details.
|
||||
strace is released under a Berkeley-style license at the request of Paul Kranenburg; see the file [COPYING](COPYING) for details.
|
||||
|
||||
See the file [NEWS](NEWS) for information on what has changed in recent versions.
|
||||
|
||||
Please read the file [INSTALL-git](INSTALL-git.md) for installation instructions.
|
||||
|
||||
Please take a look at [the guide for new contributors](https://strace.io/wiki/NewContributorGuide) if you want to get involved in strace development.
|
||||
|
||||
The user discussion and development of strace take place on [the strace mailing list](https://lists.strace.io/mailman/listinfo/strace-devel) -- everyone is welcome to post bug reports, feature requests, comments and patches to strace-devel@lists.strace.io. The mailing list archives are available at https://lists.strace.io/pipermail/strace-devel/ and other archival sites.
|
||||
|
||||
The GIT repository of strace is available at [GitHub](https://github.com/strace/strace/) and [GitLab](https://gitlab.com/strace/strace/).
|
||||
|
||||
The latest binary strace packages are available in many repositories, including
|
||||
[OBS](https://build.opensuse.org/package/show/home:ldv_alt/strace/),
|
||||
[Fedora rawhide](https://apps.fedoraproject.org/packages/strace), and
|
||||
[Sisyphus](https://packages.altlinux.org/en/Sisyphus/srpms/strace).
|
||||
The user discussion and development of strace take place on [the strace mailing list](https://lists.sourceforge.net/lists/listinfo/strace-devel) -- everyone is welcome to post bug reports, feature requests, comments and patches to strace-devel@lists.sourceforge.net. The mailing list archives are available at https://sourceforge.net/p/strace/mailman/strace-devel/ and other archival sites.
|
||||
|
||||
[](https://travis-ci.org/strace/strace) [](https://codecov.io/github/strace/strace?branch=master)
|
||||
|
7
access.c
7
access.c
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
|
24
affinity.c
24
affinity.c
@ -1,9 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2004 Roland McGrath <roland@redhat.com>
|
||||
* Copyright (c) 2009-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2009-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
89
aio.c
89
aio.c
@ -3,18 +3,36 @@
|
||||
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
|
||||
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
|
||||
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
|
||||
* Copyright (c) 1999-2018 The strace developers.
|
||||
* Copyright (c) 1999-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
#include "print_fields.h"
|
||||
#include <linux/aio_abi.h>
|
||||
|
||||
#include "xlat/aio_cmds.h"
|
||||
|
||||
SYS_FUNC(io_setup)
|
||||
{
|
||||
if (entering(tcp))
|
||||
@ -38,22 +56,28 @@ enum iocb_sub {
|
||||
static enum iocb_sub
|
||||
tprint_lio_opcode(unsigned int cmd)
|
||||
{
|
||||
static const enum iocb_sub subs[] = {
|
||||
[IOCB_CMD_PREAD] = SUB_COMMON,
|
||||
[IOCB_CMD_PWRITE] = SUB_COMMON,
|
||||
[IOCB_CMD_FSYNC] = SUB_NONE,
|
||||
[IOCB_CMD_FDSYNC] = SUB_NONE,
|
||||
[IOCB_CMD_PREADX] = SUB_NONE,
|
||||
[IOCB_CMD_POLL] = SUB_NONE,
|
||||
[IOCB_CMD_NOOP] = SUB_NONE,
|
||||
[IOCB_CMD_PREADV] = SUB_VECTOR,
|
||||
[IOCB_CMD_PWRITEV] = SUB_VECTOR,
|
||||
static const struct {
|
||||
const char *name;
|
||||
enum iocb_sub sub;
|
||||
} cmds[] = {
|
||||
{ "IOCB_CMD_PREAD", SUB_COMMON },
|
||||
{ "IOCB_CMD_PWRITE", SUB_COMMON },
|
||||
{ "IOCB_CMD_FSYNC", SUB_NONE },
|
||||
{ "IOCB_CMD_FDSYNC", SUB_NONE },
|
||||
{ "IOCB_CMD_PREADX", SUB_NONE },
|
||||
{ "IOCB_CMD_POLL", SUB_NONE },
|
||||
{ "IOCB_CMD_NOOP", SUB_NONE },
|
||||
{ "IOCB_CMD_PREADV", SUB_VECTOR },
|
||||
{ "IOCB_CMD_PWRITEV", SUB_VECTOR },
|
||||
};
|
||||
|
||||
printxval_indexn_ex(ARRSZ_PAIR(aio_cmds) - 1, cmd, "IOCB_CMD_???",
|
||||
XLAT_STYLE_FMT_U);
|
||||
|
||||
return cmd < ARRAY_SIZE(subs) ? subs[cmd] : SUB_NONE;
|
||||
if (cmd < ARRAY_SIZE(cmds)) {
|
||||
tprints(cmds[cmd].name);
|
||||
return cmds[cmd].sub;
|
||||
}
|
||||
tprintf("%u", cmd);
|
||||
tprints_comment("IOCB_CMD_???");
|
||||
return SUB_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -105,8 +129,6 @@ print_iocb_header(struct tcb *tcp, const struct iocb *cb)
|
||||
static void
|
||||
print_iocb(struct tcb *tcp, const struct iocb *cb)
|
||||
{
|
||||
tprints("{");
|
||||
|
||||
enum iocb_sub sub = print_iocb_header(tcp, cb);
|
||||
|
||||
switch (sub) {
|
||||
@ -138,8 +160,6 @@ print_iocb(struct tcb *tcp, const struct iocb *cb)
|
||||
case SUB_NONE:
|
||||
break;
|
||||
}
|
||||
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -154,8 +174,10 @@ print_iocbp(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
|
||||
addr = *(kernel_ulong_t *) elem_buf;
|
||||
}
|
||||
|
||||
tprints("{");
|
||||
if (!umove_or_printaddr(tcp, addr, &cb))
|
||||
print_iocb(tcp, &cb);
|
||||
tprints("}");
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -174,7 +196,7 @@ SYS_FUNC(io_submit)
|
||||
printaddr(addr);
|
||||
else
|
||||
print_array(tcp, addr, nr, &iocbp, current_wordsize,
|
||||
tfetch_mem, print_iocbp, 0);
|
||||
umoven_or_printaddr, print_iocbp, 0);
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
@ -216,8 +238,7 @@ SYS_FUNC(io_cancel)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
print_io_getevents(struct tcb *tcp, bool has_usig)
|
||||
SYS_FUNC(io_getevents)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printaddr(tcp->u_arg[0]);
|
||||
@ -227,30 +248,16 @@ print_io_getevents(struct tcb *tcp, bool has_usig)
|
||||
} else {
|
||||
struct io_event buf;
|
||||
print_array(tcp, tcp->u_arg[3], tcp->u_rval, &buf, sizeof(buf),
|
||||
tfetch_mem, print_io_event, 0);
|
||||
umoven_or_printaddr, print_io_event, 0);
|
||||
tprints(", ");
|
||||
/*
|
||||
* Since the timeout and usig parameters are read by the kernel
|
||||
* Since the timeout parameter is read by the kernel
|
||||
* on entering syscall, it has to be decoded the same way
|
||||
* whether the syscall has failed or not.
|
||||
*/
|
||||
temporarily_clear_syserror(tcp);
|
||||
print_timespec(tcp, tcp->u_arg[4]);
|
||||
if (has_usig) {
|
||||
tprints(", ");
|
||||
print_aio_sigset(tcp, tcp->u_arg[5]);
|
||||
}
|
||||
restore_cleared_syserror(tcp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYS_FUNC(io_getevents)
|
||||
{
|
||||
return print_io_getevents(tcp, false);
|
||||
}
|
||||
|
||||
SYS_FUNC(io_pgetevents)
|
||||
{
|
||||
return print_io_getevents(tcp, true);
|
||||
}
|
||||
|
27
alpha.c
27
alpha.c
@ -1,17 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2016-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#ifdef ALPHA
|
||||
|
||||
# include "xstring.h"
|
||||
|
||||
static int
|
||||
decode_getxxid(struct tcb *tcp, const char *what)
|
||||
{
|
||||
@ -23,7 +40,7 @@ decode_getxxid(struct tcb *tcp, const char *what)
|
||||
return 0;
|
||||
static const char const fmt[] = "%s %ld";
|
||||
static char outstr[sizeof(fmt) + 3 * sizeof(rval)];
|
||||
xsprintf(outstr, fmt, what, rval);
|
||||
snprintf(outstr, sizeof(outstr), fmt, what, rval);
|
||||
tcp->auxstr = outstr;
|
||||
return RVAL_STR;
|
||||
}
|
||||
|
15
arch_defs.h
15
arch_defs.h
@ -1,15 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
/* Architecture-specific definitions. */
|
||||
#ifndef STRACE_ARCH_DEFS_H
|
||||
# define STRACE_ARCH_DEFS_H
|
||||
|
||||
# include "arch_defs_.h"
|
||||
# include "linux/arch_defs_.h"
|
||||
|
||||
#endif /* !STRACE_ARCH_DEFS_H */
|
248
basic_filters.c
248
basic_filters.c
@ -1,88 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2016-2018 The strace developers.
|
||||
* Copyright (c) 2016-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#include <regex.h>
|
||||
|
||||
#include "filter.h"
|
||||
#include "number_set.h"
|
||||
#include "xstring.h"
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether a @-separated personality specification suffix is present.
|
||||
* Personality suffix is a one of strings stored in personality_designators
|
||||
* array.
|
||||
*
|
||||
* @param[in] s Specification string to check.
|
||||
* @param[out] p Where to store personality number if it is found.
|
||||
* @return If personality is found, the provided string is copied without
|
||||
* suffix and returned as a result (callee should de-alllocate it
|
||||
* with free() after use), and personality number is written to p.
|
||||
* Otherwise, NULL is returned and p is untouched.
|
||||
*/
|
||||
static char *
|
||||
qualify_syscall_separate_personality(const char *s, unsigned int *p)
|
||||
{
|
||||
char *pos = strchr(s, '@');
|
||||
|
||||
if (!pos)
|
||||
return NULL;
|
||||
|
||||
for (unsigned int i = 0; i < SUPPORTED_PERSONALITIES; i++) {
|
||||
if (!strcmp(pos + 1, personality_designators[i])) {
|
||||
*p = i;
|
||||
return xstrndup(s, pos - s);
|
||||
}
|
||||
}
|
||||
|
||||
error_msg_and_help("incorrect personality designator '%s'"
|
||||
" in qualification '%s'", pos + 1, s);
|
||||
}
|
||||
|
||||
static bool
|
||||
qualify_syscall_number_personality(int n, unsigned int p,
|
||||
struct number_set *set)
|
||||
{
|
||||
if ((unsigned int) n >= nsyscall_vec[p])
|
||||
return false;
|
||||
|
||||
add_number_to_set_array(n, set, p);
|
||||
|
||||
return true;
|
||||
}
|
||||
#include "filter.h"
|
||||
#include <regex.h>
|
||||
|
||||
static bool
|
||||
qualify_syscall_number(const char *s, struct number_set *set)
|
||||
{
|
||||
unsigned int p;
|
||||
char *num_str = qualify_syscall_separate_personality(s, &p);
|
||||
int n;
|
||||
|
||||
if (num_str) {
|
||||
n = string_to_uint(num_str);
|
||||
free(num_str);
|
||||
|
||||
if (n < 0)
|
||||
return false;
|
||||
|
||||
return qualify_syscall_number_personality(n, p, set);
|
||||
}
|
||||
|
||||
n = string_to_uint(s);
|
||||
int n = string_to_uint(s);
|
||||
if (n < 0)
|
||||
return false;
|
||||
|
||||
unsigned int p;
|
||||
bool done = false;
|
||||
|
||||
for (p = 0; p < SUPPORTED_PERSONALITIES; ++p)
|
||||
done |= qualify_syscall_number_personality(n, p, set);
|
||||
for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
|
||||
if ((unsigned) n >= nsyscall_vec[p]) {
|
||||
continue;
|
||||
}
|
||||
add_number_to_set_array(n, set, p);
|
||||
done = true;
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
@ -106,32 +71,20 @@ qualify_syscall_regex(const char *s, struct number_set *set)
|
||||
if ((rc = regcomp(&preg, s, REG_EXTENDED | REG_NOSUB)) != 0)
|
||||
regerror_msg_and_die(rc, &preg, "regcomp", s);
|
||||
|
||||
unsigned int p;
|
||||
bool found = false;
|
||||
for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
|
||||
unsigned int i;
|
||||
|
||||
for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
|
||||
for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
|
||||
for (i = 0; i < nsyscall_vec[p]; ++i) {
|
||||
if (!sysent_vec[p][i].sys_name)
|
||||
continue;
|
||||
|
||||
rc = regexec(&preg, sysent_vec[p][i].sys_name,
|
||||
0, NULL, 0);
|
||||
|
||||
if (rc == REG_NOMATCH) {
|
||||
char name_buf[128];
|
||||
char *pos = stpcpy(name_buf,
|
||||
sysent_vec[p][i].sys_name);
|
||||
|
||||
(void) xappendstr(name_buf, pos, "@%s",
|
||||
personality_designators[p]);
|
||||
|
||||
rc = regexec(&preg, name_buf, 0, NULL, 0);
|
||||
}
|
||||
|
||||
if (rc == REG_NOMATCH)
|
||||
continue;
|
||||
else if (rc)
|
||||
regerror_msg_and_die(rc, &preg, "regexec", s);
|
||||
|
||||
add_number_to_set_array(i, set, p);
|
||||
found = true;
|
||||
}
|
||||
@ -148,13 +101,19 @@ lookup_class(const char *s)
|
||||
const char *name;
|
||||
unsigned int value;
|
||||
} syscall_class[] = {
|
||||
{ "desc", TRACE_DESC },
|
||||
{ "file", TRACE_FILE },
|
||||
{ "memory", TRACE_MEMORY },
|
||||
{ "process", TRACE_PROCESS },
|
||||
{ "signal", TRACE_SIGNAL },
|
||||
{ "ipc", TRACE_IPC },
|
||||
{ "network", TRACE_NETWORK },
|
||||
{ "%desc", TRACE_DESC },
|
||||
{ "%file", TRACE_FILE },
|
||||
{ "%memory", TRACE_MEMORY },
|
||||
{ "%process", TRACE_PROCESS },
|
||||
{ "%signal", TRACE_SIGNAL },
|
||||
{ "%ipc", TRACE_IPC },
|
||||
{ "%net", TRACE_NETWORK },
|
||||
{ "%network", TRACE_NETWORK },
|
||||
{ "%stat", TRACE_STAT },
|
||||
{ "%lstat", TRACE_LSTAT },
|
||||
@ -163,20 +122,13 @@ lookup_class(const char *s)
|
||||
{ "%statfs", TRACE_STATFS },
|
||||
{ "%fstatfs", TRACE_FSTATFS },
|
||||
{ "%%statfs", TRACE_STATFS_LIKE },
|
||||
{ "%pure", TRACE_PURE },
|
||||
/* legacy class names */
|
||||
{ "desc", TRACE_DESC },
|
||||
{ "file", TRACE_FILE },
|
||||
{ "memory", TRACE_MEMORY },
|
||||
{ "process", TRACE_PROCESS },
|
||||
{ "signal", TRACE_SIGNAL },
|
||||
{ "ipc", TRACE_IPC },
|
||||
{ "network", TRACE_NETWORK },
|
||||
};
|
||||
|
||||
for (unsigned int i = 0; i < ARRAY_SIZE(syscall_class); ++i) {
|
||||
if (strcmp(s, syscall_class[i].name) == 0)
|
||||
unsigned int i;
|
||||
for (i = 0; i < ARRAY_SIZE(syscall_class); ++i) {
|
||||
if (strcmp(s, syscall_class[i].name) == 0) {
|
||||
return syscall_class[i].value;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -189,64 +141,41 @@ qualify_syscall_class(const char *s, struct number_set *set)
|
||||
if (!n)
|
||||
return false;
|
||||
|
||||
for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
|
||||
for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
|
||||
if (sysent_vec[p][i].sys_name &&
|
||||
(sysent_vec[p][i].sys_flags & n) == n)
|
||||
add_number_to_set_array(i, set, p);
|
||||
unsigned int p;
|
||||
for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < nsyscall_vec[p]; ++i) {
|
||||
if (!sysent_vec[p][i].sys_name
|
||||
|| (sysent_vec[p][i].sys_flags & n) != n) {
|
||||
continue;
|
||||
}
|
||||
add_number_to_set_array(i, set, p);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
kernel_long_t
|
||||
scno_by_name(const char *s, unsigned int p, kernel_long_t start)
|
||||
{
|
||||
if (p >= SUPPORTED_PERSONALITIES)
|
||||
return -1;
|
||||
|
||||
for (kernel_ulong_t i = start; i < nsyscall_vec[p]; ++i) {
|
||||
if (sysent_vec[p][i].sys_name &&
|
||||
strcmp(s, sysent_vec[p][i].sys_name) == 0)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static bool
|
||||
qualify_syscall_name_personality(const char *s, unsigned int p,
|
||||
struct number_set *set)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
for (kernel_long_t scno = 0; (scno = scno_by_name(s, p, scno)) >= 0;
|
||||
++scno) {
|
||||
add_number_to_set_array(scno, set, p);
|
||||
found = true;
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
static bool
|
||||
qualify_syscall_name(const char *s, struct number_set *set)
|
||||
{
|
||||
unsigned int p;
|
||||
char *name_str = qualify_syscall_separate_personality(s, &p);
|
||||
bool found = false;
|
||||
|
||||
if (name_str) {
|
||||
found = qualify_syscall_name_personality(name_str, p, set);
|
||||
free(name_str);
|
||||
for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
|
||||
unsigned int i;
|
||||
|
||||
return found;
|
||||
for (i = 0; i < nsyscall_vec[p]; ++i) {
|
||||
if (!sysent_vec[p][i].sys_name
|
||||
|| strcmp(s, sysent_vec[p][i].sys_name)) {
|
||||
continue;
|
||||
}
|
||||
add_number_to_set_array(i, set, p);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (p = 0; p < SUPPORTED_PERSONALITIES; ++p)
|
||||
found |= qualify_syscall_name_personality(s, p, set);
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
@ -273,7 +202,8 @@ qualify_syscall(const char *token, struct number_set *set)
|
||||
* according to STR specification.
|
||||
*/
|
||||
void
|
||||
qualify_syscall_tokens(const char *const str, struct number_set *const set)
|
||||
qualify_syscall_tokens(const char *const str, struct number_set *const set,
|
||||
const char *const name)
|
||||
{
|
||||
/* Clear all sets. */
|
||||
clear_number_set_array(set, SUPPORTED_PERSONALITIES);
|
||||
@ -283,6 +213,7 @@ qualify_syscall_tokens(const char *const str, struct number_set *const set)
|
||||
* of the remaining specification.
|
||||
*/
|
||||
const char *s = str;
|
||||
handle_inversion:
|
||||
while (*s == '!') {
|
||||
invert_number_set_array(set, SUPPORTED_PERSONALITIES);
|
||||
++s;
|
||||
@ -296,9 +227,8 @@ qualify_syscall_tokens(const char *const str, struct number_set *const set)
|
||||
*/
|
||||
return;
|
||||
} else if (strcmp(s, "all") == 0) {
|
||||
/* "all" == "!none" */
|
||||
invert_number_set_array(set, SUPPORTED_PERSONALITIES);
|
||||
return;
|
||||
s = "!none";
|
||||
goto handle_inversion;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -310,19 +240,22 @@ qualify_syscall_tokens(const char *const str, struct number_set *const set)
|
||||
*/
|
||||
char *copy = xstrdup(s);
|
||||
char *saveptr = NULL;
|
||||
const char *token;
|
||||
bool done = false;
|
||||
|
||||
for (const char *token = strtok_r(copy, ",", &saveptr);
|
||||
token; token = strtok_r(NULL, ",", &saveptr)) {
|
||||
for (token = strtok_r(copy, ",", &saveptr); token;
|
||||
token = strtok_r(NULL, ",", &saveptr)) {
|
||||
done = qualify_syscall(token, set);
|
||||
if (!done)
|
||||
error_msg_and_die("invalid system call '%s'", token);
|
||||
if (!done) {
|
||||
error_msg_and_die("invalid %s '%s'", name, token);
|
||||
}
|
||||
}
|
||||
|
||||
free(copy);
|
||||
|
||||
if (!done)
|
||||
error_msg_and_die("invalid system call '%s'", str);
|
||||
if (!done) {
|
||||
error_msg_and_die("invalid %s '%s'", name, str);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -340,6 +273,7 @@ qualify_tokens(const char *const str, struct number_set *const set,
|
||||
* of the remaining specification.
|
||||
*/
|
||||
const char *s = str;
|
||||
handle_inversion:
|
||||
while (*s == '!') {
|
||||
invert_number_set_array(set, 1);
|
||||
++s;
|
||||
@ -353,9 +287,8 @@ qualify_tokens(const char *const str, struct number_set *const set,
|
||||
*/
|
||||
return;
|
||||
} else if (strcmp(s, "all") == 0) {
|
||||
/* "all" == "!none" */
|
||||
invert_number_set_array(set, 1);
|
||||
return;
|
||||
s = "!none";
|
||||
goto handle_inversion;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -367,19 +300,22 @@ qualify_tokens(const char *const str, struct number_set *const set,
|
||||
*/
|
||||
char *copy = xstrdup(s);
|
||||
char *saveptr = NULL;
|
||||
const char *token;
|
||||
int number = -1;
|
||||
|
||||
for (const char *token = strtok_r(copy, ",", &saveptr);
|
||||
token; token = strtok_r(NULL, ",", &saveptr)) {
|
||||
for (token = strtok_r(copy, ",", &saveptr); token;
|
||||
token = strtok_r(NULL, ",", &saveptr)) {
|
||||
number = func(token);
|
||||
if (number < 0)
|
||||
if (number < 0) {
|
||||
error_msg_and_die("invalid %s '%s'", name, token);
|
||||
}
|
||||
|
||||
add_number_to_set(number, set);
|
||||
}
|
||||
|
||||
free(copy);
|
||||
|
||||
if (number < 0)
|
||||
if (number < 0) {
|
||||
error_msg_and_die("invalid %s '%s'", name, str);
|
||||
}
|
||||
}
|
||||
|
24
bind.c
24
bind.c
@ -3,10 +3,30 @@
|
||||
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
|
||||
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
|
||||
* Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
|
||||
* Copyright (c) 1999-2018 The strace developers.
|
||||
* Copyright (c) 1999-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
24
bjm.c
24
bjm.c
@ -3,10 +3,30 @@
|
||||
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
|
||||
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
|
||||
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
|
||||
* Copyright (c) 1999-2018 The strace developers.
|
||||
* Copyright (c) 1999-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
85
block.c
85
block.c
@ -1,10 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010 Jeff Mahoney <jeffm@suse.com>
|
||||
* Copyright (c) 2011-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2011-2018 The strace developers.
|
||||
* Copyright (c) 2011-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -45,15 +65,60 @@ typedef struct blk_user_trace_setup {
|
||||
uint32_t pid;
|
||||
} struct_blk_user_trace_setup;
|
||||
|
||||
/* Provide fall-back definitions for BLK* ioctls */
|
||||
#define XLAT_MACROS_ONLY
|
||||
#include "xlat/block_ioctl_cmds.h"
|
||||
#undef XLAT_MACROS_ONLY
|
||||
|
||||
#include MPERS_DEFS
|
||||
|
||||
#include "print_fields.h"
|
||||
|
||||
#ifndef BLKPG
|
||||
# define BLKPG _IO(0x12, 105)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ioctl numbers <= 114 are present in Linux 2.4. The following ones have been
|
||||
* added since then and headers containing them may not be available on every
|
||||
* system.
|
||||
*/
|
||||
|
||||
#ifndef BLKTRACESETUP
|
||||
# define BLKTRACESETUP _IOWR(0x12, 115, struct_blk_user_trace_setup)
|
||||
#endif
|
||||
#ifndef BLKTRACESTART
|
||||
# define BLKTRACESTART _IO(0x12, 116)
|
||||
#endif
|
||||
#ifndef BLKTRACESTOP
|
||||
# define BLKTRACESTOP _IO(0x12, 117)
|
||||
#endif
|
||||
#ifndef BLKTRACETEARDOWN
|
||||
# define BLKTRACETEARDOWN _IO(0x12, 118)
|
||||
#endif
|
||||
#ifndef BLKDISCARD
|
||||
# define BLKDISCARD _IO(0x12, 119)
|
||||
#endif
|
||||
#ifndef BLKIOMIN
|
||||
# define BLKIOMIN _IO(0x12, 120)
|
||||
#endif
|
||||
#ifndef BLKIOOPT
|
||||
# define BLKIOOPT _IO(0x12, 121)
|
||||
#endif
|
||||
#ifndef BLKALIGNOFF
|
||||
# define BLKALIGNOFF _IO(0x12, 122)
|
||||
#endif
|
||||
#ifndef BLKPBSZGET
|
||||
# define BLKPBSZGET _IO(0x12, 123)
|
||||
#endif
|
||||
#ifndef BLKDISCARDZEROES
|
||||
# define BLKDISCARDZEROES _IO(0x12, 124)
|
||||
#endif
|
||||
#ifndef BLKSECDISCARD
|
||||
# define BLKSECDISCARD _IO(0x12, 125)
|
||||
#endif
|
||||
#ifndef BLKROTATIONAL
|
||||
# define BLKROTATIONAL _IO(0x12, 126)
|
||||
#endif
|
||||
#ifndef BLKZEROOUT
|
||||
# define BLKZEROOUT _IO(0x12, 127)
|
||||
#endif
|
||||
|
||||
#include "xlat/blkpg_ops.h"
|
||||
|
||||
static void
|
||||
@ -103,7 +168,7 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
|
||||
case BLKALIGNOFF:
|
||||
if (entering(tcp))
|
||||
return 0;
|
||||
ATTRIBUTE_FALLTHROUGH;
|
||||
/* fall through */
|
||||
/* take a signed int */
|
||||
case BLKROSET:
|
||||
case BLKBSZSET:
|
||||
@ -116,8 +181,6 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
|
||||
case BLKIOMIN:
|
||||
case BLKIOOPT:
|
||||
case BLKDISCARDZEROES:
|
||||
case BLKGETZONESZ:
|
||||
case BLKGETNRZONES:
|
||||
if (entering(tcp))
|
||||
return 0;
|
||||
tprints(", ");
|
||||
@ -141,6 +204,7 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
|
||||
printnum_ulong(tcp, arg);
|
||||
break;
|
||||
|
||||
#ifdef HAVE_BLKGETSIZE64
|
||||
/* returns an uint64_t */
|
||||
case BLKGETSIZE64:
|
||||
if (entering(tcp))
|
||||
@ -148,6 +212,7 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
|
||||
tprints(", ");
|
||||
printnum_int64(tcp, arg, "%" PRIu64);
|
||||
break;
|
||||
#endif
|
||||
|
||||
/* takes a pair of uint64_t */
|
||||
case BLKDISCARD:
|
||||
|
17
bootstrap
17
bootstrap
@ -1,11 +1,5 @@
|
||||
#!/bin/sh -eu
|
||||
#
|
||||
# Copyright (c) 2014-2018 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
./m4/gen_bpf_attr_m4.sh
|
||||
./generate_mpers_am.sh
|
||||
./xlat/gen.sh
|
||||
./tests/gen_pure_executables.sh
|
||||
@ -16,12 +10,9 @@ for m in m32 mx32; do
|
||||
rm -rf $tests
|
||||
mkdir $tests
|
||||
s='[[:space:]]*'
|
||||
[ "$m" = m32 ] && k="s/^\\(SIZEOF_KERNEL_LONG_T$s=\\).*/\\1 4/;" || k=
|
||||
sed "s/@arch@/@arch_$m@/;
|
||||
s/^\\(SIZEOF_LONG$s=\\).*/\\1 4/; $k
|
||||
s/^MPERS_NAME$s=.*/& $m/;
|
||||
s/^MPERS_CC_FLAGS$s=.*/& @cc_flags_$m@/;
|
||||
s/^ARCH_MFLAGS$s=.*/& -DMPERS_IS_\$(MPERS_NAME) \$(MPERS_CC_FLAGS)/" \
|
||||
s/^ARCH_MFLAGS$s=.*/& -DMPERS_IS_\$(MPERS_NAME) -$m/" \
|
||||
tests/Makefile.am > $tests/Makefile.am
|
||||
for f in tests/*; do
|
||||
case "${f##*/}" in
|
||||
@ -31,8 +22,4 @@ for m in m32 mx32; do
|
||||
done
|
||||
done
|
||||
|
||||
for f in README INSTALL; do
|
||||
cp "dist/$f" .
|
||||
done
|
||||
|
||||
autoreconf -f -i "$@"
|
||||
exec autoreconf -f -i "$@"
|
||||
|
785
bpf.c
785
bpf.c
@ -1,10 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2017 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2017 Quentin Monnet <quentin.monnet@6wind.com>
|
||||
* Copyright (c) 2015-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -13,12 +32,8 @@
|
||||
#ifdef HAVE_LINUX_BPF_H
|
||||
# include <linux/bpf.h>
|
||||
#endif
|
||||
#include <linux/filter.h>
|
||||
|
||||
#include "bpf_attr.h"
|
||||
|
||||
#include "xlat/bpf_commands.h"
|
||||
#include "xlat/bpf_file_mode_flags.h"
|
||||
#include "xlat/bpf_map_types.h"
|
||||
#include "xlat/bpf_map_flags.h"
|
||||
#include "xlat/bpf_prog_types.h"
|
||||
@ -26,9 +41,6 @@
|
||||
#include "xlat/bpf_map_update_elem_flags.h"
|
||||
#include "xlat/bpf_attach_type.h"
|
||||
#include "xlat/bpf_attach_flags.h"
|
||||
#include "xlat/bpf_query_flags.h"
|
||||
#include "xlat/ebpf_regs.h"
|
||||
#include "xlat/numa_node.h"
|
||||
|
||||
#define DECL_BPF_CMD_DECODER(bpf_cmd_decoder) \
|
||||
int \
|
||||
@ -38,38 +50,14 @@ bpf_cmd_decoder(struct tcb *const tcp, \
|
||||
void *const data) \
|
||||
/* End of DECL_BPF_CMD_DECODER definition. */
|
||||
|
||||
#define BEGIN_BPF_CMD_DECODER(bpf_cmd) \
|
||||
static DECL_BPF_CMD_DECODER(decode_ ## bpf_cmd) \
|
||||
{ \
|
||||
struct bpf_cmd ## _struct attr = {}; \
|
||||
const size_t attr_size = bpf_cmd ## _struct_size; \
|
||||
const unsigned int len = MIN(size, attr_size); \
|
||||
memcpy(&attr, data, len); \
|
||||
do { \
|
||||
/* End of BEGIN_BPF_CMD_DECODER definition. */
|
||||
|
||||
#define END_BPF_CMD_DECODER(rval) \
|
||||
decode_attr_extra_data(tcp, data, size, attr_size); \
|
||||
} while (0); \
|
||||
tprints("}"); \
|
||||
return (rval); \
|
||||
} \
|
||||
/* End of END_BPF_CMD_DECODER definition. */
|
||||
#define DEF_BPF_CMD_DECODER(bpf_cmd) \
|
||||
static DECL_BPF_CMD_DECODER(decode_ ## bpf_cmd)
|
||||
|
||||
#define BPF_CMD_ENTRY(bpf_cmd) \
|
||||
[bpf_cmd] = decode_ ## bpf_cmd
|
||||
|
||||
typedef DECL_BPF_CMD_DECODER((*bpf_cmd_decoder_t));
|
||||
|
||||
/*
|
||||
* A note about bpf syscall decoder: it doesn't perform any size sanity checks,
|
||||
* so even if it leads to partial copying of one of the fields, the command
|
||||
* handler will still use the (partially-copied-from-userspace, partially
|
||||
* zeroed) field value. That's why we stop decoding and check for known sizes
|
||||
* that correspond to released versions of the structure used by the specific
|
||||
* command - it looks like the most sensible way to parse this insanity.
|
||||
*/
|
||||
|
||||
static int
|
||||
decode_attr_extra_data(struct tcb *const tcp,
|
||||
const char *data,
|
||||
@ -86,14 +74,11 @@ decode_attr_extra_data(struct tcb *const tcp,
|
||||
for (i = 0; i < size; ++i) {
|
||||
if (data[i]) {
|
||||
tprints(", ");
|
||||
if (abbrev(tcp)) {
|
||||
if (abbrev(tcp))
|
||||
tprints("...");
|
||||
} else {
|
||||
tprintf("/* bytes %zu..%zu */ ",
|
||||
attr_size, attr_size + size - 1);
|
||||
else
|
||||
print_quoted_string(data, size,
|
||||
QUOTE_FORCE_HEX);
|
||||
}
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
}
|
||||
@ -101,588 +86,197 @@ decode_attr_extra_data(struct tcb *const tcp,
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct ebpf_insn {
|
||||
uint8_t code;
|
||||
uint8_t dst_reg:4;
|
||||
uint8_t src_reg:4;
|
||||
int16_t off;
|
||||
int32_t imm;
|
||||
};
|
||||
|
||||
struct ebpf_insns_data {
|
||||
unsigned int count;
|
||||
};
|
||||
|
||||
static bool
|
||||
print_ebpf_insn(struct tcb * const tcp, void * const elem_buf,
|
||||
const size_t elem_size, void * const data)
|
||||
DEF_BPF_CMD_DECODER(BPF_MAP_CREATE)
|
||||
{
|
||||
struct ebpf_insns_data *eid = data;
|
||||
struct ebpf_insn *insn = elem_buf;
|
||||
struct {
|
||||
uint32_t map_type, key_size, value_size, max_entries,
|
||||
map_flags, inner_map_fd;
|
||||
} attr = {};
|
||||
const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
|
||||
|
||||
if (eid->count++ >= BPF_MAXINSNS) {
|
||||
tprints("...");
|
||||
return false;
|
||||
}
|
||||
memcpy(&attr, data, len);
|
||||
|
||||
tprints("{code=");
|
||||
print_bpf_filter_code(insn->code, true);
|
||||
|
||||
/* We can't use PRINT_FIELD_XVAL on bit fields */
|
||||
tprints(", dst_reg=");
|
||||
printxval_index(ebpf_regs, insn->dst_reg, "BPF_REG_???");
|
||||
tprints(", src_reg=");
|
||||
printxval_index(ebpf_regs, insn->src_reg, "BPF_REG_???");
|
||||
|
||||
PRINT_FIELD_D(", ", *insn, off);
|
||||
PRINT_FIELD_X(", ", *insn, imm);
|
||||
tprints("}");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
print_ebpf_prog(struct tcb *const tcp, const uint64_t addr, const uint32_t len)
|
||||
{
|
||||
print_big_u64_addr(addr);
|
||||
if (abbrev(tcp)) {
|
||||
printaddr(addr);
|
||||
} else {
|
||||
struct ebpf_insns_data eid = {};
|
||||
struct ebpf_insn insn;
|
||||
|
||||
print_array(tcp, addr, len, &insn, sizeof(insn),
|
||||
tfetch_mem, print_ebpf_insn, &eid);
|
||||
}
|
||||
}
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)
|
||||
{
|
||||
PRINT_FIELD_XVAL_INDEX("{", attr, map_type, bpf_map_types,
|
||||
"BPF_MAP_TYPE_???");
|
||||
PRINT_FIELD_XVAL("{", attr, map_type, bpf_map_types,
|
||||
"BPF_MAP_TYPE_???");
|
||||
PRINT_FIELD_U(", ", attr, key_size);
|
||||
PRINT_FIELD_U(", ", attr, value_size);
|
||||
PRINT_FIELD_U(", ", attr, max_entries);
|
||||
|
||||
/* map_flags field was added in Linux commit v4.6-rc1~91^2~108^2~6. */
|
||||
if (len <= offsetof(struct BPF_MAP_CREATE_struct, map_flags))
|
||||
break;
|
||||
PRINT_FIELD_FLAGS(", ", attr, map_flags, bpf_map_flags, "BPF_F_???");
|
||||
|
||||
/*
|
||||
* inner_map_fd field was added in Linux commit
|
||||
* v4.12-rc1~64^3~373^2~2.
|
||||
*/
|
||||
if (len <= offsetof(struct BPF_MAP_CREATE_struct, inner_map_fd))
|
||||
break;
|
||||
PRINT_FIELD_FD(", ", attr, inner_map_fd, tcp);
|
||||
decode_attr_extra_data(tcp, data, size, sizeof(attr));
|
||||
tprints("}");
|
||||
|
||||
/* numa_node field was added in Linux commit v4.14-rc1~130^2~196^2~1. */
|
||||
if (len <= offsetof(struct BPF_MAP_CREATE_struct, numa_node))
|
||||
break;
|
||||
if (attr.map_flags & BPF_F_NUMA_NODE) {
|
||||
/*
|
||||
* Kernel uses the value of -1 as a designation for "no NUMA
|
||||
* node specified", and even uses NUMA_NO_NODE constant;
|
||||
* however, the constant definition is not a part of UAPI
|
||||
* headers, thus we can't simply print this named constant
|
||||
* instead of the value. Let's force verbose xlat style instead
|
||||
* in order to provide the information for the user while
|
||||
* not hampering the availability to derive the actual value
|
||||
* without the access to the kernel headers.
|
||||
*/
|
||||
tprints(", numa_node=");
|
||||
printxvals_ex(attr.numa_node, NULL,
|
||||
XLAT_STYLE_FMT_U | XLAT_STYLE_VERBOSE,
|
||||
numa_node, NULL);
|
||||
}
|
||||
|
||||
/* map_name field was added in Linux commit v4.15-rc1~84^2~605^2~3. */
|
||||
if (len <= offsetof(struct BPF_MAP_CREATE_struct, map_name))
|
||||
break;
|
||||
PRINT_FIELD_CSTRING_SZ(", ", attr, map_name,
|
||||
MIN(sizeof(attr.map_name),
|
||||
len - offsetof(struct BPF_MAP_CREATE_struct,
|
||||
map_name)));
|
||||
|
||||
/*
|
||||
* map_ifindex field was added in Linux commit
|
||||
* v4.16-rc1~123^2~145^2~5^2~8.
|
||||
*/
|
||||
if (len <= offsetof(struct BPF_MAP_CREATE_struct, map_ifindex))
|
||||
break;
|
||||
PRINT_FIELD_IFINDEX(", ", attr, map_ifindex);
|
||||
return RVAL_DECODED | RVAL_FD;
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM)
|
||||
DEF_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM)
|
||||
{
|
||||
struct bpf_io_elem_struct {
|
||||
uint32_t map_fd;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) key, value;
|
||||
} attr = {};
|
||||
|
||||
const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
|
||||
|
||||
memcpy(&attr, data, len);
|
||||
|
||||
PRINT_FIELD_FD("{", attr, map_fd, tcp);
|
||||
PRINT_FIELD_ADDR64(", ", attr, key);
|
||||
PRINT_FIELD_ADDR64(", ", attr, value);
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
PRINT_FIELD_X(", ", attr, key);
|
||||
PRINT_FIELD_X(", ", attr, value);
|
||||
decode_attr_extra_data(tcp, data, size, sizeof(attr));
|
||||
tprints("}");
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_ELEM)
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
DEF_BPF_CMD_DECODER(BPF_MAP_UPDATE_ELEM)
|
||||
{
|
||||
struct {
|
||||
uint32_t map_fd;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) key;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) value;
|
||||
uint64_t flags;
|
||||
} attr = {};
|
||||
const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
|
||||
|
||||
memcpy(&attr, data, len);
|
||||
|
||||
PRINT_FIELD_FD("{", attr, map_fd, tcp);
|
||||
PRINT_FIELD_ADDR64(", ", attr, key);
|
||||
PRINT_FIELD_ADDR64(", ", attr, value);
|
||||
PRINT_FIELD_XVAL_INDEX(", ", attr, flags, bpf_map_update_elem_flags,
|
||||
"BPF_???");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
PRINT_FIELD_X(", ", attr, key);
|
||||
PRINT_FIELD_X(", ", attr, value);
|
||||
PRINT_FIELD_XVAL(", ", attr, flags, bpf_map_update_elem_flags,
|
||||
"BPF_???");
|
||||
decode_attr_extra_data(tcp, data, size, sizeof(attr));
|
||||
tprints("}");
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_MAP_DELETE_ELEM)
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
DEF_BPF_CMD_DECODER(BPF_MAP_DELETE_ELEM)
|
||||
{
|
||||
struct {
|
||||
uint32_t map_fd;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) key;
|
||||
} attr = {};
|
||||
const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
|
||||
|
||||
memcpy(&attr, data, len);
|
||||
|
||||
PRINT_FIELD_FD("{", attr, map_fd, tcp);
|
||||
PRINT_FIELD_ADDR64(", ", attr, key);
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
PRINT_FIELD_X(", ", attr, key);
|
||||
decode_attr_extra_data(tcp, data, size, sizeof(attr));
|
||||
tprints("}");
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_NEXT_KEY)
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
DEF_BPF_CMD_DECODER(BPF_MAP_GET_NEXT_KEY)
|
||||
{
|
||||
struct bpf_io_elem_struct {
|
||||
uint32_t map_fd;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) key, next_key;
|
||||
} attr = {};
|
||||
|
||||
const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
|
||||
|
||||
memcpy(&attr, data, len);
|
||||
|
||||
PRINT_FIELD_FD("{", attr, map_fd, tcp);
|
||||
PRINT_FIELD_ADDR64(", ", attr, key);
|
||||
PRINT_FIELD_ADDR64(", ", attr, next_key);
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
PRINT_FIELD_X(", ", attr, key);
|
||||
PRINT_FIELD_X(", ", attr, next_key);
|
||||
decode_attr_extra_data(tcp, data, size, sizeof(attr));
|
||||
tprints("}");
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)
|
||||
{
|
||||
PRINT_FIELD_XVAL_INDEX("{", attr, prog_type, bpf_prog_types,
|
||||
"BPF_PROG_TYPE_???");
|
||||
struct bpf_prog_load {
|
||||
uint32_t prog_type, insn_cnt;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) insns, license;
|
||||
uint32_t log_level, log_size;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) log_buf;
|
||||
uint32_t kern_version, prog_flags;
|
||||
} attr = {};
|
||||
const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
|
||||
|
||||
memcpy(&attr, data, len);
|
||||
|
||||
PRINT_FIELD_XVAL("{", attr, prog_type, bpf_prog_types,
|
||||
"BPF_PROG_TYPE_???");
|
||||
PRINT_FIELD_U(", ", attr, insn_cnt);
|
||||
tprints(", insns=");
|
||||
print_ebpf_prog(tcp, attr.insns, attr.insn_cnt);
|
||||
|
||||
tprintf(", license=");
|
||||
print_big_u64_addr(attr.license);
|
||||
printstr(tcp, attr.license);
|
||||
|
||||
/* log_* fields were added in Linux commit v3.18-rc1~52^2~1^2~4. */
|
||||
if (len <= offsetof(struct BPF_PROG_LOAD_struct, log_level))
|
||||
break;
|
||||
PRINT_FIELD_X(", ", attr, insns);
|
||||
PRINT_FIELD_STR(", ", attr, license, tcp);
|
||||
PRINT_FIELD_U(", ", attr, log_level);
|
||||
PRINT_FIELD_U(", ", attr, log_size);
|
||||
tprintf(", log_buf=");
|
||||
print_big_u64_addr(attr.log_buf);
|
||||
printstr_ex(tcp, attr.log_buf, attr.log_size, QUOTE_0_TERMINATED);
|
||||
|
||||
/* kern_version field was added in Linux commit v4.1-rc1~84^2~50. */
|
||||
if (len <= offsetof(struct BPF_PROG_LOAD_struct, kern_version))
|
||||
break;
|
||||
tprints(", kern_version=");
|
||||
print_kernel_version(attr.kern_version);
|
||||
/* prog_flags field was added in Linux commit v4.12-rc2~34^2~29^2~2. */
|
||||
if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_flags))
|
||||
break;
|
||||
PRINT_FIELD_X(", ", attr, log_buf);
|
||||
PRINT_FIELD_U(", ", attr, kern_version);
|
||||
PRINT_FIELD_FLAGS(", ", attr, prog_flags, bpf_prog_flags, "BPF_F_???");
|
||||
decode_attr_extra_data(tcp, data, size, sizeof(attr));
|
||||
tprints("}");
|
||||
|
||||
/* prog_name field was added in Linux commit v4.15-rc1~84^2~605^2~4. */
|
||||
if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_name))
|
||||
break;
|
||||
PRINT_FIELD_CSTRING_SZ(", ", attr, prog_name,
|
||||
MIN(sizeof(attr.prog_name),
|
||||
len - offsetof(struct BPF_PROG_LOAD_struct,
|
||||
prog_name)));
|
||||
|
||||
/*
|
||||
* prog_ifindex field was added as prog_target_ifindex in Linux commit
|
||||
* v4.15-rc1~84^2~127^2~13 and renamed to its current name in
|
||||
* v4.15-rc1~15^2~5^2~3^2~7.
|
||||
*/
|
||||
if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_ifindex))
|
||||
break;
|
||||
PRINT_FIELD_IFINDEX(", ", attr, prog_ifindex);
|
||||
|
||||
/*
|
||||
* expected_attach_type was added in Linux commit
|
||||
* v4.17-rc1~148^2~19^2^2~8.
|
||||
*/
|
||||
if (len <= offsetof(struct BPF_PROG_LOAD_struct, expected_attach_type))
|
||||
break;
|
||||
PRINT_FIELD_XVAL(", ", attr, expected_attach_type, bpf_attach_type,
|
||||
"BPF_???");
|
||||
return RVAL_DECODED | RVAL_FD;
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_OBJ_PIN)
|
||||
DEF_BPF_CMD_DECODER(BPF_OBJ_PIN)
|
||||
{
|
||||
tprintf("{pathname=");
|
||||
print_big_u64_addr(attr.pathname);
|
||||
printpath(tcp, attr.pathname);
|
||||
struct bpf_obj {
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) pathname;
|
||||
uint32_t bpf_fd;
|
||||
} attr = {};
|
||||
const size_t attr_size =
|
||||
offsetofend(struct bpf_obj, bpf_fd);
|
||||
const unsigned int len = size < attr_size ? size : attr_size;
|
||||
|
||||
memcpy(&attr, data, len);
|
||||
|
||||
PRINT_FIELD_PATH("{", attr, pathname, tcp);
|
||||
PRINT_FIELD_FD(", ", attr, bpf_fd, tcp);
|
||||
decode_attr_extra_data(tcp, data, size, attr_size);
|
||||
tprints("}");
|
||||
|
||||
/* file_flags field was added in Linux v4.15-rc1~84^2~384^2~4 */
|
||||
if (len <= offsetof(struct BPF_OBJ_PIN_struct, file_flags))
|
||||
break;
|
||||
PRINT_FIELD_FLAGS(", ", attr, file_flags, bpf_file_mode_flags,
|
||||
"BPF_F_???");
|
||||
return RVAL_DECODED | RVAL_FD;
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
|
||||
|
||||
#define decode_BPF_OBJ_GET decode_BPF_OBJ_PIN
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_PROG_ATTACH)
|
||||
DEF_BPF_CMD_DECODER(BPF_PROG_ATTACH)
|
||||
{
|
||||
struct {
|
||||
uint32_t target_fd, attach_bpf_fd, attach_type, attach_flags;
|
||||
} attr = {};
|
||||
const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
|
||||
|
||||
memcpy(&attr, data, len);
|
||||
|
||||
PRINT_FIELD_FD("{", attr, target_fd, tcp);
|
||||
PRINT_FIELD_FD(", ", attr, attach_bpf_fd, tcp);
|
||||
PRINT_FIELD_XVAL_INDEX(", ", attr, attach_type, bpf_attach_type,
|
||||
"BPF_???");
|
||||
PRINT_FIELD_XVAL(", ", attr, attach_type, bpf_attach_type, "BPF_???");
|
||||
PRINT_FIELD_FLAGS(", ", attr, attach_flags, bpf_attach_flags,
|
||||
"BPF_F_???");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
decode_attr_extra_data(tcp, data, size, sizeof(attr));
|
||||
tprints("}");
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_PROG_DETACH)
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
DEF_BPF_CMD_DECODER(BPF_PROG_DETACH)
|
||||
{
|
||||
struct {
|
||||
uint32_t target_fd, dummy, attach_type;
|
||||
} attr = {};
|
||||
const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
|
||||
|
||||
memcpy(&attr, data, len);
|
||||
|
||||
PRINT_FIELD_FD("{", attr, target_fd, tcp);
|
||||
PRINT_FIELD_XVAL_INDEX(", ", attr, attach_type, bpf_attach_type,
|
||||
"BPF_???");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)
|
||||
{
|
||||
PRINT_FIELD_FD("{test={", attr, prog_fd, tcp);
|
||||
PRINT_FIELD_U(", ", attr, retval);
|
||||
PRINT_FIELD_U(", ", attr, data_size_in);
|
||||
PRINT_FIELD_U(", ", attr, data_size_out);
|
||||
PRINT_FIELD_ADDR64(", ", attr, data_in);
|
||||
PRINT_FIELD_ADDR64(", ", attr, data_out);
|
||||
PRINT_FIELD_U(", ", attr, repeat);
|
||||
PRINT_FIELD_U(", ", attr, duration);
|
||||
PRINT_FIELD_XVAL(", ", attr, attach_type, bpf_attach_type, "BPF_???");
|
||||
decode_attr_extra_data(tcp, data, size, sizeof(attr));
|
||||
tprints("}");
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID)
|
||||
{
|
||||
PRINT_FIELD_U("{", attr, start_id);
|
||||
PRINT_FIELD_U(", ", attr, next_id);
|
||||
|
||||
/* open_flags field has been added in Linux v4.15-rc1~84^2~384^2~4 */
|
||||
if (len <= offsetof(struct BPF_PROG_GET_NEXT_ID_struct, open_flags))
|
||||
break;
|
||||
PRINT_FIELD_FLAGS(", ", attr, open_flags, bpf_file_mode_flags,
|
||||
"BPF_F_???");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
#define decode_BPF_MAP_GET_NEXT_ID decode_BPF_PROG_GET_NEXT_ID
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID)
|
||||
{
|
||||
PRINT_FIELD_U("{", attr, prog_id);
|
||||
PRINT_FIELD_U(", ", attr, next_id);
|
||||
|
||||
/* open_flags field has been added in Linux v4.15-rc1~84^2~384^2~4 */
|
||||
if (len <= offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags))
|
||||
break;
|
||||
PRINT_FIELD_FLAGS(", ", attr, open_flags, bpf_file_mode_flags,
|
||||
"BPF_F_???");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID)
|
||||
{
|
||||
PRINT_FIELD_U("{", attr, map_id);
|
||||
PRINT_FIELD_U(", ", attr, next_id);
|
||||
|
||||
/* open_flags field has been added in Linux v4.15-rc1~84^2~384^2~4 */
|
||||
if (len <= offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags))
|
||||
break;
|
||||
PRINT_FIELD_FLAGS(", ", attr, open_flags, bpf_file_mode_flags,
|
||||
"BPF_F_???");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
struct obj_get_info_saved;
|
||||
typedef void (*print_bpf_obj_info_fn)(struct tcb *,
|
||||
uint32_t bpf_fd,
|
||||
const char *info_buf,
|
||||
uint32_t size,
|
||||
struct obj_get_info_saved *saved);
|
||||
|
||||
struct obj_get_info_saved {
|
||||
print_bpf_obj_info_fn print_fn;
|
||||
|
||||
uint32_t info_len;
|
||||
|
||||
uint32_t jited_prog_len;
|
||||
uint32_t xlated_prog_len;
|
||||
uint32_t nr_map_ids;
|
||||
};
|
||||
|
||||
static void
|
||||
print_bpf_map_info(struct tcb * const tcp, uint32_t bpf_fd,
|
||||
const char *info_buf, uint32_t size,
|
||||
struct obj_get_info_saved *saved)
|
||||
{
|
||||
if (entering(tcp))
|
||||
return;
|
||||
|
||||
struct bpf_map_info_struct info = { 0 };
|
||||
const unsigned int len = MIN(size, bpf_map_info_struct_size);
|
||||
|
||||
memcpy(&info, info_buf, len);
|
||||
|
||||
PRINT_FIELD_XVAL("{", info, type, bpf_map_types, "BPF_MAP_TYPE_???");
|
||||
PRINT_FIELD_U(", ", info, id);
|
||||
PRINT_FIELD_U(", ", info, key_size);
|
||||
PRINT_FIELD_U(", ", info, value_size);
|
||||
PRINT_FIELD_U(", ", info, max_entries);
|
||||
PRINT_FIELD_FLAGS(", ", info, map_flags, bpf_map_flags, "BPF_F_???");
|
||||
|
||||
/*
|
||||
* "name" field was introduced by Linux commit v4.15-rc1~84^2~605^2~3.
|
||||
*/
|
||||
if (len <= offsetof(struct bpf_map_info_struct, name))
|
||||
goto print_bpf_map_info_end;
|
||||
PRINT_FIELD_CSTRING(", ", info, name);
|
||||
|
||||
/*
|
||||
* ifindex, netns_dev, and netns_ino fields were introduced
|
||||
* by Linux commit v4.16-rc1~123^2~109^2~5^2~4.
|
||||
*/
|
||||
if (len <= offsetof(struct bpf_map_info_struct, ifindex))
|
||||
goto print_bpf_map_info_end;
|
||||
PRINT_FIELD_IFINDEX(", ", info, ifindex);
|
||||
PRINT_FIELD_DEV(", ", info, netns_dev);
|
||||
PRINT_FIELD_U(", ", info, netns_ino);
|
||||
|
||||
decode_attr_extra_data(tcp, info_buf, size, bpf_map_info_struct_size);
|
||||
|
||||
print_bpf_map_info_end:
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
static void
|
||||
print_bpf_prog_info(struct tcb * const tcp, uint32_t bpf_fd,
|
||||
const char *info_buf, uint32_t size,
|
||||
struct obj_get_info_saved *saved)
|
||||
{
|
||||
struct bpf_prog_info_struct info = { 0 };
|
||||
const unsigned int len = MIN(size, bpf_prog_info_struct_size);
|
||||
uint64_t map_id_buf;
|
||||
|
||||
memcpy(&info, info_buf, len);
|
||||
|
||||
if (entering(tcp)) {
|
||||
saved->jited_prog_len = info.jited_prog_len;
|
||||
saved->xlated_prog_len = info.xlated_prog_len;
|
||||
saved->nr_map_ids = info.nr_map_ids;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
PRINT_FIELD_XVAL("{", info, type, bpf_prog_types, "BPF_PROG_TYPE_???");
|
||||
PRINT_FIELD_U(", ", info, id);
|
||||
PRINT_FIELD_HEX_ARRAY(", ", info, tag);
|
||||
|
||||
tprints(", jited_prog_len=");
|
||||
if (saved->jited_prog_len != info.jited_prog_len)
|
||||
tprintf("%" PRIu32 " => ", saved->jited_prog_len);
|
||||
tprintf("%" PRIu32, info.jited_prog_len);
|
||||
|
||||
tprints(", jited_prog_insns=");
|
||||
print_big_u64_addr(info.jited_prog_insns);
|
||||
printstr_ex(tcp, info.jited_prog_insns, info.jited_prog_len,
|
||||
QUOTE_FORCE_HEX);
|
||||
|
||||
tprints(", xlated_prog_len=");
|
||||
if (saved->xlated_prog_len != info.xlated_prog_len)
|
||||
tprintf("%" PRIu32 " => ", saved->xlated_prog_len);
|
||||
tprintf("%" PRIu32, info.xlated_prog_len);
|
||||
|
||||
tprints(", xlated_prog_insns=");
|
||||
print_ebpf_prog(tcp, info.xlated_prog_insns,
|
||||
MIN(saved->xlated_prog_len, info.xlated_prog_len) / 8);
|
||||
|
||||
/*
|
||||
* load_time, created_by_uid, nr_map_ids, map_ids, and name fields
|
||||
* were introduced by Linux commit v4.15-rc1~84^2~605^2~4.
|
||||
*/
|
||||
if (len <= offsetof(struct bpf_prog_info_struct, load_time))
|
||||
goto print_bpf_prog_info_end;
|
||||
PRINT_FIELD_U(", ", info, load_time);
|
||||
PRINT_FIELD_UID(", ", info, created_by_uid);
|
||||
|
||||
tprints(", nr_map_ids=");
|
||||
if (saved->nr_map_ids != info.nr_map_ids)
|
||||
tprintf("%" PRIu32 " => ", saved->nr_map_ids);
|
||||
tprintf("%" PRIu32, info.nr_map_ids);
|
||||
|
||||
tprints(", map_ids=");
|
||||
print_big_u64_addr(info.map_ids);
|
||||
print_array(tcp, info.map_ids, MIN(saved->nr_map_ids, info.nr_map_ids),
|
||||
&map_id_buf, sizeof(map_id_buf),
|
||||
tfetch_mem, print_uint32_array_member, 0);
|
||||
|
||||
PRINT_FIELD_CSTRING(", ", info, name);
|
||||
|
||||
/*
|
||||
* ifindex, netns_dev, and netns_ino fields were introduced
|
||||
* by Linux commit v4.16-rc1~123^2~227^2~5^2~2.
|
||||
*/
|
||||
if (len <= offsetof(struct bpf_prog_info_struct, ifindex))
|
||||
goto print_bpf_prog_info_end;
|
||||
PRINT_FIELD_IFINDEX(", ", info, ifindex);
|
||||
PRINT_FIELD_DEV(", ", info, netns_dev);
|
||||
PRINT_FIELD_U(", ", info, netns_ino);
|
||||
|
||||
decode_attr_extra_data(tcp, info_buf, size, bpf_prog_info_struct_size);
|
||||
|
||||
print_bpf_prog_info_end:
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
static const char *
|
||||
fetch_bpf_obj_info(struct tcb * const tcp, uint64_t info, uint32_t size)
|
||||
{
|
||||
static char *info_buf;
|
||||
|
||||
if (!info_buf)
|
||||
info_buf = xmalloc(get_pagesize());
|
||||
|
||||
memset(info_buf, 0, get_pagesize());
|
||||
|
||||
if (size > 0 && size <= get_pagesize()
|
||||
&& !umoven(tcp, info, size, info_buf))
|
||||
return info_buf;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
print_bpf_obj_info_addr(struct tcb * const tcp, uint64_t addr)
|
||||
{
|
||||
if (exiting(tcp))
|
||||
printaddr64(addr);
|
||||
}
|
||||
|
||||
static void
|
||||
print_bpf_obj_info(struct tcb * const tcp, uint32_t bpf_fd, uint64_t info,
|
||||
uint32_t size, struct obj_get_info_saved *saved)
|
||||
{
|
||||
if (abbrev(tcp)) {
|
||||
print_bpf_obj_info_addr(tcp, info);
|
||||
return;
|
||||
}
|
||||
|
||||
static struct {
|
||||
const char *id;
|
||||
print_bpf_obj_info_fn print_fn;
|
||||
} obj_printers[] = {
|
||||
{ "anon_inode:bpf-map", print_bpf_map_info },
|
||||
{ "anon_inode:bpf-prog", print_bpf_prog_info }
|
||||
};
|
||||
|
||||
if (entering(tcp)) {
|
||||
char path[PATH_MAX + 1];
|
||||
|
||||
if (getfdpath(tcp, bpf_fd, path, sizeof(path)) > 0) {
|
||||
for (size_t i = 0; i < ARRAY_SIZE(obj_printers); ++i) {
|
||||
if (!strcmp(path, obj_printers[i].id)) {
|
||||
saved->print_fn =
|
||||
obj_printers[i].print_fn;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!saved || !saved->print_fn) {
|
||||
print_bpf_obj_info_addr(tcp, info);
|
||||
return;
|
||||
}
|
||||
|
||||
const char *info_buf = fetch_bpf_obj_info(tcp, info, size);
|
||||
|
||||
if (info_buf)
|
||||
saved->print_fn(tcp, bpf_fd, info_buf, size, saved);
|
||||
else
|
||||
print_bpf_obj_info_addr(tcp, info);
|
||||
}
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)
|
||||
{
|
||||
struct obj_get_info_saved *saved;
|
||||
|
||||
if (entering(tcp)) {
|
||||
saved = xcalloc(1, sizeof(*saved));
|
||||
saved->info_len = attr.info_len;
|
||||
set_tcb_priv_data(tcp, saved, free);
|
||||
|
||||
PRINT_FIELD_FD("{info={", attr, bpf_fd, tcp);
|
||||
PRINT_FIELD_U(", ", attr, info_len);
|
||||
} else {
|
||||
saved = get_tcb_priv_data(tcp);
|
||||
|
||||
if (saved && (saved->info_len != attr.info_len))
|
||||
tprintf(" => %u", attr.info_len);
|
||||
|
||||
tprintf(", info=");
|
||||
}
|
||||
|
||||
print_bpf_obj_info(tcp, attr.bpf_fd, attr.info, attr.info_len, saved);
|
||||
|
||||
if (entering(tcp))
|
||||
return 0;
|
||||
|
||||
tprints("}");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)
|
||||
{
|
||||
uint32_t prog_id_buf;
|
||||
|
||||
if (entering(tcp)) {
|
||||
PRINT_FIELD_FD("{query={", attr, target_fd, tcp);
|
||||
PRINT_FIELD_XVAL_INDEX(", ", attr, attach_type, bpf_attach_type,
|
||||
"BPF_???");
|
||||
PRINT_FIELD_FLAGS(", ", attr, query_flags, bpf_query_flags,
|
||||
"BPF_F_QUERY_???");
|
||||
PRINT_FIELD_FLAGS(", ", attr, attach_flags, bpf_attach_flags,
|
||||
"BPF_F_???");
|
||||
|
||||
tprints(", prog_ids=");
|
||||
|
||||
set_tcb_priv_ulong(tcp, attr.prog_cnt);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
print_big_u64_addr(attr.prog_ids);
|
||||
print_array(tcp, attr.prog_ids, attr.prog_cnt, &prog_id_buf,
|
||||
sizeof(prog_id_buf), tfetch_mem,
|
||||
print_uint32_array_member, 0);
|
||||
|
||||
tprints(", prog_cnt=");
|
||||
const uint32_t prog_cnt_entering = get_tcb_priv_ulong(tcp);
|
||||
if (prog_cnt_entering != attr.prog_cnt)
|
||||
tprintf("%" PRIu32 " => ", prog_cnt_entering);
|
||||
tprintf("%" PRIu32, attr.prog_cnt);
|
||||
tprints("}");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_RAW_TRACEPOINT_OPEN)
|
||||
{
|
||||
enum { TP_NAME_SIZE = 128 };
|
||||
|
||||
tprintf("{raw_tracepoint={name=");
|
||||
print_big_u64_addr(attr.name);
|
||||
printstr_ex(tcp, attr.name, TP_NAME_SIZE, QUOTE_0_TERMINATED);
|
||||
|
||||
PRINT_FIELD_FD(", ", attr, prog_fd, tcp);
|
||||
|
||||
tprints("}");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
SYS_FUNC(bpf)
|
||||
{
|
||||
@ -697,42 +291,41 @@ SYS_FUNC(bpf)
|
||||
BPF_CMD_ENTRY(BPF_OBJ_GET),
|
||||
BPF_CMD_ENTRY(BPF_PROG_ATTACH),
|
||||
BPF_CMD_ENTRY(BPF_PROG_DETACH),
|
||||
BPF_CMD_ENTRY(BPF_PROG_TEST_RUN),
|
||||
BPF_CMD_ENTRY(BPF_PROG_GET_NEXT_ID),
|
||||
BPF_CMD_ENTRY(BPF_MAP_GET_NEXT_ID),
|
||||
BPF_CMD_ENTRY(BPF_PROG_GET_FD_BY_ID),
|
||||
BPF_CMD_ENTRY(BPF_MAP_GET_FD_BY_ID),
|
||||
BPF_CMD_ENTRY(BPF_OBJ_GET_INFO_BY_FD),
|
||||
BPF_CMD_ENTRY(BPF_PROG_QUERY),
|
||||
BPF_CMD_ENTRY(BPF_RAW_TRACEPOINT_OPEN),
|
||||
};
|
||||
|
||||
const unsigned int cmd = tcp->u_arg[0];
|
||||
const kernel_ulong_t addr = tcp->u_arg[1];
|
||||
const unsigned int size = tcp->u_arg[2];
|
||||
int rc = RVAL_DECODED;
|
||||
int rc;
|
||||
|
||||
if (entering(tcp)) {
|
||||
printxval_index(bpf_commands, cmd, "BPF_???");
|
||||
tprints(", ");
|
||||
}
|
||||
|
||||
if (size > 0
|
||||
&& size <= get_pagesize()
|
||||
&& cmd < ARRAY_SIZE(bpf_cmd_decoders)
|
||||
&& bpf_cmd_decoders[cmd]) {
|
||||
static size_t page_size;
|
||||
static char *buf;
|
||||
|
||||
if (!buf)
|
||||
buf = xmalloc(get_pagesize());
|
||||
if (!buf) {
|
||||
page_size = get_pagesize();
|
||||
buf = xmalloc(page_size);
|
||||
}
|
||||
|
||||
if (!umoven_or_printaddr_ignore_syserror(tcp, addr, size, buf))
|
||||
rc = bpf_cmd_decoders[cmd](tcp, addr, size, buf);
|
||||
printxval(bpf_commands, cmd, "BPF_???");
|
||||
tprints(", ");
|
||||
|
||||
if (size > 0
|
||||
&& size <= get_pagesize()
|
||||
&& cmd < ARRAY_SIZE(bpf_cmd_decoders)
|
||||
&& bpf_cmd_decoders[cmd]) {
|
||||
rc = umoven_or_printaddr(tcp, addr, size, buf)
|
||||
? RVAL_DECODED
|
||||
: bpf_cmd_decoders[cmd](tcp, addr, size, buf);
|
||||
} else {
|
||||
printaddr(addr);
|
||||
rc = RVAL_DECODED;
|
||||
}
|
||||
} else {
|
||||
printaddr(addr);
|
||||
rc = bpf_cmd_decoders[cmd](tcp, addr, size, NULL) | RVAL_DECODED;
|
||||
}
|
||||
|
||||
if (exiting(tcp) || (rc & RVAL_DECODED))
|
||||
if (rc & RVAL_DECODED)
|
||||
tprintf(", %u", size);
|
||||
|
||||
return rc;
|
||||
|
274
bpf_attr.h
274
bpf_attr.h
@ -1,274 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#ifndef STRACE_BPF_ATTR_H
|
||||
# define STRACE_BPF_ATTR_H
|
||||
|
||||
/*
|
||||
* The policy is that all fields of type uint64_t in this header file
|
||||
* must have ATTRIBUTE_ALIGNED(8).
|
||||
*
|
||||
* This should not cause any contradictions with <linux/bpf.h>
|
||||
* unless the latter is buggy.
|
||||
*
|
||||
* By word "buggy" I mean containing such changes as Linux kernel commit
|
||||
* v4.16-rc1~123^2~109^2~5^2~4.
|
||||
*/
|
||||
|
||||
# ifndef BPF_OBJ_NAME_LEN
|
||||
# define BPF_OBJ_NAME_LEN 16U
|
||||
# else
|
||||
# if BPF_OBJ_NAME_LEN != 16U
|
||||
# error "Unexpected value of BPF_OBJ_NAME_LEN"
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifndef BPF_TAG_SIZE
|
||||
# define BPF_TAG_SIZE 8
|
||||
# else
|
||||
# if BPF_TAG_SIZE != 8
|
||||
# error "Unexpected value of BPF_TAG_SIZE"
|
||||
# endif
|
||||
# endif
|
||||
|
||||
struct BPF_MAP_CREATE_struct {
|
||||
uint32_t map_type;
|
||||
uint32_t key_size;
|
||||
uint32_t value_size;
|
||||
uint32_t max_entries;
|
||||
uint32_t map_flags;
|
||||
uint32_t inner_map_fd;
|
||||
uint32_t numa_node;
|
||||
char map_name[BPF_OBJ_NAME_LEN];
|
||||
uint32_t map_ifindex;
|
||||
};
|
||||
|
||||
# define BPF_MAP_CREATE_struct_size \
|
||||
sizeof(struct BPF_MAP_CREATE_struct)
|
||||
# define expected_BPF_MAP_CREATE_struct_size 48
|
||||
|
||||
struct BPF_MAP_LOOKUP_ELEM_struct {
|
||||
uint32_t map_fd;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) key;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) value;
|
||||
};
|
||||
|
||||
# define BPF_MAP_LOOKUP_ELEM_struct_size \
|
||||
sizeof(struct BPF_MAP_LOOKUP_ELEM_struct)
|
||||
# define expected_BPF_MAP_LOOKUP_ELEM_struct_size 24
|
||||
|
||||
struct BPF_MAP_UPDATE_ELEM_struct {
|
||||
uint32_t map_fd;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) key;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) value;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) flags;
|
||||
};
|
||||
|
||||
# define BPF_MAP_UPDATE_ELEM_struct_size \
|
||||
sizeof(struct BPF_MAP_UPDATE_ELEM_struct)
|
||||
# define expected_BPF_MAP_UPDATE_ELEM_struct_size 32
|
||||
|
||||
struct BPF_MAP_DELETE_ELEM_struct {
|
||||
uint32_t map_fd;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) key;
|
||||
};
|
||||
|
||||
# define BPF_MAP_DELETE_ELEM_struct_size \
|
||||
sizeof(struct BPF_MAP_DELETE_ELEM_struct)
|
||||
# define expected_BPF_MAP_DELETE_ELEM_struct_size 16
|
||||
|
||||
struct BPF_MAP_GET_NEXT_KEY_struct {
|
||||
uint32_t map_fd;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) key;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) next_key;
|
||||
};
|
||||
|
||||
# define BPF_MAP_GET_NEXT_KEY_struct_size \
|
||||
sizeof(struct BPF_MAP_GET_NEXT_KEY_struct)
|
||||
# define expected_BPF_MAP_GET_NEXT_KEY_struct_size 24
|
||||
|
||||
struct BPF_PROG_LOAD_struct {
|
||||
uint32_t prog_type;
|
||||
uint32_t insn_cnt;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) insns;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) license;
|
||||
uint32_t log_level;
|
||||
uint32_t log_size;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) log_buf;
|
||||
uint32_t kern_version;
|
||||
uint32_t prog_flags;
|
||||
char prog_name[BPF_OBJ_NAME_LEN];
|
||||
uint32_t prog_ifindex;
|
||||
uint32_t expected_attach_type;
|
||||
};
|
||||
|
||||
# define BPF_PROG_LOAD_struct_size \
|
||||
offsetofend(struct BPF_PROG_LOAD_struct, expected_attach_type)
|
||||
# define expected_BPF_PROG_LOAD_struct_size 72
|
||||
|
||||
struct BPF_OBJ_PIN_struct {
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) pathname;
|
||||
uint32_t bpf_fd;
|
||||
uint32_t file_flags;
|
||||
};
|
||||
|
||||
# define BPF_OBJ_PIN_struct_size \
|
||||
sizeof(struct BPF_OBJ_PIN_struct)
|
||||
# define expected_BPF_OBJ_PIN_struct_size 16
|
||||
|
||||
# define BPF_OBJ_GET_struct BPF_OBJ_PIN_struct
|
||||
# define BPF_OBJ_GET_struct_size BPF_OBJ_PIN_struct_size
|
||||
|
||||
struct BPF_PROG_ATTACH_struct {
|
||||
uint32_t target_fd;
|
||||
uint32_t attach_bpf_fd;
|
||||
uint32_t attach_type;
|
||||
uint32_t attach_flags;
|
||||
};
|
||||
|
||||
# define BPF_PROG_ATTACH_struct_size \
|
||||
sizeof(struct BPF_PROG_ATTACH_struct)
|
||||
# define expected_BPF_PROG_ATTACH_struct_size 16
|
||||
|
||||
struct BPF_PROG_DETACH_struct {
|
||||
uint32_t target_fd;
|
||||
uint32_t dummy;
|
||||
uint32_t attach_type;
|
||||
};
|
||||
|
||||
# define BPF_PROG_DETACH_struct_size \
|
||||
sizeof(struct BPF_PROG_DETACH_struct)
|
||||
# define expected_BPF_PROG_DETACH_struct_size 12
|
||||
|
||||
struct BPF_PROG_TEST_RUN_struct /* test */ {
|
||||
uint32_t prog_fd;
|
||||
uint32_t retval;
|
||||
uint32_t data_size_in;
|
||||
uint32_t data_size_out;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) data_in;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) data_out;
|
||||
uint32_t repeat;
|
||||
uint32_t duration;
|
||||
};
|
||||
|
||||
# define BPF_PROG_TEST_RUN_struct_size \
|
||||
sizeof(struct BPF_PROG_TEST_RUN_struct)
|
||||
# define expected_BPF_PROG_TEST_RUN_struct_size 40
|
||||
|
||||
struct BPF_PROG_GET_NEXT_ID_struct {
|
||||
uint32_t start_id;
|
||||
uint32_t next_id;
|
||||
uint32_t open_flags;
|
||||
};
|
||||
|
||||
# define BPF_PROG_GET_NEXT_ID_struct_size \
|
||||
sizeof(struct BPF_PROG_GET_NEXT_ID_struct)
|
||||
# define expected_BPF_PROG_GET_NEXT_ID_struct_size 12
|
||||
|
||||
# define BPF_MAP_GET_NEXT_ID_struct BPF_PROG_GET_NEXT_ID_struct
|
||||
# define BPF_MAP_GET_NEXT_ID_struct_size BPF_PROG_GET_NEXT_ID_struct_size
|
||||
|
||||
struct BPF_PROG_GET_FD_BY_ID_struct {
|
||||
uint32_t prog_id;
|
||||
uint32_t next_id;
|
||||
uint32_t open_flags;
|
||||
};
|
||||
|
||||
# define BPF_PROG_GET_FD_BY_ID_struct_size \
|
||||
sizeof(struct BPF_PROG_GET_FD_BY_ID_struct)
|
||||
# define expected_BPF_PROG_GET_FD_BY_ID_struct_size 12
|
||||
|
||||
struct BPF_MAP_GET_FD_BY_ID_struct {
|
||||
uint32_t map_id;
|
||||
uint32_t next_id;
|
||||
uint32_t open_flags;
|
||||
};
|
||||
|
||||
# define BPF_MAP_GET_FD_BY_ID_struct_size \
|
||||
sizeof(struct BPF_MAP_GET_FD_BY_ID_struct)
|
||||
# define expected_BPF_MAP_GET_FD_BY_ID_struct_size 12
|
||||
|
||||
struct BPF_OBJ_GET_INFO_BY_FD_struct /* info */ {
|
||||
uint32_t bpf_fd;
|
||||
uint32_t info_len;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) info;
|
||||
};
|
||||
|
||||
# define BPF_OBJ_GET_INFO_BY_FD_struct_size \
|
||||
sizeof(struct BPF_OBJ_GET_INFO_BY_FD_struct)
|
||||
# define expected_BPF_OBJ_GET_INFO_BY_FD_struct_size 16
|
||||
|
||||
struct BPF_PROG_QUERY_struct /* query */ {
|
||||
uint32_t target_fd;
|
||||
uint32_t attach_type;
|
||||
uint32_t query_flags;
|
||||
uint32_t attach_flags;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) prog_ids;
|
||||
uint32_t prog_cnt;
|
||||
};
|
||||
|
||||
# define BPF_PROG_QUERY_struct_size \
|
||||
offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt)
|
||||
# define expected_BPF_PROG_QUERY_struct_size 28
|
||||
|
||||
struct BPF_RAW_TRACEPOINT_OPEN_struct /* raw_tracepoint */ {
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) name;
|
||||
uint32_t prog_fd;
|
||||
};
|
||||
|
||||
# define BPF_RAW_TRACEPOINT_OPEN_struct_size \
|
||||
offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, prog_fd)
|
||||
# define expected_BPF_RAW_TRACEPOINT_OPEN_struct_size 12
|
||||
|
||||
struct bpf_map_info_struct {
|
||||
uint32_t type;
|
||||
uint32_t id;
|
||||
uint32_t key_size;
|
||||
uint32_t value_size;
|
||||
uint32_t max_entries;
|
||||
uint32_t map_flags;
|
||||
char name[BPF_OBJ_NAME_LEN];
|
||||
uint32_t ifindex;
|
||||
/*
|
||||
* The kernel UAPI is broken by Linux commit
|
||||
* v4.16-rc1~123^2~109^2~5^2~4 .
|
||||
*/
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) netns_dev; /* skip check */
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */
|
||||
};
|
||||
|
||||
# define bpf_map_info_struct_size \
|
||||
sizeof(struct bpf_map_info_struct)
|
||||
# define expected_bpf_map_info_struct_size 64
|
||||
|
||||
struct bpf_prog_info_struct {
|
||||
uint32_t type;
|
||||
uint32_t id;
|
||||
uint8_t tag[BPF_TAG_SIZE];
|
||||
uint32_t jited_prog_len;
|
||||
uint32_t xlated_prog_len;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) jited_prog_insns;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) xlated_prog_insns;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) load_time;
|
||||
uint32_t created_by_uid;
|
||||
uint32_t nr_map_ids;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) map_ids;
|
||||
char name[BPF_OBJ_NAME_LEN];
|
||||
uint32_t ifindex;
|
||||
/*
|
||||
* The kernel UAPI is broken by Linux commit
|
||||
* v4.16-rc1~123^2~227^2~5^2~2 .
|
||||
*/
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) netns_dev; /* skip check */
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */
|
||||
};
|
||||
|
||||
# define bpf_prog_info_struct_size \
|
||||
sizeof(struct bpf_prog_info_struct)
|
||||
# define expected_bpf_prog_info_struct_size 104
|
||||
|
||||
#endif /* !STRACE_BPF_ATTR_H */
|
127
bpf_filter.c
127
bpf_filter.c
@ -2,10 +2,29 @@
|
||||
* Decoder of classic BPF programs.
|
||||
*
|
||||
* Copyright (c) 2015-2017 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2017-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -14,7 +33,6 @@
|
||||
#include "bpf_fprog.h"
|
||||
|
||||
#include <linux/filter.h>
|
||||
|
||||
#include "xlat/bpf_class.h"
|
||||
#include "xlat/bpf_miscop.h"
|
||||
#include "xlat/bpf_mode.h"
|
||||
@ -24,45 +42,49 @@
|
||||
#include "xlat/bpf_size.h"
|
||||
#include "xlat/bpf_src.h"
|
||||
|
||||
#include "xlat/ebpf_class.h"
|
||||
#include "xlat/ebpf_mode.h"
|
||||
#include "xlat/ebpf_op_alu.h"
|
||||
#include "xlat/ebpf_op_jmp.h"
|
||||
#include "xlat/ebpf_size.h"
|
||||
|
||||
void
|
||||
print_bpf_filter_code(const uint16_t code, bool extended)
|
||||
static void
|
||||
print_bpf_filter_code(const uint16_t code)
|
||||
{
|
||||
const struct xlat *mode = extended ? ebpf_mode : bpf_mode;
|
||||
uint16_t i = code & ~BPF_CLASS(code);
|
||||
|
||||
if (extended)
|
||||
printxval_index(ebpf_class, BPF_CLASS(code), "BPF_???");
|
||||
else
|
||||
printxval_index(bpf_class, BPF_CLASS(code), "BPF_???");
|
||||
printxval(bpf_class, BPF_CLASS(code), "BPF_???");
|
||||
switch (BPF_CLASS(code)) {
|
||||
case BPF_ST:
|
||||
case BPF_STX:
|
||||
if (!extended) {
|
||||
case BPF_LD:
|
||||
case BPF_LDX:
|
||||
tprints("|");
|
||||
printxval(bpf_size, BPF_SIZE(code), "BPF_???");
|
||||
tprints("|");
|
||||
printxval(bpf_mode, BPF_MODE(code), "BPF_???");
|
||||
break;
|
||||
case BPF_ST:
|
||||
case BPF_STX:
|
||||
if (i) {
|
||||
tprintf("|%#x", i);
|
||||
tprints_comment("BPF_???");
|
||||
}
|
||||
break;
|
||||
}
|
||||
ATTRIBUTE_FALLTHROUGH; /* extended == true */
|
||||
|
||||
case BPF_LD:
|
||||
case BPF_LDX:
|
||||
tprints("|");
|
||||
printxvals(BPF_SIZE(code), "BPF_???",
|
||||
bpf_size, extended ? ebpf_size : NULL, NULL);
|
||||
tprints("|");
|
||||
printxval(mode, BPF_MODE(code), "BPF_???");
|
||||
break;
|
||||
|
||||
case BPF_MISC: /* BPF_ALU64 in eBPF */
|
||||
if (!extended) {
|
||||
case BPF_ALU:
|
||||
tprints("|");
|
||||
printxval(bpf_src, BPF_SRC(code), "BPF_???");
|
||||
tprints("|");
|
||||
printxval(bpf_op_alu, BPF_OP(code), "BPF_???");
|
||||
break;
|
||||
case BPF_JMP:
|
||||
tprints("|");
|
||||
printxval(bpf_src, BPF_SRC(code), "BPF_???");
|
||||
tprints("|");
|
||||
printxval(bpf_op_jmp, BPF_OP(code), "BPF_???");
|
||||
break;
|
||||
case BPF_RET:
|
||||
tprints("|");
|
||||
printxval(bpf_rval, BPF_RVAL(code), "BPF_???");
|
||||
i &= ~BPF_RVAL(code);
|
||||
if (i) {
|
||||
tprintf("|%#x", i);
|
||||
tprints_comment("BPF_???");
|
||||
}
|
||||
break;
|
||||
case BPF_MISC:
|
||||
tprints("|");
|
||||
printxval(bpf_miscop, BPF_MISCOP(code), "BPF_???");
|
||||
i &= ~BPF_MISCOP(code);
|
||||
@ -71,39 +93,6 @@ print_bpf_filter_code(const uint16_t code, bool extended)
|
||||
tprints_comment("BPF_???");
|
||||
}
|
||||
break;
|
||||
}
|
||||
ATTRIBUTE_FALLTHROUGH; /* extended == true */
|
||||
|
||||
case BPF_ALU:
|
||||
tprints("|");
|
||||
printxval(bpf_src, BPF_SRC(code), "BPF_???");
|
||||
tprints("|");
|
||||
printxvals(BPF_OP(code), "BPF_???",
|
||||
bpf_op_alu,
|
||||
extended ? ebpf_op_alu : NULL, NULL);
|
||||
break;
|
||||
|
||||
case BPF_JMP:
|
||||
tprints("|");
|
||||
printxval(bpf_src, BPF_SRC(code), "BPF_???");
|
||||
tprints("|");
|
||||
printxvals(BPF_OP(code), "BPF_???",
|
||||
bpf_op_jmp, extended ? ebpf_op_jmp : NULL, NULL);
|
||||
break;
|
||||
|
||||
case BPF_RET: /* Reserved in eBPF */
|
||||
if (!extended) {
|
||||
tprints("|");
|
||||
printxval(bpf_rval, BPF_RVAL(code), "BPF_???");
|
||||
i &= ~BPF_RVAL(code);
|
||||
}
|
||||
|
||||
if (i) {
|
||||
tprintf("|%#x", i);
|
||||
tprints_comment("BPF_???");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,7 +101,7 @@ print_bpf_filter_stmt(const struct bpf_filter_block *const filter,
|
||||
const print_bpf_filter_fn print_k)
|
||||
{
|
||||
tprints("BPF_STMT(");
|
||||
print_bpf_filter_code(filter->code, false);
|
||||
print_bpf_filter_code(filter->code);
|
||||
tprints(", ");
|
||||
if (!print_k || !print_k(filter))
|
||||
tprintf("%#x", filter->k);
|
||||
@ -123,7 +112,7 @@ static void
|
||||
print_bpf_filter_jump(const struct bpf_filter_block *const filter)
|
||||
{
|
||||
tprints("BPF_JUMP(");
|
||||
print_bpf_filter_code(filter->code, false);
|
||||
print_bpf_filter_code(filter->code);
|
||||
tprintf(", %#x, %#x, %#x)", filter->k, filter->jt, filter->jf);
|
||||
}
|
||||
|
||||
@ -163,7 +152,7 @@ print_bpf_fprog(struct tcb *const tcp, const kernel_ulong_t addr,
|
||||
struct bpf_filter_block filter;
|
||||
|
||||
print_array(tcp, addr, len, &filter, sizeof(filter),
|
||||
tfetch_mem, print_bpf_filter_block, &fbd);
|
||||
umoven_or_printaddr, print_bpf_filter_block, &fbd);
|
||||
}
|
||||
}
|
||||
|
||||
|
26
bpf_filter.h
26
bpf_filter.h
@ -1,14 +1,34 @@
|
||||
/*
|
||||
* Classic BPF filter block.
|
||||
*
|
||||
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2017 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#ifndef STRACE_BPF_FILTER_H
|
||||
# define STRACE_BPF_FILTER_H
|
||||
#define STRACE_BPF_FILTER_H
|
||||
|
||||
struct bpf_filter_block {
|
||||
uint16_t code;
|
||||
|
@ -1,12 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#ifndef STRACE_BPF_FPROG_H
|
||||
# define STRACE_BPF_FPROG_H
|
||||
#define STRACE_BPF_FPROG_H
|
||||
|
||||
struct bpf_fprog {
|
||||
unsigned short len;
|
||||
|
@ -1,10 +1,30 @@
|
||||
/*
|
||||
* Decoder of seccomp filter programs.
|
||||
*
|
||||
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2017 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
@ -2,10 +2,29 @@
|
||||
* Decoder of socket filter programs.
|
||||
*
|
||||
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2017-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -14,25 +33,23 @@
|
||||
|
||||
#include <linux/filter.h>
|
||||
#include "xlat/skf_ad.h"
|
||||
#include "xlat/skf_off.h"
|
||||
|
||||
static bool
|
||||
print_sock_filter_k(const struct bpf_filter_block *const fp)
|
||||
{
|
||||
if (BPF_CLASS(fp->code) == BPF_LD && BPF_MODE(fp->code) == BPF_ABS) {
|
||||
if (fp->k >= (unsigned int) SKF_AD_OFF) {
|
||||
print_xlat32(SKF_AD_OFF);
|
||||
tprints("+");
|
||||
tprints("SKF_AD_OFF+");
|
||||
printxval(skf_ad, fp->k - (unsigned int) SKF_AD_OFF,
|
||||
"SKF_AD_???");
|
||||
return true;
|
||||
} else if (fp->k >= (unsigned int) SKF_NET_OFF) {
|
||||
print_xlat32(SKF_NET_OFF);
|
||||
tprintf("+%u", fp->k - (unsigned int) SKF_NET_OFF);
|
||||
tprintf("%s+%u", "SKF_NET_OFF",
|
||||
fp->k - (unsigned int) SKF_NET_OFF);
|
||||
return true;
|
||||
} else if (fp->k >= (unsigned int) SKF_LL_OFF) {
|
||||
print_xlat32(SKF_LL_OFF);
|
||||
tprintf("+%u", fp->k - (unsigned int) SKF_LL_OFF);
|
||||
tprintf("%s+%u", "SKF_LL_OFF",
|
||||
fp->k - (unsigned int) SKF_LL_OFF);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
52
cacheflush.c
52
cacheflush.c
@ -4,10 +4,30 @@
|
||||
* Copyright (c) 2010 Carmelo Amoroso <carmelo.amoroso@st.com>
|
||||
* Copyright (c) 2015 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
|
||||
* Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* Copyright (c) 2014-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -20,15 +40,15 @@
|
||||
# include "xlat/cacheflush_scope.h"
|
||||
|
||||
static const struct xlat cacheflush_flags[] = {
|
||||
# ifdef FLUSH_CACHE_BOTH
|
||||
#ifdef FLUSH_CACHE_BOTH
|
||||
XLAT(FLUSH_CACHE_BOTH),
|
||||
# endif
|
||||
# ifdef FLUSH_CACHE_DATA
|
||||
#endif
|
||||
#ifdef FLUSH_CACHE_DATA
|
||||
XLAT(FLUSH_CACHE_DATA),
|
||||
# endif
|
||||
# ifdef FLUSH_CACHE_INSN
|
||||
#endif
|
||||
#ifdef FLUSH_CACHE_INSN
|
||||
XLAT(FLUSH_CACHE_INSN),
|
||||
# endif
|
||||
#endif
|
||||
XLAT_END
|
||||
};
|
||||
|
||||
@ -72,18 +92,18 @@ SYS_FUNC(cacheflush)
|
||||
|
||||
#ifdef SH
|
||||
static const struct xlat cacheflush_flags[] = {
|
||||
# ifdef CACHEFLUSH_D_INVAL
|
||||
#ifdef CACHEFLUSH_D_INVAL
|
||||
XLAT(CACHEFLUSH_D_INVAL),
|
||||
# endif
|
||||
# ifdef CACHEFLUSH_D_WB
|
||||
#endif
|
||||
#ifdef CACHEFLUSH_D_WB
|
||||
XLAT(CACHEFLUSH_D_WB),
|
||||
# endif
|
||||
# ifdef CACHEFLUSH_D_PURGE
|
||||
#endif
|
||||
#ifdef CACHEFLUSH_D_PURGE
|
||||
XLAT(CACHEFLUSH_D_PURGE),
|
||||
# endif
|
||||
# ifdef CACHEFLUSH_I
|
||||
#endif
|
||||
#ifdef CACHEFLUSH_I
|
||||
XLAT(CACHEFLUSH_I),
|
||||
# endif
|
||||
#endif
|
||||
XLAT_END
|
||||
};
|
||||
|
||||
|
24
capability.c
24
capability.c
@ -2,10 +2,30 @@
|
||||
* Copyright (c) 2000 Wichert Akkerman <wakkerma@debian.org>
|
||||
* Copyright (c) 2011 Denys Vlasenko <dvlasenk@redhat.com>
|
||||
* Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* Copyright (c) 2014-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
7
caps0.h
7
caps0.h
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
CAP_CHOWN,
|
||||
CAP_DAC_OVERRIDE,
|
||||
CAP_DAC_READ_SEARCH,
|
||||
|
7
caps1.h
7
caps1.h
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
CAP_MAC_OVERRIDE,
|
||||
CAP_MAC_ADMIN,
|
||||
CAP_SYSLOG,
|
||||
|
7
chdir.c
7
chdir.c
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
SYS_FUNC(chdir)
|
||||
|
7
chmod.c
7
chmod.c
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
static void
|
||||
|
@ -1,129 +0,0 @@
|
||||
#!/bin/sh -ex
|
||||
#
|
||||
# Copyright (c) 2018 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
type sudo >/dev/null 2>&1 && sudo=sudo || sudo=
|
||||
common_packages='autoconf automake faketime file gawk gcc-multilib git gzip libbluetooth-dev make xz-utils'
|
||||
|
||||
retry_if_failed()
|
||||
{
|
||||
for i in `seq 0 99`; do
|
||||
"$@" && i= && break || sleep 1
|
||||
done
|
||||
[ -z "$i" ]
|
||||
}
|
||||
|
||||
updated=
|
||||
apt_get_install()
|
||||
{
|
||||
[ -n "$updated" ] || {
|
||||
retry_if_failed $sudo apt-get -qq update
|
||||
updated=1
|
||||
}
|
||||
retry_if_failed $sudo \
|
||||
apt-get -qq --no-install-suggests --no-install-recommends \
|
||||
install -y "$@"
|
||||
}
|
||||
|
||||
git_installed=
|
||||
clone_repo()
|
||||
{
|
||||
local src dst branch
|
||||
src="$1"; shift
|
||||
dst="$1"; shift
|
||||
branch="${1-}"
|
||||
|
||||
[ -n "$git_installed" ] || {
|
||||
apt_get_install git ca-certificates
|
||||
git_installed=1
|
||||
}
|
||||
|
||||
case "$src" in
|
||||
*://*) ;;
|
||||
*) local url path
|
||||
url="$(git config remote.origin.url)"
|
||||
path="${url#*://*/}"
|
||||
src="${url%$path}$src"
|
||||
;;
|
||||
esac
|
||||
|
||||
retry_if_failed \
|
||||
git clone --depth=1 ${branch:+--branch $branch} "$src" "$dst"
|
||||
}
|
||||
|
||||
case "$CC" in
|
||||
gcc-*)
|
||||
retry_if_failed \
|
||||
$sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
apt_get_install $common_packages "$CC"-multilib
|
||||
;;
|
||||
clang*)
|
||||
apt_get_install $common_packages "$CC"
|
||||
;;
|
||||
*)
|
||||
apt_get_install $common_packages
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$KHEADERS" in
|
||||
*/*)
|
||||
clone_repo https://github.com/"$KHEADERS" kernel ${KBRANCH-}
|
||||
$sudo make -C kernel headers_install INSTALL_HDR_PATH=/opt/kernel
|
||||
$sudo rm -rf kernel
|
||||
KHEADERS_INC=/opt/kernel/include
|
||||
;;
|
||||
*)
|
||||
KHEADERS_INC=/usr/include
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$CC" in
|
||||
musl-gcc)
|
||||
clone_repo strace/musl musl
|
||||
cd musl
|
||||
CC=gcc
|
||||
build=
|
||||
case "${TARGET-}" in
|
||||
x32)
|
||||
CC="$CC -mx32"
|
||||
;;
|
||||
x86)
|
||||
CC="$CC -m32"
|
||||
build='--build=i686-pc-linux-gnu --target=i686-pc-linux-gnu'
|
||||
;;
|
||||
esac
|
||||
./configure --prefix=/opt/musl --exec-prefix=/usr ${build}
|
||||
make
|
||||
$sudo make install
|
||||
cd -
|
||||
rm -rf musl
|
||||
$sudo ln -s \
|
||||
$KHEADERS_INC/asm* \
|
||||
$KHEADERS_INC/linux \
|
||||
$KHEADERS_INC/mtd \
|
||||
/opt/musl/include/
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${STACKTRACE-}" in
|
||||
libdw)
|
||||
apt_get_install libdw-dev
|
||||
;;
|
||||
libunwind)
|
||||
apt_get_install libunwind8-dev
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${CHECK-}" in
|
||||
coverage)
|
||||
apt_get_install lcov
|
||||
retry_if_failed \
|
||||
pip install --user codecov
|
||||
;;
|
||||
valgrind)
|
||||
apt_get_install valgrind
|
||||
;;
|
||||
esac
|
36
clone.c
36
clone.c
@ -4,10 +4,30 @@
|
||||
* Copyright (c) 2008 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
* Copyright (c) 2009-2013 Denys Vlasenko <dvlasenk@redhat.com>
|
||||
* Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* Copyright (c) 2014-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -29,7 +49,7 @@
|
||||
# define ARG_PTID (tcp->scno == __NR_clone2 ? 3 : 2)
|
||||
# define ARG_CTID (tcp->scno == __NR_clone2 ? 4 : 3)
|
||||
# define ARG_TLS (tcp->scno == __NR_clone2 ? 5 : 4)
|
||||
#elif defined S390 || defined S390X
|
||||
#elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32
|
||||
# define ARG_STACK 0
|
||||
# define ARG_FLAGS 1
|
||||
# define ARG_PTID 2
|
||||
@ -64,7 +84,7 @@ print_tls_arg(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
if (current_personality == 1)
|
||||
# endif
|
||||
{
|
||||
print_user_desc(tcp, tcp->u_arg[ARG_TLS], USER_DESC_BOTH);
|
||||
print_user_desc(tcp, tcp->u_arg[ARG_TLS]);
|
||||
}
|
||||
# if SUPPORTED_PERSONALITIES > 1
|
||||
else
|
||||
@ -91,10 +111,8 @@ SYS_FUNC(clone)
|
||||
tprints("flags=");
|
||||
if (!printflags64(clone_flags, flags & ~CSIGNAL, NULL))
|
||||
sep = "";
|
||||
if ((flags & CSIGNAL) != 0) {
|
||||
tprints(sep);
|
||||
printsignal(flags & CSIGNAL);
|
||||
}
|
||||
if ((flags & CSIGNAL) != 0)
|
||||
tprintf("%s%s", sep, signame(flags & CSIGNAL));
|
||||
if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID
|
||||
|CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0)
|
||||
return 0;
|
||||
@ -143,5 +161,5 @@ SYS_FUNC(unshare)
|
||||
|
||||
SYS_FUNC(fork)
|
||||
{
|
||||
return RVAL_DECODED;
|
||||
return RVAL_DECODED | RVAL_UDECIMAL;
|
||||
}
|
||||
|
442
configure.ac
442
configure.ac
@ -5,15 +5,35 @@
|
||||
# Copyright (c) 2006-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
# Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
|
||||
# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
|
||||
# Copyright (c) 2002-2018 The strace developers.
|
||||
# Copyright (c) 2002-2017 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# 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. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. 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.
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([strace],
|
||||
m4_esyscmd([./git-version-gen .tarball-version]),
|
||||
[strace-devel@lists.strace.io],
|
||||
[strace-devel@lists.sourceforge.net],
|
||||
[strace],
|
||||
[https://strace.io])
|
||||
m4_define([copyright_year], m4_esyscmd([./copyright-year-gen .year]))
|
||||
@ -26,13 +46,12 @@ AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests 1.13])
|
||||
AM_MAINTAINER_MODE
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
RPM_CHANGELOGTIME="$(LC_TIME=C date -u '+%a %b %d %Y')"
|
||||
RPM_CHANGELOGTIME="$(LC_TIME=C date '+%a %b %d %Y')"
|
||||
AC_SUBST(RPM_CHANGELOGTIME)
|
||||
DEB_CHANGELOGTIME="$(LC_TIME=C date -u -R)"
|
||||
DEB_CHANGELOGTIME="$(LC_TIME=C date -R)"
|
||||
AC_SUBST(DEB_CHANGELOGTIME)
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_CC_STDC
|
||||
AC_PROG_CPP
|
||||
st_WARN_CFLAGS
|
||||
AX_PROG_CC_FOR_BUILD
|
||||
@ -51,38 +70,11 @@ AC_SUBST([MANPAGE_DATE], [manpage_date])
|
||||
AC_MSG_CHECKING([for supported architecture])
|
||||
arch_m32=
|
||||
arch_mx32=
|
||||
cc_flags_m32=-m32
|
||||
cc_flags_mx32=-mx32
|
||||
case "$host_cpu" in
|
||||
aarch64*)
|
||||
arch=aarch64
|
||||
arch_m32=arm
|
||||
AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
|
||||
;;
|
||||
alpha*)
|
||||
arch=alpha
|
||||
AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
|
||||
;;
|
||||
arc*)
|
||||
arch=arc
|
||||
AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
|
||||
;;
|
||||
arm*)
|
||||
arch=arm
|
||||
AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
|
||||
;;
|
||||
avr32*)
|
||||
arch=avr32
|
||||
AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
|
||||
;;
|
||||
bfin)
|
||||
arch=bfin
|
||||
AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
|
||||
;;
|
||||
hppa*|parisc*)
|
||||
arch=hppa
|
||||
AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
|
||||
;;
|
||||
i[[3456]]86|pentium)
|
||||
arch=i386
|
||||
AC_DEFINE([I386], 1, [Define for the i386 architecture.])
|
||||
@ -95,25 +87,26 @@ m68k)
|
||||
arch=m68k
|
||||
AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
|
||||
;;
|
||||
sparc64*)
|
||||
arch=sparc64
|
||||
arch_m32=sparc
|
||||
AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
|
||||
;;
|
||||
sparc*)
|
||||
arch=sparc
|
||||
AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
|
||||
;;
|
||||
metag*)
|
||||
arch=metag
|
||||
AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
|
||||
;;
|
||||
microblaze*)
|
||||
arch=microblaze
|
||||
AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
|
||||
;;
|
||||
mips*)
|
||||
arch=mips
|
||||
AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
|
||||
;;
|
||||
nios2*)
|
||||
arch=nios2
|
||||
AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
|
||||
;;
|
||||
or1k*)
|
||||
arch=or1k
|
||||
AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
|
||||
alpha*)
|
||||
arch=alpha
|
||||
AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
|
||||
;;
|
||||
powerpc*)
|
||||
AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
|
||||
@ -126,9 +119,22 @@ powerpc*)
|
||||
AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
|
||||
fi
|
||||
;;
|
||||
riscv*)
|
||||
arch=riscv
|
||||
AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
|
||||
arm*)
|
||||
arch=arm
|
||||
AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
|
||||
;;
|
||||
aarch64*)
|
||||
arch=aarch64
|
||||
arch_m32=arm
|
||||
AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
|
||||
;;
|
||||
avr32*)
|
||||
arch=avr32
|
||||
AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
|
||||
;;
|
||||
arc*)
|
||||
arch=arc
|
||||
AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
|
||||
;;
|
||||
s390)
|
||||
arch=s390
|
||||
@ -136,10 +142,12 @@ s390)
|
||||
;;
|
||||
s390x)
|
||||
arch=s390x
|
||||
arch_m32=s390
|
||||
cc_flags_m32=-m31
|
||||
AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
|
||||
;;
|
||||
hppa*|parisc*)
|
||||
arch=hppa
|
||||
AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
|
||||
;;
|
||||
sh64*)
|
||||
arch=sh64
|
||||
AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
|
||||
@ -148,19 +156,6 @@ sh*)
|
||||
arch=sh
|
||||
AC_DEFINE([SH], 1, [Define for the SH architecture.])
|
||||
;;
|
||||
sparc64*)
|
||||
arch=sparc64
|
||||
arch_m32=sparc
|
||||
AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
|
||||
;;
|
||||
sparc*)
|
||||
arch=sparc
|
||||
AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
|
||||
;;
|
||||
tile*)
|
||||
arch=tile
|
||||
AC_DEFINE([TILE], 1, [Define for the Tile architecture])
|
||||
;;
|
||||
x86?64*)
|
||||
arch_m32=i386
|
||||
AC_TRY_COMPILE(
|
||||
@ -174,10 +169,42 @@ x86?64*)
|
||||
AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
|
||||
fi
|
||||
;;
|
||||
cris|crisv10)
|
||||
arch=crisv10
|
||||
AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
|
||||
;;
|
||||
crisv32)
|
||||
arch=crisv32
|
||||
AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
|
||||
;;
|
||||
tile*)
|
||||
arch=tile
|
||||
AC_DEFINE([TILE], 1, [Define for the Tile architecture])
|
||||
;;
|
||||
microblaze*)
|
||||
arch=microblaze
|
||||
AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
|
||||
;;
|
||||
nios2*)
|
||||
arch=nios2
|
||||
AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
|
||||
;;
|
||||
|
||||
or1k*)
|
||||
arch=or1k
|
||||
AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
|
||||
;;
|
||||
|
||||
xtensa*)
|
||||
arch=xtensa
|
||||
AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
|
||||
;;
|
||||
|
||||
riscv*)
|
||||
arch=riscv
|
||||
AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_RESULT([NO!])
|
||||
AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
|
||||
@ -185,8 +212,6 @@ xtensa*)
|
||||
esac
|
||||
AC_MSG_RESULT($arch)
|
||||
|
||||
arch_native=$arch
|
||||
|
||||
test -n "$arch_m32" ||
|
||||
arch_m32=$arch
|
||||
test -n "$arch_mx32" ||
|
||||
@ -194,15 +219,12 @@ test -n "$arch_mx32" ||
|
||||
AC_SUBST(arch)
|
||||
AC_SUBST(arch_m32)
|
||||
AC_SUBST(arch_mx32)
|
||||
AC_SUBST(cc_flags_m32)
|
||||
AC_SUBST(cc_flags_mx32)
|
||||
AC_SUBST(arch_native)
|
||||
|
||||
MIPS_ABI=
|
||||
if test "$arch" = mips; then
|
||||
AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
|
||||
[AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM], ,
|
||||
[AC_MSG_FAILURE([_MIPS_SIM cannot be determined])])])
|
||||
[AC_MSG_ERROR([_MIPS_SIM cannot be determined])])])
|
||||
|
||||
# requires GCC >= 3.4
|
||||
AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
|
||||
@ -255,7 +277,6 @@ AC_CHECK_FUNCS(m4_normalize([
|
||||
fstatat
|
||||
ftruncate
|
||||
futimens
|
||||
iconv_open
|
||||
if_indextoname
|
||||
open64
|
||||
prctl
|
||||
@ -283,10 +304,7 @@ AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
|
||||
[#include <sys/types.h>
|
||||
#include <asm/stat.h>])
|
||||
|
||||
AC_CHECK_TYPES([struct user_desc],
|
||||
[AC_CHECK_MEMBERS([struct user_desc.lm],,,
|
||||
[#include <asm/ldt.h>])],,
|
||||
[#include <asm/ldt.h>])
|
||||
AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
|
||||
|
||||
AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,,
|
||||
[#include <sys/types.h>
|
||||
@ -298,16 +316,11 @@ AC_CHECK_TYPES(m4_normalize([
|
||||
struct ptrace_peeksiginfo_args
|
||||
]),,, [#include <sys/ptrace.h>])
|
||||
|
||||
# For kernels that do not have v3.10-rc1~201^2~11
|
||||
AC_CHECK_TYPES([s390_compat_regs],,, [#include <asm/ptrace.h>])
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
struct flock,
|
||||
struct flock64,
|
||||
struct __kernel_flock,
|
||||
struct __kernel_flock64,
|
||||
struct f_owner_ex,
|
||||
struct __kernel_f_owner_ex
|
||||
struct __kernel_flock64
|
||||
]),,,
|
||||
[#include <sys/types.h>
|
||||
#include <linux/fcntl.h>])
|
||||
@ -351,7 +364,6 @@ AC_CHECK_MEMBERS(m4_normalize([
|
||||
struct perf_event_attr.use_clockid,
|
||||
struct perf_event_attr.context_switch,
|
||||
struct perf_event_attr.write_backward,
|
||||
struct perf_event_attr.namespaces,
|
||||
struct perf_event_attr.bp_type,
|
||||
struct perf_event_attr.config1,
|
||||
struct perf_event_attr.config2,
|
||||
@ -365,10 +377,9 @@ AC_CHECK_MEMBERS(m4_normalize([
|
||||
|
||||
AC_CHECK_HEADERS(m4_normalize([
|
||||
asm/cachectl.h
|
||||
asm/guarded_storage.h
|
||||
asm/sysmips.h
|
||||
bluetooth/bluetooth.h
|
||||
elf.h
|
||||
iconv.h
|
||||
inttypes.h
|
||||
linux/bsg.h
|
||||
linux/cryptouser.h
|
||||
@ -377,14 +388,13 @@ AC_CHECK_HEADERS(m4_normalize([
|
||||
linux/falloc.h
|
||||
linux/fib_rules.h
|
||||
linux/fiemap.h
|
||||
linux/genetlink.h
|
||||
linux/hiddev.h
|
||||
linux/if_addr.h
|
||||
linux/if_link.h
|
||||
linux/ip_vs.h
|
||||
linux/ipc.h
|
||||
linux/kcmp.h
|
||||
linux/kvm.h
|
||||
linux/memfd.h
|
||||
linux/mmtimer.h
|
||||
linux/msg.h
|
||||
linux/neighbour.h
|
||||
@ -410,7 +420,6 @@ AC_CHECK_HEADERS(m4_normalize([
|
||||
mqueue.h
|
||||
netinet/sctp.h
|
||||
netipx/ipx.h
|
||||
paths.h
|
||||
scsi/sg.h
|
||||
stropts.h
|
||||
sys/conf.h
|
||||
@ -419,6 +428,7 @@ AC_CHECK_HEADERS(m4_normalize([
|
||||
sys/ipc.h
|
||||
sys/msg.h
|
||||
sys/quota.h
|
||||
sys/reg.h
|
||||
sys/sem.h
|
||||
sys/shm.h
|
||||
sys/signalfd.h
|
||||
@ -448,18 +458,11 @@ AC_CHECK_HEADERS([linux/input.h], [
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS([linux/bpf.h], [
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
struct bpf_insn,
|
||||
struct bpf_map_info,
|
||||
struct bpf_prog_info
|
||||
]),,, [#include <linux/bpf.h>])
|
||||
st_BPF_ATTR
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS([bluetooth/bluetooth.h], [
|
||||
AC_CHECK_MEMBERS([struct sockaddr_l2.l2_bdaddr_type],,,
|
||||
[#include <bluetooth/bluetooth.h>
|
||||
#include <bluetooth/l2cap.h>])
|
||||
st_CHECK_UNION_BPF_ATTR([attach_flags])
|
||||
st_CHECK_UNION_BPF_ATTR([bpf_fd])
|
||||
st_CHECK_UNION_BPF_ATTR([flags])
|
||||
st_CHECK_UNION_BPF_ATTR([inner_map_fd])
|
||||
st_CHECK_UNION_BPF_ATTR([prog_flags])
|
||||
])
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
@ -478,8 +481,7 @@ AC_CHECK_TYPES([struct netconfmsg],,, [#include <linux/netconf.h>])
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
struct rta_mfc_stats,
|
||||
struct rtvia
|
||||
]),,, [#include <sys/socket.h>
|
||||
#include <linux/rtnetlink.h>])
|
||||
]),,, [#include <linux/rtnetlink.h>])
|
||||
|
||||
AC_CHECK_MEMBERS([struct ndt_stats.ndts_table_fulls],,, [#include <linux/neighbour.h>])
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
@ -489,23 +491,13 @@ AC_CHECK_TYPES(m4_normalize([
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
struct ifla_bridge_id,
|
||||
struct ifla_cacheinfo,
|
||||
struct ifla_port_vsi,
|
||||
struct rtnl_link_stats64
|
||||
]),,, [#include <sys/socket.h>
|
||||
#include <linux/rtnetlink.h>])
|
||||
]),,, [#include <linux/if_link.h>])
|
||||
AC_CHECK_MEMBERS(m4_normalize([
|
||||
struct rtnl_link_stats.rx_nohandler,
|
||||
struct rtnl_link_stats64.rx_nohandler
|
||||
]),,, [#include <sys/socket.h>
|
||||
#include <linux/rtnetlink.h>])
|
||||
AC_CHECK_DECLS(m4_normalize([
|
||||
IFLA_PORT_SELF,
|
||||
IFLA_PROTINFO,
|
||||
IFLA_AF_SPEC,
|
||||
IFLA_XDP
|
||||
]),,, [#include <sys/socket.h>
|
||||
#include <linux/rtnetlink.h>])
|
||||
]),,, [#include <linux/if_link.h>])
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
struct gnet_stats_basic,
|
||||
@ -514,15 +506,9 @@ AC_CHECK_TYPES(m4_normalize([
|
||||
struct gnet_stats_rate_est64
|
||||
]),,, [#include <linux/gen_stats.h>])
|
||||
|
||||
AC_CHECK_TYPES([struct tc_sizespec],,, [#include <linux/types.h>
|
||||
#include <linux/pkt_sched.h>])
|
||||
AC_CHECK_DECLS([TCA_STAB_DATA],,, [#include <linux/types.h>
|
||||
#include <linux/pkt_sched.h>])
|
||||
AC_CHECK_TYPES([struct tc_sizespec],,, [#include <linux/pkt_sched.h>])
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
struct fib_rule_uid_range,
|
||||
struct fib_rule_port_range
|
||||
]),,, [#include <linux/fib_rules.h>])
|
||||
AC_CHECK_TYPES([struct fib_rule_uid_range],,, [#include <linux/fib_rules.h>])
|
||||
|
||||
AC_CHECK_TYPES([struct statfs], [
|
||||
AC_CHECK_MEMBERS(m4_normalize([
|
||||
@ -548,47 +534,12 @@ AC_CHECK_TYPES([struct statfs64], [
|
||||
|
||||
AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>])
|
||||
|
||||
AC_CHECK_TYPES([struct mtd_write_req],,, [#include <mtd/mtd-abi.h>])
|
||||
|
||||
AC_CHECK_MEMBERS([struct ubi_attach_req.max_beb_per1024],,, [#include <mtd/ubi-user.h>])
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
struct ptp_sys_offset
|
||||
]),,, [#include <linux/ptp_clock.h>])
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
struct kvm_cpuid2,
|
||||
struct kvm_regs,
|
||||
struct kvm_sregs,
|
||||
struct kvm_userspace_memory_region
|
||||
]),,, [#include <linux/kvm.h>])
|
||||
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
|
||||
AC_CACHE_CHECK([whether <linux/signal.h> can be used along with <signal.h>],
|
||||
[st_cv_linux_signal],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <signal.h>
|
||||
#include <linux/signal.h>]],[])],
|
||||
[st_cv_linux_signal=yes],
|
||||
[st_cv_linux_signal=no])])
|
||||
if test "x$st_cv_linux_signal" = xno; then
|
||||
mkdir -p linux/linux
|
||||
cp $srcdir/linux/signal.h.in linux/linux/signal.h
|
||||
CPPFLAGS="$CPPFLAGS -Ilinux"
|
||||
fi
|
||||
|
||||
AC_CHECK_TYPES([struct __aio_sigset],,, [#include <linux/aio_abi.h>])
|
||||
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
|
||||
AC_CHECK_HEADERS([linux/btrfs.h], [
|
||||
AC_CHECK_MEMBERS(m4_normalize([
|
||||
struct btrfs_ioctl_feature_flags.compat_flags,
|
||||
struct btrfs_ioctl_fs_info_args.nodesize,
|
||||
struct btrfs_ioctl_defrag_range_args.start,
|
||||
struct btrfs_ioctl_search_args_v2.buf_size,
|
||||
struct btrfs_ioctl_logical_ino_args.flags
|
||||
struct btrfs_ioctl_search_args_v2.buf_size
|
||||
]),,, [ #include <stdio.h>
|
||||
#include <linux/btrfs.h>])
|
||||
AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB,
|
||||
@ -645,8 +596,6 @@ AC_CHECK_DECLS(m4_normalize([
|
||||
KERN_MAX_LOCK_DEPTH,
|
||||
KERN_NMI_WATCHDOG,
|
||||
KERN_PANIC_ON_NMI,
|
||||
KERN_PANIC_ON_WARN,
|
||||
KERN_PANIC_PRINT,
|
||||
NET_LLC,
|
||||
NET_NETFILTER,
|
||||
NET_DCCP,
|
||||
@ -769,17 +718,21 @@ AC_CHECK_MEMBERS(m4_normalize([
|
||||
#include <linux/types.h>
|
||||
#include <linux/videodev2.h>])
|
||||
|
||||
AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
|
||||
#include <stdlib.h>
|
||||
#include <linux/fs.h>], [return !BLKGETSIZE64;])],
|
||||
[ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
|
||||
if test $ac_cv_have_blkgetsize64 = yes; then
|
||||
AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
|
||||
fi)
|
||||
|
||||
AC_CHECK_SIZEOF([long])
|
||||
SIZEOF_LONG="$ac_cv_sizeof_long"
|
||||
AC_SUBST(SIZEOF_LONG)
|
||||
AC_CHECK_SIZEOF([long long])
|
||||
AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
|
||||
AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"])
|
||||
SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t"
|
||||
AC_SUBST(SIZEOF_KERNEL_LONG_T)
|
||||
AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
|
||||
|
||||
|
||||
AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
|
||||
[[st_cv_SIGRTMIN="$(echo SIGRTMIN |
|
||||
$CPP $CPPFLAGS -P -imacros asm/signal.h - |
|
||||
@ -818,99 +771,113 @@ if test "x$st_cv_have_program_invocation_name" = xyes; then
|
||||
[Define to 1 if the system provides program_invocation_name variable])
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for static_assert], [st_cv_have_static_assert],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <assert.h>]],
|
||||
[[static_assert(1,"")]]
|
||||
)
|
||||
],
|
||||
[st_cv_have_static_assert=yes],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([],
|
||||
[[_Static_assert(1,"")]]
|
||||
)
|
||||
],
|
||||
[st_cv_have_static_assert=_Static_assert],
|
||||
[st_cv_have_static_assert=no]
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
case "x$st_cv_have_static_assert" in
|
||||
xyes)
|
||||
AC_DEFINE([HAVE_STATIC_ASSERT], [1],
|
||||
[Define to 1 if the system provides static_assert])
|
||||
;;
|
||||
x_Static_assert)
|
||||
AC_DEFINE([HAVE__STATIC_ASSERT], [1],
|
||||
[Define to 1 if the system provides _Static_assert])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=])
|
||||
if test "x$ac_cv_lib_dl_dladdr" = xyes; then
|
||||
AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr])
|
||||
fi
|
||||
AC_SUBST(dl_LIBS)
|
||||
|
||||
saved_LIBS="$LIBS"
|
||||
AC_SEARCH_LIBS([timer_create], [rt])
|
||||
LIBS="$saved_LIBS"
|
||||
case "$ac_cv_search_timer_create" in
|
||||
no) AC_MSG_FAILURE([failed to find timer_create]) ;;
|
||||
-l*) timer_LIBS="$ac_cv_search_timer_create" ;;
|
||||
*) timer_LIBS= ;;
|
||||
esac
|
||||
AC_SUBST(timer_LIBS)
|
||||
|
||||
saved_LIBS="$LIBS"
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt])
|
||||
LIBS="$saved_LIBS"
|
||||
case "$ac_cv_search_clock_gettime" in
|
||||
no) AC_MSG_FAILURE([failed to find clock_gettime]) ;;
|
||||
-l*) clock_LIBS="$ac_cv_search_clock_gettime" ;;
|
||||
*) clock_LIBS= ;;
|
||||
esac
|
||||
AC_SUBST(clock_LIBS)
|
||||
|
||||
saved_LIBS="$LIBS"
|
||||
AC_SEARCH_LIBS([mq_open], [rt])
|
||||
LIBS="$saved_LIBS"
|
||||
case "$ac_cv_search_mq_open" in
|
||||
-l*) mq_LIBS="$ac_cv_search_mq_open" ;;
|
||||
*) mq_LIBS= ;;
|
||||
esac
|
||||
AC_SUBST(mq_LIBS)
|
||||
|
||||
AC_PATH_PROG([PERL], [perl])
|
||||
|
||||
AC_CHECK_TOOL([READELF], [readelf])
|
||||
dnl stack trace with libunwind
|
||||
libunwind_CPPFLAGS=
|
||||
libunwind_LDFLAGS=
|
||||
libunwind_LIBS=
|
||||
AC_ARG_WITH([libunwind],
|
||||
[AS_HELP_STRING([--with-libunwind],
|
||||
[use libunwind to implement stack tracing support])],
|
||||
[case "${withval}" in
|
||||
yes|no|check) ;;
|
||||
*) with_libunwind=yes
|
||||
libunwind_CPPFLAGS="-I${withval}/include"
|
||||
libunwind_LDFLAGS="-L${withval}/lib" ;;
|
||||
esac],
|
||||
[with_libunwind=check]
|
||||
)
|
||||
|
||||
st_STACKTRACE
|
||||
use_libunwind=no
|
||||
AS_IF([test "x$with_libunwind" != xno],
|
||||
[saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
|
||||
|
||||
AC_CHECK_HEADERS([libunwind-ptrace.h],
|
||||
[saved_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
|
||||
|
||||
AC_CHECK_LIB([unwind], [backtrace],
|
||||
[libunwind_LIBS="-lunwind $libunwind_LIBS"
|
||||
|
||||
AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
|
||||
saved_LIBS="$LIBS"
|
||||
LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
|
||||
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
|
||||
[[return !unw_create_addr_space(0, 0)]])
|
||||
],
|
||||
[AC_MSG_RESULT([yes])
|
||||
libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
|
||||
|
||||
AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
|
||||
[libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
|
||||
use_libunwind=yes
|
||||
],
|
||||
[if test "x$with_libunwind" != xcheck; then
|
||||
AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
|
||||
fi
|
||||
],
|
||||
[$libunwind_LIBS]
|
||||
)
|
||||
],
|
||||
[AC_MSG_RESULT([no])
|
||||
if test "x$with_libunwind" != xcheck; then
|
||||
AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
|
||||
fi
|
||||
]
|
||||
)
|
||||
|
||||
LIBS="$saved_LIBS"
|
||||
],
|
||||
[if test "x$with_libunwind" != xcheck; then
|
||||
AC_MSG_FAILURE([failed to find libunwind])
|
||||
fi
|
||||
],
|
||||
[$libunwind_LIBS]
|
||||
)
|
||||
|
||||
LDFLAGS="$saved_LDFLAGS"
|
||||
],
|
||||
[if test "x$with_libunwind" != xcheck; then
|
||||
AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
|
||||
fi
|
||||
]
|
||||
)
|
||||
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
]
|
||||
)
|
||||
|
||||
dnl enable libunwind
|
||||
AC_MSG_CHECKING([whether to enable stack tracing support using libunwind])
|
||||
if test "x$use_libunwind" = xyes; then
|
||||
AC_DEFINE([USE_LIBUNWIND], 1, [Compile stack tracing functionality])
|
||||
AC_SUBST(libunwind_LIBS)
|
||||
AC_SUBST(libunwind_LDFLAGS)
|
||||
AC_SUBST(libunwind_CPPFLAGS)
|
||||
fi
|
||||
AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
|
||||
AC_MSG_RESULT([$use_libunwind])
|
||||
|
||||
if test "$arch" = mips && test "$no_create" != yes; then
|
||||
mkdir -p linux/mips
|
||||
if $srcdir/linux/mips/genstub.sh linux/mips; then
|
||||
AC_MSG_RESULT([Generated MIPS syscallent stubs])
|
||||
else
|
||||
AC_MSG_ERROR([Failed to generate syscallent stubs])
|
||||
AC_MSG_FAILURE([Failed to generate syscallent stubs])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([mpers],
|
||||
[AS_HELP_STRING([--enable-mpers=yes|no|check|m32|mx32],
|
||||
[whether to enable multiple personalities support required
|
||||
for proper decoding of structures used by tracees with
|
||||
personalities that differ from the personality of strace,
|
||||
default is yes.])],
|
||||
[case "$enableval" in
|
||||
yes|no|check|m32|mx32) enable_mpers="$enableval" ;;
|
||||
*) AC_MSG_ERROR([bad value $enableval for enable-mpers option.
|
||||
Valid options are: yes, no, check, m32, mx32.])
|
||||
;;
|
||||
esac],
|
||||
[enable_mpers=yes])
|
||||
|
||||
st_MPERS([m32], [aarch64|powerpc64|riscv|s390x|sparc64|tile|x32|x86_64])
|
||||
st_MPERS([m32], [aarch64|powerpc64|sparc64|tile|x32|x86_64])
|
||||
st_MPERS([mx32], [x86_64])
|
||||
|
||||
AX_VALGRIND_DFLT([sgcheck], [off])
|
||||
@ -921,7 +888,6 @@ AC_CONFIG_FILES([Makefile
|
||||
tests-m32/Makefile
|
||||
tests-mx32/Makefile
|
||||
strace.1
|
||||
strace-log-merge.1
|
||||
strace.spec
|
||||
debian/changelog])
|
||||
AC_OUTPUT
|
||||
|
@ -1,8 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
@ -1,13 +1,7 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2017-2018 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#! /bin/sh
|
||||
|
||||
: ${YEAR_FILE:=$1}
|
||||
: ${DEFAULT_YEAR:=$2}
|
||||
LC_TIME=C; export LC_TIME
|
||||
|
||||
year=
|
||||
|
||||
@ -19,17 +13,11 @@ year=
|
||||
[ -f "${YEAR_FILE}" ] && year="$(cat "${YEAR_FILE}")"
|
||||
|
||||
[ -n "${year}" ] ||
|
||||
year="$(date -u +%Y -d "$(git show -s --format=format:%cD)")"
|
||||
year="$(date +%Y -d "$(git show --format=format:%cD --no-patch)")"
|
||||
|
||||
[ -n "${year}" ] ||
|
||||
year="${DEFAULT_YEAR}"
|
||||
[ -n "${year}" ] || year="${DEFAULT_YEAR}"
|
||||
|
||||
[ -n "${year}" ] ||
|
||||
[ -z "${SOURCE_DATE_EPOCH-}" ] ||
|
||||
year="$(date -u +%Y -d "@${SOURCE_DATE_EPOCH}")"
|
||||
|
||||
[ -n "${year}" ] ||
|
||||
year="$(date -u +%Y)"
|
||||
[ -n "${year}" ] || year="$(date "+%Y")"
|
||||
|
||||
[ -n "${year}" ] || {
|
||||
echo >&2 'Undefined year.'
|
||||
|
152
count.c
152
count.c
@ -8,10 +8,30 @@
|
||||
* <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
|
||||
* Copyright (c) 2004 Roland McGrath <roland@redhat.com>
|
||||
* Copyright (c) 2006 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2006-2018 The strace developers.
|
||||
* Copyright (c) 2006-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -19,45 +39,73 @@
|
||||
/* Per-syscall stats structure */
|
||||
struct call_counts {
|
||||
/* time may be total latency or system time */
|
||||
struct timespec time;
|
||||
unsigned int calls, errors;
|
||||
struct timeval time;
|
||||
int calls, errors;
|
||||
};
|
||||
|
||||
static struct call_counts *countv[SUPPORTED_PERSONALITIES];
|
||||
#define counts (countv[current_personality])
|
||||
|
||||
static struct timespec overhead;
|
||||
static struct timeval shortest = { 1000000, 0 };
|
||||
|
||||
void
|
||||
count_syscall(struct tcb *tcp, const struct timespec *syscall_exiting_ts)
|
||||
count_syscall(struct tcb *tcp, const struct timeval *syscall_exiting_tv)
|
||||
{
|
||||
struct timeval wtv;
|
||||
struct timeval *tv = &wtv;
|
||||
struct call_counts *cc;
|
||||
|
||||
if (!scno_in_range(tcp->scno))
|
||||
return;
|
||||
|
||||
if (!counts)
|
||||
counts = xcalloc(nsyscalls, sizeof(*counts));
|
||||
struct call_counts *cc = &counts[tcp->scno];
|
||||
cc = &counts[tcp->scno];
|
||||
|
||||
cc->calls++;
|
||||
if (syserror(tcp))
|
||||
cc->errors++;
|
||||
|
||||
if (count_wallclock) {
|
||||
/* wall clock time spent while in syscall */
|
||||
struct timespec wts;
|
||||
ts_sub(&wts, syscall_exiting_ts, &tcp->etime);
|
||||
/* tv = wall clock time spent while in syscall */
|
||||
tv_sub(tv, syscall_exiting_tv, &tcp->etime);
|
||||
|
||||
ts_add(&cc->time, &cc->time, &wts);
|
||||
} else {
|
||||
/* system CPU time spent while in syscall */
|
||||
ts_add(&cc->time, &cc->time, &tcp->dtime);
|
||||
/* Spent more wall clock time than spent system time? (usually yes) */
|
||||
if (tv_cmp(tv, &tcp->dtime) > 0) {
|
||||
static struct timeval one_tick = { -1, 0 };
|
||||
|
||||
if (one_tick.tv_sec == -1) {
|
||||
/* Initialize it. */
|
||||
struct itimerval it;
|
||||
|
||||
memset(&it, 0, sizeof(it));
|
||||
it.it_interval.tv_usec = 1;
|
||||
setitimer(ITIMER_REAL, &it, NULL);
|
||||
getitimer(ITIMER_REAL, &it);
|
||||
one_tick = it.it_interval;
|
||||
//FIXME: this hack doesn't work (tested on linux-3.6.11): one_tick = 0.000000
|
||||
//tprintf(" one_tick.tv_usec:%u\n", (unsigned)one_tick.tv_usec);
|
||||
}
|
||||
|
||||
if (tv_nz(&tcp->dtime))
|
||||
/* tv = system time spent, if it isn't 0 */
|
||||
tv = &tcp->dtime;
|
||||
else if (tv_cmp(tv, &one_tick) > 0) {
|
||||
/* tv = smallest "sane" time interval */
|
||||
if (tv_cmp(&shortest, &one_tick) < 0)
|
||||
tv = &shortest;
|
||||
else
|
||||
tv = &one_tick;
|
||||
}
|
||||
}
|
||||
if (tv_cmp(tv, &shortest) < 0)
|
||||
shortest = *tv;
|
||||
tv_add(&cc->time, &cc->time, count_wallclock ? &wtv : tv);
|
||||
}
|
||||
|
||||
static int
|
||||
time_cmp(void *a, void *b)
|
||||
{
|
||||
return -ts_cmp(&counts[*((int *) a)].time,
|
||||
return -tv_cmp(&counts[*((int *) a)].time,
|
||||
&counts[*((int *) b)].time);
|
||||
}
|
||||
|
||||
@ -79,6 +127,7 @@ count_cmp(void *a, void *b)
|
||||
}
|
||||
|
||||
static int (*sortfun)();
|
||||
static struct timeval overhead = { -1, -1 };
|
||||
|
||||
void
|
||||
set_sortby(const char *sortby)
|
||||
@ -99,72 +148,79 @@ set_sortby(const char *sortby)
|
||||
void set_overhead(int n)
|
||||
{
|
||||
overhead.tv_sec = n / 1000000;
|
||||
overhead.tv_nsec = n % 1000000 * 1000;
|
||||
overhead.tv_usec = n % 1000000;
|
||||
}
|
||||
|
||||
static void
|
||||
call_summary_pers(FILE *outf)
|
||||
{
|
||||
static const char dashes[] = "----------------";
|
||||
static const char header[] = "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n";
|
||||
static const char data[] = "%6.2f %11.6f %11lu %9u %9.u %s\n";
|
||||
static const char summary[] = "%6.6s %11.6f %11.11s %9u %9.u %s\n";
|
||||
|
||||
unsigned int i;
|
||||
unsigned int call_cum, error_cum;
|
||||
struct timespec tv_cum, dtv;
|
||||
int call_cum, error_cum;
|
||||
struct timeval tv_cum, dtv;
|
||||
double float_tv_cum;
|
||||
double percent;
|
||||
unsigned int *sorted_count;
|
||||
const char *dashes = "----------------";
|
||||
char error_str[sizeof(int)*3];
|
||||
int *sorted_count;
|
||||
|
||||
fprintf(outf, header,
|
||||
fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n",
|
||||
"% time", "seconds", "usecs/call",
|
||||
"calls", "errors", "syscall");
|
||||
fprintf(outf, header, dashes, dashes, dashes, dashes, dashes, dashes);
|
||||
fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n",
|
||||
dashes, dashes, dashes, dashes, dashes, dashes);
|
||||
|
||||
sorted_count = xcalloc(sizeof(sorted_count[0]), nsyscalls);
|
||||
call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_nsec = 0;
|
||||
sorted_count = xcalloc(sizeof(int), nsyscalls);
|
||||
call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_usec = 0;
|
||||
if (overhead.tv_sec == -1) {
|
||||
tv_mul(&overhead, &shortest, 8);
|
||||
tv_div(&overhead, &overhead, 10);
|
||||
}
|
||||
for (i = 0; i < nsyscalls; i++) {
|
||||
sorted_count[i] = i;
|
||||
if (counts == NULL || counts[i].calls == 0)
|
||||
continue;
|
||||
ts_mul(&dtv, &overhead, counts[i].calls);
|
||||
ts_sub(&counts[i].time, &counts[i].time, &dtv);
|
||||
if (counts[i].time.tv_sec < 0 || counts[i].time.tv_nsec < 0)
|
||||
counts[i].time.tv_sec = counts[i].time.tv_nsec = 0;
|
||||
tv_mul(&dtv, &overhead, counts[i].calls);
|
||||
tv_sub(&counts[i].time, &counts[i].time, &dtv);
|
||||
call_cum += counts[i].calls;
|
||||
error_cum += counts[i].errors;
|
||||
ts_add(&tv_cum, &tv_cum, &counts[i].time);
|
||||
tv_add(&tv_cum, &tv_cum, &counts[i].time);
|
||||
}
|
||||
float_tv_cum = ts_float(&tv_cum);
|
||||
float_tv_cum = tv_float(&tv_cum);
|
||||
if (counts) {
|
||||
if (sortfun)
|
||||
qsort((void *) sorted_count, nsyscalls,
|
||||
sizeof(sorted_count[0]), sortfun);
|
||||
qsort((void *) sorted_count, nsyscalls, sizeof(int), sortfun);
|
||||
for (i = 0; i < nsyscalls; i++) {
|
||||
double float_syscall_time;
|
||||
unsigned int idx = sorted_count[i];
|
||||
int idx = sorted_count[i];
|
||||
struct call_counts *cc = &counts[idx];
|
||||
if (cc->calls == 0)
|
||||
continue;
|
||||
ts_div(&dtv, &cc->time, cc->calls);
|
||||
float_syscall_time = ts_float(&cc->time);
|
||||
tv_div(&dtv, &cc->time, cc->calls);
|
||||
error_str[0] = '\0';
|
||||
if (cc->errors)
|
||||
sprintf(error_str, "%u", cc->errors);
|
||||
float_syscall_time = tv_float(&cc->time);
|
||||
percent = (100.0 * float_syscall_time);
|
||||
if (percent != 0.0)
|
||||
percent /= float_tv_cum;
|
||||
/* else: float_tv_cum can be 0.0 too and we get 0/0 = NAN */
|
||||
fprintf(outf, data,
|
||||
fprintf(outf, "%6.2f %11.6f %11lu %9u %9.9s %s\n",
|
||||
percent, float_syscall_time,
|
||||
(long) (1000000 * dtv.tv_sec + dtv.tv_nsec / 1000),
|
||||
cc->calls, cc->errors, sysent[idx].sys_name);
|
||||
(long) (1000000 * dtv.tv_sec + dtv.tv_usec),
|
||||
cc->calls,
|
||||
error_str, sysent[idx].sys_name);
|
||||
}
|
||||
}
|
||||
free(sorted_count);
|
||||
|
||||
fprintf(outf, header, dashes, dashes, dashes, dashes, dashes, dashes);
|
||||
fprintf(outf, summary,
|
||||
fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n",
|
||||
dashes, dashes, dashes, dashes, dashes, dashes);
|
||||
error_str[0] = '\0';
|
||||
if (error_cum)
|
||||
sprintf(error_str, "%u", error_cum);
|
||||
fprintf(outf, "%6.6s %11.6f %11.11s %9u %9.9s %s\n",
|
||||
"100.00", float_tv_cum, "",
|
||||
call_cum, error_cum, "total");
|
||||
call_cum, error_str, "total");
|
||||
}
|
||||
|
||||
void
|
||||
@ -180,8 +236,8 @@ call_summary(FILE *outf)
|
||||
set_personality(i);
|
||||
if (i)
|
||||
fprintf(outf,
|
||||
"System call usage summary for %s mode:\n",
|
||||
personality_names[i]);
|
||||
"System call usage summary for %d bit mode:\n",
|
||||
current_wordsize * 8);
|
||||
call_summary_pers(outf);
|
||||
}
|
||||
|
||||
|
51
debian/changelog.in
vendored
51
debian/changelog.in
vendored
@ -4,48 +4,6 @@ strace (@PACKAGE_VERSION@-1) experimental; urgency=low
|
||||
|
||||
-- Strace <@PACKAGE_BUGREPORT@> @DEB_CHANGELOGTIME@
|
||||
|
||||
strace (4.26-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version.
|
||||
|
||||
-- Dmitry V. Levin <ldv@altlinux.org> Wed, 26 Dec 2018 18:25:10 +0000
|
||||
|
||||
strace (4.25-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version.
|
||||
|
||||
-- Dmitry V. Levin <ldv@altlinux.org> Tue, 30 Oct 2018 08:09:10 +0000
|
||||
|
||||
strace (4.24-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version.
|
||||
|
||||
-- Dmitry V. Levin <ldv@altlinux.org> Tue, 14 Aug 2018 00:01:02 +0000
|
||||
|
||||
strace (4.23-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version.
|
||||
|
||||
-- Dmitry V. Levin <ldv@altlinux.org> Thu, 14 Jun 2018 11:00:00 +0000
|
||||
|
||||
strace (4.22-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version.
|
||||
|
||||
-- Dmitry V. Levin <ldv@altlinux.org> Thu, 05 Apr 2018 04:05:06 +0000
|
||||
|
||||
strace (4.21-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version.
|
||||
|
||||
-- Dmitry V. Levin <ldv@altlinux.org> Tue, 13 Feb 2018 23:24:25 +0000
|
||||
|
||||
strace (4.20-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version.
|
||||
|
||||
-- Dmitry V. Levin <ldv@altlinux.org> Mon, 13 Nov 2017 20:21:22 +0000
|
||||
|
||||
strace (4.19-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version.
|
||||
@ -965,24 +923,23 @@ strace (3.1-4) unstable; urgency=low
|
||||
|
||||
* Fixed changestemplate
|
||||
|
||||
-- Wichert Akkerman <wakkerma@wi.leidenuniv.nl> Thu, 12 Sep 1996 14:59:44 +0200
|
||||
-- Wichert Akkerman <wakkerma@wi.leidenuniv.nl>, Thu Sep 12 14:59:44 MET DST 1996
|
||||
|
||||
strace (3.1-3) unstable; urgency=low
|
||||
|
||||
* Revamped debian files
|
||||
|
||||
-- Wichert Akkerman <wakkerma@wi.leidenuniv.nl> Thu, 11 Jul 1996 20:19:11 +0200
|
||||
-- Wichert Akkerman <wakkerma@wi.leidenuniv.nl>, Thu Jul 11 20:19:11 MET DST 1996
|
||||
|
||||
|
||||
strace (3.1-2) unstable; urgency=low
|
||||
|
||||
* Added some #ifdef's around IPX stuff to make it compilable on non-Linux
|
||||
systems.
|
||||
* changed debian.control and debian.rules to conform to new debian naming
|
||||
schemes
|
||||
* added architecture-option to debian.rules and debian.control
|
||||
|
||||
-- Wichert Akkerman <wakkerma@wi.leidenuniv.nl> Thu, 1 Jul 1996 00:00:00 +0000
|
||||
-- Wichert Akkerman <wakkerma@wi.leidenuniv.nl>
|
||||
|
||||
strace (3.1-1) unstable; urgency=low
|
||||
|
||||
@ -995,4 +952,4 @@ strace (3.1-1) unstable; urgency=low
|
||||
* added IP, IPX and TCP support to get-/setsockopt()
|
||||
* added IPX support
|
||||
|
||||
-- Wichert Akkerman <wakkerma@wi.leidenuniv.nl> Thu, 1 Jun 1996 00:00:00 +0000
|
||||
-- Wichert Akkerman <wakkerma@wi.leidenuniv.nl>
|
||||
|
2
debian/compat
vendored
2
debian/compat
vendored
@ -1 +1 @@
|
||||
10
|
||||
7
|
||||
|
16
debian/control
vendored
16
debian/control
vendored
@ -2,14 +2,14 @@ Source: strace
|
||||
Maintainer: Steve McIntyre <93sam@debian.org>
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Build-Depends: libc6-dev (>= 2.2.2) [!alpha !ia64], libc6.1-dev (>= 2.2.2) [alpha ia64], gcc-multilib [amd64 i386 powerpc ppc64 ppc64el s390 s390x sparc sparc64 x32], debhelper (>= 7.0.0), gawk, libdw-dev, libiberty-dev, libbluetooth-dev
|
||||
Standards-Version: 4.1.3
|
||||
Build-Depends: libc6-dev (>= 2.2.2) [!alpha !ia64], libc6.1-dev (>= 2.2.2) [alpha ia64], gcc-multilib [amd64 i386 powerpc ppc64 s390 sparc sparc64 x32], debhelper (>= 7.0.0), gawk
|
||||
Standards-Version: 3.9.6
|
||||
Homepage: https://strace.io
|
||||
Vcs-Git: https://salsa.debian.org/debian/strace.git
|
||||
Vcs-Browser: https://salsa.debian.org/debian/strace
|
||||
Vcs-Git: https://anonscm.debian.org/git/collab-maint/strace.git
|
||||
Vcs-Browser: https://anonscm.debian.org/git/collab-maint/strace.git
|
||||
|
||||
Package: strace
|
||||
Architecture: linux-any
|
||||
Architecture: alpha amd64 arm64 armeb armel armhf hppa i386 ia64 m68k mips mipsel mips64 mips64el or1k powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64 x32
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: System call tracer
|
||||
strace is a system call tracer, i.e. a debugging tool which prints out
|
||||
@ -23,7 +23,7 @@ Description: System call tracer
|
||||
|
||||
Package: strace64
|
||||
Architecture: i386 powerpc s390 sparc
|
||||
Priority: optional
|
||||
Priority: extra
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: System call tracer for 64bit binaries
|
||||
strace is a system call tracer, i.e. a debugging tool which prints out
|
||||
@ -41,8 +41,8 @@ Description: System call tracer for 64bit binaries
|
||||
Package: strace-udeb
|
||||
Section: debian-installer
|
||||
XC-Package-Type: udeb
|
||||
Priority: optional
|
||||
Architecture: linux-any
|
||||
Priority: extra
|
||||
Architecture: alpha amd64 arm64 armeb armel armhf hppa i386 ia64 m68k mips mipsel mips64 mips64el or1k powerpc powerpcspe ppc64 ppc64el s390 sh4 sparc sparc64 x32
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: System call tracer
|
||||
strace is a system call tracer, i.e. a debugging tool which prints out
|
||||
|
38
debian/copyright
vendored
38
debian/copyright
vendored
@ -1,7 +1,7 @@
|
||||
This is the Debian packaged version of strace. For a complete list of
|
||||
changes from the upstream version please see the changelog.
|
||||
|
||||
The upstream sources can be found at https://github.com/strace/strace/
|
||||
The upstream sources can be found at http://sourceforge.net/projects/strace/
|
||||
|
||||
This is the copyright as found in the upstream sources:
|
||||
|
||||
@ -10,18 +10,30 @@ Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
|
||||
Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
|
||||
Copyright (c) 1995, 1996 Michael Elizabeth Chastain <mec@duracef.shout.net>
|
||||
Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
|
||||
Copyright (c) 1998-2001 Wichert Akkerman <wakkerma@deephackmode.org>
|
||||
Copyright (c) 2001-2018 The strace developers.
|
||||
Copyright (c) 1998-2003 Wichert Akkerman <wakkerma@deephackmode.org>
|
||||
Copyright (c) 2002-2008 Roland McGrath <roland@redhat.com>
|
||||
Copyright (c) 2003-2008 Dmitry V. Levin <ldv@altlinux.org>
|
||||
Copyright (c) 2007-2008 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
All rights reserved.
|
||||
|
||||
strace is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 2.1 of the License,
|
||||
or (at your option) any later version.
|
||||
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. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
strace is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See LGPL-2.1-or-later for more details.
|
||||
|
||||
strace test suite is provided under the terms of the GNU General Public License
|
||||
version 2 or later, see tests/COPYING for more details.
|
||||
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.
|
||||
|
60
debian/rules
vendored
60
debian/rules
vendored
@ -5,7 +5,6 @@
|
||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
DPKG_EXPORT_BUILDFLAGS = 1
|
||||
include /usr/share/dpkg/buildflags.mk
|
||||
include /usr/share/dpkg/architecture.mk
|
||||
|
||||
CFLAGS += -Wall -g
|
||||
|
||||
@ -20,7 +19,9 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
||||
MAKEFLAGS += -j$(NUMJOBS)
|
||||
endif
|
||||
|
||||
extra_build_targets += build-udeb-stamp
|
||||
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
|
||||
|
||||
arch64_map = i386=x86_64 powerpc=powerpc64 sparc=sparc64 s390=s390x
|
||||
ifneq (,$(filter $(DEB_HOST_ARCH)=%, $(arch64_map)))
|
||||
@ -43,34 +44,25 @@ build: build-arch build-indep
|
||||
build-arch: build-stamp $(extra_build_targets)
|
||||
build-indep: build-stamp $(extra_build_targets)
|
||||
|
||||
configure:
|
||||
./bootstrap
|
||||
|
||||
%-stamp: %/Makefile
|
||||
$(MAKE) -C $*
|
||||
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
|
||||
$*/strace -V
|
||||
$(MAKE) -C $* check VERBOSE=1
|
||||
endif
|
||||
touch $@
|
||||
|
||||
build/Makefile: configure
|
||||
build/Makefile:
|
||||
mkdir -p $(@D)
|
||||
cd $(@D); sh ../configure --enable-mpers=check --prefix=/usr $(CONFIG_OPTS)
|
||||
cd $(@D); sh ../configure --prefix=/usr $(CONFIG_OPTS)
|
||||
|
||||
build-udeb/Makefile: configure
|
||||
build64/Makefile:
|
||||
mkdir -p $(@D)
|
||||
cd $(@D); sh ../configure --enable-mpers=check --prefix=/usr \
|
||||
--without-stacktrace --without-libiberty $(CONFIG_OPTS)
|
||||
|
||||
build64/Makefile: configure
|
||||
mkdir -p $(@D)
|
||||
cd $(@D); CC="$(CC64)" sh ../configure --enable-mpers=check --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(HOST64)
|
||||
cd $(@D); CC="$(CC64)" sh ../configure --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(HOST64)
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -rf build build-udeb build64 strace64.1 debian/strace64.substvars
|
||||
rm -rf build build64 strace64.1 debian/strace64.substvars
|
||||
dh_clean
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
@ -82,22 +74,22 @@ binary-arch: build
|
||||
|
||||
# prepare 64bit executable and manpage, if it has been built
|
||||
test -f build64-stamp && ( mv build64/strace build64/strace64 ; \
|
||||
mv build64/strace.1 build64/strace64.1 ) || true
|
||||
cp strace.1 strace64.1 ) || true
|
||||
|
||||
dh_testdir -a
|
||||
dh_testroot -a
|
||||
dh_installdirs -a
|
||||
dh_installdocs -a
|
||||
dh_installman -a
|
||||
dh_installexamples -a
|
||||
dh_installchangelogs -a
|
||||
dh_install -a
|
||||
dh_link -a
|
||||
dh_strip -a
|
||||
dh_compress -a
|
||||
dh_fixperms -a
|
||||
dh_installdeb -a
|
||||
dh_shlibdeps -a
|
||||
dh_gencontrol -a
|
||||
dh_md5sums -a
|
||||
dh_builddeb -a
|
||||
dh_testdir -s
|
||||
dh_testroot -s
|
||||
dh_installdirs -s
|
||||
dh_installdocs -s
|
||||
dh_installman -s
|
||||
dh_installexamples -s
|
||||
dh_installchangelogs -s
|
||||
dh_install -s
|
||||
dh_link -s
|
||||
dh_strip -s
|
||||
dh_compress -s
|
||||
dh_fixperms -s
|
||||
dh_installdeb -s
|
||||
dh_shlibdeps -s
|
||||
dh_gencontrol -s
|
||||
dh_md5sums -s
|
||||
dh_builddeb -s
|
||||
|
2
debian/strace-udeb.install
vendored
2
debian/strace-udeb.install
vendored
@ -1 +1 @@
|
||||
build-udeb/strace usr/bin
|
||||
build/strace usr/bin
|
||||
|
1
debian/strace.install
vendored
1
debian/strace.install
vendored
@ -1,2 +1 @@
|
||||
build/strace usr/bin
|
||||
strace-log-merge usr/bin
|
||||
|
3
debian/strace.manpages
vendored
3
debian/strace.manpages
vendored
@ -1,2 +1 @@
|
||||
build/strace.1
|
||||
build/strace-log-merge.1
|
||||
strace.1
|
||||
|
2
debian/strace64.manpages
vendored
2
debian/strace64.manpages
vendored
@ -1 +1 @@
|
||||
build64/strace64.1
|
||||
strace64.1
|
||||
|
134
delay.c
134
delay.c
@ -1,134 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
struct inject_delay_data {
|
||||
struct timespec ts_enter;
|
||||
struct timespec ts_exit;
|
||||
};
|
||||
|
||||
static struct inject_delay_data *delay_data_vec;
|
||||
static size_t delay_data_vec_capacity; /* size of the arena */
|
||||
static size_t delay_data_vec_size; /* size of the used arena */
|
||||
|
||||
static timer_t delay_timer = (timer_t) -1;
|
||||
static bool delay_timer_is_armed;
|
||||
|
||||
static void
|
||||
expand_delay_data_vec(void)
|
||||
{
|
||||
const size_t old_capacity = delay_data_vec_capacity;
|
||||
delay_data_vec = xgrowarray(delay_data_vec, &delay_data_vec_capacity,
|
||||
sizeof(*delay_data_vec));
|
||||
memset(delay_data_vec + old_capacity, 0,
|
||||
(delay_data_vec_capacity - old_capacity)
|
||||
* sizeof(*delay_data_vec));
|
||||
}
|
||||
|
||||
uint16_t
|
||||
alloc_delay_data(void)
|
||||
{
|
||||
const uint16_t rval = delay_data_vec_size;
|
||||
|
||||
if (rval < delay_data_vec_size)
|
||||
error_func_msg_and_die("delay index overflow");
|
||||
|
||||
if (delay_data_vec_size == delay_data_vec_capacity)
|
||||
expand_delay_data_vec();
|
||||
|
||||
++delay_data_vec_size;
|
||||
return rval;
|
||||
}
|
||||
|
||||
void
|
||||
fill_delay_data(uint16_t delay_idx, int intval, bool isenter)
|
||||
{
|
||||
if (delay_idx >= delay_data_vec_size)
|
||||
error_func_msg_and_die("delay_idx >= delay_data_vec_size");
|
||||
|
||||
struct timespec *ts;
|
||||
if (isenter)
|
||||
ts = &(delay_data_vec[delay_idx].ts_enter);
|
||||
else
|
||||
ts = &(delay_data_vec[delay_idx].ts_exit);
|
||||
|
||||
ts->tv_sec = intval / 1000000;
|
||||
ts->tv_nsec = intval % 1000000 * 1000;
|
||||
}
|
||||
|
||||
static bool
|
||||
is_delay_timer_created(void)
|
||||
{
|
||||
return delay_timer != (timer_t) -1;
|
||||
}
|
||||
|
||||
bool
|
||||
is_delay_timer_armed(void)
|
||||
{
|
||||
return delay_timer_is_armed;
|
||||
}
|
||||
|
||||
void
|
||||
delay_timer_expired(void)
|
||||
{
|
||||
delay_timer_is_armed = false;
|
||||
}
|
||||
|
||||
void
|
||||
arm_delay_timer(const struct tcb *const tcp)
|
||||
{
|
||||
const struct itimerspec its = {
|
||||
.it_value = tcp->delay_expiration_time
|
||||
};
|
||||
|
||||
if (timer_settime(delay_timer, TIMER_ABSTIME, &its, NULL))
|
||||
perror_msg_and_die("timer_settime");
|
||||
|
||||
delay_timer_is_armed = true;
|
||||
|
||||
debug_func_msg("timer set to %lld.%09ld for pid %d",
|
||||
(long long) tcp->delay_expiration_time.tv_sec,
|
||||
(long) tcp->delay_expiration_time.tv_nsec,
|
||||
tcp->pid);
|
||||
}
|
||||
|
||||
void
|
||||
delay_tcb(struct tcb *tcp, uint16_t delay_idx, bool isenter)
|
||||
{
|
||||
if (delay_idx >= delay_data_vec_size)
|
||||
error_func_msg_and_die("delay_idx >= delay_data_vec_size");
|
||||
|
||||
debug_func_msg("delaying pid %d on %s",
|
||||
tcp->pid, isenter ? "enter" : "exit");
|
||||
tcp->flags |= TCB_DELAYED;
|
||||
|
||||
struct timespec *ts_diff;
|
||||
if (isenter)
|
||||
ts_diff = &(delay_data_vec[delay_idx].ts_enter);
|
||||
else
|
||||
ts_diff = &(delay_data_vec[delay_idx].ts_exit);
|
||||
|
||||
struct timespec ts_now;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts_now);
|
||||
ts_add(&tcp->delay_expiration_time, &ts_now, ts_diff);
|
||||
|
||||
if (is_delay_timer_created()) {
|
||||
struct itimerspec its;
|
||||
if (timer_gettime(delay_timer, &its))
|
||||
perror_msg_and_die("timer_gettime");
|
||||
|
||||
const struct timespec *const ts_old = &its.it_value;
|
||||
if (ts_nz(ts_old) && ts_cmp(ts_diff, ts_old) > 0)
|
||||
return;
|
||||
} else {
|
||||
if (timer_create(CLOCK_MONOTONIC, NULL, &delay_timer))
|
||||
perror_msg_and_die("timer_create");
|
||||
}
|
||||
|
||||
arm_delay_timer(tcp);
|
||||
}
|
18
delay.h
18
delay.h
@ -1,18 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#ifndef STRACE_DELAY_H
|
||||
# define STRACE_DELAY_H
|
||||
|
||||
uint16_t alloc_delay_data(void);
|
||||
void fill_delay_data(uint16_t delay_idx, int intval, bool isenter);
|
||||
bool is_delay_timer_armed(void);
|
||||
void delay_timer_expired(void);
|
||||
void arm_delay_timer(const struct tcb *);
|
||||
void delay_tcb(struct tcb *, uint16_t delay_idx, bool isenter);
|
||||
|
||||
#endif /* !STRACE_DELAY_H */
|
62
desc.c
62
desc.c
@ -3,14 +3,33 @@
|
||||
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
|
||||
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
|
||||
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
|
||||
* Copyright (c) 1999-2018 The strace developers.
|
||||
* Copyright (c) 1999-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
#include "xstring.h"
|
||||
|
||||
SYS_FUNC(close)
|
||||
{
|
||||
@ -138,9 +157,7 @@ decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
|
||||
/* +2 chars needed at the end: ']',NUL */
|
||||
if (outptr < end_outstr - (sizeof(", except [") + sizeof(int)*3 + 2)) {
|
||||
if (first) {
|
||||
outptr = xappendstr(outstr,
|
||||
outptr,
|
||||
"%s%s [%u",
|
||||
outptr += sprintf(outptr, "%s%s [%u",
|
||||
sep,
|
||||
i == 0 ? "in" : i == 1 ? "out" : "except",
|
||||
j
|
||||
@ -148,9 +165,7 @@ decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
|
||||
first = 0;
|
||||
sep = ", ";
|
||||
} else {
|
||||
outptr = xappendstr(outstr,
|
||||
outptr,
|
||||
" %u", j);
|
||||
outptr += sprintf(outptr, " %u", j);
|
||||
}
|
||||
}
|
||||
if (--ready_fds == 0)
|
||||
@ -164,8 +179,7 @@ decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
|
||||
if (args[4]) {
|
||||
const char *str = sprint_tv_ts(tcp, args[4]);
|
||||
if (outptr + sizeof("left ") + strlen(sep) + strlen(str) < end_outstr) {
|
||||
outptr = xappendstr(outstr, outptr,
|
||||
"%sleft %s", sep, str);
|
||||
outptr += sprintf(outptr, "%sleft %s", sep, str);
|
||||
}
|
||||
}
|
||||
*outptr = '\0';
|
||||
@ -176,21 +190,29 @@ decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if HAVE_ARCH_OLD_SELECT
|
||||
SYS_FUNC(oldselect)
|
||||
{
|
||||
kernel_ulong_t *args =
|
||||
fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 5);
|
||||
kernel_ulong_t select_args[5];
|
||||
unsigned int oldselect_args[5];
|
||||
|
||||
if (args) {
|
||||
return decode_select(tcp, args, print_timeval, sprint_timeval);
|
||||
if (sizeof(*select_args) == sizeof(*oldselect_args)) {
|
||||
if (umove_or_printaddr(tcp, tcp->u_arg[0], &select_args)) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (entering(tcp))
|
||||
printaddr(tcp->u_arg[0]);
|
||||
return RVAL_DECODED;
|
||||
unsigned int i;
|
||||
|
||||
if (umove_or_printaddr(tcp, tcp->u_arg[0], &oldselect_args)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < 5; ++i) {
|
||||
select_args[i] = oldselect_args[i];
|
||||
}
|
||||
}
|
||||
|
||||
return decode_select(tcp, select_args, print_timeval, sprint_timeval);
|
||||
}
|
||||
#endif /* HAVE_ARCH_OLD_SELECT */
|
||||
|
||||
#ifdef ALPHA
|
||||
SYS_FUNC(osf_select)
|
||||
|
24
dirent.c
24
dirent.c
@ -4,10 +4,30 @@
|
||||
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
|
||||
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
|
||||
* Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* Copyright (c) 2014-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
24
dirent64.c
24
dirent64.c
@ -4,10 +4,30 @@
|
||||
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
|
||||
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
|
||||
* Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2018 The strace developers.
|
||||
* Copyright (c) 2015-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
134
dist/INSTALL
vendored
134
dist/INSTALL
vendored
@ -1,134 +0,0 @@
|
||||
0. BUILD REQUIREMENTS
|
||||
|
||||
- Sane POSIX shell.
|
||||
- gcc-like compiler that supports C99 and some GNU extensions (namely, empty
|
||||
structures, empty definitions, zero length arrays, ranged designated
|
||||
initialisers).
|
||||
- libc. GNU libc and musl are supported.
|
||||
- Linux UAPI headers.
|
||||
- GNU Make.
|
||||
- GNU coreutils.
|
||||
- For running test suite: gawk, grep, sed, runtime environment for all
|
||||
personalities.
|
||||
- Requirements for optional features are documented in their description.
|
||||
|
||||
1. CONFIGURATION AND OPTIONAL FEATURES
|
||||
|
||||
Configuration is done using GNU Autoconf-generated configure script.
|
||||
Please refer to the README-configure file for generic information regarding
|
||||
configure usage.
|
||||
|
||||
In addition to standard configure options, strace's configure file provides
|
||||
the following options:
|
||||
|
||||
1.1. Additional build and testing hardening
|
||||
|
||||
--enable-gcc-Werror turn on gcc's -Werror option
|
||||
--enable-code-coverage Whether to enable code coverage support
|
||||
--with-gcov=GCOV use given GCOV for coverage (GCOV=gcov).
|
||||
--enable-valgrind Whether to enable Valgrind on the unit tests
|
||||
--disable-valgrind-memcheck
|
||||
Whether to skip memcheck during the Valgrind tests
|
||||
--disable-valgrind-helgrind
|
||||
Whether to skip helgrind during the Valgrind tests
|
||||
--disable-valgrind-drd Whether to skip drd during the Valgrind tests
|
||||
--enable-valgrind-sgcheck
|
||||
Whether to use sgcheck during the Valgrind tests
|
||||
|
||||
1.2. Optional features
|
||||
|
||||
1.2.1. Multiple personalities support
|
||||
|
||||
--enable-mpers=yes|no|check|m32|mx32
|
||||
whether to enable multiple personalities support
|
||||
required for proper decoding of structures used by
|
||||
tracees with personalities that differ from the
|
||||
personality of strace, default is yes.
|
||||
|
||||
Personality is a way system call is performed (in terms of ABI). For example,
|
||||
Linux kernel on multiple 64-bit architectures that evolve from their 32-bit
|
||||
counterparts have support for running 32-bit binaries with 32-bit system call
|
||||
ABI, and that system call ABI constitutes a separate personality in strace's
|
||||
terms. Another example is 32-on-64 bit ABI; while exploiting the same way for
|
||||
performing system calls as native 64-bit system calls, this ABI has different
|
||||
type sizes and, as a result, also constitutes a separate personality; the only
|
||||
such ABI that is currently supported by strace is x32 on x86_64. This is
|
||||
important as different ABIs use different alignments and type sizes, as a
|
||||
result, fields in structures in unions have different offsets on different
|
||||
ABIs. In order to be able to correctly parse all the structures used in various
|
||||
system calls and ioctl commands, strace compiles these structure definitions
|
||||
for these different ABI and then parses DWARF of these compiled definitions in
|
||||
order to generate proper structure definitions that compiled with decoder code.
|
||||
Taking the aforementioned into account, there are the following requirements:
|
||||
|
||||
- gawk (at least version 3)
|
||||
- Ability to compile for m32 personality (on architectures where it is supported)
|
||||
- On x86_64, x32, powerpc64, sparc64, riscv64, tile64: gcc -m32
|
||||
- s390x: gcc -m31
|
||||
- AArch64: a separate compiler for armv7 EABI
|
||||
- See information about configuration in "1.3.2. AArch64: AArch32 support"
|
||||
- Ability to compile for mx32 personality (on architectures where it is supported)
|
||||
- On x86_64: gcc -mx32
|
||||
- For tests: runtime support (linker, libc, and loader)
|
||||
|
||||
1.2.2. Stack unwinding (-k option)
|
||||
|
||||
--with-libunwind use libunwind to implement stack tracing support
|
||||
--with-libiberty use libiberty to demangle symbols in stack trace
|
||||
|
||||
1.3. Architecture-specific features
|
||||
|
||||
1.3.1. ARMv7: OABI support
|
||||
|
||||
--enable-arm-oabi enable OABI support on ARM EABI
|
||||
|
||||
1.3.2. AArch64: AArch32 support
|
||||
|
||||
CC_FOR_M32
|
||||
CPP_FOR_M32
|
||||
CFLAGS_FOR_M32
|
||||
CPPFLAGS_FOR_M32
|
||||
|
||||
1.4. Miscellanea
|
||||
|
||||
1.4.1. Static build configuration
|
||||
|
||||
For static linking, provide LDFLAGS='-static -pthread'.
|
||||
|
||||
1.4.2. Cross-compilation configuration
|
||||
|
||||
2. BUILDING
|
||||
|
||||
make
|
||||
make V=1
|
||||
|
||||
3. TESTING
|
||||
|
||||
make check
|
||||
|
||||
TESTS='list of tests'
|
||||
VALGRIND_FLAGS
|
||||
TIMEOUT_DURATION
|
||||
|
||||
BTRFS_MOUNTPOINT
|
||||
|
||||
4. ADDITIONAL TARGETS
|
||||
|
||||
make code-coverage-capture
|
||||
make code-coverage-capture CODE_COVERAGE_BRANCH_COVERAGE=
|
||||
|
||||
5. INSTALLATION
|
||||
|
||||
make install
|
||||
|
||||
6. PACKAGING
|
||||
|
||||
6.1. Distribution tarball
|
||||
|
||||
./make-dist
|
||||
|
||||
Requires git
|
||||
|
||||
6.2. dpkg package
|
||||
|
||||
6.3. RPM package
|
38
dist/README
vendored
38
dist/README
vendored
@ -1,38 +0,0 @@
|
||||
This is strace - a diagnostic, debugging and instructional userspace utility
|
||||
with a traditional command-line interface for Linux. It is used to monitor
|
||||
and tamper with interactions between processes and the Linux kernel, which
|
||||
include system calls, signal deliveries, and changes of process state.
|
||||
The operation of strace is made possible by the kernel feature known as ptrace.
|
||||
|
||||
strace is released under the terms of the GNU Lesser General Public License
|
||||
version 2.1 or later; see the file COPYING for details.
|
||||
strace test suite is released under the terms of the GNU General Public License
|
||||
version 2 or later; see the file tests/COPYING for details.
|
||||
|
||||
See the file CREDITS for a list of authors and other contributors.
|
||||
See the file INSTALL for compilation and installation instructions.
|
||||
See the file NEWS for information on what has changed in recent versions.
|
||||
See the file README-hacking for information related to strace development.
|
||||
|
||||
The project's homepage is at
|
||||
https://strace.io
|
||||
|
||||
The GIT repository of strace is available at
|
||||
https://github.com/strace/strace/ and https://gitlab.com/strace/strace/
|
||||
|
||||
strace has a mailing list:
|
||||
strace-devel@lists.strace.io
|
||||
|
||||
Everyone is welcome to post bug reports, feature requests, comments
|
||||
and patches to the list. The mailing list archives are available at
|
||||
https://lists.strace.io/pipermail/strace-devel/
|
||||
|
||||
System requirements:
|
||||
* Linux kernel >= 2.6.18 is recommended. Older versions might still work
|
||||
but they haven't been thoroughly tested with this release.
|
||||
* Linux kernel >= 2.5.46 is required.
|
||||
Older versions without a decent PTRACE_SETOPTIONS support will not work.
|
||||
* On mips, Linux kernel >= 2.6.15 is required.
|
||||
Older versions without a decent PTRACE_GETREGS support will not work.
|
||||
* On s390 and s390x, Linux kernel >= 2.6.27 is required.
|
||||
Older versions without a decent PTRACE_GETREGSET support will not work.
|
63
dm.c
63
dm.c
@ -5,10 +5,30 @@
|
||||
* Copyright (c) 2016 Masatake Yamato <yamato@redhat.com>
|
||||
* Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2016 Eugene Syromyatnikov <evgsyr@gmail.com>
|
||||
* Copyright (c) 2016-2018 The strace developers.
|
||||
* Copyright (c) 2016-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -71,7 +91,7 @@ dm_decode_values(struct tcb *tcp, const unsigned int code,
|
||||
case DM_DEV_SUSPEND:
|
||||
if (ioc->flags & DM_SUSPEND_FLAG)
|
||||
break;
|
||||
ATTRIBUTE_FALLTHROUGH;
|
||||
/* Fall through */
|
||||
case DM_DEV_RENAME:
|
||||
case DM_DEV_REMOVE:
|
||||
case DM_DEV_WAIT:
|
||||
@ -98,7 +118,7 @@ dm_decode_values(struct tcb *tcp, const unsigned int code,
|
||||
}
|
||||
}
|
||||
|
||||
# include "xlat/dm_flags.h"
|
||||
#include "xlat/dm_flags.h"
|
||||
|
||||
static void
|
||||
dm_decode_flags(const struct dm_ioctl *ioc)
|
||||
@ -217,7 +237,7 @@ dm_decode_dm_target_deps(struct tcb *const tcp, const kernel_ulong_t addr,
|
||||
|
||||
tprints(", deps=");
|
||||
print_array(tcp, addr + offset_end, s.count, &dev_buf, sizeof(dev_buf),
|
||||
tfetch_mem, dm_print_dev, NULL);
|
||||
umoven_or_printaddr, dm_print_dev, NULL);
|
||||
|
||||
tprints("}");
|
||||
|
||||
@ -238,7 +258,6 @@ dm_decode_dm_name_list(struct tcb *const tcp, const kernel_ulong_t addr,
|
||||
uint32_t offset = ioc->data_start;
|
||||
uint32_t offset_end = 0;
|
||||
uint32_t count;
|
||||
int rc;
|
||||
|
||||
if (ioc->data_start == ioc->data_size)
|
||||
return;
|
||||
@ -269,36 +288,8 @@ dm_decode_dm_name_list(struct tcb *const tcp, const kernel_ulong_t addr,
|
||||
|
||||
PRINT_FIELD_DEV("{", s, dev);
|
||||
tprints(", name=");
|
||||
rc = printstr_ex(tcp, addr + offset_end,
|
||||
ioc->data_size - offset_end,
|
||||
QUOTE_0_TERMINATED);
|
||||
|
||||
/*
|
||||
* In Linux v4.13-rc1~137^2~13 it has been decided to cram in
|
||||
* one more undocumented field after the device name, as if the
|
||||
* format decoding was not twisted enough already. So, we have
|
||||
* to check "next" now, and if it _looks like_ that there is
|
||||
* a space for one additional integer, let's print it. As if the
|
||||
* perversity with "name string going further than pointer to
|
||||
* the next one" wasn't enough. Moreover, the calculation was
|
||||
* broken for m32 on 64-bit kernels until v4.14-rc4~20^2~3, and
|
||||
* we have no ability to detect kernel bit-ness (on x86, at
|
||||
* least), so refrain from printing it for the DM versions below
|
||||
* 4.37 (the original version was also aligned differently than
|
||||
* now even on 64 bit).
|
||||
*/
|
||||
|
||||
if ((rc > 0) && ioc->version[1] >= 37) {
|
||||
kernel_ulong_t event_addr =
|
||||
(addr + offset_end + rc + 7) & ~7;
|
||||
uint32_t event_nr;
|
||||
|
||||
if ((event_addr + sizeof(event_nr)) <=
|
||||
(addr + offset + s.next) &&
|
||||
!umove(tcp, event_addr, &event_nr))
|
||||
tprintf(", event_nr=%" PRIu32, event_nr);
|
||||
}
|
||||
|
||||
printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end,
|
||||
QUOTE_0_TERMINATED);
|
||||
tprints("}");
|
||||
|
||||
if (!s.next)
|
||||
|
36
dyxlat.c
36
dyxlat.c
@ -1,7 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 The strace developers.
|
||||
* Copyright (c) 2017 The strace developers.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -24,8 +44,8 @@ dyxlat_alloc(const size_t nmemb)
|
||||
struct dyxlat *const dyxlat = xmalloc(sizeof(*dyxlat));
|
||||
|
||||
dyxlat->used = 1;
|
||||
dyxlat->allocated = nmemb;
|
||||
dyxlat->xlat = xgrowarray(NULL, &dyxlat->allocated, sizeof(struct xlat));
|
||||
dyxlat->allocated = nmemb ? nmemb : 16;
|
||||
dyxlat->xlat = xcalloc(dyxlat->allocated, sizeof(struct xlat));
|
||||
MARK_END(dyxlat->xlat[0]);
|
||||
|
||||
return dyxlat;
|
||||
@ -70,9 +90,11 @@ dyxlat_add_pair(struct dyxlat *const dyxlat, const uint64_t val,
|
||||
}
|
||||
}
|
||||
|
||||
if (dyxlat->used >= dyxlat->allocated)
|
||||
dyxlat->xlat = xgrowarray(dyxlat->xlat, &dyxlat->allocated,
|
||||
sizeof(struct xlat));
|
||||
if (dyxlat->used >= dyxlat->allocated) {
|
||||
dyxlat->allocated *= 2;
|
||||
dyxlat->xlat = xreallocarray(dyxlat->xlat, dyxlat->allocated,
|
||||
sizeof(struct xlat));
|
||||
}
|
||||
|
||||
dyxlat->xlat[dyxlat->used - 1].val = val;
|
||||
dyxlat->xlat[dyxlat->used - 1].str = xstrndup(str, len);
|
||||
|
26
epoll.c
26
epoll.c
@ -2,10 +2,30 @@
|
||||
* Copyright (c) 2004-2007 Ulrich Drepper <drepper@redhat.com>
|
||||
* Copyright (c) 2004 Roland McGrath <roland@redhat.com>
|
||||
* Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2018 The strace developers.
|
||||
* Copyright (c) 2015-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -74,7 +94,7 @@ epoll_wait_common(struct tcb *tcp)
|
||||
} else {
|
||||
struct epoll_event ev;
|
||||
print_array(tcp, tcp->u_arg[1], tcp->u_rval, &ev, sizeof(ev),
|
||||
tfetch_mem, print_epoll_event, 0);
|
||||
umoven_or_printaddr, print_epoll_event, 0);
|
||||
tprintf(", %d, %d", (int) tcp->u_arg[2], (int) tcp->u_arg[3]);
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2018 The strace developers.
|
||||
* Copyright (c) 1999-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -70,7 +90,6 @@ error_msg_and_die(const char *fmt, ...)
|
||||
va_list p;
|
||||
va_start(p, fmt);
|
||||
verror_msg(0, fmt, p);
|
||||
va_end(p);
|
||||
die();
|
||||
}
|
||||
|
||||
@ -81,7 +100,6 @@ error_msg_and_help(const char *fmt, ...)
|
||||
va_list p;
|
||||
va_start(p, fmt);
|
||||
verror_msg(0, fmt, p);
|
||||
va_end(p);
|
||||
}
|
||||
fprintf(stderr, "Try '%s -h' for more information.\n",
|
||||
program_invocation_name);
|
||||
@ -103,6 +121,5 @@ perror_msg_and_die(const char *fmt, ...)
|
||||
va_list p;
|
||||
va_start(p, fmt);
|
||||
verror_msg(errno, fmt, p);
|
||||
va_end(p);
|
||||
die();
|
||||
}
|
||||
|
@ -4,20 +4,36 @@
|
||||
* package. Variable 'program_invocation_name' and function 'die()'
|
||||
* have to be defined globally.
|
||||
*
|
||||
* Copyright (c) 2001-2018 The strace developers.
|
||||
* Copyright (c) 2001-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#ifndef STRACE_ERROR_PRINTS_H
|
||||
# define STRACE_ERROR_PRINTS_H
|
||||
#define STRACE_ERROR_PRINTS_H
|
||||
|
||||
# include <stdbool.h>
|
||||
|
||||
# include "gcc_compat.h"
|
||||
|
||||
extern bool debug_flag;
|
||||
#include "gcc_compat.h"
|
||||
|
||||
void die(void) ATTRIBUTE_NORETURN;
|
||||
|
||||
@ -30,30 +46,4 @@ void error_msg_and_help(const char *fmt, ...)
|
||||
void error_msg_and_die(const char *fmt, ...)
|
||||
ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
|
||||
|
||||
/* Wrappers for if (debug_flag) error_msg(...) */
|
||||
# define debug_msg(...) \
|
||||
do { \
|
||||
if (debug_flag) \
|
||||
error_msg(__VA_ARGS__); \
|
||||
} while (0)
|
||||
# define debug_perror_msg(...) \
|
||||
do { \
|
||||
if (debug_flag) \
|
||||
perror_msg(__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
/* Simple wrappers for providing function name in error messages */
|
||||
# define error_func_msg(fmt_, ...) \
|
||||
error_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
|
||||
# define perror_func_msg(fmt_, ...) \
|
||||
perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
|
||||
# define debug_func_msg(fmt_, ...) \
|
||||
debug_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
|
||||
# define debug_func_perror_msg(fmt_, ...) \
|
||||
debug_perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
|
||||
# define error_func_msg_and_die(fmt_, ...) \
|
||||
error_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__)
|
||||
# define perror_func_msg_and_die(fmt_, ...) \
|
||||
perror_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__)
|
||||
|
||||
#endif /* !STRACE_ERROR_PRINTS_H */
|
||||
|
213
evdev.c
213
evdev.c
@ -1,22 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Etienne Gemsa <etienne.gemsa@lse.epita.fr>
|
||||
* Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2018 The strace developers.
|
||||
* Copyright (c) 2015-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#include "xlat/evdev_abs.h"
|
||||
#include "xlat/evdev_ev.h"
|
||||
|
||||
#ifdef HAVE_LINUX_INPUT_H
|
||||
|
||||
#include DEF_MPERS_TYPE(struct_ff_effect)
|
||||
|
||||
# include <linux/ioctl.h>
|
||||
# include <linux/input.h>
|
||||
|
||||
typedef struct ff_effect struct_ff_effect;
|
||||
|
||||
#endif /* HAVE_LINUX_INPUT_H */
|
||||
|
||||
#include MPERS_DEFS
|
||||
|
||||
#ifdef HAVE_LINUX_INPUT_H
|
||||
|
||||
# include "xlat/evdev_autorepeat.h"
|
||||
# include "xlat/evdev_ff_status.h"
|
||||
# include "xlat/evdev_ff_types.h"
|
||||
@ -28,12 +55,104 @@
|
||||
# include "xlat/evdev_relative_axes.h"
|
||||
# include "xlat/evdev_snd.h"
|
||||
# include "xlat/evdev_switch.h"
|
||||
# include "xlat/evdev_sync.h"
|
||||
|
||||
# ifndef SYN_MAX
|
||||
# define SYN_MAX 0xf
|
||||
# endif
|
||||
|
||||
const size_t evdev_abs_size = ARRAY_SIZE(evdev_abs) - 1;
|
||||
static void
|
||||
decode_envelope(void *const data)
|
||||
{
|
||||
const struct ff_envelope *const envelope = data;
|
||||
|
||||
tprintf(", envelope={attack_length=%" PRIu16
|
||||
", attack_level=%" PRIu16
|
||||
", fade_length=%" PRIu16
|
||||
", fade_level=%#x}",
|
||||
envelope->attack_length,
|
||||
envelope->attack_level,
|
||||
envelope->fade_length,
|
||||
envelope->fade_level);
|
||||
}
|
||||
|
||||
static int
|
||||
ff_effect_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||
{
|
||||
tprints(", ");
|
||||
|
||||
struct_ff_effect ffe;
|
||||
|
||||
if (umove_or_printaddr(tcp, arg, &ffe))
|
||||
return RVAL_IOCTL_DECODED;
|
||||
|
||||
tprints("{type=");
|
||||
printxval(evdev_ff_types, ffe.type, "FF_???");
|
||||
tprintf(", id=%" PRIu16
|
||||
", direction=%" PRIu16 ", ",
|
||||
ffe.id,
|
||||
ffe.direction);
|
||||
|
||||
if (abbrev(tcp)) {
|
||||
tprints("...}");
|
||||
return RVAL_IOCTL_DECODED;
|
||||
}
|
||||
|
||||
tprintf("trigger={button=%" PRIu16
|
||||
", interval=%" PRIu16 "}"
|
||||
", replay={length=%" PRIu16
|
||||
", delay=%" PRIu16 "}",
|
||||
ffe.trigger.button,
|
||||
ffe.trigger.interval,
|
||||
ffe.replay.length,
|
||||
ffe.replay.delay);
|
||||
|
||||
switch (ffe.type) {
|
||||
case FF_CONSTANT:
|
||||
tprintf(", constant={level=%" PRId16,
|
||||
ffe.u.constant.level);
|
||||
decode_envelope(&ffe.u.constant.envelope);
|
||||
tprints("}");
|
||||
break;
|
||||
case FF_RAMP:
|
||||
tprintf(", ramp={start_level=%" PRId16
|
||||
", end_level=%" PRId16,
|
||||
ffe.u.ramp.start_level,
|
||||
ffe.u.ramp.end_level);
|
||||
decode_envelope(&ffe.u.ramp.envelope);
|
||||
tprints("}");
|
||||
break;
|
||||
case FF_PERIODIC:
|
||||
tprintf(", periodic={waveform=%" PRIu16
|
||||
", period=%" PRIu16
|
||||
", magnitude=%" PRId16
|
||||
", offset=%" PRId16
|
||||
", phase=%" PRIu16,
|
||||
ffe.u.periodic.waveform,
|
||||
ffe.u.periodic.period,
|
||||
ffe.u.periodic.magnitude,
|
||||
ffe.u.periodic.offset,
|
||||
ffe.u.periodic.phase);
|
||||
decode_envelope(&ffe.u.periodic.envelope);
|
||||
tprintf(", custom_len=%u, custom_data=",
|
||||
ffe.u.periodic.custom_len);
|
||||
printaddr(ptr_to_kulong(ffe.u.periodic.custom_data));
|
||||
tprints("}");
|
||||
break;
|
||||
case FF_RUMBLE:
|
||||
tprintf(", rumble={strong_magnitude=%" PRIu16
|
||||
", weak_magnitude=%" PRIu16 "}",
|
||||
ffe.u.rumble.strong_magnitude,
|
||||
ffe.u.rumble.weak_magnitude);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
tprints("}");
|
||||
|
||||
return RVAL_IOCTL_DECODED;
|
||||
}
|
||||
|
||||
static int
|
||||
abs_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||
@ -78,7 +197,7 @@ keycode_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||
|
||||
if (!umove_or_printaddr(tcp, arg, &keycode)) {
|
||||
tprintf("[%u, ", keycode[0]);
|
||||
printxval_index(evdev_keycode, keycode[1], "KEY_???");
|
||||
printxval(evdev_keycode, keycode[1], "KEY_???");
|
||||
tprints("]");
|
||||
}
|
||||
|
||||
@ -105,7 +224,7 @@ keycode_V2_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||
unsigned int i;
|
||||
|
||||
tprintf("index=%" PRIu16 ", keycode=", ike.index);
|
||||
printxval_index(evdev_keycode, ike.keycode, "KEY_???");
|
||||
printxval(evdev_keycode, ike.keycode, "KEY_???");
|
||||
tprints(", scancode=[");
|
||||
for (i = 0; i < ARRAY_SIZE(ike.scancode); i++) {
|
||||
if (i > 0)
|
||||
@ -144,17 +263,17 @@ getid_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||
}
|
||||
|
||||
static int
|
||||
decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
const struct xlat decode_nr[], const unsigned int max_nr,
|
||||
const char *const dflt, size_t decode_nr_size, enum xlat_type xt)
|
||||
decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
const struct xlat decode_nr[], const unsigned int max_nr,
|
||||
const char *const dflt)
|
||||
{
|
||||
tprints(", ");
|
||||
|
||||
unsigned int size;
|
||||
if ((kernel_ulong_t) tcp->u_rval > max_nr / 8)
|
||||
if ((kernel_ulong_t) tcp->u_rval > max_nr)
|
||||
size = max_nr;
|
||||
else
|
||||
size = tcp->u_rval * 8;
|
||||
size = tcp->u_rval;
|
||||
char decoded_arg[size];
|
||||
|
||||
if (umove_or_printaddr(tcp, arg, &decoded_arg))
|
||||
@ -167,7 +286,7 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
if (i < 0) {
|
||||
tprints(" 0 ");
|
||||
} else {
|
||||
printxval_dispatch(decode_nr, decode_nr_size, i, dflt, xt);
|
||||
printxval(decode_nr, i, dflt);
|
||||
|
||||
while ((i = next_set_bit(decoded_arg, i + 1, size)) > 0) {
|
||||
if (abbrev(tcp) && bit_displayed >= 3) {
|
||||
@ -175,8 +294,7 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
break;
|
||||
}
|
||||
tprints(", ");
|
||||
printxval_dispatch(decode_nr, decode_nr_size, i, dflt,
|
||||
xt);
|
||||
printxval(decode_nr, i, dflt);
|
||||
bit_displayed++;
|
||||
}
|
||||
}
|
||||
@ -186,10 +304,6 @@ decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg,
|
||||
return RVAL_IOCTL_DECODED;
|
||||
}
|
||||
|
||||
# define decode_bitset(tcp_, arg_, decode_nr_, max_nr_, dflt_, xt_) \
|
||||
decode_bitset_((tcp_), (arg_), (decode_nr_), (max_nr_), \
|
||||
(dflt_), ARRAY_SIZE(decode_nr_) - 1, (xt_))
|
||||
|
||||
# ifdef EVIOCGMTSLOTS
|
||||
static int
|
||||
mtslots_ioctl(struct tcb *const tcp, const unsigned int code,
|
||||
@ -238,44 +352,45 @@ bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr,
|
||||
const kernel_ulong_t arg)
|
||||
{
|
||||
switch (ev_nr) {
|
||||
case 0:
|
||||
return decode_bitset(tcp, arg, evdev_ev,
|
||||
EV_MAX, "EV_???", XT_SORTED);
|
||||
case EV_SYN:
|
||||
return decode_bitset(tcp, arg, evdev_sync,
|
||||
SYN_MAX, "SYN_???");
|
||||
case EV_KEY:
|
||||
return decode_bitset(tcp, arg, evdev_keycode,
|
||||
KEY_MAX, "KEY_???", XT_INDEXED);
|
||||
KEY_MAX, "KEY_???");
|
||||
case EV_REL:
|
||||
return decode_bitset(tcp, arg, evdev_relative_axes,
|
||||
REL_MAX, "REL_???", XT_INDEXED);
|
||||
REL_MAX, "REL_???");
|
||||
case EV_ABS:
|
||||
return decode_bitset(tcp, arg, evdev_abs,
|
||||
ABS_MAX, "ABS_???", XT_INDEXED);
|
||||
ABS_MAX, "ABS_???");
|
||||
case EV_MSC:
|
||||
return decode_bitset(tcp, arg, evdev_misc,
|
||||
MSC_MAX, "MSC_???", XT_INDEXED);
|
||||
MSC_MAX, "MSC_???");
|
||||
# ifdef EV_SW
|
||||
case EV_SW:
|
||||
return decode_bitset(tcp, arg, evdev_switch,
|
||||
SW_MAX, "SW_???", XT_INDEXED);
|
||||
SW_MAX, "SW_???");
|
||||
# endif
|
||||
case EV_LED:
|
||||
return decode_bitset(tcp, arg, evdev_leds,
|
||||
LED_MAX, "LED_???", XT_INDEXED);
|
||||
LED_MAX, "LED_???");
|
||||
case EV_SND:
|
||||
return decode_bitset(tcp, arg, evdev_snd,
|
||||
SND_MAX, "SND_???", XT_INDEXED);
|
||||
SND_MAX, "SND_???");
|
||||
case EV_REP:
|
||||
return decode_bitset(tcp, arg, evdev_autorepeat,
|
||||
REP_MAX, "REP_???", XT_INDEXED);
|
||||
REP_MAX, "REP_???");
|
||||
case EV_FF:
|
||||
return decode_bitset(tcp, arg, evdev_ff_types,
|
||||
FF_MAX, "FF_???", XT_SORTED);
|
||||
FF_MAX, "FF_???");
|
||||
case EV_PWR:
|
||||
tprints(", ");
|
||||
printnum_int(tcp, arg, "%d");
|
||||
return RVAL_IOCTL_DECODED;
|
||||
case EV_FF_STATUS:
|
||||
return decode_bitset(tcp, arg, evdev_ff_status,
|
||||
FF_STATUS_MAX, "FF_STATUS_???",
|
||||
XT_INDEXED);
|
||||
FF_STATUS_MAX, "FF_STATUS_???");
|
||||
default:
|
||||
tprints(", ");
|
||||
printaddr(arg);
|
||||
@ -329,23 +444,22 @@ evdev_read_ioctl(struct tcb *const tcp, const unsigned int code,
|
||||
# ifdef EVIOCGPROP
|
||||
case _IOC_NR(EVIOCGPROP(0)):
|
||||
return decode_bitset(tcp, arg, evdev_prop,
|
||||
INPUT_PROP_MAX, "PROP_???",
|
||||
XT_INDEXED);
|
||||
INPUT_PROP_MAX, "PROP_???");
|
||||
# endif
|
||||
case _IOC_NR(EVIOCGSND(0)):
|
||||
return decode_bitset(tcp, arg, evdev_snd,
|
||||
SND_MAX, "SND_???", XT_INDEXED);
|
||||
SND_MAX, "SND_???");
|
||||
# ifdef EVIOCGSW
|
||||
case _IOC_NR(EVIOCGSW(0)):
|
||||
return decode_bitset(tcp, arg, evdev_switch,
|
||||
SW_MAX, "SW_???", XT_INDEXED);
|
||||
SW_MAX, "SW_???");
|
||||
# endif
|
||||
case _IOC_NR(EVIOCGKEY(0)):
|
||||
return decode_bitset(tcp, arg, evdev_keycode,
|
||||
KEY_MAX, "KEY_???", XT_INDEXED);
|
||||
KEY_MAX, "KEY_???");
|
||||
case _IOC_NR(EVIOCGLED(0)):
|
||||
return decode_bitset(tcp, arg, evdev_leds,
|
||||
LED_MAX, "LED_???", XT_INDEXED);
|
||||
LED_MAX, "LED_???");
|
||||
}
|
||||
|
||||
/* multi-number fixed-length commands */
|
||||
@ -375,6 +489,8 @@ evdev_write_ioctl(struct tcb *const tcp, const unsigned int code,
|
||||
case EVIOCSKEYCODE_V2:
|
||||
return keycode_V2_ioctl(tcp, arg);
|
||||
# endif
|
||||
case EVIOCSFF:
|
||||
return ff_effect_ioctl(tcp, arg);
|
||||
case EVIOCRMFF:
|
||||
tprintf(", %d", (int) arg);
|
||||
return RVAL_IOCTL_DECODED;
|
||||
@ -390,12 +506,6 @@ evdev_write_ioctl(struct tcb *const tcp, const unsigned int code,
|
||||
printnum_int(tcp, arg, "%u");
|
||||
return RVAL_IOCTL_DECODED;
|
||||
# endif
|
||||
default: {
|
||||
int rc = evdev_write_ioctl_mpers(tcp, code, arg);
|
||||
|
||||
if (rc != RVAL_DECODED)
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
/* multi-number fixed-length commands */
|
||||
@ -405,15 +515,8 @@ evdev_write_ioctl(struct tcb *const tcp, const unsigned int code,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
print_evdev_ff_type(const kernel_ulong_t val)
|
||||
{
|
||||
printxval(evdev_ff_types, val, "FF_???");
|
||||
}
|
||||
|
||||
int
|
||||
evdev_ioctl(struct tcb *const tcp,
|
||||
const unsigned int code, const kernel_ulong_t arg)
|
||||
MPERS_PRINTER_DECL(int, evdev_ioctl, struct tcb *const tcp,
|
||||
const unsigned int code, const kernel_ulong_t arg)
|
||||
{
|
||||
switch (_IOC_DIR(code)) {
|
||||
case _IOC_READ:
|
||||
|
131
evdev_mpers.c
131
evdev_mpers.c
@ -1,131 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Etienne Gemsa <etienne.gemsa@lse.epita.fr>
|
||||
* Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#ifdef HAVE_LINUX_INPUT_H
|
||||
|
||||
# include DEF_MPERS_TYPE(struct_ff_effect)
|
||||
|
||||
# include <linux/ioctl.h>
|
||||
# include <linux/input.h>
|
||||
|
||||
typedef struct ff_effect struct_ff_effect;
|
||||
|
||||
#endif /* HAVE_LINUX_INPUT_H */
|
||||
|
||||
#include MPERS_DEFS
|
||||
|
||||
#ifdef HAVE_LINUX_INPUT_H
|
||||
|
||||
static void
|
||||
decode_envelope(void *const data)
|
||||
{
|
||||
const struct ff_envelope *const envelope = data;
|
||||
|
||||
tprintf(", envelope={attack_length=%" PRIu16
|
||||
", attack_level=%" PRIu16
|
||||
", fade_length=%" PRIu16
|
||||
", fade_level=%#x}",
|
||||
envelope->attack_length,
|
||||
envelope->attack_level,
|
||||
envelope->fade_length,
|
||||
envelope->fade_level);
|
||||
}
|
||||
|
||||
static int
|
||||
ff_effect_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||
{
|
||||
tprints(", ");
|
||||
|
||||
struct_ff_effect ffe;
|
||||
|
||||
if (umove_or_printaddr(tcp, arg, &ffe))
|
||||
return RVAL_IOCTL_DECODED;
|
||||
|
||||
tprints("{type=");
|
||||
print_evdev_ff_type(ffe.type);
|
||||
tprintf(", id=%" PRIu16
|
||||
", direction=%" PRIu16 ", ",
|
||||
ffe.id,
|
||||
ffe.direction);
|
||||
|
||||
if (abbrev(tcp)) {
|
||||
tprints("...}");
|
||||
return RVAL_IOCTL_DECODED;
|
||||
}
|
||||
|
||||
tprintf("trigger={button=%" PRIu16
|
||||
", interval=%" PRIu16 "}"
|
||||
", replay={length=%" PRIu16
|
||||
", delay=%" PRIu16 "}",
|
||||
ffe.trigger.button,
|
||||
ffe.trigger.interval,
|
||||
ffe.replay.length,
|
||||
ffe.replay.delay);
|
||||
|
||||
switch (ffe.type) {
|
||||
case FF_CONSTANT:
|
||||
tprintf(", constant={level=%" PRId16,
|
||||
ffe.u.constant.level);
|
||||
decode_envelope(&ffe.u.constant.envelope);
|
||||
tprints("}");
|
||||
break;
|
||||
case FF_RAMP:
|
||||
tprintf(", ramp={start_level=%" PRId16
|
||||
", end_level=%" PRId16,
|
||||
ffe.u.ramp.start_level,
|
||||
ffe.u.ramp.end_level);
|
||||
decode_envelope(&ffe.u.ramp.envelope);
|
||||
tprints("}");
|
||||
break;
|
||||
case FF_PERIODIC:
|
||||
tprintf(", periodic={waveform=%" PRIu16
|
||||
", period=%" PRIu16
|
||||
", magnitude=%" PRId16
|
||||
", offset=%" PRId16
|
||||
", phase=%" PRIu16,
|
||||
ffe.u.periodic.waveform,
|
||||
ffe.u.periodic.period,
|
||||
ffe.u.periodic.magnitude,
|
||||
ffe.u.periodic.offset,
|
||||
ffe.u.periodic.phase);
|
||||
decode_envelope(&ffe.u.periodic.envelope);
|
||||
tprintf(", custom_len=%u, custom_data=",
|
||||
ffe.u.periodic.custom_len);
|
||||
printaddr(ptr_to_kulong(ffe.u.periodic.custom_data));
|
||||
tprints("}");
|
||||
break;
|
||||
case FF_RUMBLE:
|
||||
tprintf(", rumble={strong_magnitude=%" PRIu16
|
||||
", weak_magnitude=%" PRIu16 "}",
|
||||
ffe.u.rumble.strong_magnitude,
|
||||
ffe.u.rumble.weak_magnitude);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
tprints("}");
|
||||
|
||||
return RVAL_IOCTL_DECODED;
|
||||
}
|
||||
|
||||
MPERS_PRINTER_DECL(int, evdev_write_ioctl_mpers, struct tcb *const tcp,
|
||||
const unsigned int code, const kernel_ulong_t arg)
|
||||
{
|
||||
switch (code) {
|
||||
case EVIOCSFF:
|
||||
return ff_effect_ioctl(tcp, arg);
|
||||
default:
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* HAVE_LINUX_INPUT_H */
|
24
eventfd.c
24
eventfd.c
@ -1,9 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Ulrich Drepper <drepper@redhat.com>
|
||||
* Copyright (c) 2008-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2008-2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
31
execve.c
31
execve.c
@ -6,10 +6,30 @@
|
||||
* Copyright (c) 2007 Roland McGrath <roland@redhat.com>
|
||||
* Copyright (c) 2011-2012 Denys Vlasenko <vda.linux@googlemail.com>
|
||||
* Copyright (c) 2010-2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* Copyright (c) 2014-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -37,11 +57,8 @@ printargv(struct tcb *const tcp, kernel_ulong_t addr)
|
||||
if (umoven(tcp, addr, wordsize, cp.data)) {
|
||||
if (sep == start_sep)
|
||||
printaddr(addr);
|
||||
else {
|
||||
tprints(", ...");
|
||||
printaddr_comment(addr);
|
||||
tprints("]");
|
||||
}
|
||||
else
|
||||
tprints(", ???]");
|
||||
return;
|
||||
}
|
||||
if (!(wordsize < sizeof(cp.p64) ? cp.p32 : cp.p64)) {
|
||||
|
21
f_owner_ex.h
21
f_owner_ex.h
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#ifndef STRACE_F_OWNER_EX_H
|
||||
# define STRACE_F_OWNER_EX_H
|
||||
|
||||
# include <linux/fcntl.h>
|
||||
|
||||
# if defined HAVE_STRUCT_F_OWNER_EX
|
||||
typedef struct f_owner_ex struct_kernel_f_owner_ex;
|
||||
# elif defined HAVE_STRUCT___KERNEL_F_OWNER_EX
|
||||
typedef struct __kernel_f_owner_ex struct_kernel_f_owner_ex;
|
||||
# else
|
||||
# error struct f_owner_ex definition not found in <linux/fcntl.h>
|
||||
# endif
|
||||
|
||||
#endif /* !STRACE_F_OWNER_EX_H */
|
24
fadvise.c
24
fadvise.c
@ -5,10 +5,30 @@
|
||||
* Copyright (c) 2009 Andreas Schwab <schwab@redhat.com>
|
||||
* Copyright (c) 2009 Kirill A. Shutemov <kirill@shutemov.name>
|
||||
* Copyright (c) 2011-2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* Copyright (c) 2014-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#ifdef HAVE_LINUX_FALLOC_H
|
||||
|
32
fanotify.c
32
fanotify.c
@ -1,9 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* Copyright (c) 2014-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -55,12 +75,10 @@ SYS_FUNC(fanotify_mark)
|
||||
#endif
|
||||
printflags64(fan_event_flags, mask, "FAN_???");
|
||||
tprints(", ");
|
||||
if ((int) tcp->u_arg[argn] == FAN_NOFD) {
|
||||
print_xlat_d(FAN_NOFD);
|
||||
tprints(", ");
|
||||
} else {
|
||||
if ((int) tcp->u_arg[argn] == FAN_NOFD)
|
||||
tprints("FAN_NOFD, ");
|
||||
else
|
||||
print_dirfd(tcp, tcp->u_arg[argn]);
|
||||
}
|
||||
printpath(tcp, tcp->u_arg[argn + 1]);
|
||||
|
||||
return RVAL_DECODED;
|
||||
|
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
SYS_FUNC(fchownat)
|
||||
|
47
fcntl.c
47
fcntl.c
@ -3,10 +3,30 @@
|
||||
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
|
||||
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
|
||||
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
|
||||
* Copyright (c) 1999-2018 The strace developers.
|
||||
* Copyright (c) 1999-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -15,6 +35,7 @@
|
||||
#include "xlat/f_owner_types.h"
|
||||
#include "xlat/f_seals.h"
|
||||
#include "xlat/fcntlcmds.h"
|
||||
#include "xlat/fcntl64cmds.h"
|
||||
#include "xlat/fdflags.h"
|
||||
#include "xlat/lockfcmds.h"
|
||||
#include "xlat/notifyflags.h"
|
||||
@ -114,7 +135,7 @@ print_fcntl(struct tcb *tcp)
|
||||
break;
|
||||
case F_SETSIG:
|
||||
tprints(", ");
|
||||
printsignal(tcp->u_arg[2]);
|
||||
tprints(signame(tcp->u_arg[2]));
|
||||
break;
|
||||
case F_GETOWN:
|
||||
case F_GETPIPE_SZ:
|
||||
@ -176,7 +197,18 @@ SYS_FUNC(fcntl)
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
printxval(fcntlcmds, tcp->u_arg[1], "F_???");
|
||||
const unsigned int cmd = tcp->u_arg[1];
|
||||
const char *str = xlookup(fcntlcmds, cmd);
|
||||
if (str) {
|
||||
tprints(str);
|
||||
} else {
|
||||
/*
|
||||
* fcntl syscall does not recognize these
|
||||
* constants, but we would like to show them
|
||||
* for better debugging experience.
|
||||
*/
|
||||
printxval(fcntl64cmds, cmd, "F_???");
|
||||
}
|
||||
}
|
||||
return print_fcntl(tcp);
|
||||
}
|
||||
@ -187,7 +219,12 @@ SYS_FUNC(fcntl64)
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
printxval(fcntlcmds, cmd, "F_???");
|
||||
const char *str = xlookup(fcntl64cmds, cmd);
|
||||
if (str) {
|
||||
tprints(str);
|
||||
} else {
|
||||
printxval(fcntlcmds, cmd, "F_???");
|
||||
}
|
||||
}
|
||||
switch (cmd) {
|
||||
case F_SETLK64:
|
||||
|
@ -1,8 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2017 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
/*
|
||||
* Fetch indirect syscall arguments that are provided as an array.
|
||||
* Return a pointer to a static array of kernel_ulong_t elements,
|
||||
* or NULL in case of fetch failure.
|
||||
*/
|
||||
kernel_ulong_t *
|
||||
fetch_indirect_syscall_args(struct tcb *const tcp,
|
||||
const kernel_ulong_t addr,
|
||||
const unsigned int n_args)
|
||||
{
|
||||
static kernel_ulong_t u_arg[MAX_ARGS];
|
||||
|
||||
if (current_wordsize == sizeof(*u_arg)) {
|
||||
if (umoven(tcp, addr, sizeof(*u_arg) * n_args, u_arg))
|
||||
return NULL;
|
||||
} else {
|
||||
uint32_t narrow_arg[ARRAY_SIZE(u_arg)];
|
||||
|
||||
if (umoven(tcp, addr, sizeof(*narrow_arg) * n_args, narrow_arg))
|
||||
return NULL;
|
||||
for (unsigned int i = 0; i < n_args; ++i)
|
||||
u_arg[i] = narrow_arg[i];
|
||||
}
|
||||
|
||||
return u_arg;
|
||||
}
|
@ -1,9 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2018 The strace developers.
|
||||
* Copyright (c) 2015-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2018 Eugene Syromyatnikov <evgsyr@gmail.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#include DEF_MPERS_TYPE(struct_keyctl_kdf_params)
|
||||
|
@ -1,8 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
@ -1,8 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
@ -1,9 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2016-2018 The strace developers.
|
||||
* Copyright (c) 2016-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
@ -1,9 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2016-2018 The strace developers.
|
||||
* Copyright (c) 2016-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
@ -1,9 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2016-2018 The strace developers.
|
||||
* Copyright (c) 2016-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#include DEF_MPERS_TYPE(struct_xfs_dqstats)
|
||||
|
||||
#include "xfs_quota_stat.h"
|
||||
typedef struct xfs_dqstats struct_xfs_dqstats;
|
||||
|
||||
#include MPERS_DEFS
|
||||
|
||||
MPERS_PRINTER_DECL(bool, fetch_struct_quotastat, struct tcb *const tcp,
|
||||
const kernel_ulong_t data, void *p)
|
||||
{
|
||||
struct xfs_dqstats *dq = p;
|
||||
struct_xfs_dqstats dqstat;
|
||||
|
||||
if (umove_or_printaddr(tcp, data, &dqstat))
|
||||
return false;
|
||||
|
||||
dq->qs_version = dqstat.qs_version;
|
||||
dq->qs_flags = dqstat.qs_flags;
|
||||
dq->qs_pad = dqstat.qs_pad;
|
||||
dq->qs_uquota.qfs_ino = dqstat.qs_uquota.qfs_ino;
|
||||
dq->qs_uquota.qfs_nblks = dqstat.qs_uquota.qfs_nblks;
|
||||
dq->qs_uquota.qfs_nextents = dqstat.qs_uquota.qfs_nextents;
|
||||
dq->qs_gquota.qfs_ino = dqstat.qs_gquota.qfs_ino;
|
||||
dq->qs_gquota.qfs_nblks = dqstat.qs_gquota.qfs_nblks;
|
||||
dq->qs_gquota.qfs_nextents = dqstat.qs_gquota.qfs_nextents;
|
||||
dq->qs_incoredqs = dqstat.qs_incoredqs;
|
||||
dq->qs_btimelimit = dqstat.qs_btimelimit;
|
||||
dq->qs_itimelimit = dqstat.qs_itimelimit;
|
||||
dq->qs_rtbtimelimit = dqstat.qs_rtbtimelimit;
|
||||
dq->qs_bwarnlimit = dqstat.qs_bwarnlimit;
|
||||
dq->qs_iwarnlimit = dqstat.qs_iwarnlimit;
|
||||
return true;
|
||||
}
|
@ -1,9 +1,4 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2017-2018 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#! /bin/sh
|
||||
|
||||
if [ "$1" = "-f" ]; then
|
||||
shift
|
||||
@ -15,7 +10,6 @@ fi
|
||||
: ${DATE_FILE:=$(dirname "$FILE")/.$(basename "${FILE}").date}
|
||||
: ${DEFAULT_DATE:=$2}
|
||||
: ${DATE_FORMAT:=%Y-%m-%d}
|
||||
LC_TIME=C; export LC_TIME
|
||||
|
||||
date=
|
||||
|
||||
@ -27,21 +21,15 @@ date=
|
||||
[ -f "${DATE_FILE}" ] && date="$(cat "${DATE_FILE}")"
|
||||
|
||||
[ -n "${date}" ] ||
|
||||
date="$(git log -s -n 1 --format=format:%cD "${FILE}")"
|
||||
date="$(git log -n 1 --format=format:%cD --no-patch "${FILE}")"
|
||||
|
||||
[ -n "${date}" ] ||
|
||||
date="${DEFAULT_DATE}"
|
||||
[ -n "${date}" ] || year="${DEFAULT_DATE}"
|
||||
|
||||
[ -n "${date}" ] ||
|
||||
[ -z "${SOURCE_DATE_EPOCH-}" ] ||
|
||||
date="$(date -u -d "@${SOURCE_DATE_EPOCH}")"
|
||||
|
||||
[ -n "${date}" ] ||
|
||||
date="$(date -u)"
|
||||
[ -n "${date}" ] || date="$(date -u)"
|
||||
|
||||
[ -n "${date}" ] || {
|
||||
echo >&2 'Undefined date.'
|
||||
exit 1
|
||||
}
|
||||
|
||||
exec printf "%s" $(date -u "+${DATE_FORMAT}" -d "${date}")
|
||||
exec printf "%s" $(date "+${DATE_FORMAT}" -d "${date}")
|
||||
|
@ -1,9 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2018 The strace developers.
|
||||
* Copyright (c) 2015-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
32
file_ioctl.c
32
file_ioctl.c
@ -1,9 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2016 Jeff Mahoney <jeffm@suse.com>
|
||||
* Copyright (c) 2016-2018 The strace developers.
|
||||
* Copyright (c) 2016-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -165,7 +185,7 @@ file_ioctl(struct tcb *const tcp, const unsigned int code,
|
||||
|
||||
rc = print_array(tcp, arg + offsetof(typeof(args), info),
|
||||
args.dest_count, &info, sizeof(info),
|
||||
tfetch_mem,
|
||||
umoven_or_printaddr,
|
||||
print_file_dedupe_range_info, limit);
|
||||
|
||||
tprints("}");
|
||||
@ -205,15 +225,15 @@ file_ioctl(struct tcb *const tcp, const unsigned int code,
|
||||
"FIEMAP_FLAG_???");
|
||||
tprintf(", fm_mapped_extents=%u",
|
||||
args.fm_mapped_extents);
|
||||
tprints(", fm_extents=");
|
||||
if (abbrev(tcp)) {
|
||||
tprints(", ...");
|
||||
tprints("...");
|
||||
} else {
|
||||
struct fiemap_extent fe;
|
||||
tprints(", fm_extents=");
|
||||
print_array(tcp,
|
||||
arg + offsetof(typeof(args), fm_extents),
|
||||
args.fm_mapped_extents, &fe, sizeof(fe),
|
||||
tfetch_mem,
|
||||
umoven_or_printaddr,
|
||||
print_fiemap_extent, 0);
|
||||
}
|
||||
tprints("}");
|
||||
|
29
filter.h
29
filter.h
@ -1,19 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Nikolay Marchuk <marchuk.nikolay.a@gmail.com>
|
||||
* Copyright (c) 2017-2018 The strace developers.
|
||||
* Copyright (c) 2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#ifndef STRACE_FILTER_H
|
||||
# define STRACE_FILTER_H
|
||||
#define STRACE_FILTER_H
|
||||
|
||||
struct number_set;
|
||||
typedef int (*string_to_uint_func)(const char *);
|
||||
|
||||
void qualify_tokens(const char *str, struct number_set *set,
|
||||
string_to_uint_func func, const char *name);
|
||||
void qualify_syscall_tokens(const char *str, struct number_set *set);
|
||||
void qualify_syscall_tokens(const char *str, struct number_set *set,
|
||||
const char *name);
|
||||
|
||||
#endif /* !STRACE_FILTER_H */
|
||||
|
254
filter_qualify.c
254
filter_qualify.c
@ -1,17 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2016-2018 The strace developers.
|
||||
* Copyright (c) 2016-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
#include "nsig.h"
|
||||
#include "number_set.h"
|
||||
#include "filter.h"
|
||||
#include "delay.h"
|
||||
#include "retval.h"
|
||||
|
||||
struct number_set *read_set;
|
||||
struct number_set *write_set;
|
||||
@ -23,26 +41,20 @@ static struct number_set *raw_set;
|
||||
static struct number_set *trace_set;
|
||||
static struct number_set *verbose_set;
|
||||
|
||||
/* Only syscall numbers are personality-specific so far. */
|
||||
struct inject_personality_data {
|
||||
uint16_t scno;
|
||||
};
|
||||
|
||||
static int
|
||||
sigstr_to_uint(const char *s)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (*s >= '0' && *s <= '9')
|
||||
return string_to_uint_upto(s, 255);
|
||||
|
||||
if (strncasecmp(s, "SIG", 3) == 0)
|
||||
s += 3;
|
||||
|
||||
for (int i = 1; i <= 255; ++i) {
|
||||
for (i = 0; i <= 255; ++i) {
|
||||
const char *name = signame(i);
|
||||
|
||||
if (!name)
|
||||
continue;
|
||||
|
||||
if (strncasecmp(name, "SIG", 3) != 0)
|
||||
continue;
|
||||
|
||||
@ -60,7 +72,9 @@ sigstr_to_uint(const char *s)
|
||||
static int
|
||||
find_errno_by_name(const char *name)
|
||||
{
|
||||
for (unsigned int i = 1; i < nerrnos; ++i) {
|
||||
unsigned int i;
|
||||
|
||||
for (i = 1; i < nerrnos; ++i) {
|
||||
if (errnoent[i] && (strcasecmp(name, errnoent[i]) == 0))
|
||||
return i;
|
||||
}
|
||||
@ -68,29 +82,8 @@ find_errno_by_name(const char *name)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static bool
|
||||
parse_delay_token(const char *input, struct inject_opts *fopts, bool isenter)
|
||||
{
|
||||
unsigned flag = isenter ? INJECT_F_DELAY_ENTER : INJECT_F_DELAY_EXIT;
|
||||
|
||||
if (fopts->data.flags & flag) /* duplicate */
|
||||
return false;
|
||||
long long intval = string_to_ulonglong(input);
|
||||
if (intval < 0) /* couldn't parse */
|
||||
return false;
|
||||
|
||||
if (fopts->data.delay_idx == (uint16_t) -1)
|
||||
fopts->data.delay_idx = alloc_delay_data();
|
||||
/* populate .ts_enter or .ts_exit */
|
||||
fill_delay_data(fopts->data.delay_idx, intval, isenter);
|
||||
fopts->data.flags |= flag;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
parse_inject_token(const char *const token, struct inject_opts *const fopts,
|
||||
struct inject_personality_data *const pdata,
|
||||
const bool fault_tokens_only)
|
||||
{
|
||||
const char *val;
|
||||
@ -126,85 +119,24 @@ parse_inject_token(const char *const token, struct inject_opts *const fopts,
|
||||
/* F == F+0 */
|
||||
fopts->step = 0;
|
||||
}
|
||||
} else if ((val = STR_STRIP_PREFIX(token, "syscall=")) != token) {
|
||||
if (fopts->data.flags & INJECT_F_SYSCALL)
|
||||
return false;
|
||||
|
||||
for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
|
||||
kernel_long_t scno = scno_by_name(val, p, 0);
|
||||
|
||||
if (scno < 0)
|
||||
return false;
|
||||
|
||||
/*
|
||||
* We want to inject only pure system calls with no side
|
||||
* effects.
|
||||
*/
|
||||
if (!(sysent_vec[p][scno].sys_flags & TRACE_PURE))
|
||||
return false;
|
||||
|
||||
pdata[p].scno = scno;
|
||||
}
|
||||
|
||||
fopts->data.flags |= INJECT_F_SYSCALL;
|
||||
} else if ((val = STR_STRIP_PREFIX(token, "error=")) != token) {
|
||||
if (fopts->data.flags & (INJECT_F_ERROR | INJECT_F_RETVAL))
|
||||
if (fopts->data.flags & INJECT_F_RETVAL)
|
||||
return false;
|
||||
intval = string_to_uint_upto(val, MAX_ERRNO_VALUE);
|
||||
if (intval < 0)
|
||||
intval = find_errno_by_name(val);
|
||||
if (intval < 1)
|
||||
return false;
|
||||
fopts->data.rval_idx = retval_new(intval);
|
||||
fopts->data.flags |= INJECT_F_ERROR;
|
||||
fopts->data.rval = -intval;
|
||||
fopts->data.flags |= INJECT_F_RETVAL;
|
||||
} else if (!fault_tokens_only
|
||||
&& (val = STR_STRIP_PREFIX(token, "retval=")) != token) {
|
||||
|
||||
if (fopts->data.flags & (INJECT_F_ERROR | INJECT_F_RETVAL))
|
||||
if (fopts->data.flags & INJECT_F_RETVAL)
|
||||
return false;
|
||||
|
||||
errno = 0;
|
||||
char *endp;
|
||||
unsigned long long ullval = strtoull(val, &endp, 0);
|
||||
if (endp == val || *endp || (kernel_ulong_t) ullval != ullval
|
||||
|| ((ullval == 0 || ullval == ULLONG_MAX) && errno))
|
||||
intval = string_to_uint(val);
|
||||
if (intval < 0)
|
||||
return false;
|
||||
|
||||
#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
|
||||
bool inadvertent_fault_injection = false;
|
||||
#endif
|
||||
|
||||
#if !HAVE_ARCH_DEDICATED_ERR_REG
|
||||
if ((kernel_long_t) ullval < 0
|
||||
&& (kernel_long_t) ullval >= -MAX_ERRNO_VALUE) {
|
||||
# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
|
||||
inadvertent_fault_injection = true;
|
||||
# endif
|
||||
error_msg("Inadvertent injection of error %" PRI_kld
|
||||
" is possible for retval=%llu",
|
||||
-(kernel_long_t) ullval, ullval);
|
||||
}
|
||||
# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
|
||||
else if ((int) ullval < 0 && (int) ullval >= -MAX_ERRNO_VALUE) {
|
||||
inadvertent_fault_injection = true;
|
||||
error_msg("Inadvertent injection of error %d is"
|
||||
" possible in compat personality for"
|
||||
" retval=%llu",
|
||||
-(int) ullval, ullval);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
|
||||
if (!inadvertent_fault_injection
|
||||
&& (unsigned int) ullval != ullval) {
|
||||
error_msg("Injected return value %llu will be"
|
||||
" clipped to %u in compat personality",
|
||||
ullval, (unsigned int) ullval);
|
||||
}
|
||||
#endif
|
||||
|
||||
fopts->data.rval_idx = retval_new(ullval);
|
||||
fopts->data.rval = intval;
|
||||
fopts->data.flags |= INJECT_F_RETVAL;
|
||||
} else if (!fault_tokens_only
|
||||
&& (val = STR_STRIP_PREFIX(token, "signal=")) != token) {
|
||||
@ -215,14 +147,6 @@ parse_inject_token(const char *const token, struct inject_opts *const fopts,
|
||||
return false;
|
||||
fopts->data.signo = intval;
|
||||
fopts->data.flags |= INJECT_F_SIGNAL;
|
||||
} else if (!fault_tokens_only
|
||||
&& (val = STR_STRIP_PREFIX(token, "delay_enter=")) != token) {
|
||||
if (!parse_delay_token(val, fopts, true))
|
||||
return false;
|
||||
} else if (!fault_tokens_only
|
||||
&& (val = STR_STRIP_PREFIX(token, "delay_exit=")) != token) {
|
||||
if (!parse_delay_token(val, fopts, false))
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@ -230,25 +154,30 @@ parse_inject_token(const char *const token, struct inject_opts *const fopts,
|
||||
return true;
|
||||
}
|
||||
|
||||
static const char *
|
||||
parse_inject_expression(char *const str,
|
||||
static char *
|
||||
parse_inject_expression(const char *const s, char **buf,
|
||||
struct inject_opts *const fopts,
|
||||
struct inject_personality_data *const pdata,
|
||||
const bool fault_tokens_only)
|
||||
{
|
||||
if (str[0] == '\0' || str[0] == ':')
|
||||
return "";
|
||||
|
||||
char *saveptr = NULL;
|
||||
const char *name = strtok_r(str, ":", &saveptr);
|
||||
|
||||
char *name = NULL;
|
||||
char *token;
|
||||
while ((token = strtok_r(NULL, ":", &saveptr))) {
|
||||
if (!parse_inject_token(token, fopts, pdata, fault_tokens_only))
|
||||
return NULL;
|
||||
|
||||
*buf = xstrdup(s);
|
||||
for (token = strtok_r(*buf, ":", &saveptr); token;
|
||||
token = strtok_r(NULL, ":", &saveptr)) {
|
||||
if (!name)
|
||||
name = token;
|
||||
else if (!parse_inject_token(token, fopts, fault_tokens_only))
|
||||
goto parse_error;
|
||||
}
|
||||
|
||||
return name;
|
||||
if (name)
|
||||
return name;
|
||||
|
||||
parse_error:
|
||||
free(*buf);
|
||||
return *buf = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -280,7 +209,7 @@ qualify_trace(const char *const str)
|
||||
{
|
||||
if (!trace_set)
|
||||
trace_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
|
||||
qualify_syscall_tokens(str, trace_set);
|
||||
qualify_syscall_tokens(str, trace_set, "system call");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -288,7 +217,7 @@ qualify_abbrev(const char *const str)
|
||||
{
|
||||
if (!abbrev_set)
|
||||
abbrev_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
|
||||
qualify_syscall_tokens(str, abbrev_set);
|
||||
qualify_syscall_tokens(str, abbrev_set, "system call");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -296,7 +225,7 @@ qualify_verbose(const char *const str)
|
||||
{
|
||||
if (!verbose_set)
|
||||
verbose_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
|
||||
qualify_syscall_tokens(str, verbose_set);
|
||||
qualify_syscall_tokens(str, verbose_set, "system call");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -304,7 +233,7 @@ qualify_raw(const char *const str)
|
||||
{
|
||||
if (!raw_set)
|
||||
raw_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
|
||||
qualify_syscall_tokens(str, raw_set);
|
||||
qualify_syscall_tokens(str, raw_set, "system call");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -314,41 +243,38 @@ qualify_inject_common(const char *const str,
|
||||
{
|
||||
struct inject_opts opts = {
|
||||
.first = 1,
|
||||
.step = 1,
|
||||
.data = {
|
||||
.delay_idx = -1
|
||||
}
|
||||
.step = 1
|
||||
};
|
||||
struct inject_personality_data pdata[SUPPORTED_PERSONALITIES] = { { 0 } };
|
||||
char *copy = xstrdup(str);
|
||||
const char *name =
|
||||
parse_inject_expression(copy, &opts, pdata, fault_tokens_only);
|
||||
if (!name)
|
||||
char *buf = NULL;
|
||||
char *name = parse_inject_expression(str, &buf, &opts, fault_tokens_only);
|
||||
if (!name) {
|
||||
error_msg_and_die("invalid %s '%s'", description, str);
|
||||
}
|
||||
|
||||
struct number_set *tmp_set =
|
||||
alloc_number_set_array(SUPPORTED_PERSONALITIES);
|
||||
qualify_syscall_tokens(name, tmp_set);
|
||||
|
||||
free(copy);
|
||||
|
||||
/* If neither of retval, error, signal or delay is specified, then ... */
|
||||
if (!(opts.data.flags & INJECT_ACTION_FLAGS)) {
|
||||
/* If neither of retval, error, or signal is specified, then ... */
|
||||
if (!opts.data.flags) {
|
||||
if (fault_tokens_only) {
|
||||
/* in fault= syntax the default error code is ENOSYS. */
|
||||
opts.data.rval_idx = retval_new(ENOSYS);
|
||||
opts.data.flags |= INJECT_F_ERROR;
|
||||
opts.data.rval = -ENOSYS;
|
||||
opts.data.flags |= INJECT_F_RETVAL;
|
||||
} else {
|
||||
/* in inject= syntax this is not allowed. */
|
||||
error_msg_and_die("invalid %s '%s'", description, str);
|
||||
}
|
||||
}
|
||||
|
||||
struct number_set *tmp_set =
|
||||
alloc_number_set_array(SUPPORTED_PERSONALITIES);
|
||||
qualify_syscall_tokens(name, tmp_set, description);
|
||||
|
||||
free(buf);
|
||||
|
||||
/*
|
||||
* Initialize inject_vec according to tmp_set.
|
||||
* Initialize inject_vec accourding to tmp_set.
|
||||
* Merge tmp_set into inject_set.
|
||||
*/
|
||||
for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
|
||||
unsigned int p;
|
||||
for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
|
||||
if (number_set_array_is_empty(tmp_set, p))
|
||||
continue;
|
||||
|
||||
@ -358,17 +284,14 @@ qualify_inject_common(const char *const str,
|
||||
}
|
||||
if (!inject_vec[p]) {
|
||||
inject_vec[p] = xcalloc(nsyscall_vec[p],
|
||||
sizeof(*inject_vec[p]));
|
||||
sizeof(*inject_vec[p]));
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
|
||||
unsigned int i;
|
||||
for (i = 0; i < nsyscall_vec[p]; ++i) {
|
||||
if (is_number_in_set_array(i, tmp_set, p)) {
|
||||
add_number_to_set_array(i, inject_set, p);
|
||||
inject_vec[p][i] = opts;
|
||||
|
||||
/* Copy per-personality data. */
|
||||
inject_vec[p][i].data.scno =
|
||||
pdata[p].scno;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -388,25 +311,6 @@ qualify_inject(const char *const str)
|
||||
qualify_inject_common(str, false, "inject argument");
|
||||
}
|
||||
|
||||
static void
|
||||
qualify_kvm(const char *const str)
|
||||
{
|
||||
if (strcmp(str, "vcpu") == 0) {
|
||||
#ifdef HAVE_LINUX_KVM_H
|
||||
if (os_release >= KERNEL_VERSION(4, 16, 0))
|
||||
kvm_run_structure_decoder_init();
|
||||
else
|
||||
error_msg("-e kvm=vcpu option needs"
|
||||
" Linux 4.16.0 or higher");
|
||||
#else
|
||||
error_msg("-e kvm=vcpu option is not implemented"
|
||||
" for this architecture");
|
||||
#endif
|
||||
} else {
|
||||
error_msg_and_die("invalid -e kvm= argument: '%s'", str);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct qual_options {
|
||||
const char *name;
|
||||
void (*qualify)(const char *);
|
||||
@ -430,15 +334,15 @@ static const struct qual_options {
|
||||
{ "w", qualify_write },
|
||||
{ "fault", qualify_fault },
|
||||
{ "inject", qualify_inject },
|
||||
{ "kvm", qualify_kvm },
|
||||
};
|
||||
|
||||
void
|
||||
qualify(const char *str)
|
||||
{
|
||||
const struct qual_options *opt = qual_options;
|
||||
unsigned int i;
|
||||
|
||||
for (unsigned int i = 0; i < ARRAY_SIZE(qual_options); ++i) {
|
||||
for (i = 0; i < ARRAY_SIZE(qual_options); ++i) {
|
||||
const char *name = qual_options[i].name;
|
||||
const size_t len = strlen(name);
|
||||
const char *val = str_strip_prefix_len(str, name, len);
|
||||
|
24
flock.c
24
flock.c
@ -3,10 +3,30 @@
|
||||
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
|
||||
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
|
||||
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
|
||||
* Copyright (c) 1999-2018 The strace developers.
|
||||
* Copyright (c) 1999-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
48
flock.h
48
flock.h
@ -1,30 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2018 The strace developers.
|
||||
* Copyright (c) 2015-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#ifndef STRACE_FLOCK_H
|
||||
# define STRACE_FLOCK_H
|
||||
#define STRACE_FLOCK_H
|
||||
|
||||
# include <linux/fcntl.h>
|
||||
#include <linux/fcntl.h>
|
||||
|
||||
# if defined HAVE_STRUCT_FLOCK
|
||||
#if defined HAVE_STRUCT_FLOCK
|
||||
typedef struct flock struct_kernel_flock;
|
||||
# elif defined HAVE_STRUCT___KERNEL_FLOCK
|
||||
#elif defined HAVE_STRUCT___KERNEL_FLOCK
|
||||
typedef struct __kernel_flock struct_kernel_flock;
|
||||
# else
|
||||
# error struct flock definition not found in <linux/fcntl.h>
|
||||
# endif
|
||||
#else
|
||||
# error struct flock definition not found in <linux/fcntl.h>
|
||||
#endif
|
||||
|
||||
# if defined HAVE_STRUCT_FLOCK64
|
||||
#if defined HAVE_STRUCT_FLOCK64
|
||||
typedef struct flock64 struct_kernel_flock64;
|
||||
# elif defined HAVE_STRUCT___KERNEL_FLOCK64
|
||||
#elif defined HAVE_STRUCT___KERNEL_FLOCK64
|
||||
typedef struct __kernel_flock64 struct_kernel_flock64;
|
||||
# else
|
||||
# error struct flock64 definition not found in <linux/fcntl.h>
|
||||
# endif
|
||||
#else
|
||||
# error struct flock64 definition not found in <linux/fcntl.h>
|
||||
#endif
|
||||
|
||||
#endif /* !STRACE_FLOCK_H */
|
||||
|
24
fs_x_ioctl.c
24
fs_x_ioctl.c
@ -1,10 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
|
||||
* Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2016-2018 The strace developers.
|
||||
* Copyright (c) 2016-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
SYS_FUNC(fstatfs)
|
||||
|
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
SYS_FUNC(fstatfs64)
|
||||
|
40
futex.c
40
futex.c
@ -3,10 +3,30 @@
|
||||
* Copyright (c) 2007-2008 Ulrich Drepper <drepper@redhat.com>
|
||||
* Copyright (c) 2009 Andreas Schwab <schwab@redhat.com>
|
||||
* Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2014-2018 The strace developers.
|
||||
* Copyright (c) 2014-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
@ -17,11 +37,7 @@
|
||||
#ifndef FUTEX_CLOCK_REALTIME
|
||||
# define FUTEX_CLOCK_REALTIME 256
|
||||
#endif
|
||||
#ifndef FUTEX_OP_OPARG_SHIFT
|
||||
# define FUTEX_OP_OPARG_SHIFT 8
|
||||
#endif
|
||||
|
||||
#include "xlat/futexbitset.h"
|
||||
#include "xlat/futexops.h"
|
||||
#include "xlat/futexwakeops.h"
|
||||
#include "xlat/futexwakecmps.h"
|
||||
@ -55,13 +71,11 @@ SYS_FUNC(futex)
|
||||
tprintf(", %u", val);
|
||||
tprints(", ");
|
||||
print_timespec(tcp, timeout);
|
||||
tprints(", ");
|
||||
printxval(futexbitset, val3, NULL);
|
||||
tprintf(", %#x", val3);
|
||||
break;
|
||||
case FUTEX_WAKE_BITSET:
|
||||
tprintf(", %u", val);
|
||||
tprints(", ");
|
||||
printxval(futexbitset, val3, NULL);
|
||||
tprintf(", %#x", val3);
|
||||
break;
|
||||
case FUTEX_REQUEUE:
|
||||
tprintf(", %u", val);
|
||||
@ -80,10 +94,8 @@ SYS_FUNC(futex)
|
||||
tprintf(", %u, ", val2);
|
||||
printaddr(uaddr2);
|
||||
tprints(", ");
|
||||
if ((val3 >> 28) & FUTEX_OP_OPARG_SHIFT) {
|
||||
print_xlat(FUTEX_OP_OPARG_SHIFT);
|
||||
tprints("<<28|");
|
||||
}
|
||||
if ((val3 >> 28) & 8)
|
||||
tprints("FUTEX_OP_OPARG_SHIFT<<28|");
|
||||
comment = printxval(futexwakeops, (val3 >> 28) & 0x7, NULL)
|
||||
? NULL : "FUTEX_OP_???";
|
||||
tprints("<<28");
|
||||
|
176
gcc_compat.h
176
gcc_compat.h
@ -1,120 +1,96 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2015-2018 The strace developers.
|
||||
* Copyright (c) 2015-2017 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
* 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. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. 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.
|
||||
*/
|
||||
|
||||
#ifndef STRACE_GCC_COMPAT_H
|
||||
# define STRACE_GCC_COMPAT_H
|
||||
#define STRACE_GCC_COMPAT_H
|
||||
|
||||
# if defined __GNUC__ && defined __GNUC_MINOR__
|
||||
# define GNUC_PREREQ(maj, min) \
|
||||
#if defined __GNUC__ && defined __GNUC_MINOR__
|
||||
# define GNUC_PREREQ(maj, min) \
|
||||
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
||||
# else
|
||||
# define GNUC_PREREQ(maj, min) 0
|
||||
# endif
|
||||
#else
|
||||
# define __attribute__(x) /* empty */
|
||||
# define GNUC_PREREQ(maj, min) 0
|
||||
#endif
|
||||
|
||||
# if defined __clang__ && defined __clang_major__ && defined __clang_minor__
|
||||
# define CLANG_PREREQ(maj, min) \
|
||||
((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
|
||||
# else
|
||||
# define CLANG_PREREQ(maj, min) 0
|
||||
# endif
|
||||
#if GNUC_PREREQ(2, 5)
|
||||
# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
|
||||
#else
|
||||
# define ATTRIBUTE_NORETURN /* empty */
|
||||
#endif
|
||||
|
||||
# if !(GNUC_PREREQ(2, 0) || CLANG_PREREQ(1, 0))
|
||||
# define __attribute__(x) /* empty */
|
||||
# endif
|
||||
#if GNUC_PREREQ(2, 7)
|
||||
# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
|
||||
# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
|
||||
# define ATTRIBUTE_PACKED __attribute__((__packed__))
|
||||
#else
|
||||
# define ATTRIBUTE_FORMAT(args) /* empty */
|
||||
# define ATTRIBUTE_ALIGNED(arg) /* empty */
|
||||
# define ATTRIBUTE_PACKED /* empty */
|
||||
#endif
|
||||
|
||||
# if GNUC_PREREQ(2, 5)
|
||||
# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
|
||||
# else
|
||||
# define ATTRIBUTE_NORETURN /* empty */
|
||||
# endif
|
||||
|
||||
# if GNUC_PREREQ(2, 7)
|
||||
# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
|
||||
# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
|
||||
# define ATTRIBUTE_PACKED __attribute__((__packed__))
|
||||
# else
|
||||
# define ATTRIBUTE_FORMAT(args) /* empty */
|
||||
# define ATTRIBUTE_ALIGNED(arg) /* empty */
|
||||
# define ATTRIBUTE_PACKED /* empty */
|
||||
# endif
|
||||
|
||||
# if GNUC_PREREQ(3, 0)
|
||||
# define SAME_TYPE(x, y) __builtin_types_compatible_p(typeof(x), typeof(y))
|
||||
# define FAIL_BUILD_ON_ZERO(expr) (sizeof(int[-1 + 2 * !!(expr)]) * 0)
|
||||
#if GNUC_PREREQ(3, 0)
|
||||
# define SAME_TYPE(x, y) __builtin_types_compatible_p(typeof(x), typeof(y))
|
||||
# define FAIL_BUILD_ON_ZERO(expr) (sizeof(int[-1 + 2 * !!(expr)]) * 0)
|
||||
/* &(a)[0] is a pointer and not an array, shouldn't be treated as the same */
|
||||
# define MUST_BE_ARRAY(a) FAIL_BUILD_ON_ZERO(!SAME_TYPE((a), &(a)[0]))
|
||||
# else
|
||||
# define SAME_TYPE(x, y) 0
|
||||
# define MUST_BE_ARRAY(a) 0
|
||||
# endif
|
||||
# define MUST_BE_ARRAY(a) FAIL_BUILD_ON_ZERO(!SAME_TYPE((a), &(a)[0]))
|
||||
#else
|
||||
# define SAME_TYPE(x, y) 0
|
||||
# define MUST_BE_ARRAY(a) 0
|
||||
#endif
|
||||
|
||||
# if GNUC_PREREQ(3, 0)
|
||||
# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
|
||||
# else
|
||||
# define ATTRIBUTE_MALLOC /* empty */
|
||||
# endif
|
||||
#if GNUC_PREREQ(3, 0)
|
||||
# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
|
||||
#else
|
||||
# define ATTRIBUTE_MALLOC /* empty */
|
||||
#endif
|
||||
|
||||
# if GNUC_PREREQ(3, 1)
|
||||
# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
|
||||
# else
|
||||
# define ATTRIBUTE_NOINLINE /* empty */
|
||||
# endif
|
||||
#if GNUC_PREREQ(3, 1)
|
||||
# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
|
||||
#else
|
||||
# define ATTRIBUTE_NOINLINE /* empty */
|
||||
#endif
|
||||
|
||||
# if GNUC_PREREQ(4, 0)
|
||||
# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__))
|
||||
# else
|
||||
# define ATTRIBUTE_SENTINEL /* empty */
|
||||
# endif
|
||||
#if GNUC_PREREQ(4, 0)
|
||||
# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__))
|
||||
#else
|
||||
# define ATTRIBUTE_SENTINEL /* empty */
|
||||
#endif
|
||||
|
||||
# if GNUC_PREREQ(4, 1)
|
||||
# define ALIGNOF(t_) __alignof__(t_)
|
||||
# else
|
||||
# define ALIGNOF(t_) (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
|
||||
# endif
|
||||
#if GNUC_PREREQ(4, 1)
|
||||
# define ALIGNOF(t_) __alignof__(t_)
|
||||
#else
|
||||
# define ALIGNOF(t_) (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
|
||||
#endif
|
||||
|
||||
# if GNUC_PREREQ(4, 3)
|
||||
# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
|
||||
# else
|
||||
# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
|
||||
# endif
|
||||
|
||||
# if GNUC_PREREQ(7, 0)
|
||||
# define ATTRIBUTE_FALLTHROUGH __attribute__((__fallthrough__))
|
||||
# else
|
||||
# define ATTRIBUTE_FALLTHROUGH ((void) 0)
|
||||
# endif
|
||||
|
||||
# if CLANG_PREREQ(2, 8)
|
||||
# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
|
||||
_Pragma("clang diagnostic push"); \
|
||||
_Pragma("clang diagnostic ignored \"-Winitializer-overrides\"");
|
||||
# define DIAG_POP_IGNORE_OVERRIDE_INIT \
|
||||
_Pragma("clang diagnostic pop");
|
||||
# elif GNUC_PREREQ(4, 2)
|
||||
# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
|
||||
_Pragma("GCC diagnostic push"); \
|
||||
_Pragma("GCC diagnostic ignored \"-Woverride-init\"");
|
||||
# define DIAG_POP_IGNORE_OVERRIDE_INIT \
|
||||
_Pragma("GCC diagnostic pop");
|
||||
# else
|
||||
# define DIAG_PUSH_IGNORE_OVERRIDE_INIT /* empty */
|
||||
# define DIAG_POP_IGNORE_OVERRIDE_INIT /* empty */
|
||||
# endif
|
||||
|
||||
# if GNUC_PREREQ(6, 0)
|
||||
# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE \
|
||||
_Pragma("GCC diagnostic push"); \
|
||||
_Pragma("GCC diagnostic ignored \"-Wtautological-compare\"");
|
||||
# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE \
|
||||
_Pragma("GCC diagnostic pop");
|
||||
# else
|
||||
# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
|
||||
# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
|
||||
# endif
|
||||
#if GNUC_PREREQ(4, 3)
|
||||
# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
|
||||
#else
|
||||
# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
|
||||
#endif
|
||||
|
||||
#endif /* !STRACE_GCC_COMPAT_H */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user