Compare commits
248 Commits
esyr/loopi
...
esyr/next-
Author | SHA1 | Date | |
---|---|---|---|
b083940210 | |||
9319e0a49c | |||
eaea61a93b | |||
e2b7a15518 | |||
4e854fee20 | |||
ca28f1d4e7 | |||
aa720f7306 | |||
f49fc80253 | |||
f5b54b38ee | |||
997ce1ad8e | |||
420b631687 | |||
a6ace08dbc | |||
e44ae68ae4 | |||
5338aecfa9 | |||
05de794953 | |||
9c26fb26e3 | |||
ce76cd330d | |||
b53717e034 | |||
7bfd2375ff | |||
57098d88c2 | |||
ce9d5044c8 | |||
7657246b59 | |||
76eea4699e | |||
a1d541c26a | |||
4ef7513055 | |||
91ab71f387 | |||
9e9071d615 | |||
d6d103b4fa | |||
776043f4cc | |||
e7b9424cac | |||
d20c0c7804 | |||
b84f967d27 | |||
ad40a98f06 | |||
8a268ad962 | |||
161121a3d2 | |||
6141608483 | |||
74d0cad5dd | |||
504b43651c | |||
b45562e897 | |||
e6e005f70c | |||
ce366255c5 | |||
826306c987 | |||
2f46f33384 | |||
1d46db4207 | |||
12f618552a | |||
606a8f39e8 | |||
7908a872ba | |||
d1f4b528cb | |||
48a84accf6 | |||
4a602e8962 | |||
8ff46440ff | |||
d998972eb5 | |||
2d2edb4654 | |||
3cfdc5da72 | |||
8cfc98ca99 | |||
e963559c13 | |||
cae7ddf0a3 | |||
3c068f860e | |||
53bc64c795 | |||
079776b9bd | |||
36837ede63 | |||
369afb0506 | |||
90337bbfe8 | |||
dd0b8073d6 | |||
616d4ed93c | |||
6b583ed1b3 | |||
d8e5ff352a | |||
231658be6b | |||
016178ec9b | |||
66aea8089d | |||
ed3e7e751d | |||
da97767c05 | |||
a8778adef2 | |||
e3068c9791 | |||
400c83337d | |||
ab353ade4e | |||
8d3ee7033f | |||
5bccbbe42b | |||
6888b56c80 | |||
fd02c5ea81 | |||
cd733e0454 | |||
21cc88963f | |||
7138dcec9e | |||
ff18af2bb4 | |||
a475336863 | |||
be048f54c5 | |||
2a905d1b00 | |||
6a44f46c7c | |||
9baa6bcc88 | |||
3a94852d43 | |||
323c689701 | |||
638b5c99b6 | |||
d9a5b26067 | |||
f6964715e3 | |||
2fc6a3647a | |||
4ebabbed7c | |||
b43aae36d9 | |||
81c9974f11 | |||
0e58b178e5 | |||
bca1b70f6b | |||
6d024c6336 | |||
1525464331 | |||
0fa594e3e8 | |||
4ed4a2ffcc | |||
07c1744c02 | |||
53ac73b04e | |||
c2cc305c66 | |||
061d0e133e | |||
cfc3e07033 | |||
a26ad5c9ad | |||
9ea764c377 | |||
a6e6d0aa1f | |||
1324a28cc7 | |||
394ba90034 | |||
60b094103f | |||
c35f9466a8 | |||
52981bfb48 | |||
8015a74269 | |||
78fd3aa2b8 | |||
4f72de66f4 | |||
ef330a84d9 | |||
1090f31204 | |||
1aca712d4a | |||
bca69f9e39 | |||
c3e1c57045 | |||
a4c8986bd7 | |||
c7436d45a8 | |||
f2f91dbe8b | |||
49443a8c8c | |||
7f3519e4d8 | |||
caac21a22b | |||
1d5a776f63 | |||
771a786157 | |||
6d4b688d38 | |||
342801a9dc | |||
56c64c0f85 | |||
452bb1c4b9 | |||
c8dc2208eb | |||
d7beb8d758 | |||
b4e5977fee | |||
72ecb7691a | |||
fc2d593d3d | |||
8783cd8119 | |||
aeb343b726 | |||
8a7ba35d04 | |||
156777f967 | |||
719d1f8986 | |||
2d89ff7096 | |||
06bb2018c7 | |||
1abb9c7b21 | |||
9f7da75206 | |||
895a68db41 | |||
399a2d8849 | |||
22ec7c5edb | |||
1ef81b4b74 | |||
b7d8794dbf | |||
4544b3f554 | |||
2df7898efb | |||
00c56292a1 | |||
25f71c5488 | |||
33ea6a9bb0 | |||
f4e7b1e740 | |||
bfbdf336ec | |||
08c045c3ac | |||
68d33a311a | |||
d055196eb4 | |||
dd1061290f | |||
1cf06bb8df | |||
33e9a736b1 | |||
e369424a58 | |||
cd6e2d27f8 | |||
90320f4ce4 | |||
3ef3477891 | |||
f0865403a2 | |||
69d148d233 | |||
059568a665 | |||
71404212b8 | |||
86899822ba | |||
05ae538c90 | |||
3305550ccc | |||
57a2b0fbdd | |||
f71663b233 | |||
2b70434e3e | |||
0685a353bf | |||
beece1ab43 | |||
8b2355f55f | |||
d58f4c7ee8 | |||
e30f3c2558 | |||
0a21612184 | |||
1a28b6dba2 | |||
32e987b87a | |||
7c7705fbc9 | |||
f73d6361c1 | |||
53faa8304c | |||
11c4fc6d99 | |||
8b58aa17fb | |||
861f9fd7d8 | |||
dea7b2d055 | |||
b3766e3e01 | |||
6ee33f6452 | |||
e8f456d4e1 | |||
15090ba907 | |||
aaab15665e | |||
398c49b48a | |||
2e9d851346 | |||
653abe7a9d | |||
b821526643 | |||
a010a633cd | |||
3960fea7f1 | |||
8de3d10e71 | |||
13263abd4f | |||
ef560cb5d7 | |||
ea3b724cf0 | |||
d961fb6936 | |||
e901b0cd05 | |||
6d4d8e4241 | |||
fa5d35f8f3 | |||
9964dc7dc4 | |||
849d1ea8ac | |||
d573499dfc | |||
7f232e50af | |||
43d076b53d | |||
c15ae06098 | |||
977d5aed13 | |||
5a22df3304 | |||
624d03085c | |||
98bfc2f997 | |||
fc9b2b76e3 | |||
f12b03a7c5 | |||
4d575e0243 | |||
6fa6d63bd1 | |||
cba303088d | |||
ff4b53baa8 | |||
741b34b3d1 | |||
da228c39ad | |||
044c1560f2 | |||
7e632b44d2 | |||
02ad183786 | |||
4087e34e87 | |||
c31ced973c | |||
0484e396f2 | |||
871c1af6c3 | |||
39a77ad205 | |||
9f25e7a911 | |||
f676bc701d | |||
e6c00226f4 | |||
0ab4f638cd | |||
d5f960204c |
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1,2 +0,0 @@
|
||||
/* export-ignore
|
||||
/README-github_gitlab-autogenerated-archives.txt -export-ignore
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -12,8 +12,6 @@
|
||||
/.version
|
||||
/CREDITS
|
||||
/ChangeLog
|
||||
/INSTALL
|
||||
/README
|
||||
/aclocal.m4
|
||||
/autom4te.cache
|
||||
/bpf_attr_check.c
|
||||
@ -55,14 +53,15 @@
|
||||
/native_printer_decls.h
|
||||
/native_printer_defs.h
|
||||
/printers.h
|
||||
/README
|
||||
/scno.h
|
||||
/sen.h
|
||||
/stamp-h1
|
||||
/strace
|
||||
/strace-*.tar.gz
|
||||
/strace-*.tar.xz
|
||||
/strace-log-merge.1
|
||||
/strace.1
|
||||
/strace-log-merge.1
|
||||
/strace.dsc
|
||||
/strace.spec
|
||||
/sys_func.h
|
||||
|
30
COPYING
30
COPYING
@ -7,14 +7,24 @@ Copyright (c) 1998-2001 Wichert Akkerman <wakkerma@deephackmode.org>
|
||||
Copyright (c) 2001-2018 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.
|
||||
|
@ -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
|
@ -5,5 +5,5 @@ that are needed to build strace. Some of these files are generated by tools
|
||||
from the GNU Autoconf and GNU Automake packages.
|
||||
|
||||
Note: rather than running `autoreconf` directly, please invoke `./bootstrap`
|
||||
script and follow the instructions given in [INSTALL](README-configure) file for further
|
||||
script and follow the instructions given in [INSTALL](INSTALL) file for further
|
||||
building and 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!
|
130
Makefile.am
130
Makefile.am
@ -7,7 +7,27 @@
|
||||
# Copyright (c) 2002-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.
|
||||
|
||||
if HAVE_M32_RUNTIME
|
||||
TESTS_M32 = tests-m32
|
||||
@ -41,8 +61,9 @@ AM_CPPFLAGS_FOR_BUILD = $(AM_CPPFLAGS)
|
||||
|
||||
include xlat/Makemodule.am
|
||||
|
||||
strace_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
strace_CFLAGS = $(AM_CFLAGS)
|
||||
strace_CPPFLAGS = $(AM_CPPFLAGS) -DHAVE_DEFS_H
|
||||
strace_CFLAGS = $(AM_CFLAGS) -DMPERS_WORDSIZE=PERSONALITY0_WORDSIZE \
|
||||
-DMPERS_KLONGSIZE=PERSONALITY0_KLONGSIZE
|
||||
strace_LDFLAGS =
|
||||
strace_LDADD = libstrace.a $(clock_LIBS) $(timer_LIBS)
|
||||
noinst_LIBRARIES = libstrace.a
|
||||
@ -127,15 +148,13 @@ strace_SOURCES = \
|
||||
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 \
|
||||
@ -160,7 +179,6 @@ strace_SOURCES = \
|
||||
kexec.c \
|
||||
keyctl.c \
|
||||
keyctl_kdf_params.h \
|
||||
kill_save_errno.h \
|
||||
kvm.c \
|
||||
largefile_wrappers.h \
|
||||
ldt.c \
|
||||
@ -168,7 +186,6 @@ strace_SOURCES = \
|
||||
linux/asm_stat.h \
|
||||
linux/x32/asm_stat.h \
|
||||
linux/x86_64/asm_stat.h \
|
||||
list.h \
|
||||
listen.c \
|
||||
lookup_dcookie.c \
|
||||
loop.c \
|
||||
@ -188,15 +205,15 @@ 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_inet_diag.c \
|
||||
netlink_kobject_uevent.c \
|
||||
netlink_kobject_uevent.h \
|
||||
netlink_sock_diag.h \
|
||||
netlink_inet_diag.c \
|
||||
netlink_netfilter.c \
|
||||
netlink_netlink_diag.c \
|
||||
netlink_packet_diag.c \
|
||||
@ -205,7 +222,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 \
|
||||
@ -228,11 +244,9 @@ strace_SOURCES = \
|
||||
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 \
|
||||
@ -251,11 +265,9 @@ strace_SOURCES = \
|
||||
process.c \
|
||||
process_vm.c \
|
||||
ptp.c \
|
||||
ptp_clock.h \
|
||||
ptrace.h \
|
||||
ptrace_syscall_info.c \
|
||||
ptrace_syscall_info.h \
|
||||
quota.c \
|
||||
random_ioctl.c \
|
||||
readahead.c \
|
||||
readlink.c \
|
||||
reboot.c \
|
||||
@ -270,6 +282,7 @@ strace_SOURCES = \
|
||||
rtc.c \
|
||||
rtnl_addr.c \
|
||||
rtnl_addrlabel.c \
|
||||
rtnl_cachereport.c \
|
||||
rtnl_dcb.c \
|
||||
rtnl_link.c \
|
||||
rtnl_mdb.c \
|
||||
@ -279,6 +292,7 @@ strace_SOURCES = \
|
||||
rtnl_nsid.c \
|
||||
rtnl_route.c \
|
||||
rtnl_rule.c \
|
||||
rtnl_stats.c \
|
||||
rtnl_tc.c \
|
||||
rtnl_tc_action.c \
|
||||
s390.c \
|
||||
@ -308,14 +322,15 @@ strace_SOURCES = \
|
||||
statx.c \
|
||||
statx.h \
|
||||
strace.c \
|
||||
string_to_uint.c \
|
||||
string_to_uint.h \
|
||||
string_to_uint.c \
|
||||
swapon.c \
|
||||
syscall.c \
|
||||
sysctl.c \
|
||||
sysent.h \
|
||||
sysent_shorthand_defs.h \
|
||||
sysent_shorthand_undefs.h \
|
||||
sysfs.c \
|
||||
sysinfo.c \
|
||||
syslog.c \
|
||||
sysmips.c \
|
||||
@ -349,7 +364,10 @@ strace_SOURCES = \
|
||||
$(strace_SOURCES_check) \
|
||||
# end of strace_SOURCES
|
||||
|
||||
strace_SOURCES_check = bpf_attr_check.c
|
||||
strace_SOURCES_check = \
|
||||
bpf_attr_check.c \
|
||||
ptp_clock_check.c \
|
||||
# end of strace_SOURCES_check
|
||||
|
||||
if ENABLE_STACKTRACE
|
||||
strace_SOURCES += unwind.c unwind.h
|
||||
@ -392,8 +410,6 @@ EXTRA_DIST = \
|
||||
CREDITS \
|
||||
ChangeLog \
|
||||
ChangeLog-CVS \
|
||||
LGPL-2.1-or-later \
|
||||
README-configure \
|
||||
README-linux-ptrace \
|
||||
debian/changelog \
|
||||
debian/compat \
|
||||
@ -410,6 +426,7 @@ EXTRA_DIST = \
|
||||
debian/strace64.manpages \
|
||||
debian/watch \
|
||||
gen_bpf_attr_check.sh \
|
||||
gen_ptp_clock_check.sh \
|
||||
generate_sen.sh \
|
||||
ioctl_iocdef.c \
|
||||
ioctlsort.c \
|
||||
@ -421,8 +438,9 @@ EXTRA_DIST = \
|
||||
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/get_error.c \
|
||||
linux/aarch64/get_scno.c \
|
||||
@ -441,6 +459,8 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -456,6 +476,8 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -468,10 +490,11 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -486,6 +509,8 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -498,6 +523,7 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -510,12 +536,12 @@ EXTRA_DIST = \
|
||||
linux/bfin/set_scno.c \
|
||||
linux/bfin/syscallent.h \
|
||||
linux/bfin/userent.h \
|
||||
linux/check_scno.c \
|
||||
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 \
|
||||
@ -530,9 +556,10 @@ EXTRA_DIST = \
|
||||
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_defs_.h \
|
||||
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 \
|
||||
@ -561,11 +588,13 @@ EXTRA_DIST = \
|
||||
linux/ia64/rt_sigframe.h \
|
||||
linux/ia64/set_error.c \
|
||||
linux/ia64/set_scno.c \
|
||||
linux/ia64/shuffle_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 \
|
||||
@ -580,6 +609,7 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -592,6 +622,7 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -607,6 +638,8 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -629,6 +662,8 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -640,6 +675,8 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -653,6 +690,7 @@ EXTRA_DIST = \
|
||||
linux/packet_diag.h \
|
||||
linux/powerpc/arch_defs_.h \
|
||||
linux/powerpc/arch_regs.c \
|
||||
linux/powerpc/arch_regs.h \
|
||||
linux/powerpc/arch_rt_sigframe.c \
|
||||
linux/powerpc/arch_sigreturn.c \
|
||||
linux/powerpc/errnoent.h \
|
||||
@ -669,8 +707,8 @@ EXTRA_DIST = \
|
||||
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_regs.h \
|
||||
linux/powerpc64/arch_rt_sigframe.c \
|
||||
linux/powerpc64/arch_sigreturn.c \
|
||||
linux/powerpc64/errnoent.h \
|
||||
@ -690,11 +728,11 @@ EXTRA_DIST = \
|
||||
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/riscv/arch_regs.c \
|
||||
linux/riscv/arch_regs.h \
|
||||
linux/riscv/arch_rt_sigframe.c \
|
||||
linux/riscv/get_error.c \
|
||||
linux/riscv/get_scno.c \
|
||||
linux/riscv/get_syscall_args.c \
|
||||
@ -710,6 +748,8 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -725,8 +765,9 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -745,6 +786,7 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -760,6 +802,7 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -780,6 +823,8 @@ EXTRA_DIST = \
|
||||
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/get_error.c \
|
||||
@ -795,9 +840,9 @@ EXTRA_DIST = \
|
||||
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_regs.h \
|
||||
linux/sparc64/arch_rt_sigframe.c \
|
||||
linux/sparc64/arch_sigreturn.c \
|
||||
linux/sparc64/errnoent.h \
|
||||
@ -819,8 +864,9 @@ EXTRA_DIST = \
|
||||
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/get_error.c \
|
||||
linux/tile/get_scno.c \
|
||||
@ -840,13 +886,11 @@ EXTRA_DIST = \
|
||||
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/get_error.c \
|
||||
linux/x32/get_scno.c \
|
||||
linux/x32/get_syscall_args.c \
|
||||
@ -854,7 +898,6 @@ 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 \
|
||||
@ -864,7 +907,6 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -891,6 +933,7 @@ EXTRA_DIST = \
|
||||
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 \
|
||||
@ -928,6 +971,9 @@ $(srcdir)/.version:
|
||||
bpf_attr_check.c: $(srcdir)/bpf_attr.h $(srcdir)/gen_bpf_attr_check.sh
|
||||
$(srcdir)/gen_bpf_attr_check.sh $< > $@-t && mv $@-t $@
|
||||
|
||||
ptp_clock_check.c: $(srcdir)/ptp_clock.h $(srcdir)/gen_ptp_clock_check.sh
|
||||
$(srcdir)/gen_ptp_clock_check.sh $< > $@-t && mv $@-t $@
|
||||
|
||||
strace_SOURCES_c = \
|
||||
$(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES))
|
||||
|
||||
@ -1007,11 +1053,11 @@ ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioc
|
||||
|
||||
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
|
||||
printers.h ptp_clock_check.c 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
|
||||
printers.h ptp_clock_check.c sen.h sys_func.h
|
||||
DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h linux/linux/signal.h
|
||||
|
||||
include scno.am
|
||||
@ -1041,7 +1087,7 @@ mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
|
||||
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; \
|
||||
$(srcdir)/mpers.sh "$(mpers_NAME)" "$(mpers_CC_FLAGS)" "$$f" || exit; \
|
||||
done
|
||||
> $@
|
||||
|
||||
@ -1112,7 +1158,9 @@ BUILT_SOURCES += $(mpers_m32_targets)
|
||||
CLEANFILES += $(mpers_m32_targets)
|
||||
|
||||
$(mpers_m32_targets): mpers_NAME = m32
|
||||
$(mpers_m32_targets): mpers_CC_FLAGS = @cc_flags_m32@
|
||||
$(mpers_m32_targets): mpers_CC_FLAGS = @cc_flags_m32@ \
|
||||
-DMPERS_WORDSIZE=PERSONALITY1_WORDSIZE \
|
||||
-DMPERS_KLONGSIZE=PERSONALITY1_KLONGSIZE
|
||||
|
||||
endif # HAVE_M32_MPERS
|
||||
|
||||
@ -1129,7 +1177,9 @@ BUILT_SOURCES += $(mpers_mx32_targets)
|
||||
CLEANFILES += $(mpers_mx32_targets)
|
||||
|
||||
$(mpers_mx32_targets): mpers_NAME = mx32
|
||||
$(mpers_mx32_targets): mpers_CC_FLAGS = @cc_flags_mx32@
|
||||
$(mpers_mx32_targets): mpers_CC_FLAGS = @cc_flags_mx32@ \
|
||||
-DMPERS_WORDSIZE=PERSONALITY2_WORDSIZE \
|
||||
-DMPERS_KLONGSIZE=PERSONALITY2_KLONGSIZE
|
||||
|
||||
endif # HAVE_MX32_MPERS
|
||||
|
||||
|
69
NEWS
69
NEWS
@ -1,75 +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)
|
||||
===============================================
|
||||
|
||||
|
@ -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.
|
@ -3,8 +3,7 @@ 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.
|
||||
|
||||
|
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"
|
||||
|
77
aio.c
77
aio.c
@ -6,7 +6,27 @@
|
||||
* Copyright (c) 1999-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,6 +34,13 @@
|
||||
#include <linux/aio_abi.h>
|
||||
|
||||
#include "xlat/aio_cmds.h"
|
||||
#include "xlat/aio_iocb_flags.h"
|
||||
|
||||
#ifdef HAVE_STRUCT_IOCB_AIO_RW_FLAGS
|
||||
# define AIO_RW_FLAGS_FIELD aio_rw_flags
|
||||
#else
|
||||
# define AIO_RW_FLAGS_FIELD aio_reserved1
|
||||
#endif
|
||||
|
||||
SYS_FUNC(io_setup)
|
||||
{
|
||||
@ -32,7 +59,7 @@ SYS_FUNC(io_destroy)
|
||||
}
|
||||
|
||||
enum iocb_sub {
|
||||
SUB_NONE, SUB_COMMON, SUB_VECTOR
|
||||
SUB_NONE, SUB_COMMON, SUB_VECTOR, SUB_POLL
|
||||
};
|
||||
|
||||
static enum iocb_sub
|
||||
@ -44,14 +71,13 @@ tprint_lio_opcode(unsigned int cmd)
|
||||
[IOCB_CMD_FSYNC] = SUB_NONE,
|
||||
[IOCB_CMD_FDSYNC] = SUB_NONE,
|
||||
[IOCB_CMD_PREADX] = SUB_NONE,
|
||||
[IOCB_CMD_POLL] = SUB_NONE,
|
||||
[IOCB_CMD_POLL] = SUB_POLL,
|
||||
[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);
|
||||
printxval_ex(aio_cmds, cmd, "IOCB_CMD_???", XLAT_STYLE_FMT_U);
|
||||
|
||||
return cmd < ARRAY_SIZE(subs) ? subs[cmd] : SUB_NONE;
|
||||
}
|
||||
@ -59,14 +85,14 @@ tprint_lio_opcode(unsigned int cmd)
|
||||
static void
|
||||
print_common_flags(struct tcb *tcp, const struct iocb *cb)
|
||||
{
|
||||
/* IOCB_FLAG_RESFD is available since v2.6.22-rc1~47 */
|
||||
#ifdef IOCB_FLAG_RESFD
|
||||
if (cb->aio_flags)
|
||||
PRINT_FIELD_FLAGS(", ", *cb, aio_flags, aio_iocb_flags,
|
||||
"IOCB_FLAG_???");
|
||||
|
||||
if (cb->aio_flags & IOCB_FLAG_RESFD)
|
||||
PRINT_FIELD_FD(", ", *cb, aio_resfd, tcp);
|
||||
|
||||
if (cb->aio_flags & ~IOCB_FLAG_RESFD)
|
||||
PRINT_FIELD_X(", ", *cb, aio_flags);
|
||||
#endif
|
||||
else if (cb->aio_resfd)
|
||||
PRINT_FIELD_X(", ", *cb, aio_resfd);
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -82,20 +108,25 @@ print_iocb_header(struct tcb *tcp, const struct iocb *cb)
|
||||
{
|
||||
enum iocb_sub sub;
|
||||
|
||||
if (cb->aio_data){
|
||||
PRINT_FIELD_X("", *cb, aio_data);
|
||||
tprints(", ");
|
||||
|
||||
if (cb->aio_key)
|
||||
PRINT_FIELD_U(", ", *cb, aio_key);
|
||||
|
||||
if (cb->AIO_RW_FLAGS_FIELD) {
|
||||
tprints(", aio_rw_flags=");
|
||||
printflags(rwf_flags, cb->AIO_RW_FLAGS_FIELD, "RWF_???");
|
||||
}
|
||||
|
||||
if (cb->aio_key) {
|
||||
PRINT_FIELD_U("", *cb, aio_key);
|
||||
tprints(", ");
|
||||
}
|
||||
|
||||
tprints("aio_lio_opcode=");
|
||||
tprints(", aio_lio_opcode=");
|
||||
sub = tprint_lio_opcode(cb->aio_lio_opcode);
|
||||
if (cb->aio_reqprio)
|
||||
|
||||
if (cb->aio_flags & IOCB_FLAG_IOPRIO) {
|
||||
tprints(", aio_reqprio=");
|
||||
print_ioprio(zero_extend_signed_to_ull(cb->aio_reqprio));
|
||||
} else if (cb->aio_reqprio) {
|
||||
PRINT_FIELD_D(", ", *cb, aio_reqprio);
|
||||
}
|
||||
|
||||
PRINT_FIELD_FD(", ", *cb, aio_fildes, tcp);
|
||||
|
||||
@ -135,6 +166,10 @@ print_iocb(struct tcb *tcp, const struct iocb *cb)
|
||||
PRINT_FIELD_D(", ", *cb, aio_offset);
|
||||
print_common_flags(tcp, cb);
|
||||
break;
|
||||
case SUB_POLL:
|
||||
PRINT_FIELD_FLAGS(", ", *cb, aio_buf, pollflags, "POLL???");
|
||||
print_common_flags(tcp, cb);
|
||||
break;
|
||||
case SUB_NONE:
|
||||
break;
|
||||
}
|
||||
@ -235,7 +270,7 @@ print_io_getevents(struct tcb *tcp, bool has_usig)
|
||||
* whether the syscall has failed or not.
|
||||
*/
|
||||
temporarily_clear_syserror(tcp);
|
||||
print_timespec(tcp, tcp->u_arg[4]);
|
||||
print_timespec(tcp, tcp->u_arg[4], false);
|
||||
if (has_usig) {
|
||||
tprints(", ");
|
||||
print_aio_sigset(tcp, tcp->u_arg[5]);
|
||||
|
22
alpha.c
22
alpha.c
@ -3,7 +3,27 @@
|
||||
* 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"
|
||||
|
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* 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
|
||||
|
@ -3,7 +3,27 @@
|
||||
* 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"
|
||||
|
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"
|
||||
|
24
block.c
24
block.c
@ -4,7 +4,27 @@
|
||||
* Copyright (c) 2011-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"
|
||||
@ -116,8 +136,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(", ");
|
||||
|
10
bootstrap
10
bootstrap
@ -1,11 +1,9 @@
|
||||
#!/bin/sh -eu
|
||||
#
|
||||
# Copyright (c) 2014-2018 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
export LANG=C
|
||||
|
||||
./m4/gen_bpf_attr_m4.sh
|
||||
./m4/gen_ptp_clock_m4.sh
|
||||
./generate_mpers_am.sh
|
||||
./xlat/gen.sh
|
||||
./tests/gen_pure_executables.sh
|
||||
@ -31,7 +29,7 @@ for m in m32 mx32; do
|
||||
done
|
||||
done
|
||||
|
||||
for f in README INSTALL; do
|
||||
for f in README; do
|
||||
cp "dist/$f" .
|
||||
done
|
||||
|
||||
|
49
bpf.c
49
bpf.c
@ -4,7 +4,27 @@
|
||||
* 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"
|
||||
@ -130,9 +150,9 @@ print_ebpf_insn(struct tcb * const tcp, void * const elem_buf,
|
||||
|
||||
/* We can't use PRINT_FIELD_XVAL on bit fields */
|
||||
tprints(", dst_reg=");
|
||||
printxval_index(ebpf_regs, insn->dst_reg, "BPF_REG_???");
|
||||
printxval(ebpf_regs, insn->dst_reg, "BPF_REG_???");
|
||||
tprints(", src_reg=");
|
||||
printxval_index(ebpf_regs, insn->src_reg, "BPF_REG_???");
|
||||
printxval(ebpf_regs, insn->src_reg, "BPF_REG_???");
|
||||
|
||||
PRINT_FIELD_D(", ", *insn, off);
|
||||
PRINT_FIELD_X(", ", *insn, imm);
|
||||
@ -158,7 +178,7 @@ print_ebpf_prog(struct tcb *const tcp, const uint64_t addr, const uint32_t len)
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)
|
||||
{
|
||||
PRINT_FIELD_XVAL_INDEX("{", attr, map_type, bpf_map_types,
|
||||
PRINT_FIELD_XVAL("{", attr, map_type, bpf_map_types,
|
||||
"BPF_MAP_TYPE_???");
|
||||
PRINT_FIELD_U(", ", attr, key_size);
|
||||
PRINT_FIELD_U(", ", attr, value_size);
|
||||
@ -228,7 +248,7 @@ BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_ELEM)
|
||||
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,
|
||||
PRINT_FIELD_XVAL(", ", attr, flags, bpf_map_update_elem_flags,
|
||||
"BPF_???");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
@ -250,7 +270,7 @@ END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)
|
||||
{
|
||||
PRINT_FIELD_XVAL_INDEX("{", attr, prog_type, bpf_prog_types,
|
||||
PRINT_FIELD_XVAL("{", attr, prog_type, bpf_prog_types,
|
||||
"BPF_PROG_TYPE_???");
|
||||
PRINT_FIELD_U(", ", attr, insn_cnt);
|
||||
tprints(", insns=");
|
||||
@ -272,8 +292,11 @@ BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)
|
||||
/* 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);
|
||||
tprintf(", kern_version=KERNEL_VERSION(%u, %u, %u)",
|
||||
attr.kern_version >> 16,
|
||||
(attr.kern_version >> 8) & 0xFF,
|
||||
attr.kern_version & 0xFF);
|
||||
|
||||
/* 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;
|
||||
@ -329,8 +352,7 @@ BEGIN_BPF_CMD_DECODER(BPF_PROG_ATTACH)
|
||||
{
|
||||
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_???");
|
||||
}
|
||||
@ -339,8 +361,7 @@ END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
BEGIN_BPF_CMD_DECODER(BPF_PROG_DETACH)
|
||||
{
|
||||
PRINT_FIELD_FD("{", attr, target_fd, tcp);
|
||||
PRINT_FIELD_XVAL_INDEX(", ", attr, attach_type, bpf_attach_type,
|
||||
"BPF_???");
|
||||
PRINT_FIELD_XVAL(", ", attr, attach_type, bpf_attach_type, "BPF_???");
|
||||
}
|
||||
END_BPF_CMD_DECODER(RVAL_DECODED)
|
||||
|
||||
@ -642,7 +663,7 @@ BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)
|
||||
|
||||
if (entering(tcp)) {
|
||||
PRINT_FIELD_FD("{query={", attr, target_fd, tcp);
|
||||
PRINT_FIELD_XVAL_INDEX(", ", attr, attach_type, bpf_attach_type,
|
||||
PRINT_FIELD_XVAL(", ", attr, attach_type, bpf_attach_type,
|
||||
"BPF_???");
|
||||
PRINT_FIELD_FLAGS(", ", attr, query_flags, bpf_query_flags,
|
||||
"BPF_F_QUERY_???");
|
||||
@ -713,7 +734,7 @@ SYS_FUNC(bpf)
|
||||
int rc = RVAL_DECODED;
|
||||
|
||||
if (entering(tcp)) {
|
||||
printxval_index(bpf_commands, cmd, "BPF_???");
|
||||
printxval(bpf_commands, cmd, "BPF_???");
|
||||
tprints(", ");
|
||||
}
|
||||
|
||||
|
22
bpf_attr.h
22
bpf_attr.h
@ -2,7 +2,27 @@
|
||||
* Copyright (c) 2015-2018 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_ATTR_H
|
||||
|
28
bpf_filter.c
28
bpf_filter.c
@ -5,7 +5,27 @@
|
||||
* 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"
|
||||
@ -36,10 +56,8 @@ print_bpf_filter_code(const uint16_t code, bool extended)
|
||||
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(extended ? ebpf_class : bpf_class, BPF_CLASS(code),
|
||||
"BPF_???");
|
||||
switch (BPF_CLASS(code)) {
|
||||
case BPF_ST:
|
||||
case BPF_STX:
|
||||
|
24
bpf_filter.h
24
bpf_filter.h
@ -1,10 +1,30 @@
|
||||
/*
|
||||
* 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
|
||||
|
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
|
@ -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"
|
||||
|
@ -5,7 +5,27 @@
|
||||
* 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"
|
||||
|
22
btrfs.c
22
btrfs.c
@ -3,7 +3,27 @@
|
||||
* 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"
|
||||
|
24
cacheflush.c
24
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"
|
||||
|
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,9 +1,4 @@
|
||||
#!/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'
|
||||
|
@ -1,9 +1,4 @@
|
||||
#!/bin/sh -ex
|
||||
#
|
||||
# Copyright (c) 2018 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS='--disable-dependency-tracking'
|
||||
export DISTCHECK_CONFIGURE_FLAGS
|
||||
|
22
clone.c
22
clone.c
@ -7,7 +7,27 @@
|
||||
* Copyright (c) 2014-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"
|
||||
|
55
configure.ac
55
configure.ac
@ -8,7 +8,27 @@
|
||||
# Copyright (c) 2002-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.
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([strace],
|
||||
@ -335,7 +355,8 @@ AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
|
||||
AC_CHECK_MEMBERS(m4_normalize([
|
||||
siginfo_t.si_syscall,
|
||||
siginfo_t.si_timerid,
|
||||
siginfo_t.si_overrun
|
||||
siginfo_t.si_overrun,
|
||||
siginfo_t.si_trapno
|
||||
]),,, [#include <signal.h>])
|
||||
|
||||
AC_CHECK_MEMBERS(m4_normalize([
|
||||
@ -456,6 +477,10 @@ AC_CHECK_HEADERS([linux/bpf.h], [
|
||||
st_BPF_ATTR
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS([linux/ptp_clock.h], [
|
||||
st_PTP_CLOCK
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS([bluetooth/bluetooth.h], [
|
||||
AC_CHECK_MEMBERS([struct sockaddr_l2.l2_bdaddr_type],,,
|
||||
[#include <bluetooth/bluetooth.h>
|
||||
@ -473,6 +498,7 @@ AC_CHECK_MEMBERS(m4_normalize([
|
||||
|
||||
AC_CHECK_TYPES([struct dcbmsg],,, [#include <linux/dcbnl.h>])
|
||||
AC_CHECK_TYPES([struct ifaddrlblmsg],,, [#include <linux/if_addrlabel.h>])
|
||||
AC_CHECK_TYPES([struct if_stats_msg],,, [#include <linux/if_link.h>])
|
||||
AC_CHECK_TYPES([struct netconfmsg],,, [#include <linux/netconf.h>])
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
@ -550,11 +576,10 @@ 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_MEMBERS(m4_normalize([
|
||||
struct ubi_attach_req.max_beb_per1024
|
||||
struct ubi_mkvol_req.flags
|
||||
]),,, [#include <mtd/ubi-user.h>])
|
||||
|
||||
AC_CHECK_TYPES(m4_normalize([
|
||||
struct kvm_cpuid2,
|
||||
@ -580,6 +605,8 @@ fi
|
||||
|
||||
AC_CHECK_TYPES([struct __aio_sigset],,, [#include <linux/aio_abi.h>])
|
||||
|
||||
AC_CHECK_MEMBERS([struct iocb.aio_rw_flags],,, [#include <linux/aio_abi.h>])
|
||||
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
|
||||
AC_CHECK_HEADERS([linux/btrfs.h], [
|
||||
@ -645,8 +672,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,
|
||||
@ -910,8 +935,16 @@ AC_ARG_ENABLE([mpers],
|
||||
esac],
|
||||
[enable_mpers=yes])
|
||||
|
||||
st_MPERS([m32], [aarch64|powerpc64|riscv|s390x|sparc64|tile|x32|x86_64])
|
||||
st_MPERS([mx32], [x86_64])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(, [[#include "linux/]]$arch[[/arch_defs_.h"
|
||||
#include "linux/arch_defs_.h"
|
||||
int i[SUPPORTED_PERSONALITIES > 1 ? 1 : -1];]])],
|
||||
[st_MPERS([m32], ["$arch"])])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(, [[#include "linux/]]$arch[[/arch_defs_.h"
|
||||
#include "linux/arch_defs_.h"
|
||||
int i[SUPPORTED_PERSONALITIES > 2 ? 1 : -1];]])],
|
||||
[st_MPERS([mx32], ["$arch"])])
|
||||
|
||||
AX_VALGRIND_DFLT([sgcheck], [off])
|
||||
AX_VALGRIND_CHECK
|
||||
|
@ -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,4 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (c) 2017-2018 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
: ${YEAR_FILE:=$1}
|
||||
: ${DEFAULT_YEAR:=$2}
|
||||
@ -19,7 +14,7 @@ year=
|
||||
[ -f "${YEAR_FILE}" ] && year="$(cat "${YEAR_FILE}")"
|
||||
|
||||
[ -n "${year}" ] ||
|
||||
year="$(date -u +%Y -d "$(git show -s --format=format:%cD)")"
|
||||
year="$(date -u +%Y -d "$(git show --format=format:%cD --no-patch)")"
|
||||
|
||||
[ -n "${year}" ] ||
|
||||
year="${DEFAULT_YEAR}"
|
||||
|
450
count.c
450
count.c
@ -11,160 +11,466 @@
|
||||
* Copyright (c) 2006-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"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/* Per-syscall stats structure */
|
||||
struct call_counts {
|
||||
/* time may be total latency or system time */
|
||||
struct timespec time;
|
||||
struct timespec time_min;
|
||||
struct timespec time_max;
|
||||
double time_avg;
|
||||
unsigned int calls, errors;
|
||||
};
|
||||
|
||||
static struct call_counts *countv[SUPPORTED_PERSONALITIES];
|
||||
#define counts (countv[current_personality])
|
||||
|
||||
static const struct timespec zero_ts;
|
||||
static const struct timespec max_ts = {
|
||||
(time_t) (long long) (zero_extend_signed_to_ull(~(((time_t) 0))) >> 1),
|
||||
LONG_MAX };
|
||||
|
||||
static struct timespec overhead;
|
||||
|
||||
|
||||
enum count_summary_columns {
|
||||
CSC_NONE,
|
||||
CSC_TIME_100S,
|
||||
CSC_TIME_TOTAL,
|
||||
CSC_TIME_MIN,
|
||||
CSC_TIME_MAX,
|
||||
CSC_TIME_AVG,
|
||||
CSC_CALLS,
|
||||
CSC_ERRORS,
|
||||
CSC_SC_NAME,
|
||||
|
||||
CSC_MAX,
|
||||
};
|
||||
|
||||
#define DEF_COLUMNS \
|
||||
_(CSC_TIME_100S), \
|
||||
_(CSC_TIME_TOTAL), \
|
||||
_(CSC_TIME_AVG), \
|
||||
_(CSC_CALLS), \
|
||||
_(CSC_ERRORS), \
|
||||
_(CSC_SC_NAME), \
|
||||
/* End of DEF_COLUMNS definition */
|
||||
|
||||
#define _(x) x
|
||||
static uint8_t columns[CSC_MAX] = { DEF_COLUMNS };
|
||||
#undef _
|
||||
#define _(x) [x] = 1
|
||||
static uint8_t visible[CSC_MAX] = { DEF_COLUMNS };
|
||||
#undef _
|
||||
|
||||
void
|
||||
count_syscall(struct tcb *tcp, const struct timespec *syscall_exiting_ts)
|
||||
{
|
||||
if (!scno_in_range(tcp->scno))
|
||||
return;
|
||||
|
||||
if (!counts)
|
||||
if (!counts) {
|
||||
counts = xcalloc(nsyscalls, sizeof(*counts));
|
||||
|
||||
for (size_t i = 0; i < nsyscalls; i++)
|
||||
counts[i].time_min = max_ts;
|
||||
}
|
||||
struct call_counts *cc = &counts[tcp->scno];
|
||||
|
||||
cc->calls++;
|
||||
if (syserror(tcp))
|
||||
cc->errors++;
|
||||
|
||||
struct timespec wts;
|
||||
if (count_wallclock) {
|
||||
/* wall clock time spent while in syscall */
|
||||
struct timespec wts;
|
||||
ts_sub(&wts, syscall_exiting_ts, &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);
|
||||
ts_sub(&wts, &tcp->stime, &tcp->ltime);
|
||||
}
|
||||
|
||||
ts_sub(&wts, &wts, &overhead);
|
||||
ts_max(&wts, &wts, &zero_ts);
|
||||
|
||||
if (ts_cmp(&wts, &cc->time_min) < 0)
|
||||
cc->time_min = wts;
|
||||
if (ts_cmp(&wts, &cc->time_max) > 0)
|
||||
cc->time_max = wts;
|
||||
|
||||
ts_add(&cc->time, &cc->time, &wts);
|
||||
}
|
||||
|
||||
static int
|
||||
time_cmp(void *a, void *b)
|
||||
time_cmp(const void *a, const void *b)
|
||||
{
|
||||
return -ts_cmp(&counts[*((int *) a)].time,
|
||||
&counts[*((int *) b)].time);
|
||||
return -ts_cmp(&counts[*((unsigned int *) a)].time,
|
||||
&counts[*((unsigned int *) b)].time);
|
||||
}
|
||||
|
||||
static int
|
||||
syscall_cmp(void *a, void *b)
|
||||
min_time_cmp(const void *a, const void *b)
|
||||
{
|
||||
const char *a_name = sysent[*((int *) a)].sys_name;
|
||||
const char *b_name = sysent[*((int *) b)].sys_name;
|
||||
return strcmp(a_name ? a_name : "", b_name ? b_name : "");
|
||||
return -ts_cmp(&counts[*((unsigned int *) a)].time_min,
|
||||
&counts[*((unsigned int *) b)].time_min);
|
||||
}
|
||||
|
||||
static int
|
||||
count_cmp(void *a, void *b)
|
||||
max_time_cmp(const void *a, const void *b)
|
||||
{
|
||||
int m = counts[*((int *) a)].calls;
|
||||
int n = counts[*((int *) b)].calls;
|
||||
return -ts_cmp(&counts[*((unsigned int *) a)].time_max,
|
||||
&counts[*((unsigned int *) b)].time_max);
|
||||
}
|
||||
|
||||
static int
|
||||
avg_time_cmp(const void *a, const void *b)
|
||||
{
|
||||
double m = counts[*((unsigned int *) a)].time_avg;
|
||||
double n = counts[*((unsigned int *) b)].time_avg;
|
||||
|
||||
return (m < n) ? 1 : (m > n) ? -1 : 0;
|
||||
}
|
||||
|
||||
static int (*sortfun)();
|
||||
static int
|
||||
syscall_cmp(const void *a, const void *b)
|
||||
{
|
||||
const char *a_name = sysent[*((unsigned int *) a)].sys_name;
|
||||
const char *b_name = sysent[*((unsigned int *) b)].sys_name;
|
||||
return strcmp(a_name ? a_name : "", b_name ? b_name : "");
|
||||
}
|
||||
|
||||
static int
|
||||
count_cmp(const void *a, const void *b)
|
||||
{
|
||||
unsigned int m = counts[*((unsigned int *) a)].calls;
|
||||
unsigned int n = counts[*((unsigned int *) b)].calls;
|
||||
|
||||
return (m < n) ? 1 : (m > n) ? -1 : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
error_cmp(const void *a, const void *b)
|
||||
{
|
||||
unsigned int m = counts[*((unsigned int *) a)].errors;
|
||||
unsigned int n = counts[*((unsigned int *) b)].errors;
|
||||
|
||||
return (m < n) ? 1 : (m > n) ? -1 : 0;
|
||||
}
|
||||
|
||||
static int (*sortfun)(const void *a, const void *b);
|
||||
|
||||
void
|
||||
set_sortby(const char *sortby)
|
||||
{
|
||||
if (strcmp(sortby, "time") == 0)
|
||||
sortfun = time_cmp;
|
||||
else if (strcmp(sortby, "calls") == 0)
|
||||
sortfun = count_cmp;
|
||||
else if (strcmp(sortby, "name") == 0)
|
||||
sortfun = syscall_cmp;
|
||||
else if (strcmp(sortby, "nothing") == 0)
|
||||
sortfun = NULL;
|
||||
else {
|
||||
error_msg_and_help("invalid sortby: '%s'", sortby);
|
||||
}
|
||||
static const struct {
|
||||
int (*fn)(const void *a, const void *b);
|
||||
const char *name;
|
||||
} sort_fns[] = {
|
||||
{ time_cmp, "time" },
|
||||
{ time_cmp, "time_total" },
|
||||
{ time_cmp, "total_time" },
|
||||
{ min_time_cmp, "min_time" },
|
||||
{ min_time_cmp, "time_min" },
|
||||
{ max_time_cmp, "max_time" },
|
||||
{ max_time_cmp, "time_max" },
|
||||
{ avg_time_cmp, "avg_time" },
|
||||
{ avg_time_cmp, "time_avg" },
|
||||
{ count_cmp, "count" },
|
||||
{ count_cmp, "calls" },
|
||||
{ error_cmp, "errors" },
|
||||
{ error_cmp, "error" },
|
||||
{ syscall_cmp, "name" },
|
||||
{ syscall_cmp, "syscall_name" },
|
||||
{ syscall_cmp, "syscall" },
|
||||
{ NULL, "nothing" },
|
||||
{ NULL, "none" },
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(sort_fns); i++) {
|
||||
if (strcmp(sort_fns[i].name, sortby))
|
||||
continue;
|
||||
|
||||
sortfun = sort_fns[i].fn;
|
||||
return;
|
||||
}
|
||||
|
||||
void set_overhead(int n)
|
||||
error_msg_and_help("invalid sortby: '%s'", sortby);
|
||||
}
|
||||
|
||||
void
|
||||
set_count_summary_columns(const char *s)
|
||||
{
|
||||
overhead.tv_sec = n / 1000000;
|
||||
overhead.tv_nsec = n % 1000000 * 1000;
|
||||
static const char *cnames[] = {
|
||||
[CSC_TIME_100S] = "time_percent",
|
||||
[CSC_TIME_TOTAL] = "total_time",
|
||||
[CSC_TIME_MIN] = "min_time",
|
||||
[CSC_TIME_MAX] = "max_time",
|
||||
[CSC_TIME_AVG] = "avg_time",
|
||||
[CSC_CALLS] = "calls",
|
||||
[CSC_ERRORS] = "errors",
|
||||
[CSC_SC_NAME] = "syscall",
|
||||
};
|
||||
|
||||
const char *pos = s;
|
||||
const char *prev = s;
|
||||
size_t cur = 0;
|
||||
|
||||
memset(columns, 0, sizeof(columns));
|
||||
memset(visible, 0, sizeof(visible));
|
||||
|
||||
do {
|
||||
bool found = false;
|
||||
|
||||
pos = strchr(prev, ',');
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(cnames); i++) {
|
||||
if (!cnames[i] || (pos
|
||||
? ((size_t) (pos - prev) != strlen(cnames[i]))
|
||||
|| strncmp(prev, cnames[i], pos - prev)
|
||||
: strcmp(prev, cnames[i]))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (visible[i])
|
||||
error_msg_and_help("call summary column "
|
||||
"has been provided more "
|
||||
"than once: '%s' (-U option "
|
||||
"residual: '%s')",
|
||||
cnames[i], prev);
|
||||
|
||||
columns[cur++] = i;
|
||||
visible[i] = 1;
|
||||
found = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
error_msg_and_help("unknown column name: '%.*s'",
|
||||
(int) (pos ? pos - prev : INT_MAX),
|
||||
prev);
|
||||
|
||||
prev = pos + 1;
|
||||
} while (pos);
|
||||
}
|
||||
|
||||
void
|
||||
set_overhead(const char *str)
|
||||
{
|
||||
if (parse_ts(str, &overhead) < 0)
|
||||
error_msg_and_help("invalid -O argument: '%s'", str);
|
||||
}
|
||||
|
||||
static size_t ATTRIBUTE_FORMAT((printf, 1, 2))
|
||||
num_chars(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
int ret = vsnprintf(NULL, 0, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
return (unsigned int) MAX(ret, 0);
|
||||
}
|
||||
|
||||
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";
|
||||
enum column_flags {
|
||||
CF_L = 1 << 0, /* Left-aligned column */
|
||||
};
|
||||
static const struct {
|
||||
const char *s;
|
||||
size_t sz;
|
||||
const char *fmt;
|
||||
uint32_t flags;
|
||||
} cdesc[] = {
|
||||
[CSC_TIME_100S] = { ARRSZ_PAIR("% time"), "%*.2f" },
|
||||
[CSC_TIME_TOTAL] = { ARRSZ_PAIR("seconds"), "%*.6f" },
|
||||
[CSC_TIME_MIN] = { ARRSZ_PAIR("shortest"), "%*.6f" },
|
||||
[CSC_TIME_MAX] = { ARRSZ_PAIR("longest"), "%*.6f" },
|
||||
[CSC_TIME_AVG] = { ARRSZ_PAIR("usecs/call"), "%*lu" },
|
||||
[CSC_CALLS] = { ARRSZ_PAIR("calls"), "%*" PRIu64 },
|
||||
[CSC_ERRORS] = { ARRSZ_PAIR("errors"), "%*" PRIu64 },
|
||||
[CSC_SC_NAME] = { ARRSZ_PAIR("syscall"), "%-*s", CF_L },
|
||||
};
|
||||
|
||||
unsigned int *indices;
|
||||
|
||||
struct timespec tv_cum = zero_ts;
|
||||
struct timespec tv_min = max_ts;
|
||||
struct timespec tv_max = zero_ts;
|
||||
uint64_t call_cum = 0;
|
||||
uint64_t error_cum = 0;
|
||||
|
||||
unsigned int i;
|
||||
unsigned int call_cum, error_cum;
|
||||
struct timespec tv_cum, dtv;
|
||||
double float_tv_cum;
|
||||
double percent;
|
||||
unsigned int *sorted_count;
|
||||
|
||||
fprintf(outf, header,
|
||||
"% time", "seconds", "usecs/call",
|
||||
"calls", "errors", "syscall");
|
||||
fprintf(outf, header, dashes, dashes, dashes, dashes, dashes, dashes);
|
||||
double ts_avg_max = 0;
|
||||
size_t sc_name_max = 0;
|
||||
|
||||
sorted_count = xcalloc(sizeof(sorted_count[0]), nsyscalls);
|
||||
call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_nsec = 0;
|
||||
for (i = 0; i < nsyscalls; i++) {
|
||||
sorted_count[i] = i;
|
||||
if (counts == NULL || counts[i].calls == 0)
|
||||
|
||||
/* sort, calculate statistics */
|
||||
indices = xcalloc(sizeof(indices[0]), nsyscalls);
|
||||
for (size_t i = 0; i < nsyscalls; i++) {
|
||||
struct timespec dtv;
|
||||
|
||||
indices[i] = i;
|
||||
if (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;
|
||||
|
||||
ts_add(&tv_cum, &tv_cum, &counts[i].time);
|
||||
ts_min(&tv_min, &tv_min, &counts[i].time_min);
|
||||
ts_max(&tv_max, &tv_max, &counts[i].time_max);
|
||||
call_cum += counts[i].calls;
|
||||
error_cum += counts[i].errors;
|
||||
ts_add(&tv_cum, &tv_cum, &counts[i].time);
|
||||
|
||||
ts_div(&dtv, &counts[i].time, counts[i].calls);
|
||||
counts[i].time_avg = ts_float(&dtv);
|
||||
|
||||
ts_avg_max = MAX(ts_avg_max, counts[i].time_avg);
|
||||
sc_name_max = MAX(sc_name_max, strlen(sysent[i].sys_name));
|
||||
}
|
||||
float_tv_cum = ts_float(&tv_cum);
|
||||
if (counts) {
|
||||
|
||||
if (sortfun)
|
||||
qsort((void *) sorted_count, nsyscalls,
|
||||
sizeof(sorted_count[0]), sortfun);
|
||||
for (i = 0; i < nsyscalls; i++) {
|
||||
double float_syscall_time;
|
||||
unsigned int idx = sorted_count[i];
|
||||
qsort((void *) indices, nsyscalls, sizeof(indices[0]), sortfun);
|
||||
|
||||
/* calculate column widths */
|
||||
#define W_(c_, v_) [c_] = MAX((cdesc[c_].sz - 1), (v_))
|
||||
unsigned int cwidths[CSC_MAX] = {
|
||||
W_(CSC_TIME_100S, sizeof("100.00") - 1),
|
||||
W_(CSC_TIME_TOTAL, num_chars("%.6f", float_tv_cum)),
|
||||
W_(CSC_TIME_MIN, num_chars("%ld.000000", tv_min.tv_sec)),
|
||||
W_(CSC_TIME_MAX, num_chars("%ld.000000", tv_max.tv_sec)),
|
||||
W_(CSC_TIME_AVG, num_chars("%lu", (unsigned long)
|
||||
(ts_avg_max * 1e6))),
|
||||
W_(CSC_CALLS, num_chars("%" PRIu64, call_cum)),
|
||||
W_(CSC_ERRORS, num_chars("%" PRIu64, error_cum)),
|
||||
W_(CSC_SC_NAME, sc_name_max + 1),
|
||||
};
|
||||
#undef W_
|
||||
|
||||
/* header */
|
||||
for (size_t i = 0; columns[i] && i < ARRAY_SIZE(columns); i++) {
|
||||
const char *fmt = cdesc[columns[i]].flags & CF_L
|
||||
? "%s%-*s" : "%s%*s";
|
||||
fprintf(outf, fmt, i ? " " : "", cwidths[columns[i]],
|
||||
cdesc[columns[i]].s);
|
||||
}
|
||||
fputc('\n', outf);
|
||||
|
||||
for (size_t i = 0; columns[i] && i < ARRAY_SIZE(columns); i++) {
|
||||
if (i)
|
||||
fputc(' ', outf);
|
||||
|
||||
for (size_t j = 0; j < cwidths[columns[i]]; j++)
|
||||
fputc('-', outf);
|
||||
}
|
||||
fputc('\n', outf);
|
||||
|
||||
/* data output */
|
||||
for (size_t i = 0; i < nsyscalls; i++) {
|
||||
unsigned int idx = indices[i];
|
||||
struct call_counts *cc = &counts[idx];
|
||||
double float_syscall_time;
|
||||
|
||||
if (cc->calls == 0)
|
||||
continue;
|
||||
ts_div(&dtv, &cc->time, cc->calls);
|
||||
|
||||
float_syscall_time = ts_float(&cc->time);
|
||||
percent = (100.0 * float_syscall_time);
|
||||
/* else: float_tv_cum can be 0.0 too and we get 0/0 = NAN */
|
||||
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,
|
||||
percent, float_syscall_time,
|
||||
(long) (1000000 * dtv.tv_sec + dtv.tv_nsec / 1000),
|
||||
cc->calls, cc->errors, sysent[idx].sys_name);
|
||||
}
|
||||
}
|
||||
free(sorted_count);
|
||||
|
||||
fprintf(outf, header, dashes, dashes, dashes, dashes, dashes, dashes);
|
||||
fprintf(outf, summary,
|
||||
"100.00", float_tv_cum, "",
|
||||
call_cum, error_cum, "total");
|
||||
for (size_t i = 0; columns[i] && i < ARRAY_SIZE(columns); i++) {
|
||||
const size_t c = columns[i];
|
||||
if (i)
|
||||
fputc(' ', outf);
|
||||
|
||||
#define PC_(c_, val_) \
|
||||
case (c_): fprintf(outf, cdesc[c].fmt, cwidths[c], (val_)); break;
|
||||
|
||||
switch (c) {
|
||||
PC_(CSC_TIME_100S, percent)
|
||||
PC_(CSC_TIME_TOTAL, float_syscall_time)
|
||||
PC_(CSC_TIME_MIN, ts_float(&cc->time_min))
|
||||
PC_(CSC_TIME_MAX, ts_float(&cc->time_max))
|
||||
PC_(CSC_TIME_AVG, (long) (cc->time_avg * 1e6))
|
||||
PC_(CSC_CALLS, cc->calls)
|
||||
case CSC_ERRORS:
|
||||
if (cc->errors)
|
||||
fprintf(outf, cdesc[c].fmt,
|
||||
cwidths[c], cc->errors);
|
||||
else
|
||||
fprintf(outf, "%*s", cwidths[c], "");
|
||||
break;
|
||||
PC_(CSC_SC_NAME, sysent[idx].sys_name)
|
||||
}
|
||||
}
|
||||
fputc('\n', outf);
|
||||
}
|
||||
|
||||
free(indices);
|
||||
|
||||
/* footer */
|
||||
for (size_t i = 0; columns[i] && i < ARRAY_SIZE(columns); i++) {
|
||||
if (i)
|
||||
fputc(' ', outf);
|
||||
|
||||
for (size_t j = 0; j < cwidths[columns[i]]; j++)
|
||||
fputc('-', outf);
|
||||
}
|
||||
fputc('\n', outf);
|
||||
|
||||
/* totals */
|
||||
for (size_t i = 0; columns[i] && i < ARRAY_SIZE(columns); i++) {
|
||||
const size_t c = columns[i];
|
||||
if (i)
|
||||
fputc(' ', outf);
|
||||
|
||||
switch (c) {
|
||||
PC_(CSC_TIME_100S, 100.0)
|
||||
PC_(CSC_TIME_TOTAL, float_tv_cum)
|
||||
PC_(CSC_TIME_MIN, ts_float(&tv_min))
|
||||
PC_(CSC_TIME_MAX, ts_float(&tv_max))
|
||||
PC_(CSC_TIME_AVG,
|
||||
(unsigned long) (float_tv_cum / call_cum * 1e6))
|
||||
PC_(CSC_CALLS, call_cum)
|
||||
PC_(CSC_ERRORS, error_cum)
|
||||
PC_(CSC_SC_NAME, "total")
|
||||
}
|
||||
}
|
||||
fputc('\n', outf);
|
||||
|
||||
#undef PC_
|
||||
}
|
||||
|
||||
void
|
||||
|
12
debian/changelog.in
vendored
12
debian/changelog.in
vendored
@ -4,18 +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.
|
||||
|
30
debian/copyright
vendored
30
debian/copyright
vendored
@ -14,14 +14,24 @@ Copyright (c) 1998-2001 Wichert Akkerman <wakkerma@deephackmode.org>
|
||||
Copyright (c) 2001-2018 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.
|
||||
|
243
defs.h
243
defs.h
@ -5,7 +5,27 @@
|
||||
* Copyright (c) 2001-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.
|
||||
*/
|
||||
|
||||
#ifndef STRACE_DEFS_H
|
||||
@ -33,11 +53,12 @@
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define HAVE_FINISH_LINE
|
||||
|
||||
#include "arch_defs.h"
|
||||
#include "error_prints.h"
|
||||
#include "gcc_compat.h"
|
||||
#include "kernel_types.h"
|
||||
# include "list.h"
|
||||
#include "macros.h"
|
||||
#include "mpers_type.h"
|
||||
#include "string_to_uint.h"
|
||||
@ -207,27 +228,17 @@ struct tcb {
|
||||
const char *auxstr; /* Auxiliary info from syscall (see RVAL_STR) */
|
||||
void *_priv_data; /* Private data for syscall decoding functions */
|
||||
void (*_free_priv_data)(void *); /* Callback for freeing priv_data */
|
||||
const struct_sysent *s_ent; /* sysent[scno] or a stub struct for bad
|
||||
* scno. Use tcp_sysent() macro for access.
|
||||
*/
|
||||
const struct_sysent *s_ent; /* sysent[scno] or dummy struct for bad scno */
|
||||
const struct_sysent *s_prev_ent; /* for "resuming interrupted SYSCALL" msg */
|
||||
struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES];
|
||||
struct timespec stime; /* System time usage as of last process wait */
|
||||
struct timespec dtime; /* Delta for system time usage */
|
||||
struct timespec etime; /* Syscall entry time */
|
||||
struct timespec ltime; /* System time usage as of last syscall entry */
|
||||
struct timespec atime; /* System time right after attach */
|
||||
struct timespec etime; /* Syscall entry time (CLOCK_MONOTONIC) */
|
||||
struct timespec delay_expiration_time; /* When does the delay end */
|
||||
|
||||
struct mmap_cache_t *mmap_cache;
|
||||
|
||||
/*
|
||||
* Data that is stored during process wait traversal.
|
||||
* We use indices as the actual data is stored in an array
|
||||
* that is realloc'ed in runtime.
|
||||
*/
|
||||
size_t wait_data_idx;
|
||||
struct list_item wait_list;
|
||||
|
||||
|
||||
#ifdef HAVE_LINUX_KVM_H
|
||||
struct vcpu_info *vcpu_info_list;
|
||||
#endif
|
||||
@ -259,17 +270,18 @@ struct tcb {
|
||||
#define TCB_FILTERED 0x20 /* This system call has been filtered out */
|
||||
#define TCB_TAMPERED 0x40 /* A syscall has been tampered with */
|
||||
#define TCB_HIDE_LOG 0x80 /* We should hide everything (until execve) */
|
||||
# define TCB_CHECK_EXEC_SYSCALL 0x100 /* Check whether this execve syscall succeeded */
|
||||
# define TCB_SKIP_DETACH_ON_FIRST_EXEC 0x200 /* -b execve should skip detach on first execve */
|
||||
# define TCB_GRABBED 0x400 /* We grab the process and can catch it
|
||||
#define TCB_SKIP_DETACH_ON_FIRST_EXEC 0x100 /* -b execve should skip detach on first execve */
|
||||
#define TCB_GRABBED 0x200 /* We grab the process and can catch it
|
||||
* in the middle of a syscall */
|
||||
# define TCB_RECOVERING 0x800 /* We try to recover after detecting incorrect
|
||||
#define TCB_RECOVERING 0x400 /* We try to recover after detecting incorrect
|
||||
* syscall entering/exiting state */
|
||||
# define TCB_INJECT_DELAY_EXIT 0x1000 /* Current syscall needs to be delayed
|
||||
#define TCB_INJECT_DELAY_EXIT 0x800 /* Current syscall needs to be delayed
|
||||
on exit */
|
||||
# define TCB_DELAYED 0x2000 /* Current syscall has been delayed */
|
||||
# define TCB_TAMPERED_NO_FAIL 0x4000 /* We tamper tcb with syscall
|
||||
#define TCB_DELAYED 0x1000 /* Current syscall has been delayed */
|
||||
#define TCB_TAMPERED_NO_FAIL 0x2000 /* We tamper tcb with syscall
|
||||
that should not fail. */
|
||||
#define TCB_PTRACEOPTS_APPLIED 0x40000 /* Our PTRACE_SETOPTIONS have taken
|
||||
their effect. */
|
||||
|
||||
/* qualifier flags */
|
||||
#define QUAL_TRACE 0x001 /* this system call should be traced */
|
||||
@ -290,45 +302,23 @@ struct tcb {
|
||||
#define inject(tcp) ((tcp)->qual_flg & QUAL_INJECT)
|
||||
#define filtered(tcp) ((tcp)->flags & TCB_FILTERED)
|
||||
#define hide_log(tcp) ((tcp)->flags & TCB_HIDE_LOG)
|
||||
# define check_exec_syscall(tcp) ((tcp)->flags & TCB_CHECK_EXEC_SYSCALL)
|
||||
#define syscall_tampered(tcp) ((tcp)->flags & TCB_TAMPERED)
|
||||
#define recovering(tcp) ((tcp)->flags & TCB_RECOVERING)
|
||||
#define inject_delay_exit(tcp) ((tcp)->flags & TCB_INJECT_DELAY_EXIT)
|
||||
#define syscall_delayed(tcp) ((tcp)->flags & TCB_DELAYED)
|
||||
#define syscall_tampered_nofail(tcp) ((tcp)->flags & TCB_TAMPERED_NO_FAIL)
|
||||
|
||||
extern const struct_sysent stub_sysent;
|
||||
# define tcp_sysent(tcp) (tcp->s_ent ?: &stub_sysent)
|
||||
# define n_args(tcp) (tcp_sysent(tcp)->nargs)
|
||||
#define ptraceopts_applied(tcp) ((tcp)->flags & TCB_PTRACEOPTS_APPLIED)
|
||||
|
||||
#include "xlat.h"
|
||||
|
||||
extern const struct xlat addrfams[];
|
||||
|
||||
/** Protocol hardware identifiers array, sorted, defined in sockaddr.c. */
|
||||
extern const struct xlat arp_hardware_types[];
|
||||
/** Protocol hardware identifiers array size without terminating record. */
|
||||
extern const size_t arp_hardware_types_size;
|
||||
|
||||
extern const struct xlat at_flags[];
|
||||
extern const struct xlat clocknames[];
|
||||
extern const struct xlat dirent_types[];
|
||||
|
||||
/** Ethernet protocols list, sorted, defined in sockaddr.c. */
|
||||
extern const struct xlat ethernet_protocols[];
|
||||
/** Ethernet protocols array size without terminating record. */
|
||||
extern const size_t ethernet_protocols_size;
|
||||
|
||||
/** IP protocols list, sorted, defined in net.c. */
|
||||
extern const struct xlat inet_protocols[];
|
||||
/** IP protocols array size without terminating record. */
|
||||
extern const size_t inet_protocols_size;
|
||||
|
||||
extern const struct xlat evdev_abs[];
|
||||
/** Number of elements in evdev_abs array without the terminating record. */
|
||||
extern const size_t evdev_abs_size;
|
||||
|
||||
extern const struct xlat audit_arch[];
|
||||
extern const struct xlat evdev_ev[];
|
||||
extern const struct xlat iffflags[];
|
||||
extern const struct xlat ip_type_of_services[];
|
||||
@ -339,10 +329,13 @@ extern const struct xlat nl_netfilter_msg_types[];
|
||||
extern const struct xlat nl_route_types[];
|
||||
extern const struct xlat open_access_modes[];
|
||||
extern const struct xlat open_mode_flags[];
|
||||
extern const struct xlat pollflags[];
|
||||
extern const struct xlat resource_flags[];
|
||||
extern const struct xlat route_nexthop_flags[];
|
||||
extern const struct xlat routing_scopes[];
|
||||
extern const struct xlat routing_table_ids[];
|
||||
extern const struct xlat routing_types[];
|
||||
extern const struct xlat rwf_flags[];
|
||||
extern const struct xlat seccomp_filter_flags[];
|
||||
extern const struct xlat seccomp_ret_action[];
|
||||
extern const struct xlat setns_types[];
|
||||
@ -358,6 +351,8 @@ extern const struct xlat whence_codes[];
|
||||
#define RVAL_HEX 001 /* hex format */
|
||||
#define RVAL_OCTAL 002 /* octal format */
|
||||
#define RVAL_FD 010 /* file descriptor */
|
||||
#define RVAL_UID 011 /* UID */
|
||||
#define RVAL_GID 012 /* GID */
|
||||
#define RVAL_MASK 013 /* mask for these values */
|
||||
|
||||
#define RVAL_STR 020 /* Print `auxstr' field after return val */
|
||||
@ -373,6 +368,13 @@ extern const struct xlat whence_codes[];
|
||||
|
||||
#define indirect_ipccall(tcp) (tcp->s_ent->sys_flags & TRACE_INDIRECT_SUBCALL)
|
||||
|
||||
|
||||
extern void socket_exiting_cb(struct tcb *tcp);
|
||||
|
||||
extern void set_netlink_family_cache_entry(uint64_t inode, uint8_t family);
|
||||
extern int get_netlink_family_cache_entry(uint64_t inode);
|
||||
extern void invalidate_netlink_family_cache_entry(uint64_t inode);
|
||||
|
||||
enum sock_proto {
|
||||
SOCK_PROTO_UNKNOWN,
|
||||
SOCK_PROTO_UNIX,
|
||||
@ -393,10 +395,35 @@ enum sock_proto {
|
||||
SOCK_PROTO_PINGv6,
|
||||
SOCK_PROTO_RAWv6,
|
||||
SOCK_PROTO_NETLINK,
|
||||
SOCK_PROTO_AX25,
|
||||
SOCK_PROTO_DDP,
|
||||
SOCK_PROTO_NETROM,
|
||||
SOCK_PROTO_PACKET,
|
||||
SOCK_PROTO_ROSE,
|
||||
SOCK_PROTO_X25,
|
||||
};
|
||||
extern enum sock_proto get_proto_by_name(const char *);
|
||||
extern int get_family_by_proto(enum sock_proto proto);
|
||||
|
||||
enum fileops {
|
||||
FILEOP_READ,
|
||||
FILEOP_WRITE,
|
||||
};
|
||||
|
||||
typedef bool (*filebuf_decoder_fn)(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen);
|
||||
|
||||
extern bool decode_fanotify_read(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen);
|
||||
extern bool decode_fanotify_write(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen);
|
||||
extern bool decode_inotify_read(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen);
|
||||
|
||||
enum iov_decode {
|
||||
IOV_DECODE_ADDR,
|
||||
IOV_DECODE_STR,
|
||||
@ -437,13 +464,9 @@ extern unsigned os_release;
|
||||
extern int read_int_from_file(struct tcb *, const char *, int *);
|
||||
|
||||
extern void set_sortby(const char *);
|
||||
extern void set_overhead(int);
|
||||
|
||||
extern bool get_instruction_pointer(struct tcb *, kernel_ulong_t *);
|
||||
extern bool get_stack_pointer(struct tcb *, kernel_ulong_t *);
|
||||
extern void print_instruction_pointer(struct tcb *);
|
||||
|
||||
extern void print_syscall_resume(struct tcb *tcp);
|
||||
extern void set_overhead(const char *);
|
||||
extern void set_count_summary_columns(const char *columns);
|
||||
extern void print_pc(struct tcb *);
|
||||
|
||||
extern int syscall_entering_decode(struct tcb *);
|
||||
extern int syscall_entering_trace(struct tcb *, unsigned int *);
|
||||
@ -458,6 +481,7 @@ extern void call_summary(FILE *);
|
||||
|
||||
extern void clear_regs(struct tcb *tcp);
|
||||
extern int get_scno(struct tcb *);
|
||||
extern int get_syscall_result(struct tcb *, bool);
|
||||
extern kernel_ulong_t get_rt_sigframe_addr(struct tcb *);
|
||||
|
||||
/**
|
||||
@ -488,6 +512,14 @@ extern kernel_long_t scno_by_name(const char *s, unsigned p,
|
||||
*/
|
||||
extern kernel_ulong_t shuffle_scno(kernel_ulong_t scno);
|
||||
extern const char *err_name(unsigned long err);
|
||||
/**
|
||||
* Print error name in accordance with current xlat style setting.
|
||||
*
|
||||
* @param err Error value.
|
||||
* @param negated If set to true, negative values of the err parameter indicate
|
||||
* error condition, otherwise positive.
|
||||
*/
|
||||
extern void print_err(long err, bool negated);
|
||||
|
||||
extern bool is_erestart(struct tcb *);
|
||||
extern void temporarily_clear_syserror(struct tcb *);
|
||||
@ -597,7 +629,6 @@ extern long getrval2(struct tcb *);
|
||||
#endif
|
||||
|
||||
extern const char *signame(const int);
|
||||
extern const char *sprintsigname(const int);
|
||||
extern void pathtrace_select_set(const char *, struct path_set *);
|
||||
extern bool pathtrace_match_set(struct tcb *, struct path_set *);
|
||||
|
||||
@ -618,8 +649,7 @@ extern unsigned long getfdinode(struct tcb *, int);
|
||||
extern enum sock_proto getfdproto(struct tcb *, int);
|
||||
|
||||
extern const char *xlookup(const struct xlat *, const uint64_t);
|
||||
extern const char *xlat_search(const struct xlat *, const size_t, const uint64_t);
|
||||
extern const char *xlat_idx(const struct xlat *xlat, size_t nmemb, uint64_t val);
|
||||
extern const char *xlookup_le(const struct xlat *, uint64_t *);
|
||||
|
||||
struct dyxlat;
|
||||
struct dyxlat *dyxlat_alloc(size_t nmemb);
|
||||
@ -627,7 +657,7 @@ void dyxlat_free(struct dyxlat *);
|
||||
const struct xlat *dyxlat_get(const struct dyxlat *);
|
||||
void dyxlat_add_pair(struct dyxlat *, uint64_t val, const char *str, size_t len);
|
||||
|
||||
const struct xlat *genl_families_xlat(struct tcb *tcp);
|
||||
const char *genl_get_family_name(struct tcb *tcp, uint16_t id);
|
||||
|
||||
extern unsigned long get_pagesize(void);
|
||||
extern int next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits);
|
||||
@ -691,46 +721,8 @@ extern int printxvals_ex(uint64_t val, const char *dflt,
|
||||
ATTRIBUTE_SENTINEL;
|
||||
#define printxvals(val_, dflt_, ...) \
|
||||
printxvals_ex((val_), (dflt_), XLAT_STYLE_DEFAULT, __VA_ARGS__)
|
||||
|
||||
extern int printxval_searchn_ex(const struct xlat *, size_t xlat_size,
|
||||
uint64_t val, const char *dflt,
|
||||
enum xlat_style);
|
||||
|
||||
static inline int
|
||||
printxval_searchn(const struct xlat *xlat, size_t xlat_size, uint64_t val,
|
||||
const char *dflt)
|
||||
{
|
||||
return printxval_searchn_ex(xlat, xlat_size, val, dflt,
|
||||
XLAT_STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper around printxval_searchn that passes ARRAY_SIZE - 1
|
||||
* as the array size, as all arrays are XLAT_END-terminated and
|
||||
* printxval_searchn expects a size without the terminating record.
|
||||
*/
|
||||
# define printxval_search(xlat__, val__, dflt__) \
|
||||
printxval_searchn(xlat__, ARRAY_SIZE(xlat__) - 1, val__, dflt__)
|
||||
# define printxval_search_ex(xlat__, val__, dflt__, style__) \
|
||||
printxval_searchn_ex((xlat__), ARRAY_SIZE(xlat__) - 1, (val__), \
|
||||
(dflt__), (style__))
|
||||
|
||||
extern int printxval_indexn_ex(const struct xlat *, size_t xlat_size,
|
||||
uint64_t val, const char *dflt, enum xlat_style);
|
||||
|
||||
static inline int
|
||||
printxval_indexn(const struct xlat *xlat, size_t xlat_size, uint64_t val,
|
||||
const char *dflt)
|
||||
{
|
||||
return printxval_indexn_ex(xlat, xlat_size, val, dflt,
|
||||
XLAT_STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
# define printxval_index(xlat__, val__, dflt__) \
|
||||
printxval_indexn(xlat__, ARRAY_SIZE(xlat__) - 1, val__, dflt__)
|
||||
# define printxval_index_ex(xlat__, val__, dflt__) \
|
||||
printxval_indexn_ex((xlat__), ARRAY_SIZE(xlat__) - 1, (val__), \
|
||||
(dflt__), XLAT_STYLE_DEFAULT)
|
||||
#define printxval_ex(xlat_, val_, dflt_, style_) \
|
||||
printxvals_ex((val_), (dflt_), (style_), (xlat_), NULL)
|
||||
|
||||
extern int sprintxval_ex(char *buf, size_t size, const struct xlat *,
|
||||
unsigned int val, const char *dflt, enum xlat_style);
|
||||
@ -742,22 +734,9 @@ sprintxval(char *buf, size_t size, const struct xlat *xlat, unsigned int val,
|
||||
return sprintxval_ex(buf, size, xlat, val, dflt, XLAT_STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
extern void printxval_dispatch_ex(const struct xlat *, size_t xlat_size,
|
||||
uint64_t val, const char *dflt,
|
||||
enum xlat_type, enum xlat_style);
|
||||
static inline void
|
||||
printxval_dispatch(const struct xlat *xlat, size_t xlat_size, uint64_t val,
|
||||
const char *dflt, enum xlat_type xt)
|
||||
{
|
||||
return printxval_dispatch_ex(xlat, xlat_size, val, dflt, xt,
|
||||
XLAT_STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
enum xlat_style_private_flag_bits {
|
||||
/* print_array */
|
||||
PAF_PRINT_INDICES_BIT = XLAT_STYLE_SPEC_BITS + 1,
|
||||
PAF_INDEX_XLAT_SORTED_BIT,
|
||||
PAF_INDEX_XLAT_VALUE_INDEXED_BIT,
|
||||
|
||||
/* print_xlat */
|
||||
PXF_DEFAULT_STR_BIT,
|
||||
@ -768,8 +747,6 @@ enum xlat_style_private_flag_bits {
|
||||
enum xlat_style_private_flags {
|
||||
/* print_array */
|
||||
FLAG_(PAF_PRINT_INDICES),
|
||||
FLAG_(PAF_INDEX_XLAT_SORTED),
|
||||
FLAG_(PAF_INDEX_XLAT_VALUE_INDEXED),
|
||||
|
||||
/* print_xlat */
|
||||
FLAG_(PXF_DEFAULT_STR),
|
||||
@ -796,26 +773,32 @@ extern int printflags_ex(uint64_t flags, const char *dflt,
|
||||
enum xlat_style, const struct xlat *, ...)
|
||||
ATTRIBUTE_SENTINEL;
|
||||
extern const char *sprintflags_ex(const char *prefix, const struct xlat *,
|
||||
uint64_t flags, enum xlat_style);
|
||||
uint64_t flags, char sep, enum xlat_style);
|
||||
|
||||
static inline const char *
|
||||
sprintflags(const char *prefix, const struct xlat *xlat, uint64_t flags)
|
||||
{
|
||||
return sprintflags_ex(prefix, xlat, flags, XLAT_STYLE_DEFAULT);
|
||||
return sprintflags_ex(prefix, xlat, flags, '\0', XLAT_STYLE_DEFAULT);
|
||||
}
|
||||
|
||||
extern const char *sprinttime(long long sec);
|
||||
extern const char *sprinttime_nsec(long long sec, unsigned long long nsec);
|
||||
extern const char *sprinttime_usec(long long sec, unsigned long long usec);
|
||||
|
||||
#ifndef MAX_ADDR_LEN
|
||||
# define MAX_ADDR_LEN 32
|
||||
#endif
|
||||
|
||||
extern const char *sprint_mac_addr(const uint8_t addr[], size_t size);
|
||||
extern const char *sprint_hwaddr(const uint8_t addr[], size_t size,
|
||||
uint32_t devtype);
|
||||
|
||||
extern void print_symbolic_mode_t(unsigned int);
|
||||
extern void print_numeric_umode_t(unsigned short);
|
||||
extern void print_numeric_long_umask(unsigned long);
|
||||
extern void print_dev_t(unsigned long long dev);
|
||||
extern void print_kernel_version(unsigned long version);
|
||||
extern void print_abnormal_hi(kernel_ulong_t);
|
||||
extern void print_ioprio(unsigned int ioprio);
|
||||
|
||||
extern bool print_int32_array_member(struct tcb *, void *elem_buf,
|
||||
size_t elem_size, void *data);
|
||||
@ -845,7 +828,6 @@ print_array_ex(struct tcb *,
|
||||
void *opaque_data,
|
||||
unsigned int flags,
|
||||
const struct xlat *index_xlat,
|
||||
size_t index_xlat_size,
|
||||
const char *index_dflt);
|
||||
|
||||
static inline bool
|
||||
@ -860,7 +842,7 @@ print_array(struct tcb *const tcp,
|
||||
{
|
||||
return print_array_ex(tcp, start_addr, nmemb, elem_buf, elem_size,
|
||||
tfetch_mem_func, print_func, opaque_data,
|
||||
0, NULL, 0, NULL);
|
||||
0, NULL, NULL);
|
||||
}
|
||||
|
||||
extern kernel_ulong_t *
|
||||
@ -899,7 +881,9 @@ decode_inet_addr(struct tcb *, kernel_ulong_t addr,
|
||||
unsigned int len, int family, const char *var_name);
|
||||
extern void print_ax25_addr(const void /* ax25_address */ *addr);
|
||||
extern void print_x25_addr(const void /* struct x25_address */ *addr);
|
||||
extern void print_rose_addr(const void /* rose_address */ *addr);
|
||||
extern const char *get_sockaddr_by_inode(struct tcb *, int fd, unsigned long inode);
|
||||
extern const char *get_sockdata_by_inode(struct tcb *, int fd, unsigned long inode);
|
||||
extern bool print_sockaddr_by_inode(struct tcb *, int fd, unsigned long inode);
|
||||
extern void print_dirfd(struct tcb *, int);
|
||||
|
||||
@ -907,6 +891,7 @@ extern int
|
||||
decode_sockaddr(struct tcb *, kernel_ulong_t addr, int addrlen);
|
||||
|
||||
extern void printuid(const char *, const unsigned int);
|
||||
extern void printgid(const char *, const unsigned int);
|
||||
|
||||
extern void
|
||||
print_sigset_addr_len(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len);
|
||||
@ -976,10 +961,8 @@ DECL_IOCTL(file);
|
||||
DECL_IOCTL(fs_x);
|
||||
DECL_IOCTL(inotify);
|
||||
DECL_IOCTL(kvm);
|
||||
DECL_IOCTL(nbd);
|
||||
DECL_IOCTL(nsfs);
|
||||
DECL_IOCTL(ptp);
|
||||
DECL_IOCTL(random);
|
||||
DECL_IOCTL(scsi);
|
||||
DECL_IOCTL(term);
|
||||
DECL_IOCTL(ubi);
|
||||
@ -1017,6 +1000,9 @@ extern void ts_add(struct timespec *, const struct timespec *, const struct time
|
||||
extern void ts_sub(struct timespec *, const struct timespec *, const struct timespec *);
|
||||
extern void ts_mul(struct timespec *, const struct timespec *, int);
|
||||
extern void ts_div(struct timespec *, const struct timespec *, int);
|
||||
extern void ts_min(struct timespec *, const struct timespec *, const struct timespec *);
|
||||
extern void ts_max(struct timespec *, const struct timespec *, const struct timespec *);
|
||||
extern int parse_ts(const char *s, struct timespec *t);
|
||||
|
||||
#ifdef ENABLE_STACKTRACE
|
||||
extern void unwind_init(void);
|
||||
@ -1103,12 +1089,12 @@ typedef struct {
|
||||
int tv_sec, tv_usec;
|
||||
} timeval32_t;
|
||||
|
||||
extern void print_timeval32_t(const timeval32_t *);
|
||||
extern void print_timeval32_t(const timeval32_t *, bool rtc);
|
||||
extern void printrusage32(struct tcb *, kernel_ulong_t);
|
||||
extern const char *sprint_timeval32(struct tcb *, kernel_ulong_t addr);
|
||||
extern void print_timeval32(struct tcb *, kernel_ulong_t addr);
|
||||
extern void print_timeval32(struct tcb *, kernel_ulong_t addr, bool rtc);
|
||||
extern void print_timeval32_utimes(struct tcb *, kernel_ulong_t addr);
|
||||
extern void print_itimerval32(struct tcb *, kernel_ulong_t addr);
|
||||
extern void print_itimerval32(struct tcb *, kernel_ulong_t addr, bool rtc);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRUCT_USER_DESC
|
||||
@ -1168,6 +1154,14 @@ print_mac_addr(const char *prefix, const uint8_t addr[], size_t size)
|
||||
tprints(sprint_mac_addr(addr, size));
|
||||
}
|
||||
|
||||
static inline void
|
||||
print_hwaddr(const char *prefix, const uint8_t addr[], size_t size,
|
||||
uint32_t devtype)
|
||||
{
|
||||
tprints(prefix);
|
||||
tprints(sprint_hwaddr(addr, size, devtype));
|
||||
}
|
||||
|
||||
#if SUPPORTED_PERSONALITIES > 1
|
||||
extern void set_personality(unsigned int personality);
|
||||
extern unsigned current_personality;
|
||||
@ -1229,6 +1223,10 @@ print_big_u64_addr(const uint64_t addr)
|
||||
|
||||
#define DECL_PRINTNUM(name) \
|
||||
extern bool \
|
||||
printnum_ ## name ## _ex(struct tcb *, kernel_ulong_t addr, \
|
||||
bool addr_cmnt, const char *fmt) \
|
||||
ATTRIBUTE_FORMAT((printf, 4, 0)); \
|
||||
extern bool \
|
||||
printnum_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \
|
||||
ATTRIBUTE_FORMAT((printf, 3, 0)) \
|
||||
/* End of DECL_PRINTNUM definition. */
|
||||
@ -1408,6 +1406,7 @@ extern const char *const errnoent[];
|
||||
extern const char *const signalent[];
|
||||
extern const unsigned int nerrnos;
|
||||
extern const unsigned int nsignals;
|
||||
extern const unsigned int nsig;
|
||||
|
||||
extern const struct_sysent sysent0[];
|
||||
extern const struct_ioctlent ioctlent0[];
|
||||
|
27
delay.c
27
delay.c
@ -2,7 +2,27 @@
|
||||
* Copyright (c) 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"
|
||||
@ -46,7 +66,7 @@ alloc_delay_data(void)
|
||||
}
|
||||
|
||||
void
|
||||
fill_delay_data(uint16_t delay_idx, int intval, bool isenter)
|
||||
fill_delay_data(uint16_t delay_idx, struct timespec *val, bool isenter)
|
||||
{
|
||||
if (delay_idx >= delay_data_vec_size)
|
||||
error_func_msg_and_die("delay_idx >= delay_data_vec_size");
|
||||
@ -57,8 +77,7 @@ fill_delay_data(uint16_t delay_idx, int intval, bool isenter)
|
||||
else
|
||||
ts = &(delay_data_vec[delay_idx].ts_exit);
|
||||
|
||||
ts->tv_sec = intval / 1000000;
|
||||
ts->tv_nsec = intval % 1000000 * 1000;
|
||||
*ts = *val;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
24
delay.h
24
delay.h
@ -2,14 +2,34 @@
|
||||
* Copyright (c) 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.
|
||||
*/
|
||||
|
||||
#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);
|
||||
void fill_delay_data(uint16_t delay_idx, struct timespec *val, bool isenter);
|
||||
bool is_delay_timer_armed(void);
|
||||
void delay_timer_expired(void);
|
||||
void arm_delay_timer(const struct tcb *);
|
||||
|
29
desc.c
29
desc.c
@ -6,7 +6,27 @@
|
||||
* Copyright (c) 1999-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"
|
||||
@ -16,6 +36,9 @@ SYS_FUNC(close)
|
||||
{
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
|
||||
uint64_t inode = getfdinode(tcp, tcp->u_arg[0]);
|
||||
invalidate_netlink_family_cache_entry(inode);
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
@ -52,7 +75,7 @@ SYS_FUNC(dup3)
|
||||
|
||||
static int
|
||||
decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
|
||||
void (*const print_tv_ts) (struct tcb *, kernel_ulong_t),
|
||||
void (*const print_tv_ts) (struct tcb *, kernel_ulong_t, bool),
|
||||
const char * (*const sprint_tv_ts) (struct tcb *, kernel_ulong_t))
|
||||
{
|
||||
int i, j;
|
||||
@ -105,7 +128,7 @@ decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
|
||||
}
|
||||
free(fds);
|
||||
tprints(", ");
|
||||
print_tv_ts(tcp, args[4]);
|
||||
print_tv_ts(tcp, args[4], false);
|
||||
} else {
|
||||
static char outstr[1024];
|
||||
char *outptr;
|
||||
|
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
|
6
dist/README
vendored
6
dist/README
vendored
@ -4,10 +4,8 @@ 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.
|
||||
strace is released under a Berkeley-style license at the request
|
||||
of Paul Kranenburg; see the file COPYING for details.
|
||||
|
||||
See the file CREDITS for a list of authors and other contributors.
|
||||
See the file INSTALL for compilation and installation instructions.
|
||||
|
22
dm.c
22
dm.c
@ -8,7 +8,27 @@
|
||||
* 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"
|
||||
|
79
dyxlat.c
79
dyxlat.c
@ -1,32 +1,47 @@
|
||||
/*
|
||||
* 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"
|
||||
|
||||
struct dyxlat {
|
||||
size_t used;
|
||||
size_t allocated;
|
||||
struct xlat *xlat;
|
||||
struct xlat xlat;
|
||||
struct xlat_data *data;
|
||||
};
|
||||
|
||||
#define MARK_END(xlat) \
|
||||
do { \
|
||||
(xlat).val = 0; \
|
||||
(xlat).str = 0; \
|
||||
} while (0)
|
||||
|
||||
struct dyxlat *
|
||||
dyxlat_alloc(const size_t nmemb)
|
||||
{
|
||||
struct dyxlat *const dyxlat = xmalloc(sizeof(*dyxlat));
|
||||
|
||||
dyxlat->used = 1;
|
||||
dyxlat->xlat.type = XT_NORMAL;
|
||||
dyxlat->xlat.size = 0;
|
||||
dyxlat->allocated = nmemb;
|
||||
dyxlat->xlat = xgrowarray(NULL, &dyxlat->allocated, sizeof(struct xlat));
|
||||
MARK_END(dyxlat->xlat[0]);
|
||||
dyxlat->xlat.data = dyxlat->data = xgrowarray(NULL, &dyxlat->allocated,
|
||||
sizeof(struct xlat_data));
|
||||
|
||||
return dyxlat;
|
||||
}
|
||||
@ -36,20 +51,20 @@ dyxlat_free(struct dyxlat *const dyxlat)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < dyxlat->used - 1; ++i) {
|
||||
free((void *) dyxlat->xlat[i].str);
|
||||
dyxlat->xlat[i].str = NULL;
|
||||
for (i = 0; i < dyxlat->xlat.size; ++i) {
|
||||
free((void *) dyxlat->data[i].str);
|
||||
dyxlat->data[i].str = NULL;
|
||||
}
|
||||
|
||||
free(dyxlat->xlat);
|
||||
dyxlat->xlat = NULL;
|
||||
free(dyxlat->data);
|
||||
dyxlat->xlat.data = NULL;
|
||||
free(dyxlat);
|
||||
}
|
||||
|
||||
const struct xlat *
|
||||
dyxlat_get(const struct dyxlat *const dyxlat)
|
||||
{
|
||||
return dyxlat->xlat;
|
||||
return &dyxlat->xlat;
|
||||
}
|
||||
|
||||
void
|
||||
@ -58,24 +73,24 @@ dyxlat_add_pair(struct dyxlat *const dyxlat, const uint64_t val,
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < dyxlat->used - 1; ++i) {
|
||||
if (dyxlat->xlat[i].val == val) {
|
||||
if (strncmp(dyxlat->xlat[i].str, str, len) == 0
|
||||
&& dyxlat->xlat[i].str[len] == '\0')
|
||||
for (i = 0; i < dyxlat->xlat.size; ++i) {
|
||||
if (dyxlat->data[i].val == val) {
|
||||
if (strncmp(dyxlat->data[i].str, str, len) == 0
|
||||
&& dyxlat->data[i].str[len] == '\0')
|
||||
return;
|
||||
|
||||
free((void *) dyxlat->xlat[i].str);
|
||||
dyxlat->xlat[i].str = xstrndup(str, len);
|
||||
free((void *) dyxlat->data[i].str);
|
||||
dyxlat->data[i].str = xstrndup(str, len);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (dyxlat->used >= dyxlat->allocated)
|
||||
dyxlat->xlat = xgrowarray(dyxlat->xlat, &dyxlat->allocated,
|
||||
sizeof(struct xlat));
|
||||
if (dyxlat->xlat.size >= dyxlat->allocated)
|
||||
dyxlat->xlat.data = dyxlat->data =
|
||||
xgrowarray(dyxlat->data, &dyxlat->allocated,
|
||||
sizeof(struct xlat_data));
|
||||
|
||||
dyxlat->xlat[dyxlat->used - 1].val = val;
|
||||
dyxlat->xlat[dyxlat->used - 1].str = xstrndup(str, len);
|
||||
MARK_END(dyxlat->xlat[dyxlat->used]);
|
||||
dyxlat->used++;
|
||||
dyxlat->data[dyxlat->xlat.size].val = val;
|
||||
dyxlat->data[dyxlat->xlat.size].str = xstrndup(str, len);
|
||||
dyxlat->xlat.size++;
|
||||
}
|
||||
|
22
epoll.c
22
epoll.c
@ -5,7 +5,27 @@
|
||||
* 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"
|
||||
|
@ -2,10 +2,32 @@
|
||||
* Copyright (c) 1999-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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if defined(HAVE_DEFS_H)
|
||||
# include "defs.h"
|
||||
#elif defined(HAVE_CONFIG_H)
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
@ -26,6 +48,7 @@ verror_msg(int err_no, const char *fmt, va_list p)
|
||||
{
|
||||
char *msg;
|
||||
|
||||
finish_line();
|
||||
fflush(NULL);
|
||||
|
||||
/* We want to print entire message with single fprintf to ensure
|
||||
|
@ -4,10 +4,30 @@
|
||||
* 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
|
||||
@ -20,6 +40,11 @@
|
||||
extern bool debug_flag;
|
||||
|
||||
void die(void) ATTRIBUTE_NORETURN;
|
||||
#ifdef HAVE_FINISH_LINE
|
||||
extern void finish_line(void);
|
||||
#else
|
||||
static inline void finish_line(void) {}
|
||||
#endif
|
||||
|
||||
void error_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
|
||||
void perror_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
|
||||
|
77
evdev.c
77
evdev.c
@ -4,7 +4,27 @@
|
||||
* 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"
|
||||
@ -33,8 +53,6 @@
|
||||
# define SYN_MAX 0xf
|
||||
# endif
|
||||
|
||||
const size_t evdev_abs_size = ARRAY_SIZE(evdev_abs) - 1;
|
||||
|
||||
static int
|
||||
abs_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
||||
{
|
||||
@ -78,7 +96,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 +123,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,9 +162,9 @@ 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(", ");
|
||||
|
||||
@ -167,7 +185,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 +193,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 +203,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,
|
||||
@ -240,42 +253,41 @@ bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr,
|
||||
switch (ev_nr) {
|
||||
case 0:
|
||||
return decode_bitset(tcp, arg, evdev_ev,
|
||||
EV_MAX, "EV_???", XT_SORTED);
|
||||
EV_MAX, "EV_???");
|
||||
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_???");
|
||||
case EV_SW:
|
||||
return decode_bitset(tcp, arg, evdev_switch,
|
||||
SW_MAX, "SW_???", XT_INDEXED);
|
||||
SW_MAX, "SW_???");
|
||||
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 +341,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 */
|
||||
|
@ -4,7 +4,27 @@
|
||||
* 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"
|
||||
|
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"
|
||||
|
22
execve.c
22
execve.c
@ -9,7 +9,27 @@
|
||||
* Copyright (c) 2014-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"
|
||||
|
22
f_owner_ex.h
22
f_owner_ex.h
@ -2,7 +2,27 @@
|
||||
* Copyright (c) 2018 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_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
|
||||
|
256
fanotify.c
256
fanotify.c
@ -3,10 +3,31 @@
|
||||
* Copyright (c) 2014-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"
|
||||
#include "print_fields.h"
|
||||
|
||||
#include "xlat/fan_classes.h"
|
||||
#include "xlat/fan_init_flags.h"
|
||||
@ -17,6 +38,236 @@
|
||||
#ifndef FAN_NOFD
|
||||
# define FAN_NOFD -1
|
||||
#endif
|
||||
#ifndef FAN_AUDIT
|
||||
# define FAN_AUDIT 0x10
|
||||
#endif
|
||||
|
||||
#include "xlat/fan_mark_flags.h"
|
||||
#include "xlat/fan_event_flags.h"
|
||||
#include "xlat/fan_responses.h"
|
||||
|
||||
static void
|
||||
print_fanfd(struct tcb *tcp, int fd)
|
||||
{
|
||||
if (fd == FAN_NOFD)
|
||||
print_xlat_d(FAN_NOFD);
|
||||
else
|
||||
printfd(tcp, fd);
|
||||
}
|
||||
|
||||
#define PRINT_FIELD_FANFD(prefix_, where_, field_, tcp_) \
|
||||
do { \
|
||||
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
|
||||
print_fanfd((tcp_), (where_).field_); \
|
||||
} while (0)
|
||||
|
||||
bool
|
||||
decode_fanotify_read(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen)
|
||||
{
|
||||
struct fev_hdr {
|
||||
uint32_t event_len;
|
||||
union {
|
||||
struct {
|
||||
uint8_t vers;
|
||||
uint8_t reserved;
|
||||
uint16_t metadata_len;
|
||||
};
|
||||
uint32_t vers_v2;
|
||||
};
|
||||
} fev_hdr;
|
||||
uint32_t fev_ver = 0;
|
||||
|
||||
union fev_md {
|
||||
struct fev_md_v2 {
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) mask;
|
||||
int32_t fd;
|
||||
int32_t pid;
|
||||
} v2;
|
||||
struct fev_md_v1 {
|
||||
int32_t fd;
|
||||
uint64_t ATTRIBUTE_ALIGNED(8) mask;
|
||||
int64_t pid;
|
||||
} ATTRIBUTE_PACKED v1;
|
||||
} fev_md;
|
||||
|
||||
enum {
|
||||
FEV_V1_SIZE = sizeof(struct fev_hdr) + sizeof(struct fev_md_v1),
|
||||
FEV_V2_SIZE = sizeof(struct fev_hdr) + sizeof(struct fev_md_v2),
|
||||
FEV_MIN_SIZE = MIN(FEV_V1_SIZE, FEV_V2_SIZE),
|
||||
};
|
||||
|
||||
kernel_ulong_t pos = 0;
|
||||
|
||||
if (addrlen < sizeof(fev_hdr))
|
||||
return false;
|
||||
|
||||
tprints("[");
|
||||
|
||||
do {
|
||||
if (pos)
|
||||
tprints(", ");
|
||||
|
||||
if (umove(tcp, addr + pos, &fev_hdr)) {
|
||||
printaddr_comment(addr + pos);
|
||||
break;
|
||||
}
|
||||
|
||||
PRINT_FIELD_U("{", fev_hdr, event_len);
|
||||
|
||||
if (fev_hdr.event_len < FEV_MIN_SIZE) {
|
||||
tprints(", ... /* invalid event_len */}");
|
||||
|
||||
if (!fev_hdr.event_len)
|
||||
goto end_decoded;
|
||||
|
||||
goto end_fev_decoded;
|
||||
}
|
||||
|
||||
switch (fev_hdr.vers) {
|
||||
case 0: case 1: case 2:
|
||||
switch (fev_hdr.vers_v2) {
|
||||
case 1: case 2:
|
||||
PRINT_FIELD_U(", ", fev_hdr, vers_v2);
|
||||
fev_ver = fev_hdr.vers;
|
||||
break;
|
||||
|
||||
default:
|
||||
tprints("}");
|
||||
pos += offsetof(struct fev_hdr, vers_v2);
|
||||
goto end_decoded;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: default:
|
||||
PRINT_FIELD_U(", ", fev_hdr, vers);
|
||||
fev_ver = fev_hdr.vers;
|
||||
if (fev_hdr.reserved)
|
||||
PRINT_FIELD_U(", ", fev_hdr, reserved);
|
||||
PRINT_FIELD_U(", ", fev_hdr, metadata_len);
|
||||
|
||||
if (fev_hdr.metadata_len < FEV_V2_SIZE) {
|
||||
tprints(", ... /* invalid metadata_len */}");
|
||||
goto end_fev_decoded;
|
||||
}
|
||||
}
|
||||
|
||||
if (fev_ver < 1 || fev_ver > 3) {
|
||||
tprints(", ... /* invalid vers */}");
|
||||
goto end_fev_decoded;
|
||||
}
|
||||
|
||||
switch (fev_ver) {
|
||||
case 1:
|
||||
if (umove(tcp, addr + pos + sizeof(fev_hdr),
|
||||
&fev_md.v1)) {
|
||||
printf(", ...}");
|
||||
pos += sizeof(fev_hdr);
|
||||
goto end_decoded;
|
||||
}
|
||||
|
||||
PRINT_FIELD_FANFD(", ", fev_md.v1, fd, tcp);
|
||||
PRINT_FIELD_FLAGS(", ", fev_md.v1, mask,
|
||||
fan_event_flags, "FAN_???");
|
||||
PRINT_FIELD_D(", ", fev_md.v1, pid);
|
||||
|
||||
if (FEV_V1_SIZE < fev_hdr.event_len) {
|
||||
tprints(", ");
|
||||
printstrn(tcp, addr + pos,
|
||||
fev_hdr.event_len - FEV_V1_SIZE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2: case 3:
|
||||
if (umove(tcp, addr + pos + sizeof(fev_hdr),
|
||||
&fev_md.v2)) {
|
||||
printf(", ...}");
|
||||
pos += sizeof(fev_hdr);
|
||||
goto end_decoded;
|
||||
}
|
||||
|
||||
PRINT_FIELD_FLAGS(", ", fev_md.v2, mask,
|
||||
fan_event_flags, "FAN_???");
|
||||
PRINT_FIELD_FANFD(", ", fev_md.v2, fd, tcp);
|
||||
PRINT_FIELD_D(", ", fev_md.v2, pid);
|
||||
|
||||
if (FEV_V2_SIZE < fev_hdr.event_len) {
|
||||
tprints(", ");
|
||||
printstrn(tcp, addr + pos,
|
||||
fev_hdr.event_len - FEV_V2_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
tprints("}");
|
||||
|
||||
end_fev_decoded:
|
||||
pos += fev_hdr.event_len;
|
||||
} while (pos <= addrlen - sizeof(fev_hdr));
|
||||
|
||||
end_decoded:
|
||||
if (pos < addrlen) {
|
||||
if (pos)
|
||||
tprints(", ");
|
||||
|
||||
printstrn(tcp, addr + pos, addrlen - pos);
|
||||
}
|
||||
|
||||
tprints("]");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
decode_fanotify_write(struct tcb *tcp, int fd, const char *fdpath,
|
||||
enum fileops op, kernel_ulong_t addr,
|
||||
kernel_ulong_t addrlen)
|
||||
{
|
||||
struct fresp {
|
||||
int32_t fd;
|
||||
uint32_t response;
|
||||
} fresp;
|
||||
kernel_ulong_t pos = 0;
|
||||
|
||||
if (addrlen < sizeof(fresp))
|
||||
return false;
|
||||
|
||||
tprints("[");
|
||||
|
||||
do {
|
||||
if (pos)
|
||||
tprints(", ");
|
||||
|
||||
if (umove(tcp, addr + pos, &fresp)) {
|
||||
printaddr_comment(addr + pos);
|
||||
break;
|
||||
}
|
||||
|
||||
PRINT_FIELD_FD("{", fresp, fd, tcp);
|
||||
|
||||
tprints(", response=");
|
||||
if (fresp.response | FAN_AUDIT) {
|
||||
print_xlat(FAN_AUDIT);
|
||||
tprints("|");
|
||||
}
|
||||
printxval(fan_responses, fresp.response, "FAN_???");
|
||||
tprints("}");
|
||||
|
||||
pos += sizeof(fresp);
|
||||
} while (pos <= addrlen - sizeof(fresp));
|
||||
|
||||
if (pos < addrlen) {
|
||||
if (pos)
|
||||
tprints(", ");
|
||||
|
||||
printstrn(tcp, addr + pos, addrlen - pos);
|
||||
}
|
||||
|
||||
tprints("]");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
SYS_FUNC(fanotify_init)
|
||||
{
|
||||
@ -34,9 +285,6 @@ SYS_FUNC(fanotify_init)
|
||||
return RVAL_DECODED | RVAL_FD;
|
||||
}
|
||||
|
||||
#include "xlat/fan_mark_flags.h"
|
||||
#include "xlat/fan_event_flags.h"
|
||||
|
||||
SYS_FUNC(fanotify_mark)
|
||||
{
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
|
@ -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)
|
||||
|
69
fcntl.c
69
fcntl.c
@ -6,7 +6,27 @@
|
||||
* Copyright (c) 1999-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,6 +34,7 @@
|
||||
|
||||
#include "xlat/f_owner_types.h"
|
||||
#include "xlat/f_seals.h"
|
||||
#include "xlat/fcntl_rw_hints.h"
|
||||
#include "xlat/fcntlcmds.h"
|
||||
#include "xlat/fdflags.h"
|
||||
#include "xlat/lockfcmds.h"
|
||||
@ -64,6 +85,32 @@ print_f_owner_ex(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
tprintf(", pid=%d}", owner.pid);
|
||||
}
|
||||
|
||||
static void
|
||||
print_rwhint(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
{
|
||||
uint64_t hint;
|
||||
|
||||
if (umove_or_printaddr(tcp, addr, &hint))
|
||||
return;
|
||||
|
||||
tprints("[");
|
||||
printxval(fcntl_rw_hints, hint, "RWH_WRITE_LIFE_???");
|
||||
tprints("]");
|
||||
}
|
||||
|
||||
static void
|
||||
print_owner_uids(struct tcb *const tcp, const kernel_ulong_t addr)
|
||||
{
|
||||
uint32_t uids[2];
|
||||
|
||||
if (umove_or_printaddr(tcp, addr, uids))
|
||||
return;
|
||||
|
||||
printuid("[", uids[0]); /* Real */
|
||||
printuid(", ", uids[1]); /* Effective */
|
||||
tprints("]");
|
||||
}
|
||||
|
||||
static int
|
||||
print_fcntl(struct tcb *tcp)
|
||||
{
|
||||
@ -116,6 +163,11 @@ print_fcntl(struct tcb *tcp)
|
||||
tprints(", ");
|
||||
printsignal(tcp->u_arg[2]);
|
||||
break;
|
||||
case F_SET_RW_HINT:
|
||||
case F_SET_FILE_RW_HINT:
|
||||
tprints(", ");
|
||||
print_rwhint(tcp, tcp->u_arg[2]);
|
||||
break;
|
||||
case F_GETOWN:
|
||||
case F_GETPIPE_SZ:
|
||||
break;
|
||||
@ -159,11 +211,26 @@ print_fcntl(struct tcb *tcp)
|
||||
tcp->auxstr = sprintflags("seals ", f_seals,
|
||||
(kernel_ulong_t) tcp->u_rval);
|
||||
return RVAL_HEX | RVAL_STR;
|
||||
case F_GET_RW_HINT:
|
||||
case F_GET_FILE_RW_HINT:
|
||||
if (entering(tcp)) {
|
||||
tprints(", ");
|
||||
return 0;
|
||||
}
|
||||
print_rwhint(tcp, tcp->u_arg[2]);
|
||||
break;
|
||||
case F_GETSIG:
|
||||
if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0)
|
||||
return 0;
|
||||
tcp->auxstr = signame(tcp->u_rval);
|
||||
return RVAL_STR;
|
||||
case F_GETOWNER_UIDS:
|
||||
if (entering(tcp)) {
|
||||
tprints(", ");
|
||||
return 0;
|
||||
}
|
||||
print_owner_uids(tcp, tcp->u_arg[2]);
|
||||
break;
|
||||
default:
|
||||
tprintf(", %#" PRI_klx, tcp->u_arg[2]);
|
||||
break;
|
||||
|
@ -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"
|
||||
|
@ -2,7 +2,27 @@
|
||||
* Copyright (c) 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"
|
||||
|
@ -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,10 +1,3 @@
|
||||
/*
|
||||
* 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)
|
||||
|
@ -1,9 +1,4 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (c) 2017-2018 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
if [ "$1" = "-f" ]; then
|
||||
shift
|
||||
@ -27,7 +22,7 @@ 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}"
|
||||
|
@ -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"
|
||||
|
22
file_ioctl.c
22
file_ioctl.c
@ -3,7 +3,27 @@
|
||||
* 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"
|
||||
|
22
filter.h
22
filter.h
@ -3,7 +3,27 @@
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef STRACE_FILTER_H
|
||||
|
@ -3,7 +3,27 @@
|
||||
* 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"
|
||||
@ -28,29 +48,54 @@ struct inject_personality_data {
|
||||
uint16_t scno;
|
||||
};
|
||||
|
||||
struct alt_name {
|
||||
const char *syn;
|
||||
const char *orig;
|
||||
};
|
||||
|
||||
#define _(a_, b_) { (a_), (b_) }
|
||||
static const struct alt_name alt_signames[] = {
|
||||
#include "linux/alt_signalent.h"
|
||||
};
|
||||
|
||||
static const struct alt_name alt_errnames[] = {
|
||||
#include "linux/alt_signalent.h"
|
||||
};
|
||||
#undef _
|
||||
|
||||
static bool
|
||||
signame_eq(const char *needle, const char *straw)
|
||||
{
|
||||
if (strncasecmp(straw, "SIG", 3) != 0)
|
||||
return false;
|
||||
|
||||
straw += 3;
|
||||
|
||||
if (strncasecmp(needle, "SIG", 3) == 0)
|
||||
needle += 3;
|
||||
|
||||
return (strcasecmp(needle, straw) == 0);
|
||||
}
|
||||
|
||||
static int
|
||||
sigstr_to_uint(const char *s)
|
||||
{
|
||||
for (size_t i = 0; i < ARRAY_SIZE(alt_signames); i++) {
|
||||
if (!signame_eq(s, alt_signames[i].syn)) {
|
||||
error_msg("Signal name \"%s\" is selected instead of "
|
||||
"synonymous \"%s\"",
|
||||
alt_signames[i].orig, s);
|
||||
s = alt_signames[i].orig;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (*s >= '0' && *s <= '9')
|
||||
return string_to_uint_upto(s, 255);
|
||||
return string_to_uint_upto(s, nsig);
|
||||
|
||||
if (strncasecmp(s, "SIG", 3) == 0)
|
||||
s += 3;
|
||||
|
||||
for (int i = 1; i <= 255; ++i) {
|
||||
const char *name = signame(i);
|
||||
|
||||
if (!name)
|
||||
continue;
|
||||
|
||||
if (strncasecmp(name, "SIG", 3) != 0)
|
||||
continue;
|
||||
|
||||
name += 3;
|
||||
|
||||
if (strcasecmp(name, s) != 0)
|
||||
continue;
|
||||
|
||||
for (size_t i = 1; i <= nsig; i++) {
|
||||
if (signame_eq(s, signame(i)))
|
||||
return i;
|
||||
}
|
||||
|
||||
@ -60,6 +105,16 @@ sigstr_to_uint(const char *s)
|
||||
static int
|
||||
find_errno_by_name(const char *name)
|
||||
{
|
||||
for (unsigned int i = 0; i < ARRAY_SIZE(alt_errnames); ++i) {
|
||||
if (!strcasecmp(name, alt_errnames[i].syn)) {
|
||||
error_msg("Error name \"%s\" is selected instead of "
|
||||
"synonymous \"%s\"",
|
||||
alt_errnames[i].orig, name);
|
||||
name = alt_errnames[i].orig;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned int i = 1; i < nerrnos; ++i) {
|
||||
if (errnoent[i] && (strcasecmp(name, errnoent[i]) == 0))
|
||||
return i;
|
||||
@ -75,14 +130,15 @@ parse_delay_token(const char *input, struct inject_opts *fopts, bool isenter)
|
||||
|
||||
if (fopts->data.flags & flag) /* duplicate */
|
||||
return false;
|
||||
long long intval = string_to_ulonglong(input);
|
||||
if (intval < 0) /* couldn't parse */
|
||||
struct timespec tsval;
|
||||
|
||||
if (parse_ts(input, &tsval) < 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);
|
||||
fill_delay_data(fopts->data.delay_idx, &tsval, isenter);
|
||||
fopts->data.flags |= flag;
|
||||
|
||||
return true;
|
||||
|
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"
|
||||
|
24
flock.h
24
flock.h
@ -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.
|
||||
*/
|
||||
|
||||
#ifndef 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)
|
||||
|
81
futex.c
81
futex.c
@ -6,7 +6,27 @@
|
||||
* Copyright (c) 2014-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"
|
||||
@ -20,17 +40,45 @@
|
||||
#ifndef FUTEX_OP_OPARG_SHIFT
|
||||
# define FUTEX_OP_OPARG_SHIFT 8
|
||||
#endif
|
||||
#ifndef FUTEX_TID_MASK
|
||||
# define FUTEX_TID_MASK 0x3fffffffU
|
||||
#endif
|
||||
|
||||
#include "xlat/futexbitset.h"
|
||||
#include "xlat/futexops.h"
|
||||
#include "xlat/futexpiflags.h"
|
||||
#include "xlat/futexwakeops.h"
|
||||
#include "xlat/futexwakecmps.h"
|
||||
|
||||
static void
|
||||
printaddrnum(struct tcb *tcp, kernel_ulong_t addr)
|
||||
{
|
||||
printnum_int_ex(tcp, addr, true, "%#x");
|
||||
}
|
||||
|
||||
static void
|
||||
printaddrpival(struct tcb *tcp, kernel_ulong_t addr)
|
||||
{
|
||||
uint32_t tid;
|
||||
|
||||
if (umove_or_printaddr(tcp, addr, &tid))
|
||||
return;
|
||||
|
||||
tprints("[");
|
||||
if (tid & ~FUTEX_TID_MASK) {
|
||||
printflags(futexpiflags, tid & ~FUTEX_TID_MASK, NULL);
|
||||
tprints("|");
|
||||
}
|
||||
tprintf("%u]", tid & FUTEX_TID_MASK);
|
||||
printaddr_comment(addr);
|
||||
}
|
||||
|
||||
SYS_FUNC(futex)
|
||||
{
|
||||
const kernel_ulong_t uaddr = tcp->u_arg[0];
|
||||
const int op = tcp->u_arg[1];
|
||||
const int cmd = op & 127;
|
||||
const bool is_rt = op & FUTEX_CLOCK_REALTIME;
|
||||
const kernel_ulong_t timeout = tcp->u_arg[3];
|
||||
const kernel_ulong_t uaddr2 = tcp->u_arg[4];
|
||||
const unsigned int val = tcp->u_arg[2];
|
||||
@ -38,23 +86,33 @@ SYS_FUNC(futex)
|
||||
const unsigned int val3 = tcp->u_arg[5];
|
||||
const char *comment;
|
||||
|
||||
printaddr(uaddr);
|
||||
switch (cmd) {
|
||||
case FUTEX_LOCK_PI:
|
||||
case FUTEX_UNLOCK_PI:
|
||||
case FUTEX_TRYLOCK_PI:
|
||||
printaddrpival(tcp, uaddr);
|
||||
break;
|
||||
default:
|
||||
printaddrnum(tcp, uaddr);
|
||||
}
|
||||
|
||||
tprints(", ");
|
||||
printxval(futexops, op, "FUTEX_???");
|
||||
switch (cmd) {
|
||||
case FUTEX_WAIT:
|
||||
tprintf(", %u", val);
|
||||
tprints(", ");
|
||||
print_timespec(tcp, timeout);
|
||||
/* timeout in FUTEX_WAIT is relative, contrary to other ops */
|
||||
print_timespec(tcp, timeout, false);
|
||||
break;
|
||||
case FUTEX_LOCK_PI:
|
||||
tprints(", ");
|
||||
print_timespec(tcp, timeout);
|
||||
print_timespec(tcp, timeout, true);
|
||||
break;
|
||||
case FUTEX_WAIT_BITSET:
|
||||
tprintf(", %u", val);
|
||||
tprints(", ");
|
||||
print_timespec(tcp, timeout);
|
||||
print_timespec(tcp, timeout, is_rt);
|
||||
tprints(", ");
|
||||
printxval(futexbitset, val3, NULL);
|
||||
break;
|
||||
@ -66,19 +124,20 @@ SYS_FUNC(futex)
|
||||
case FUTEX_REQUEUE:
|
||||
tprintf(", %u", val);
|
||||
tprintf(", %u, ", val2);
|
||||
printaddr(uaddr2);
|
||||
printaddrnum(tcp, uaddr2);
|
||||
break;
|
||||
case FUTEX_CMP_REQUEUE:
|
||||
case FUTEX_CMP_REQUEUE_PI:
|
||||
tprintf(", %u", val);
|
||||
tprintf(", %u, ", val2);
|
||||
printaddr(uaddr2);
|
||||
(cmd == FUTEX_CMP_REQUEUE ? printaddrnum
|
||||
: printaddrpival)(tcp, uaddr2);
|
||||
tprintf(", %u", val3);
|
||||
break;
|
||||
case FUTEX_WAKE_OP:
|
||||
tprintf(", %u", val);
|
||||
tprintf(", %u, ", val2);
|
||||
printaddr(uaddr2);
|
||||
printaddrnum(tcp, uaddr2);
|
||||
tprints(", ");
|
||||
if ((val3 >> 28) & FUTEX_OP_OPARG_SHIFT) {
|
||||
print_xlat(FUTEX_OP_OPARG_SHIFT);
|
||||
@ -98,11 +157,13 @@ SYS_FUNC(futex)
|
||||
case FUTEX_WAIT_REQUEUE_PI:
|
||||
tprintf(", %u", val);
|
||||
tprints(", ");
|
||||
print_timespec(tcp, timeout);
|
||||
print_timespec(tcp, timeout, is_rt);
|
||||
tprints(", ");
|
||||
printaddr(uaddr2);
|
||||
printaddrpival(tcp, uaddr2);
|
||||
break;
|
||||
case FUTEX_FD:
|
||||
tprintf(", %u", val);
|
||||
return RVAL_DECODED | RVAL_FD;
|
||||
case FUTEX_WAKE:
|
||||
tprintf(", %u", val);
|
||||
break;
|
||||
|
59
gcc_compat.h
59
gcc_compat.h
@ -3,7 +3,27 @@
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef STRACE_GCC_COMPAT_H
|
||||
@ -13,18 +33,8 @@
|
||||
# define GNUC_PREREQ(maj, min) \
|
||||
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
||||
#else
|
||||
# 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, 0) || CLANG_PREREQ(1, 0))
|
||||
# define __attribute__(x) /* empty */
|
||||
# define GNUC_PREREQ(maj, min) 0
|
||||
#endif
|
||||
|
||||
#if GNUC_PREREQ(2, 5)
|
||||
@ -77,6 +87,14 @@
|
||||
# define ALIGNOF(t_) (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
|
||||
#endif
|
||||
|
||||
#if GNUC_PREREQ(4, 1)
|
||||
# define CMPXCHG(val_, old_, new_) \
|
||||
__sync_bool_compare_and_swap((val_), (old_), (new_))
|
||||
#else
|
||||
# define CMPXCHG(val_, old_, new_) \
|
||||
((val_) == (old_) ? (val_) = (new_), true : false)
|
||||
#endif
|
||||
|
||||
#if GNUC_PREREQ(4, 3)
|
||||
# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
|
||||
#else
|
||||
@ -89,23 +107,6 @@
|
||||
# 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"); \
|
||||
|
@ -2,7 +2,27 @@
|
||||
# Copyright (c) 2018 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.
|
||||
|
||||
input="$1"
|
||||
shift
|
||||
|
82
gen_ptp_clock_check.sh
Executable file
82
gen_ptp_clock_check.sh
Executable file
@ -0,0 +1,82 @@
|
||||
#!/bin/sh -efu
|
||||
# Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. 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.
|
||||
|
||||
input="$1"
|
||||
shift
|
||||
|
||||
cat <<EOF
|
||||
/* Generated by $0 from $input; do not edit. */
|
||||
#include "defs.h"
|
||||
#ifdef HAVE_LINUX_PTP_CLOCK_H
|
||||
# include <linux/ptp_clock.h>
|
||||
# include "ptp_clock.h"
|
||||
# include "static_assert.h"
|
||||
|
||||
# define SoM(type_, member_) (sizeof(((type_ *)0)->member_))
|
||||
EOF
|
||||
|
||||
for struct in $(sed -n 's/^struct \(strace_ptp_[^[:space:]]\+\) .*/\1/p' < "$input"); do
|
||||
type_name="struct ${struct#strace_}"
|
||||
TYPE_NAME="$(printf %s "$type_name" |tr '[:lower:] ' '[:upper:]_')"
|
||||
|
||||
sed -n '/^'"struct $struct"' [^{]*{$/,/^};$/p' < "$input" |
|
||||
sed -n 's/^[[:space:]]\+[^][;]*[[:space:]]\([^][[:space:];]\+\)\(\[[^;]*\]\)\?;$/\1/p' |
|
||||
while read field; do
|
||||
FIELD="$(printf %s "$field" |tr '[:lower:]' '[:upper:]')"
|
||||
|
||||
if [ "rsv" = "$field" ]; then
|
||||
cat <<EOF
|
||||
|
||||
# ifdef HAVE_${TYPE_NAME}_$FIELD
|
||||
static_assert(SoM(struct $struct, $field) <= SoM($type_name, $field),
|
||||
"$struct.$field is bigger than in system headers");
|
||||
# endif /* HAVE_${TYPE_NAME}_$FIELD */
|
||||
EOF
|
||||
continue;
|
||||
fi
|
||||
|
||||
cat <<EOF
|
||||
|
||||
# ifdef HAVE_${TYPE_NAME}_$FIELD
|
||||
static_assert(SoM(struct $struct, $field) == SoM($type_name, $field),
|
||||
"$struct.$field size mismatch");
|
||||
static_assert(offsetof(struct $struct, $field) == offsetof($type_name, $field),
|
||||
"$struct.$field offset mismatch");
|
||||
# endif /* HAVE_${TYPE_NAME}_$FIELD */
|
||||
EOF
|
||||
done
|
||||
cat <<EOF
|
||||
|
||||
static_assert(${struct}_size == expected_${struct}_size,
|
||||
"${struct}_size mismatch");
|
||||
EOF
|
||||
|
||||
done
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
#endif /* HAVE_LINUX_BPF_H */
|
||||
EOF
|
@ -1,9 +1,4 @@
|
||||
#!/bin/sh -e
|
||||
#
|
||||
# Copyright (c) 2015-2018 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
list="$(sed -r -n '/^strace_SOURCES[[:space:]]*=/,/^[[:space:]]*# end of strace_SOURCES/ s/^[[:space:]]*([[:alnum:]][^.]*\.c)[[:space:]]*\\$/\1/p' Makefile.am |
|
||||
xargs -r grep -Elx '#[[:space:]]*include[[:space:]]+MPERS_DEFS' |
|
||||
|
@ -1,9 +1,4 @@
|
||||
#!/bin/sh -e
|
||||
#
|
||||
# Copyright (c) 2015-2018 The strace developers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
echo 'enum {'
|
||||
echo 'SEN_printargs = 0,'
|
||||
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#if SUPPORTED_PERSONALITIES > 1
|
||||
# include "get_personality.h"
|
||||
# include <linux/audit.h>
|
||||
# include "arch_get_personality.c"
|
||||
#endif
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#ifndef STRACE_GET_PERSONALITY_H
|
||||
# define STRACE_GET_PERSONALITY_H
|
||||
|
||||
# include "ptrace.h"
|
||||
|
||||
extern int
|
||||
get_personality_from_syscall_info(const struct ptrace_syscall_info *);
|
||||
|
||||
#endif /* !STRACE_GET_PERSONALITY_H */
|
@ -1,18 +1,89 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2018 Dmitry V. Levin <ldv@altlinux.org>
|
||||
* Copyright (c) 2012-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"
|
||||
|
||||
#include DEF_MPERS_TYPE(struct_robust_list_head)
|
||||
|
||||
#include <linux/futex.h>
|
||||
|
||||
typedef struct robust_list_head struct_robust_list_head;
|
||||
|
||||
#include MPERS_DEFS
|
||||
|
||||
#include "print_fields.h"
|
||||
|
||||
static void
|
||||
decode_robust_list(struct tcb *tcp, kernel_ulong_t addr, kernel_ulong_t len)
|
||||
{
|
||||
struct_robust_list_head rl;
|
||||
|
||||
if (len < sizeof(rl)) {
|
||||
printaddr(addr);
|
||||
return;
|
||||
}
|
||||
if (umove_or_printaddr(tcp, addr, &rl))
|
||||
return;
|
||||
|
||||
PRINT_FIELD_PTR("{list={", rl.list, next);
|
||||
PRINT_FIELD_D("}, ", rl, futex_offset);
|
||||
PRINT_FIELD_PTR(", ", rl, list_op_pending);
|
||||
|
||||
if (len > sizeof(rl))
|
||||
tprints(", /* ??? */");
|
||||
|
||||
tprints("}");
|
||||
|
||||
printaddr_comment(addr);
|
||||
}
|
||||
|
||||
SYS_FUNC(set_robust_list)
|
||||
{
|
||||
decode_robust_list(tcp, tcp->u_arg[0], tcp->u_arg[1]);
|
||||
tprintf(", %lu", (unsigned long) tcp->u_arg[1]);
|
||||
|
||||
return RVAL_DECODED;
|
||||
}
|
||||
|
||||
SYS_FUNC(get_robust_list)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
tprintf("%d, ", (int) tcp->u_arg[0]);
|
||||
} else {
|
||||
printnum_ptr(tcp, tcp->u_arg[1]);
|
||||
mpers_ptr_t rl_ptr;
|
||||
mpers_ptr_t len = 0;
|
||||
if (!umove_or_printaddr(tcp, tcp->u_arg[1], &rl_ptr)) {
|
||||
tprints("[");
|
||||
if (!umove(tcp, tcp->u_arg[2], &len))
|
||||
decode_robust_list(tcp, rl_ptr, len);
|
||||
else
|
||||
printaddr(tcp->u_arg[1]);
|
||||
tprints("]");
|
||||
}
|
||||
tprints(", ");
|
||||
printnum_ulong(tcp, tcp->u_arg[2]);
|
||||
}
|
||||
|
7
getcpu.c
7
getcpu.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(getcpu)
|
||||
|
7
getcwd.c
7
getcwd.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(getcwd)
|
||||
|
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The strace developers.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
SYS_FUNC(getpagesize)
|
||||
|
@ -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
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
#include "xlat/getrandom_flags.h"
|
||||
|
||||
|
23
glibc_compat.h
Normal file
23
glibc_compat.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef STRACE_GLIBC_COMPAT_H
|
||||
#define STRACE_GLIBC_COMPAT_H
|
||||
|
||||
#if defined __GLIBC__
|
||||
# ifndef __GLIBC_MINOR__
|
||||
# warning "__GLIBC__ is defined, but __GLIBC_MINOR__ isn't"
|
||||
# define __GLIBC_MINOR__ 0
|
||||
# endif /* __GLIBC_MINOR__ */
|
||||
|
||||
# ifdef __GLIBC_PREREQ
|
||||
# define GLIBC_PREREQ __GLIBC_PREREQ
|
||||
# else
|
||||
# define GLIBC_PREREQ(maj, min) \
|
||||
((((__GLIBC__) << 16) + (__GLIBC_MINOR__)) >= (((maj) << 16) + (min)))
|
||||
# endif /* __GLIBC_PREREQ */
|
||||
|
||||
# define GLIBC_OLDER(maj, min) (!GLIBC_PREREQ((maj), (min)))
|
||||
#else /* !__GLIBC__ */
|
||||
# define GLIBC_PREREQ(maj, min) 0
|
||||
# define GLIBC_OLDER(maj, min) 0
|
||||
#endif
|
||||
|
||||
#endif /* STRACE_GLIBC_COMPAT_H */
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user