latrace-0.5.11.orig/ 0000755 0000000 0000000 00000000000 11620261230 011027 5 ustar latrace-0.5.11.orig/COPYING 0000644 0000000 0000000 00000104513 11565510552 012102 0 ustar GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, 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
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
latrace-0.5.11.orig/configure.ac 0000644 0000000 0000000 00000006231 11620260065 013324 0 ustar # Copyright (C) 2008, 2009 Jiri Olsa
#
# This file is part of the latrace.
#
# The latrace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The latrace 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the latrace (file COPYING). If not, see
# .
AC_PREREQ(2.61)
AC_INIT(latrace, 0.5.11, olsajiri@gmail.com)
AC_CONFIG_SRCDIR([src/latrace.c])
AC_PROG_CC
AC_PROG_LEX
AS_IF([test "x$LEX" = "x:"],
[AC_MSG_ERROR([lex/flex is needed.])])
AC_PROG_YACC
AS_IF([test "x$YACC" = "x:"],
[AC_MSG_ERROR([yacc/bison is needed.])])
AC_PROG_LN_S
AC_PATH_PROG([ASCIIDOC], [asciidoc], [:])
AC_PATH_PROG([XMLTO], [xmlto], [:])
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([string.h])
AC_CHECK_HEADERS([libintl.h])
AC_CHECK_HEADERS([malloc.h])
AC_CHECK_HEADERS([stddef.h])
AC_C_CONST
AC_TYPE_PID_T
AC_FUNC_FORK
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset setenv])
AC_CHECK_FUNCS([gettimeofday])
AC_CHECK_FUNCS([mkfifo])
AC_CHECK_FUNCS([select])
AC_CHECK_FUNCS([strchr])
AC_CHECK_FUNCS([strdup])
AC_CHECK_FUNCS([strstr])
AC_CHECK_FUNCS([strerror])
AC_CHECK_FUNCS([strtol])
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([limits.h])
AC_FUNC_MALLOC
AC_FUNC_ALLOCA
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_SELECT_ARGTYPES
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT32_T
AC_TYPE_SIZE_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT8_T
AC_SYS_LARGEFILE
date=`date "+%B %G"`
unamem=`uname -m | sed -e 's/i.86/i686/' -e 's/^armv.*/arm/'`
AC_SUBST(CONFIG_DATE, "$date")
AC_SUBST(CONFIG_SYSDEP_DIR, "$unamem")
AC_SUBST(CONFIG_VERSION, "AC_PACKAGE_VERSION")
AC_DEFINE(CONFIG_LT_CONFIG, "/tmp/lt-config", [Temporary directory prefix.])
AC_DEFINE(CONFIG_VERSION, "AC_PACKAGE_VERSION", [Version of latrace.])
# for following architectures we have argument display support
if test "$unamem" = "x86_64" -o\
"$unamem" = "i686" -o\
"$unamem" = "arm"; then
AC_DEFINE(CONFIG_ARCH_HAVE_ARGS)
AC_SUBST(CONFIG_ARCH_HAVE_ARGS, "y")
else
AC_MSG_WARN([Arguments display support disabled])
fi
# for following architectures we have automated tests support
if test "$unamem" = "x86_64" -o\
"$unamem" = "i686" -o\
"$unamem" = "arm" ; then
AC_SUBST(CONFIG_ARCH_HAVE_TEST, "y")
else
AC_MSG_WARN([No automated test support])
fi
AC_SEARCH_LIBS([cplus_demangle], [iberty_pic iberty],
[AC_DEFINE(CONFIG_LIBERTY, 1, "Liberty found.")],
[AC_MSG_WARN([libiberty not found, no demangle support (install binutils-dev)])])
AC_CONFIG_HEADER([src/autoconf.h])
AC_CONFIG_FILES([src/autoconf.make])
AC_CONFIG_FILES([doc/asciidoc.conf])
AC_CONFIG_FILES([etc/latrace.d/latrace.conf])
AC_OUTPUT
latrace-0.5.11.orig/ChangeLog 0000644 0000000 0000000 00000033637 11620260065 012622 0 ustar -------------------------------------------------------------------------------
latrace 0.5.11
2011-07-28 Jiri Olsa
* doc - update configuration file stuff
* config - add missing help for -N option
* 0.5.11 release changes
2011-07-07 Jiri Olsa
* args - fix size_t printf compile warning
2011-06-21 Jiri Olsa
* config - fixed memory leak
2011-06-15 Jiri Olsa
* global_symbol fix - proper tree management
* make tracer return actual tracee status
* move all tests to scripts
* added following options
LIBS, LIBS_TO, LIBS_FROM, SYM, SYM_OMIT, SYM_BELOW, SYM_NOEXIT
* automated tests for LIBS*/SYM*
* args - adding support to display string pointer and length,
ARGS_STRING_POINTER_LENGTH option
(contributed by Dr. David Alan Gilbert )
2011-06-02 Jiri Olsa
* adding large file support
2011-05-30 Jiri Olsa
* fixed bug in tracer waiting code
(do not exit the loop prematurely)
* reading the -N config file immediatelly within
args processing
2011-05-25 Jiri Olsa
* adding SIGTERM/SIGINT handlers,
refactoring lt_run to check the latrace got killed
* adding tests for latrace termination
* args - replacing destination strings with void pointers
* tty output - move fd to the config struct
2011-05-24 Jiri Olsa
* args - use isprint to decide whether to print the character,
force test.sh to use bash,
enable tests for ARM architecture
(contributed by Dr. David Alan Gilbert )
* fix test_[char|short|int|long] tests
* test_long - separate 32/64 versions
2011-05-13 Jiri Olsa
* build fix for ARM
(contributed by Dr. David Alan Gilbert )
* fixed errors discovered by cppcheck
2011-05-05 Jiri Olsa
* adding OUTPUT_TTY config file option
* disabling connection between -R and -q options
2011-04-20 Jiri Olsa
* prevent gcc warning with single printf like arg passing
* adding automated test support, so far for x86 and x86_64,
others are disabled. From this time on, I'll try to force
addition of automated test for each fix/feature.. ;)
2011-04-16 Jiri Olsa
* fix display of char arguments
* add threads fifo management to special directory
so the notification is not affected by other files
2011-04-06 Jiri Olsa
* fix memory leak in the argument display code
2011-04-05 Jiri Olsa
* fix controled config bug - missing shared config assignment
* moving conf header files to new location + rename s/conf/h/
* adding support for configuration file
2011-02-15 Jiri Olsa
* moving debian directory to the packaging
* Sebastian Pipping
- fix LDFLAGS/CFLAGS usage
2011-01-31 Jiri Olsa
* adding support for global symbol config
one global symbol tree to rule them all
- only one tree is searched during the plt entry/exit
- symbols are added during the bind audit callback
2010-10-17 Jiri Olsa
* Artur Skawina
- enhancing names check with *-logic for
"-l -t -f -s -n -b" options
-------------------------------------------------------------------------------
latrace 0.5.10
2010-10-13 Jiri Olsa
* Artur Skawina
- add '-n' option, allowing to omit tracing certain symbols
* 0.5.10 release changes
2010-10-02 Jiri Olsa
* Akos Pasztory
- more sophisticated parsing of /proc/self/maps
2010-09-15 Jiri Olsa
* dynamic rlimit stack check
* recognize [stack] map arrea and handle it properly
* synchronize --no-* option names
2010-09-07 Jiri Olsa
* adding stack limits dynamic check
- based on proposal from Akos Pasztory
- enabled by default, disable by new '-Y' option
2010-08-05 Jiri Olsa
* changed config file magic defines
* separate arguments display code, so it could be
disabled for not supported architectures
* updating license info
2010-07-02 Jiri Olsa
* fixing output for thread applications
- proper tid displayed for pipe mode
- proper indentation for pipe mode
2010-06-03 Jiri Olsa
* changing permissions of libltaudit.so to 755
-------------------------------------------------------------------------------
latrace 0.5.9
2010-05-11 Jiri Olsa
* 0.5.9 release changes
2010-05-07 Jiri Olsa
* fix autoconf search for iberty lib
* Akos Pasztory
- debian/rules made executable
- check for libiberty_pic and libiberty in this order
2010-04-29 Jiri Olsa
* refactoring sysdep configuration
-------------------------------------------------------------------------------
latrace 0.5.8
2010-04-19 Jiri Olsa
* 0.5.8 release changes
2009-04-08 Jiri Olsa
* fixed enum handling (strtol failure)
* added support for enum string refference definition
2009-03-01 Jiri Olsa
* Akos Pasztory
* added checks for asciidoc and xmlto
* added check for liberty-pic
* updated .gitignore
* shlib doesn't need to be executable
* added Debian packaging
* relaxed binutils-dev dependency
* generate conffiles automatically
* debian pkg docbook-xsl and docbook-xml
2010-02-28 Jiri Olsa
* controled config bug fix
* liberty controled by autoconf now
2010-02-13 Jiri Olsa
* controled config feature
* disable auditing feature
2010-02-12 Jiri Olsa
* refactoring shared config
2009-10-20 Jiri Olsa
* added clone function
2009-09-16 Jiri Olsa
* added support for pipe mode timestamp display
* added snapshot/release targets
2009-09-15 Jiri Olsa
* added initial support for timestamp display
-------------------------------------------------------------------------------
latrace 0.5.7
2009-09-08 Jiri Olsa
* 0.5.7 latrace.spec changes
2009-09-04 Jiri Olsa
* 0.5.7 release changes
2009-08-21 Jiri Olsa
* added '-B' option to always display the { } around the symbol body
* minor code sttyle changes
2009-08-20 Jiri Olsa
* added C++ demangling support - "-d" option
-------------------------------------------------------------------------------
latrace 0.5.6
2009-07-06 Jiri Olsa
* changes for the rpm review
* 0.5.6 release changes
2009-07-04 Jiri Olsa
* minor changes for the rpm review
2009-07-02 Jiri Olsa
* adding --unsafe for asciidoc to workaround
build on the Fedora Rawhide
2009-07-01 Jiri Olsa
* adding %postun %post to latrace.spec & several minor
changes based on the Fedora rpm review
2009-06-13 Jiri Olsa
* added latrace.spec for rpm pkg. building
* minor Makefile mrproper change
2009-06-06 Jiri Olsa
* added support pointers in typedef
* fixed minor bug for pointer output
* added more checks to configure.ac
* make mrproper real propper
2009-05-13 Jiri Olsa
* added DESTDIR makefile support
-------------------------------------------------------------------------------
latrace 0.5.5
2009-04-25 Jiri Olsa
* fixed arch dependent enum handling
* fixed config file line number tracking
2009-04-25 Jiri Olsa
* release notes for 0.5.5
2009-04-22 Jiri Olsa
* main Makefile changes - adding the package target
2009-04-17 Jiri Olsa
* install function - skip the install if the file does not exist
2009-04-15 Jiri Olsa
* adding syscall.conf for x86_64
2009-04-10 Jiri Olsa
* getstr_pod/enum redesign
* added etc/latrace.d/mman.conf
2009-04-08 Jiri Olsa
* enum minor changes
* added etc/latrace.d/resource.conf
2009-04-07 Jiri Olsa
* added 'pcC' options for x86_64, since it looks
glibc bug 7055 got fixed somehow
glibc bug 7055 - LD_AUDIT - gettimeofday function
segfaults if called from interface
2009-04-03 Jiri Olsa
* added doc enum part
2009-04-01 Jiri Olsa
* added enum support
2009-03-30 Jiri Olsa
* stats - syntax changes
* stats - added -C sym, fixed -C lib
2009-03-24 Jiri Olsa
* removing stack.h include from generic parts
* fix PRINT_VERBOSE[12] for x86_64
* doc changes
2009-03-17 Jiri Olsa
* doc changes
2009-03-14 Jiri Olsa
* unify the PRINT_VERBOSE[12] to one method only PRINT_VERBOSE
* unify the ERROR[12] to one method only ERROR
2009-03-09 Jiri Olsa
* minor attribute changes
2009-03-08 Jiri Olsa
* adding cscope support
2009-03-08 Jiri Olsa
* adding Makefile support for checking prefix and CFLAGS changes
(stolen from git sources)
2009-03-07 Jiri Olsa
* introducing asciidoc man page, needs more formatting changes...
2009-03-06 Jiri Olsa
* added -F option to disable fork following
* added -E option to disable exec following
2009-03-05 Jiri Olsa
* added -T option to hide thread id
2009-03-05 Jiri Olsa
* x86_64 - fixed argument display (fixed glibc bug 9893,
not sure when the glibc fix will be available,
need to consider the option availibility before next
release
-------------------------------------------------------------------------------
latrace 0.5.4
2009-02-28 Jiri Olsa
* release notes for 0.5.4
* man page update
2009-02-28 Jiri Olsa
* x86_64 code refactoring
* introduced glibc bug 9893, and disabled 'AaD' options because of that
updated man page with this info
* added more functions to the test1.c
* removed i386 link as it was useless
2009-02-16 Jiri Olsa
* Akos Pasztory
* License changes applied and better description in debian/control.
Made debian/rules executable.
2009-02-16 Jiri Olsa
* licensed under GPLv3 - more changes
2009-02-14 Jiri Olsa
* licensed under GPLv3
2009-02-05 Jiri Olsa
* Akos Pasztory
* initial Debian packaging
2009-02-05 Jiri Olsa
* Akos Pasztory
* ARM EABI argument extraction support
2009-02-05 Jiri Olsa
* Akos Pasztory
* added a test program
* Jiri Olsa - fixed x86 structure walkthrough
2009-02-05 Jiri Olsa
* Akos Pasztory
* support for additional POD types
* Added support for `short', `float', `double', `llong' and `u_llong'
(the last two are `long long's).
* Jiri Olsa - added ARGS_SPRINTF macro, to have code only on one place
and small Makefile bugfix
2009-02-02 Jiri Olsa
* Akos Pasztory
* Ignore `const' and `extern' in config files
Make it easier to reuse ordinary .h files (though
it's still far away).
2009-02-02 Jiri Olsa
* Akos Pasztory
* Made it compile in Scratchbox
- works with an older `install' program that doesn't recognize `-t'
- treat i.86 as i686
* configuration files are installed into $(sysconfdir); the program
now honors this setting at runtime
2008-12-28 Jiri Olsa
* code style changes
-------------------------------------------------------------------------------
latrace 0.5.3
2008-12-12 Jiri Olsa
* minor code style changes
2008-12-10 Jiri Olsa
* minor code style changes
* adding release notes for 0.5.3
2008-12-10 Jiri Olsa
* x86_64 - finished the case of returning structure by value,
x86_64 argument display support is now complete.. bugs expected :)
2008-12-10 Jiri Olsa
* x86_64 - support for structure passed by value in function arguments
still missing support for the same in the function return value
2008-12-10 Jiri Olsa
* x86_64 now working except for the structure detailed output
2008-12-07 Jiri Olsa
* complete redesign of the args <-> stack modules communication
to be able to manage other ABI platforms properly
2008-12-03 Jiri Olsa
* added support for objsearch LD_AUDIT interface (-L option)
2008-12-01 Jiri Olsa
* added -b option to display flow only below requested symbols
* man page updated
2008-11-28 Jiri Olsa
* minors to make autoreconf work, suggested by Nix
2008-11-26 Jiri Olsa
* x86_64 - removed 'cCp' options support because of the glibc bug #7055
2008-11-25 Jiri Olsa
* x86_64, args, output - minor fixes
2008-11-24 Jiri Olsa
* x86_64 - initial changes for argument values display (works
for integer and pointers) need updates for arguments
passed/returned by value
2008-11-22 Jiri Olsa
* arch specific code redesign (x84, x86_64)
x86 working, x86_64 compiles
* doc/latrace.1.in - minor change
2008-11-16 Jiri Olsa
* added generated date to the man page
* minor code style changes
2008-11-14 Jiri Olsa
* ./ChangeLog - added change log
-------------------------------------------------------------------------------
latrace 0.5.2
latrace-0.5.11.orig/package/ 0000755 0000000 0000000 00000000000 11620247171 012432 5 ustar latrace-0.5.11.orig/package/debian/ 0000755 0000000 0000000 00000000000 11620260100 013637 5 ustar latrace-0.5.11.orig/package/debian/control 0000644 0000000 0000000 00000001404 11620260100 015241 0 ustar Source: latrace
Section: utils
Priority: optional
Maintainer: Riku Voipio
Standards-Version: 3.9.1
Homepage: http://people.redhat.com/jolsa/latrace/index.shtml
Build-Depends: flex, bison, autoconf, debhelper (>=8),
asciidoc, xmlto, docbook-xsl, docbook-xml
Package: latrace
Architecture: i386 amd64 armel armhf
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: traces library calls in dynamically linked programs
latrace (similar to ltrace) displays dynamic library calls of a program
using the LD_AUDIT feature of newer glibc versions. It is also capable to
measure and display various statistics of dynamic calls. If a config file
is provided, latrace will display function arguments with detailed output
for structures.
latrace-0.5.11.orig/package/debian/copyright 0000644 0000000 0000000 00000001763 11620260100 015601 0 ustar This package is derived from sources obtained at:
http://people.redhat.com/jolsa/latrace/index.shtml
Debian packaging by Akos PASZTORY .
Redone by Riku Voipio .
Copyright (c) 2008-2011 Jiri Olsa
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Under Debian systems /usr/share/common-licenses/GPL-3
contains the full text of the license.
latrace-0.5.11.orig/package/debian/compat 0000644 0000000 0000000 00000000002 11620260100 015035 0 ustar 8
latrace-0.5.11.orig/package/debian/rules 0000755 0000000 0000000 00000000363 11620260100 014721 0 ustar #!/usr/bin/make -f
clean:
dh_testdir
$(MAKE) clean
rm -f LATRACE-CFLAGS configure config.status config.log
dh_clean
override_dh_auto_configure:
autoconf
./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib/latrace
%:
dh $@
latrace-0.5.11.orig/package/debian/changelog 0000644 0000000 0000000 00000000731 11620260100 015512 0 ustar latrace (0.5.11-1) unstable; urgency=low
* New upstream version
-- Riku Voipio Tue, 09 Aug 2011 18:14:03 +0300
latrace (0.5.10-1) unstable; urgency=low
* Repackage and modernize
* Initial upload to debian Closes: #605378
-- Riku Voipio Mon, 23 May 2011 11:50:52 +0300
latrace (0.5.7-1) unstable; urgency=low
* Packaged again.
-- Akos PASZTORY Wed, 24 Feb 2010 23:57:07 +0200
latrace-0.5.11.orig/package/rpm/ 0000755 0000000 0000000 00000000000 11565510552 013234 5 ustar latrace-0.5.11.orig/package/rpm/latrace.spec 0000644 0000000 0000000 00000002141 11565510552 015521 0 ustar Name: latrace
Version: 0.5.9
Release: 1%{?dist}
Summary: LD_AUDIT feature frontend for glibc 2.4+
Group: Development/Debuggers
License: GPLv3+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://people.redhat.com/jolsa/latrace
Source: http://people.redhat.com/jolsa/latrace/dl/%{name}-%{version}.tar.bz2
ExclusiveArch: %{ix86} x86_64 arm
BuildRequires: autoconf bison asciidoc xmlto binutils-devel
%description
allows you to trace library calls and get their statistics in a
manner similar to the strace utility (syscall tracing)
%prep
%setup -q
%build
autoconf
%configure
make V=1
%install
rm -rf %{buildroot}
make install ROOTDIR=%{buildroot} V=1
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc README ReleaseNotes TODO COPYING
%config(noreplace) %{_sysconfdir}/*
%{_libdir}/libltaudit.so.%{version}
%{_bindir}/latrace
%{_bindir}/latrace-ctl
%{_mandir}/man1/*
%changelog
* Tue May 11 2010 Jiri Olsa 0.5.9-1
- updated to new version
latrace-0.5.11.orig/TODO 0000644 0000000 0000000 00000002217 11620260065 011526 0 ustar
latrace TODO - feel free to contact me with any feature ideas
-------------------------------------------------------------
olsajiri@gmail.com
for 0.5.12
- document the config file usage
- testing/fixing bugs
- config - arrays in structures
- add mask enum support (ORed values)
- add support for display number at different bases (2,8,10,16)
- variable lenght argument output (printf like)
- config - long/float/double support
- config - X symbols config file
- runtime configuration control
- segfault handling support (libSegFault.so loading support)
- statistics for recursive calls
- automated tests
- other LD_AUDIT interface functions utilization
- statistics check
bugs
- make waiting for child exit more robust (suspend/continue...)
- library settings does not work properly
- testing, segfaults with skype (test with simple LD_AUDIT lib)
- test statistics counts
- fifo reading more inteligent
- detailed arguments buffer memory management (now fixed size)
- environment variables to the include path
- check we dont cross all the hardcoded limits
- consolidate leveled VERBOSE output
- info doc (produce html, pdf... outputs)
latrace-0.5.11.orig/ReleaseNotes 0000644 0000000 0000000 00000012321 11620260065 013347 0 ustar
latrace release notes (olsajiri@gmail.com)
-------------------------------------------------------------------------------
[x] latrace 0.5.11 (7/25/2011)
* enhancing names check with *-logic for
"-l -t -f -s -n -b" options
* moving conf header files to new location + rename s/conf/h/
* adding support for configuration file
* global symbol handling
one global symbol tree to rule them all
- only one tree is searched during the plt entry/exit
- symbols are added during the bind audit callback
* adding automated test support, so far for x86 and x86_64,
others are disabled.
* adding SIGTERM/SIGINT handlers,
refactoring lt_run to check the latrace got killed
* adding large file support
* make tracer return actual tracee status
* several fixies
- fix display of char arguments
- add threads fifo management to special directory
so the notification is not affected by other files
- fix memory leak in the argument display code
- fix controled config bug - missing shared config assignment
- fixed errors discovered by cppcheck
- build fix for ARM
- args - use isprint to decide whether to print the character,
force test.sh to use bash,
enable tests for ARM architecture
- args - replacing destination strings with void pointers
* thanks to the following for patches:
Dr. David Alan Gilbert
Sebastian Pipping
Artur Skawina
[x] latrace 0.5.10 (10/13/2010)
* added '-n' option, allowing to omit tracing certain symbols
* adding stack limits dynamic check (fixing several SIGSEGV issues)
- enabled by default, disable by new '-Y' option
* several fixies
- synchronize --no-* option names
- changed config file magic defines
- separate arguments display code, so it could be
disabled for not supported architectures
- updating license info
- fixing output for thread applications
proper tid displayed for pipe mode
proper indentation for pipe mode
- changing permissions of libltaudit.so to 755
[x] latrace 0.5.9 (5/14/2010)
* fix autoconf search for iberty lib
* refactoring sysdep configuration (fix for BZ#586210)
[x] latrace 0.5.8 (4/19/2010)
* controled config
* added support for enum string refference definition
* several fixies
- fixed enum handling (strtol failure)
- liberty controled by autoconf now
- added clone function
- added support for pipe mode timestamp display
- added snapshot/release targets
- added checks for asciidoc and xmlto
- added check for liberty-pic
- updated .gitignore
- shlib doesn't need to be executable
- added Debian packaging
- relaxed binutils-dev dependency
- generate conffiles automatically
- debian pkg docbook-xsl and docbook-xml
[x] latrace 0.5.7 (9/4/2009)
* added '-B' option to always display the { } around the symbol body
* added C++ demangling support - "-d" option
[x] latrace 0.5.6 (7/6/2009)
* Fedora rpm package release
* several minor fixies:
- added support pointers in typedef
- fixed minor bug for pointer output
- added more checks to configure.ac
- make mrproper real propper
- added DESTDIR makefile support
[x] latrace 0.5.5 (4/25/2009)
x added enum support
x added -F option to disable fork following
x added -E option to disable exec following
x added -T option to hide thread id
x x86_64 - added 'pcC' options , since it looks
glibc bug 7055 got fixed somehow
x x86_64 - fixed argument display (fixed glibc bug 9893,
not sure when the glibc fix will be available 2.10?)
x stats - added -C sym, fixed -C lib
x confs - added syscall.conf (x86_64), mman.conf, resource.conf
x asciidoc man/html/txt
[x] latrace 0.5.4 (3/2/2009)
x ARM support (EABI)
x added config file support for 'float', 'double',
'long long' and 'unsigned long long'
x licensed under GPLv3
x initial Debian packaging
x ignore 'const' and 'extern' in config files
Make it easier to reuse ordinary .h files (though
it's still far away).
x configuration files are installed into $(sysconfdir);
x x86_64 - disabled argument display (options 'AaD'),
because of the glibc bug 9893
x x86 - structure display fix
[x] latrace 0.5.3 (12/12/2008)
x x86_64 full support
x autoreconf compliant
x new '-b' option to display flow only below requested symbols
x new '-L' option to support objsearch LD_AUDIT interface
x bug fixes
[x] latrace 0.5.2 (11/12/2008)
x bug fixes
[x] latrace 0.5.1 (10/26/2008)
x C like syntax for the config file - typedef/struct/functions (bison/flex)
x optional detailed output for structures (by ptr and value)
x documentation - doc/expl in the man page
[x] latrace 0.5 (7/7/2008)
x display arguments values
x compile on x86_64
[x] latrace 0.4 (6/13/2008)
x multithread counts support
x separate verbose and debug ouput
x runtime for each thread
x stats - reallocation for symbol hashtable
x documentation - initial latrace man page
[x] latrace 0.3 (6/7/2008)
x separate verbose logging
x indent size configurable
x sort counts by user parameter (calls, %, library)
x output to file
x more statistics counts, time spent in call
[x] latrace 0.2 (5/26/2008)
x statistics (like strace -c)
x looking for programs in PATH, not just absolute path
x symbols deep indentation
[x] latrace 0.1 (5/18/2008)
x config symbols to audit
x config libraries to audit
latrace-0.5.11.orig/README 0000644 0000000 0000000 00000001565 11565510552 011732 0 ustar
latrace LD_AUDIT 2.4+ libc frontend - done by Jiri Olsa (olsajiri@gmail.com)
-------------------------------------------------------------------------------
---[ Installation ]
To install latrace under /usr use following commands
autoconf
./configure --prefix=/usr --sysconfdir=/etc
make
su
# set ROOTDIR or DESTDIR to you alternative root, if you dont want '/'
make install
---[ Documentation ]
All needed documentation is in the man page, after install run:
man latrace
---[ Author ]
This package is Copyright (C) 2008,2009 Jiri Olsa, and is being distributed
under the terms of the GPLv3 license. For more details, see the file
`doc/COPYING'.
You can contact me by email at olsajiri@gmail.com.
The latrace homepage is:
http://latrace.sf.net
Credit is also due to:
Nix
Akos Pasztory
latrace-0.5.11.orig/test/ 0000755 0000000 0000000 00000000000 11620260065 012013 5 ustar latrace-0.5.11.orig/test/lib-test-libsym3.c 0000644 0000000 0000000 00000000132 11620260065 015256 0 ustar void test_libsym3_1(void) { }
void test_libsym3_2(void) { }
void test_libsym3_3(void) { }
latrace-0.5.11.orig/test/lib-test-args.c 0000644 0000000 0000000 00000005425 11620260065 014642 0 ustar
char test_char_1(char a)
{
return 'd';
}
char test_char_2(char a, char b)
{
return 0xf6;
}
char test_char_3(char a, char b, char c)
{
return 0xf7;
}
char test_char_4(char a, char b, char c, char d)
{
return 0xc9;
}
char test_char_5(char a, char b, char c, char d, char e)
{
return 0x2;
}
char test_char_6(char a, char b, char c, char d, char e, char f)
{
return 'c';
}
char test_char_7(char a, char b, char c, char d, char e, char f, char g)
{
return 0x19;
}
char test_char_8(char a, char b, char c, char d, char e, char f, char g, char h)
{
return '9';
}
char test_char_9(char a, char b, char c, char d, char e, char f, char g, char h, char i)
{
return 0xd0;
}
short test_short_1(short a)
{
return -100;
}
short test_short_2(short a, short b)
{
return 30;
}
short test_short_3(short a, short b, short c)
{
return -8;
}
short test_short_4(short a, short b, short c, short d)
{
return 2097;
}
short test_short_5(short a, short b, short c, short d, short e)
{
return 1583;
}
short test_short_6(short a, short b, short c, short d, short e, short f)
{
return -25344;
}
short test_short_7(short a, short b, short c, short d, short e, short f, short g)
{
return -19;
}
short test_short_8(short a, short b, short c, short d, short e, short f, short g, short h)
{
return 3134;
}
short test_short_9(short a, short b, short c, short d, short e, short f, short g, short h, short i)
{
return -2482;
}
int test_int_1(int a)
{
return -100;
}
int test_int_2(int a, int b)
{
return 30;
}
int test_int_3(int a, int b, int c)
{
return -8;
}
int test_int_4(int a, int b, int c, int d)
{
return 200997;
}
int test_int_5(int a, int b, int c, int d, int e)
{
return -2144725863;
}
int test_int_6(int a, int b, int c, int d, int e, int f)
{
return -1223446720;
}
int test_int_7(int a, int b, int c, int d, int e, int f, int g)
{
return -19;
}
int test_int_8(int a, int b, int c, int d, int e, int f, int g, int h)
{
return 214322534;
}
int test_int_9(int a, int b, int c, int d, int e, int f, int g, int h, int i)
{
return -2482;
}
long test_long_1(long a)
{
return -a;
}
long test_long_2(long a, long b)
{
return a * b;
}
long test_long_3(long a, long b, long c)
{
return a * b * c;
}
long test_long_4(long a, long b, long c, long d)
{
return a * b * c * d;
}
long test_long_5(long a, long b, long c, long d, long e)
{
return a * b * c * d * e;
}
long test_long_6(long a, long b, long c, long d, long e, long f)
{
return a * b * c * d * e * f;
}
long test_long_7(long a, long b, long c, long d, long e, long f, long g)
{
return a * b * c * d * e * f * g;
}
long test_long_8(long a, long b, long c, long d, long e, long f, long g, long h)
{
return 0;
}
long test_long_9(long a, long b, long c, long d, long e, long f, long g, long h, long i)
{
return a * b * c * d * e * f * g * h * i;
}
latrace-0.5.11.orig/test/test.sh 0000755 0000000 0000000 00000000313 11620260065 013326 0 ustar #!/bin/bash
# Force locale to ensure we always get the same output
export LC_ALL=C
. $PWD/test/script/functions.sh
TEST test_args
TEST test_common
TEST test_tty_output
TEST test_kill
TEST test_libsym
latrace-0.5.11.orig/test/test1.c 0000644 0000000 0000000 00000013717 11565510552 013237 0 ustar #if 0
# Copyright (C) 2009 Akos Pasztory
#
# This file is part of the latrace.
#
# The latrace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The latrace 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the latrace (file COPYING). If not, see
# .
b="${0%.c}";
cc -Wall -g -shared -fPIC -DTHE_SO -DTHE_CONFIG $0 -o "$b.so";
cc -Wall -g -DTHE_APP -DTHE_CONFIG -Wl,-rpath . "$b.so" $0 -o "$b.bin";
cpp -P -DTHE_CONFIG $0 > "$b.conf";
latrace -a "$b.conf" -D "./$b.bin" | less;
exit 0;
#endif
#if defined(THE_APP) || defined(THE_SO)
#include
typedef unsigned long long u_llong;
typedef long long llong;
#endif
#ifdef THE_CONFIG
struct st1 {
char a; char b;
};
struct st2 {
int a; int b; int c; int d;
};
struct st3 {
int a; int b; int c; int d; int e; int f;
};
struct st4 {
int x; char y; int z;
};
struct st5 {
short a; int b; char c; int d; short e; char f; int g; char h; char i; short j; int k;
};
struct st6 {
char a; double b; short c; float d;
};
struct st7 {
double a;
};
struct st8 {
double a; char b; int c;
};
extern void a1(char x);
void a2(short x);
void a3(int x);
void a4(llong x);
void b1(char x, int y);
void b2(int x, char y);
void b3(int x, int y, int z, int q, int xx, int yy);
struct st3 c1(int x);
const struct st3 *c2(int x, char y, double z);
char c3(int x, double y, char z);
struct st1 c4(int x, double y);
struct st7 c5(double x, double y);
struct st8 c6(float x, double y);
struct st4 c7(char x, long b);
u_llong d1(void);
void d2(u_llong x);
void d3(int a, u_llong x);
void d4(struct st3 x);
void d5(char a, int y, struct st3 x);
double d6(char a, int y);
int l1(int x);
int l2(int x, int y);
int l3(int x, int y, int z);
int l4(int x, int y, int z, int q);
int l5(int x, int y, int z, int q, int xx);
int l6(int x, int y, int z, int q, int xx, int yy);
int l7(int x, int y, int z, int q, int xx, int yy, int zz);
int l8(int x, int y, int z, int q, int xx, int yy, int zz, int qq);
void s1(struct st1 x);
void s1p(struct st1 *x);
void s2(struct st2 x);
void s3(struct st3 x);
void s4(struct st4 x);
void s5(struct st5 x);
void s6(struct st6 x);
struct st1 r1(void);
struct st3 r3(void);
struct st4 r4(void);
void q1(int x, struct st1 y);
void q2(int x, char y, struct st1 z);
void q3(int x, int y, struct st2 z);
void q4(int x, int y, struct st4 z);
void q5(int x, int y, char z, char q, struct st4 w);
int real1(const char *w);
void real2(void);
#endif
#if defined(THE_APP) || defined(THE_SO)
static struct st1 sx = {'a', 'b'};
static struct st2 sy = {10, 20, 30, 40};
static struct st3 sz = {10, 20, 30, 40, 50, 60};
static struct st4 sq = {10, 'x', 30};
static struct st5 sa = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
static struct st6 sb = {1, 2, 3, 4};
#endif
#ifdef THE_SO
void real2(void) { puts("i am beta"); }
int real1(const char *w) { puts(w); real2(); return 3; }
u_llong d1(void) { return 1LL + (1LL << 32); }
void d2(u_llong x) { x;}
void d3(int a, u_llong x) { a+x;}
void d4(struct st3 x) { x; }
void d5(char c, int y, struct st3 x) { x; }
double d6(char a, int y) { return 1.0; }
struct st3 c1(int x)
{
static struct st3 e = {5,6,7,8,9,10};
return e;
}
const struct st3 *c2(int x, char y, double z)
{
static struct st3 e = {5,6,7,8,9,10};
return &e;
}
char c3(int x, double y, char z)
{
return z+1;
}
struct st1 c4(int x, double y)
{
struct st1 p = { 'x', 'y' };
return p;
}
struct st7 c5(double x, double y)
{
struct st7 p = { 1 };
return p;
}
struct st8 c6(float x, double y)
{
struct st8 p = { 1, 'w', 0x10 };
return p;
}
struct st4 c7(char x, long b)
{
struct st4 p = { 1, 'a', 2 };
return p;
}
int l1(int x) { return 2*x; }
int l2(int x, int y) { return 3*y; }
int l3(int x, int y, int z) { return x+y+z; }
int l4(int x, int y, int z, int q) { return x+y+z; }
int l5(int x, int y, int z, int q, int xx) { return x+y+z; }
int l6(int x, int y, int z, int q, int xx, int yy) { return x+y+z; }
int l7(int x, int y, int z, int q, int xx, int yy, int zz) { return x+y+z; }
int l8(int x, int y, int z, int q, int xx, int yy, int zz, int qq) { return x+y+z; }
void a1(char x) {}
void a2(short x) {}
void a3(int x) {}
void a4(llong x) {}
void b1(char x, int y) {}
void b2(int x, char y) {}
void b3(int x, int y, int z, int q, int xx, int yy) {}
void s1(struct st1 x) {}
void s1p(struct st1 *x) {}
void s2(struct st2 x) {}
void s3(struct st3 x) {}
void s4(struct st4 x) {}
void s5(struct st5 x) {}
void s6(struct st6 x) {}
struct st1 r1(void) { return sx; }
struct st3 r3(void) { return sz; }
struct st4 r4(void) { return sq; }
void q1(int x, struct st1 y) {}
void q2(int x, char y, struct st1 z) {}
void q3(int x, int y, struct st2 z) {}
void q4(int x, int y, struct st4 z) {}
void q5(int x, int y, char z, char q, struct st4 w) {}
#endif
#ifdef THE_APP
int main(void)
{
static const struct st3 a = {1, 2, 3, 4, 5, 6};
l1(100);
l2(100, 200);
l3(100, 200, 300);
l4(100, 200, 300, 400);
l5(100, 200, 300, 400, 500);
l6(100, 200, 300, 400, 500, 600);
l7(100, 200, 300, 400, 500, 600, 700);
l8(100, 200, 300, 400, 500, 600, 700, 800);
d1();
d2(43);
d3(100, 200);
d4(a);
d5('a', 43, a);
d6('a', 1);
c1(44);
c2(100, 'a', 3.4);
c3(200, 2.777, 'q');
c4(200, 1);
c5(1.1, 2.2);
c6(1.23, 45.6);
c7('z', 0x200);
a1('a');
a2(10);
a3(20);
a4(102030405060LL);
b1('a', 20);
b2(30, 'b');
b3(10, 20, 30, 40, 50, 60);
s1(sx);
s1p(&sx);
s2(sy);
s3(sz);
s4(sq);
s5(sa);
s6(sb);
r1();
r3();
r4();
q1(200, sx);
q2(300, 't', sx);
q3(400, 410, sy);
q4(500, 510, sq);
q5(600, 610, 'z', 'q', sq);
real1("fresh air");
real2();
return 0;
}
#endif
latrace-0.5.11.orig/test/test-lib.h 0000644 0000000 0000000 00000002463 11620260065 013714 0 ustar #ifndef TEST_LIB
#define TEST_LIB
#include
#include
struct lt_config_shared *config_init(void);
void config_clear(struct lt_config_shared *sh);
int fout_read(struct lt_config_shared *sh, char *buf, int size);
enum {
RE_TEST_TYPE_STR = 1,
RE_TEST_TYPE_INT = 2,
RE_TEST_TYPE_PID = 3,
};
enum {
RE_TEST_OFF_UNDEF = -1,
};
enum {
RE_TEST_OK = -1,
};
struct re_test_data {
int type;
int so;
int eo;
char *pat;
};
int re_test(char *line, struct re_test_data *data, int cnt);
#define TEST_START() sh->disabled = 0
#define TEST_STOP() sh->disabled = 1
#define PASSED() \
do { \
printf("."); \
fflush(NULL); \
} while(0)
#define FAILED(fmt, args...) \
do { \
char lpbuf[1024]; \
sprintf(lpbuf, "%s:%d failed - %s", \
__FUNCTION__, \
__LINE__, \
fmt); \
printf(lpbuf, ## args); \
fflush(NULL); \
exit(-1); \
} while(0)
#define TEST(testfn) \
do { \
if (testfn(sh)) { \
printf("FAILED %s\n", #testfn); \
return -1; \
} \
} while(0)
#define BUFSIZE 1000
#define LOCAL_TEST(data, cnt, test) \
do { \
char buf[BUFSIZE]; \
int ret; \
TEST_START(); \
test; \
TEST_STOP(); \
ret = fout_read(sh, buf, BUFSIZE); \
if (!ret) \
return -1; \
ret = re_test(buf, data, cnt); \
if (RE_TEST_OK != ret) \
FAILED("test %i, pattern '%s'\n", ret, data[ret].pat); \
} while(0)
#endif
latrace-0.5.11.orig/test/test-args.h 0000644 0000000 0000000 00000000411 11620260065 014071 0 ustar #ifndef TEST_ARGS_H
#define TEST_ARGS_H
#include
#include
#include
#define CONFIG_CLEAR_ARGS(sh) \
do { \
config_clear(sh); \
sh->args_enabled = 1; \
sh->hide_tid = 1; \
} while(0)
#endif /* TEST_ARGS_H */
latrace-0.5.11.orig/test/test-common.c 0000644 0000000 0000000 00000003165 11620260065 014431 0 ustar
#include
#include "test/test-lib.h"
#include
extern void test_common_f1(void);
extern void test_common_args_ptrlen(char *ptr);
#define BUFSIZE 1000
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
static int test_function(struct lt_config_shared *sh)
{
char buf[BUFSIZE];
int ret;
struct re_test_data data[] = {
{ RE_TEST_TYPE_PID, 1, -1, "[0-9]+" },
{ RE_TEST_TYPE_STR, -1, -1, "test_common_f1" },
{ RE_TEST_TYPE_STR, -1, -1, "\\[.*lib-test-common.so\\]" }
};
config_clear(sh);
TEST_START();
test_common_f1();
TEST_STOP();
ret = fout_read(sh, buf, BUFSIZE);
if (!ret)
return -1;
ret = re_test(buf, data, DATA_CNT());
if (RE_TEST_OK != ret)
FAILED("test %i, pattern '%s'\n", ret, data[ret].pat);
PASSED();
return 0;
}
static int test_args_ptrlen(struct lt_config_shared *sh)
{
char buf[BUFSIZE];
int ret;
struct re_test_data data[] = {
{ RE_TEST_TYPE_PID, 1, -1, "[0-9]+" },
{ RE_TEST_TYPE_STR, -1, -1, " test_common_args_ptrlen\\(ptr = \\(0x[0-9a-z]+, 5\\) \"krava\"\\)" },
{ RE_TEST_TYPE_STR, -1, -1, "\\[.*lib-test-common.so\\]" }
};
config_clear(sh);
sh->args_string_pointer_length = 1;
sh->args_enabled = 1;
TEST_START();
test_common_args_ptrlen("krava");
TEST_STOP();
ret = fout_read(sh, buf, BUFSIZE);
if (!ret)
return -1;
ret = re_test(buf, data, DATA_CNT());
if (RE_TEST_OK != ret)
FAILED("test %i, pattern '%s'\n", ret, data[ret].pat);
PASSED();
return 0;
}
int main(int argc, char **argv)
{
struct lt_config_shared *sh;
sh = config_init();
if (!sh)
return -1;
TEST(test_function);
TEST(test_args_ptrlen);
return 0;
}
latrace-0.5.11.orig/test/test-lib.c 0000644 0000000 0000000 00000007036 11620260065 013710 0 ustar
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
static struct lt_config_shared *get_config(char *config_dir)
{
struct lt_config_shared* sh;
int page = sysconf(_SC_PAGE_SIZE);
int fd, len;
char config_file[LT_MAXFILE];
snprintf(config_file, LT_MAXFILE, "%s/config", config_dir);
if (-1 == (fd = open(config_file, O_RDWR))) {
perror("open failed");
return NULL;
}
/* align the shared config length */
len = sizeof(struct lt_config_shared);
len = (len + page) & ~(page - 1);
sh = mmap(NULL, len,
PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0);
if ((void *) -1 == sh) {
perror("mmap failed");
return NULL;
}
sh->sh = sh;
return sh;
}
static int fout_init(struct lt_config_shared *sh, char *config_dir)
{
char output_file[LT_MAXFILE];
FILE *file;
snprintf(output_file, LT_MAXFILE, "%s/test-output", config_dir);
file = fopen(output_file, "w+");
if (!file) {
perror("fopen failed");
return -1;
}
sh->fout = file;
return 0;
}
int fout_read(struct lt_config_shared *sh, char *buf, int size)
{
FILE *file = sh->fout;
/* XXX ugly, but I could not get work pipe/fifo with
* streams.. maybe to get rid of streams completely
* would be the solution */
bzero(buf, size);
rewind(file);
fread(buf, size, 1, file);
rewind(file);
ftruncate(fileno(file), 0);
return strlen(buf);
}
struct lt_config_shared *config_init(void)
{
struct lt_config_shared *sh;
char *config_dir;
config_dir = getenv("LT_DIR");
if (!config_dir) {
printf("failed: could not get config dir\n");
return NULL;
}
sh = get_config(config_dir);
if (!sh)
return NULL;
if (fout_init(sh, config_dir))
return NULL;
sh->pipe = 0;
return sh;
}
void config_clear(struct lt_config_shared *sh)
{
sh->args_enabled = 0;
sh->args_detailed = 0;
sh->disabled = 1;
sh->verbose = 0;
sh->timestamp = 0;
sh->debug = 0;
sh->indent_sym = 0;
sh->indent_size = 0;
sh->braces = 0;
sh->demangle = 0;
sh->counts = 0;
sh->pipe = 0;
sh->hide_tid = 0;
sh->not_follow_exec = 0;
sh->not_follow_fork = 0;
sh->framesize_check = 0;
sh->framesize = 1000;
sh->pid = 0;
}
static void re_err(regex_t *re, int errcode)
{
char ebuf[BUFSIZE];
int ret;
ret = regerror(errcode, re, ebuf, BUFSIZE);
if (!ret)
return;
printf("regex failed: %s\n", ebuf);
}
int re_test(char *line, struct re_test_data *data, int cnt)
{
int i;
for(i = 0; i < cnt; i++) {
int ret;
struct re_test_data *d = &data[i];
regmatch_t m[1];
regex_t re;
unsigned long val;
memset(&re, 0x0, sizeof(re));
ret = regcomp(&re,
d->pat,
REG_EXTENDED);
if (ret) {
re_err(&re, ret);
return i;
}
ret = regexec(&re, line, 1, m, 0);
if (ret == REG_NOMATCH) {
printf("failed: did not match\n");
return i;
}
switch(d->type) {
case RE_TEST_TYPE_STR:
/* start offset check */
if (d->so != RE_TEST_OFF_UNDEF) {
if (d->so != m[0].rm_so) {
printf("failed: so mismatch %d <> %d\n",
d->so, m[0].rm_so);
return i;
}
}
/* end offset check */
if (d->eo != RE_TEST_OFF_UNDEF) {
if (d->eo != m[0].rm_eo) {
printf("failed: eo mismatch %d <> %d\n",
d->eo, m[0].rm_eo);
return i;
}
}
break;
case RE_TEST_TYPE_INT:
case RE_TEST_TYPE_PID:
val = strtoul(&line[m[0].rm_so], NULL, 10);
if (val != getpid())
return i;
break;
}
/* TODO ??? line += m[0].rm_eo; */
}
return RE_TEST_OK;
}
latrace-0.5.11.orig/test/test-args.c 0000644 0000000 0000000 00000023150 11620260065 014071 0 ustar
#include
#include
#include
static int test_char(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, 21, "test_char_1\\(a = 0x0a\\)" },
{ RE_TEST_TYPE_STR, 22, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_char_1 = 0x64 'd'" },
};
struct re_test_data data2[] = {
{ RE_TEST_TYPE_STR, 0, 31, "test_char_2\\(a = 0x0a, b = 0x14\\)" },
{ RE_TEST_TYPE_STR, 32, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_char_2 = 0xf6" },
};
struct re_test_data data3[] = {
{ RE_TEST_TYPE_STR, 0, 41, "test_char_3\\(a = 0x01, b = 0xfe, c = 0x07\\)" },
{ RE_TEST_TYPE_STR, 42, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_char_3 = 0xf7" },
};
struct re_test_data data4[] = {
{ RE_TEST_TYPE_STR, 0, 59, "test_char_4\\(a = 0x64 'd', b = 0x02, c = 0x63 'c', d = 0xff\\)" },
{ RE_TEST_TYPE_STR, 60, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_char_4 = 0xc9" },
};
struct re_test_data data5[] = {
{ RE_TEST_TYPE_STR, 0, 69, "test_char_5\\(a = 0xff, b = 0x15, c = 0x0d, d = 0x20 ' ', e = 0x79 'y'\\)" },
{ RE_TEST_TYPE_STR, 70, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_char_5 = 0x02" },
};
struct re_test_data data6[] = {
{ RE_TEST_TYPE_STR, 0, 75, "test_char_6\\(a = 0x64 'd', b = 0xc8, c = 0xd5, d = 0x0c, e = 0xc7, f = 0xf2\\)" },
{ RE_TEST_TYPE_STR, 76, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_char_6 = 0x63 'c'" },
};
struct re_test_data data7[] = {
{ RE_TEST_TYPE_STR, 0, 81, "test_char_7\\(a = 0x01, b = 0x02, c = 0x03, d = 0x04, e = 0x05, f = 0x06, g = 0x07\\)" },
{ RE_TEST_TYPE_STR, 82, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_char_7 = 0x19" },
};
struct re_test_data data8[] = {
{ RE_TEST_TYPE_STR, 0, 95, "test_char_8\\(a = 0xf5, b = 0x15, c = 0x1e, d = 0xfc, e = 0x17, f = 0x85, g = 0x46 'F', h = 0x06\\)" },
{ RE_TEST_TYPE_STR, 96, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_char_8 = 0x39 '9'" },
};
struct re_test_data data9[] = {
{ RE_TEST_TYPE_STR, 0, 109, "test_char_9\\(a = 0xf6, b = 0x01, c = 0x03, d = 0x04, e = 0x09, f = 0x63 'c', g = 0x4e 'N', h = 0xf7, i = 0x0c\\)" },
{ RE_TEST_TYPE_STR, 110, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_char_9 = 0xd0" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
CONFIG_CLEAR_ARGS(sh);
LOCAL_TEST(data1, DATA_CNT(1), test_char_1(10));
LOCAL_TEST(data2, DATA_CNT(2), test_char_2(10, 20));
LOCAL_TEST(data3, DATA_CNT(3), test_char_3(1, -2, 7));
LOCAL_TEST(data4, DATA_CNT(4), test_char_4(100, 2, 99, -1));
LOCAL_TEST(data5, DATA_CNT(5), test_char_5(-1, 21, 13, 32, 121));
LOCAL_TEST(data6, DATA_CNT(6), test_char_6(100, 200, -43, 12, 199, -14));
LOCAL_TEST(data7, DATA_CNT(7), test_char_7(1, 2, 3, 4, 5, 6, 7));
LOCAL_TEST(data8, DATA_CNT(8), test_char_8(-11, 21, 30, -4, 23, -123, 70, 6));
LOCAL_TEST(data9, DATA_CNT(9), test_char_9(-10, 1, 3, 4, 9, 99, 78, -9, 12));
PASSED();
return 0;
}
static int test_short(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, 21, "test_short_1\\(a = 100\\)" },
{ RE_TEST_TYPE_STR, 22, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_short_1 = -100" },
};
struct re_test_data data2[] = {
{ RE_TEST_TYPE_STR, 0, 28, "test_short_2\\(a = 10, b = 20\\)" },
{ RE_TEST_TYPE_STR, 29, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_short_2 = 30" },
};
struct re_test_data data3[] = {
{ RE_TEST_TYPE_STR, 0, 34, "test_short_3\\(a = 1, b = -2, c = 7\\)" },
{ RE_TEST_TYPE_STR, 35, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_short_3 = -8" },
};
struct re_test_data data4[] = {
{ RE_TEST_TYPE_STR, 0, 45, "test_short_4\\(a = 100, b = 2, c = 999, d = -1\\)" },
{ RE_TEST_TYPE_STR, 46, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_short_4 = 2097" },
};
struct re_test_data data5[] = {
{ RE_TEST_TYPE_STR, 0, 60, "test_short_5\\(a = -1, b = 21477, c = 4313, d = 100, e = 3121\\)" },
{ RE_TEST_TYPE_STR, 61, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_short_5 = 1583" },
};
struct re_test_data data6[] = {
{ RE_TEST_TYPE_STR, 0, 70, "test_short_6\\(a = 100, b = 200, c = -3543, d = 12, e = 9999, f = -1324\\)" },
{ RE_TEST_TYPE_STR, 71, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_short_6 = -25344" },
};
struct re_test_data data7[] = {
{ RE_TEST_TYPE_STR, 0, 61, "test_short_7\\(a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7\\)" },
{ RE_TEST_TYPE_STR, 62, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_short_7 = -19" },
};
struct re_test_data data8[] = {
{ RE_TEST_TYPE_STR, 0, 88, "test_short_8\\(a = -11111, b = 2143, c = 30, d = -4, e = 5123, f = -123, g = 7000, h = 76\\)" },
{ RE_TEST_TYPE_STR, 89, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_short_8 = 3134" },
};
struct re_test_data data9[] = {
{ RE_TEST_TYPE_STR, 0, 86, "test_short_9\\(a = -10, b = 1, c = 3, d = 1234, e = 9, f = 3, g = 1311, h = -99, i = 10\\)" },
{ RE_TEST_TYPE_STR, 87, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_short_9 = -2482" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
CONFIG_CLEAR_ARGS(sh);
LOCAL_TEST(data1, DATA_CNT(1), test_short_1(100));
LOCAL_TEST(data2, DATA_CNT(2), test_short_2(10, 20));
LOCAL_TEST(data3, DATA_CNT(3), test_short_3(1, -2, 7));
LOCAL_TEST(data4, DATA_CNT(4), test_short_4(100, 2, 999, -1));
LOCAL_TEST(data5, DATA_CNT(5), test_short_5(-1, 21477, 4313, 100, 3121));
LOCAL_TEST(data6, DATA_CNT(6), test_short_6(100, 200, -3543, 12, 9999, -1324));
LOCAL_TEST(data7, DATA_CNT(7), test_short_7(1, 2, 3, 4, 5, 6, 7));
LOCAL_TEST(data8, DATA_CNT(8), test_short_8(-11111, 2143, 30, -4, 5123, -123, 7000, 76));
LOCAL_TEST(data9, DATA_CNT(9), test_short_9(-10, 1, 3, 1234, 9, 3, 1311, -99, 10));
PASSED();
return 0;
}
static int test_int(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, 19, "test_int_1\\(a = 100\\)" },
{ RE_TEST_TYPE_STR, 20, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_int_1 = -100" },
};
struct re_test_data data2[] = {
{ RE_TEST_TYPE_STR, 0, 26, "test_int_2\\(a = 10, b = 20\\)" },
{ RE_TEST_TYPE_STR, 27, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_int_2 = 30" },
};
struct re_test_data data3[] = {
{ RE_TEST_TYPE_STR, 0, 32, "test_int_3\\(a = 1, b = -2, c = 7\\)" },
{ RE_TEST_TYPE_STR, 33, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_int_3 = -8" },
};
struct re_test_data data4[] = {
{ RE_TEST_TYPE_STR, 0, 46, "test_int_4\\(a = 1000, b = 2, c = 99999, d = -1\\)" },
{ RE_TEST_TYPE_STR, 47, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_int_4 = 200997" },
};
struct re_test_data data5[] = {
{ RE_TEST_TYPE_STR, 0, 66, "test_int_5\\(a = -1, b = 2147483647, c = 654313, d = 100, e = 34121\\)" },
{ RE_TEST_TYPE_STR, 67, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_int_5 = -2144725863" },
};
struct re_test_data data6[] = {
{ RE_TEST_TYPE_STR, 0, 77, "test_int_6\\(a = 100, b = 200, c = -345436543, d = 12, e = 99999999, f = -1324\\)" },
{ RE_TEST_TYPE_STR, 78, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_int_6 = -1223446720" },
};
struct re_test_data data7[] = {
{ RE_TEST_TYPE_STR, 0, 59, "test_int_7\\(a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7\\)" },
{ RE_TEST_TYPE_STR, 60, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_int_7 = -19" },
};
struct re_test_data data8[] = {
{ RE_TEST_TYPE_STR, 0, 91, "test_int_8\\(a = -11111, b = 214321543, c = 30, d = -4, e = 5123, f = -123, g = 7000, h = 76\\)" },
{ RE_TEST_TYPE_STR, 92, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_int_8 = 214322534" },
};
struct re_test_data data9[] = {
{ RE_TEST_TYPE_STR, 0, 84, "test_int_9\\(a = -10, b = 1, c = 3, d = 1234, e = 9, f = 3, g = 1311, h = -99, i = 10\\)" },
{ RE_TEST_TYPE_STR, 85, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_int_9 = -2482" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
CONFIG_CLEAR_ARGS(sh);
LOCAL_TEST(data1, DATA_CNT(1), test_int_1(100));
LOCAL_TEST(data2, DATA_CNT(2), test_int_2(10, 20));
LOCAL_TEST(data3, DATA_CNT(3), test_int_3(1, -2, 7));
LOCAL_TEST(data4, DATA_CNT(4), test_int_4(1000, 2, 99999, -1));
LOCAL_TEST(data5, DATA_CNT(5), test_int_5(-1, 2147483647, 654313, 100, 34121));
LOCAL_TEST(data6, DATA_CNT(6), test_int_6(100, 200, -345436543, 12, 99999999, -1324));
LOCAL_TEST(data7, DATA_CNT(7), test_int_7(1, 2, 3, 4, 5, 6, 7));
LOCAL_TEST(data8, DATA_CNT(8), test_int_8(-11111, 214321543, 30, -4, 5123, -123, 7000, 76));
LOCAL_TEST(data9, DATA_CNT(9), test_int_9(-10, 1, 3, 1234, 9, 3, 1311, -99, 10));
PASSED();
return 0;
}
int main(int argc, char **argv)
{
struct lt_config_shared *sh;
sh = config_init();
if (!sh)
return -1;
TEST(test_char);
TEST(test_short);
TEST(test_int);
/*
* test_long is arch specific, since long differes within x86 32 and
* 64 bits (not sure about ARM), while char/short/int are same.
* */
extern int test_long(struct lt_config_shared *sh);
TEST(test_long);
return 0;
}
latrace-0.5.11.orig/test/sysdeps/ 0000755 0000000 0000000 00000000000 11620260065 013505 5 ustar latrace-0.5.11.orig/test/sysdeps/arm/ 0000755 0000000 0000000 00000000000 11620260065 014264 5 ustar latrace-0.5.11.orig/test/sysdeps/arm/test-args.c 0000644 0000000 0000000 00000000045 11620260065 016340 0 ustar
#include
latrace-0.5.11.orig/test/sysdeps/x86_64/ 0000755 0000000 0000000 00000000000 11620260065 014443 5 ustar latrace-0.5.11.orig/test/sysdeps/x86_64/test-args.c 0000644 0000000 0000000 00000000045 11620260065 016517 0 ustar
#include
latrace-0.5.11.orig/test/sysdeps/i686/ 0000755 0000000 0000000 00000000000 11620260065 014201 5 ustar latrace-0.5.11.orig/test/sysdeps/i686/test-args.c 0000644 0000000 0000000 00000000045 11620260065 016255 0 ustar
#include
latrace-0.5.11.orig/test/lib-test-args.h 0000644 0000000 0000000 00000004173 11566455051 014660 0 ustar
#ifndef LIB_TEST_ARGS_H
#define LIB_TEST_ARGS_H
char test_char_1(char a);
char test_char_2(char a, char b);
char test_char_3(char a, char b, char c);
char test_char_4(char a, char b, char c, char d);
char test_char_5(char a, char b, char c, char d, char e);
char test_char_6(char a, char b, char c, char d, char e, char f);
char test_char_7(char a, char b, char c, char d, char e, char f, char g);
char test_char_8(char a, char b, char c, char d, char e, char f, char g, char h);
char test_char_9(char a, char b, char c, char d, char e, char f, char g, char h, char i);
short test_short_1(short a);
short test_short_2(short a, short b);
short test_short_3(short a, short b, short c);
short test_short_4(short a, short b, short c, short d);
short test_short_5(short a, short b, short c, short d, short e);
short test_short_6(short a, short b, short c, short d, short e, short f);
short test_short_7(short a, short b, short c, short d, short e, short f, short g);
short test_short_8(short a, short b, short c, short d, short e, short f, short g, short h);
short test_short_9(short a, short b, short c, short d, short e, short f, short g, short h, short i);
int test_int_1(int a);
int test_int_2(int a, int b);
int test_int_3(int a, int b, int c);
int test_int_4(int a, int b, int c, int d);
int test_int_5(int a, int b, int c, int d, int e);
int test_int_6(int a, int b, int c, int d, int e, int f);
int test_int_7(int a, int b, int c, int d, int e, int f, int g);
int test_int_8(int a, int b, int c, int d, int e, int f, int g, int h);
int test_int_9(int a, int b, int c, int d, int e, int f, int g, int h, int i);
long test_long_1(long a);
long test_long_2(long a, long b);
long test_long_3(long a, long b, long c);
long test_long_4(long a, long b, long c, long d);
long test_long_5(long a, long b, long c, long d, long e);
long test_long_6(long a, long b, long c, long d, long e, long f);
long test_long_7(long a, long b, long c, long d, long e, long f, long g);
long test_long_8(long a, long b, long c, long d, long e, long f, long g, long h);
long test_long_9(long a, long b, long c, long d, long e, long f, long g, long h, long i);
#endif /* LIB_TEST_ARGS_H */
latrace-0.5.11.orig/test/lib-test-common.c 0000644 0000000 0000000 00000000115 11620260065 015165 0 ustar
void test_common_f1(void)
{
}
void test_common_args_ptrlen(char *ptr)
{
}
latrace-0.5.11.orig/test/lib-test-libsym2.c 0000644 0000000 0000000 00000000132 11620260065 015255 0 ustar void test_libsym2_1(void) { }
void test_libsym2_2(void) { }
void test_libsym2_3(void) { }
latrace-0.5.11.orig/test/test-args-long-32.c 0000644 0000000 0000000 00000006364 11620260065 015260 0 ustar
#include
#include
int test_long(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, 27, "test_long_1\\(a = 1294967294\\)" },
{ RE_TEST_TYPE_STR, 28, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_1 = -1294967294" },
};
struct re_test_data data2[] = {
{ RE_TEST_TYPE_STR, 0, 39, "test_long_2\\(a = 123410, b = -268435455\\)" },
{ RE_TEST_TYPE_STR, 40, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_2 = -536747502" },
};
struct re_test_data data3[] = {
{ RE_TEST_TYPE_STR, 0, 38, "test_long_3\\(a = 1, b = -2, c = 234217\\)" },
{ RE_TEST_TYPE_STR, 39, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_3 = -468434" },
};
struct re_test_data data4[] = {
{ RE_TEST_TYPE_STR, 0, 55, "test_long_4\\(a = 2025479151, b = 2, c = 9119999, d = -1\\)" },
{ RE_TEST_TYPE_STR, 56, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_4 = 1786259934" },
};
struct re_test_data data5[] = {
{ RE_TEST_TYPE_STR, 0, 63, "test_long_5\\(a = -1, b = 2147483647, c = 13, d = 100, e = 34121\\)" },
{ RE_TEST_TYPE_STR, 64, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_5 = 44357300" },
};
struct re_test_data data6[] = {
{ RE_TEST_TYPE_STR, 0, 79, "test_long_6\\(a = 100, b = 102143210, c = -345436543, d = 12, e = -45, f = -1324\\)" },
{ RE_TEST_TYPE_STR, 80, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_6 = 111854720" },
};
struct re_test_data data7[] = {
{ RE_TEST_TYPE_STR, 0, 71, "test_long_7\\(a = 1, b = 24321, c = -3, d = 4, e = 432145, f = 6, g = 27\\)" },
{ RE_TEST_TYPE_STR, 72, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_7 = -666544408" },
};
struct re_test_data data8[] = {
{ RE_TEST_TYPE_STR, 0, 96, "test_long_8\\(a = -11111, b = 214321543, c = 30, d = -4, e = 51432123, f = -123, g = 7000, h = 76\\)" },
{ RE_TEST_TYPE_STR, 97, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_8 = 0" },
};
struct re_test_data data9[] = {
{ RE_TEST_TYPE_STR, 0, 93, "test_long_9\\(a = -10, b = 1, c = 3, d = 12424234, e = 9, f = 3, g = 14321311, h = -99, i = 10\\)" },
{ RE_TEST_TYPE_STR, 94, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_9 = 1488062792" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
CONFIG_CLEAR_ARGS(sh);
LOCAL_TEST(data1, DATA_CNT(1), test_long_1(1294967294));
LOCAL_TEST(data2, DATA_CNT(2), test_long_2(123410, -268435455));
LOCAL_TEST(data3, DATA_CNT(3), test_long_3(1, -2, 234217));
LOCAL_TEST(data4, DATA_CNT(4), test_long_4(2025479151, 2, 9119999, -1));
LOCAL_TEST(data5, DATA_CNT(5), test_long_5(-1, 2147483647, 13, 100, 34121));
LOCAL_TEST(data6, DATA_CNT(6), test_long_6(100, 102143210, -345436543, 12, -45, -1324));
LOCAL_TEST(data7, DATA_CNT(7), test_long_7(1, 24321, -3, 4, 432145, 6, 27));
LOCAL_TEST(data8, DATA_CNT(8), test_long_8(-11111, 214321543, 30, -4, 51432123, -123, 7000, 76));
LOCAL_TEST(data9, DATA_CNT(9), test_long_9(-10, 1, 3, 12424234, 9, 3, 14321311, -99, 10));
PASSED();
return 0;
}
latrace-0.5.11.orig/test/script/ 0000755 0000000 0000000 00000000000 11620260065 013317 5 ustar latrace-0.5.11.orig/test/script/test_tty_output.sh 0000644 0000000 0000000 00000000772 11620260065 017160 0 ustar #!/bin/bash
. $PWD/test/script/functions.sh
function tto_init
{
cat > /tmp/tto_latrace.conf < /dev/null
diff /tmp/tto_latrace.output $PWD/test/script/test_tty_output.sh
CHECK_RET
tto_cleanup
}
latrace-0.5.11.orig/test/script/test_libsym.sh 0000644 0000000 0000000 00000005511 11620260065 016213 0 ustar . $PWD/test/script/functions.sh
function tls_cleanup
{
rm -f /tmp/tls_latrace.conf
}
function test_libsym_all
{
LD_LIBRARY_PATH=$PWD ./latrace -qR $PWD/test-libsym all > /dev/null
CHECK_RET
}
function test_libsym_lib1
{
cat > /tmp/tls_latrace.conf < /dev/null
CHECK_RET
}
function test_libsym_lib2
{
cat > /tmp/tls_latrace.conf < /dev/null
CHECK_RET
}
function test_libsym_lib3
{
cat > /tmp/tls_latrace.conf < /dev/null
CHECK_RET
}
function test_libsym_lib1lib2
{
cat > /tmp/tls_latrace.conf < /dev/null
CHECK_RET
}
function test_libsym_lib2lib3
{
cat > /tmp/tls_latrace.conf < /dev/null
CHECK_RET
}
function test_libsym_lib1lib2lib3
{
cat > /tmp/tls_latrace.conf < /dev/null
CHECK_RET
}
function test_libsym_sym1
{
cat > /tmp/tls_latrace.conf < /dev/null
CHECK_RET
}
function test_libsym_sym2sym3
{
cat > /tmp/tls_latrace.conf < /dev/null
CHECK_RET
}
function test_libsym_omit_sym1
{
cat > /tmp/tls_latrace.conf < /dev/null
CHECK_RET
}
function test_libsym_omit_sym2sym3
{
cat > /tmp/tls_latrace.conf < /dev/null
CHECK_RET
}
function test_libsym
{
test_libsym_all
test_libsym_lib1
test_libsym_lib2
test_libsym_lib3
test_libsym_lib1lib2
test_libsym_lib2lib3
test_libsym_lib1lib2lib3
test_libsym_sym1
test_libsym_sym2sym3
test_libsym_omit_sym1
test_libsym_omit_sym2sym3
# TODO tests for LIBS_TO, LIBS_FROM, SYM_BELOW, SYM_NOEXIT
tls_cleanup
}
latrace-0.5.11.orig/test/script/functions.sh 0000644 0000000 0000000 00000000312 11620260065 015657 0 ustar #!/bin/bash
function CHECK_RET
{
if [ $? -ne 0 ]; then
echo " FAILED"
exit -1
else
echo -n "."
fi
}
function TEST
{
func=$1
source $PWD/test/script/$1.sh
echo -n "$1"
eval $1
echo OK
}
latrace-0.5.11.orig/test/script/test_kill.sh 0000644 0000000 0000000 00000004213 11620260065 015645 0 ustar #!/bin/bash
. $PWD/test/script/functions.sh
function tk_init
{
arg=$1
if [ x$arg == xnopipe ]; then
cat > /tmp/tk_latrace.conf < /tmp/tk_latrace.conf
fi
}
function tk_cleanup
{
rm -f /tmp/tk_latrace.conf
rm -f test-kill.expect
rm -f test-kill.out
}
function tk_wait_start
{
name=$1
while [ -z `pgrep $name` ];
do
usleep 100
done
}
function tk_wait_stop
{
pid=$1
while [ `kill -0 $pid 2> /dev/null; echo $?` == "0" ];
do
usleep 100
done
}
function test_kill_handlers
{
tk_init $1
./latrace -N /tmp/tk_latrace.conf -q $PWD/test-kill 1 > test-kill.out &
tk_wait_start test-kill
pid_latrace=$!
pid_test=`pgrep test-kill`
kill -2 $pid_latrace
tk_wait_stop $pid_latrace
tk_wait_stop $pid_test
echo -e "\nlatrace interrupted, killing child (pid $pid_test)" > test-kill.expect
echo -e "\n$PWD/test-kill finished - exited, status=0" >> test-kill.expect
diff test-kill.out test-kill.expect
CHECK_RET
}
function test_kill_nohandlers
{
tk_init $1
./latrace -N /tmp/tk_latrace.conf -q $PWD/test-kill 2 > test-kill.out &
tk_wait_start test-kill
pid_latrace=$!
pid_test=`pgrep test-kill`
kill -2 $pid_latrace
tk_wait_stop $pid_latrace
tk_wait_stop $pid_test
echo -e "\nlatrace interrupted, killing child (pid $pid_test)" > test-kill.expect
echo -e "\n$PWD/test-kill finished - killed by signal 15" >> test-kill.expect
diff test-kill.out test-kill.expect
if [ $? -ne 0 ]; then
echo "FAILED test_kill"
read
exit
fi
echo -n .
}
function test_kill_blocked
{
tk_init $1
./latrace -N /tmp/tk_latrace.conf -q $PWD/test-kill 3 > test-kill.out &
tk_wait_start test-kill
pid_latrace=$!
pid_test=`pgrep test-kill`
kill -2 $pid_latrace
tk_wait_stop $pid_latrace
tk_wait_stop $pid_test
echo -e "\nlatrace interrupted, killing child (pid $pid_test)" > test-kill.expect
echo -e "\n$PWD/test-kill finished - killed by signal 9" >> test-kill.expect
diff test-kill.out test-kill.expect
CHECK_RET
}
function test_kill
{
test_kill_handlers
test_kill_handlers nopipe
test_kill_nohandlers
test_kill_nohandlers nopipe
test_kill_blocked
test_kill_blocked nopipe
tk_cleanup
}
latrace-0.5.11.orig/test/script/test_common.sh 0000644 0000000 0000000 00000000425 11620260065 016203 0 ustar #!/bin/bash
. $PWD/test/script/functions.sh
function test_common
{
cat > /tmp/tc_latrace.conf < /dev/null
CHECK_RET
rm -f /tmp/tc_latrace.conf
}
latrace-0.5.11.orig/test/script/test_args.sh 0000644 0000000 0000000 00000000254 11620260065 015647 0 ustar #!/bin/bash
. $PWD/test/script/functions.sh
function test_args
{
LD_LIBRARY_PATH=$PWD ./latrace -qR -a $PWD/test/lib-test-args.conf ./test-args > /dev/null
CHECK_RET
}
latrace-0.5.11.orig/test/test-libsym.c 0000644 0000000 0000000 00000022003 11620260065 014430 0 ustar
#include
#include
#include
void test_libsym1_1(void);
void test_libsym1_2(void);
void test_libsym1_3(void);
void test_libsym2_1(void);
void test_libsym2_2(void);
void test_libsym2_3(void);
void test_libsym3_1(void);
void test_libsym3_2(void);
void test_libsym3_3(void);
static void test_libsym(void)
{
test_libsym1_1();
test_libsym1_2();
test_libsym1_3();
test_libsym2_1();
test_libsym2_2();
test_libsym2_3();
test_libsym3_1();
test_libsym3_2();
test_libsym3_3();
}
/* TODO
* so far following tests check for displayed output.. need
* some intelligent regex to check unwanted output is really
* not displayed */
static int test_all(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, -1, "test_libsym1_1 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_2 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_3 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_1 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_2 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_3 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_1 \\[[^]]+lib-test-libsym3.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_2 \\[[^]]+lib-test-libsym3.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_3 \\[[^]]+lib-test-libsym3.so\\]" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
config_clear(sh);
sh->hide_tid = 1;
LOCAL_TEST(data1, DATA_CNT(1), test_libsym());
PASSED();
return 0;
}
static int test_lib1(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, -1, "test_libsym1_1 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_2 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_3 \\[[^]]+lib-test-libsym1.so\\]" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
config_clear(sh);
sh->hide_tid = 1;
LOCAL_TEST(data1, DATA_CNT(1), test_libsym());
PASSED();
return 0;
}
static int test_lib2(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, -1, "test_libsym2_1 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_2 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_3 \\[[^]]+lib-test-libsym2.so\\]" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
config_clear(sh);
sh->hide_tid = 1;
LOCAL_TEST(data1, DATA_CNT(1), test_libsym());
PASSED();
return 0;
}
static int test_lib3(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, -1, "test_libsym3_1 \\[[^]]+lib-test-libsym3.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_2 \\[[^]]+lib-test-libsym3.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_3 \\[[^]]+lib-test-libsym3.so\\]" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
config_clear(sh);
sh->hide_tid = 1;
LOCAL_TEST(data1, DATA_CNT(1), test_libsym());
PASSED();
return 0;
}
static int test_lib1lib2(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, -1, "test_libsym1_1 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_2 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_3 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_1 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_2 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_3 \\[[^]]+lib-test-libsym2.so\\]" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
config_clear(sh);
sh->hide_tid = 1;
LOCAL_TEST(data1, DATA_CNT(1), test_libsym());
PASSED();
return 0;
}
static int test_lib2lib3(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, -1, "test_libsym2_1 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_2 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_3 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_1 \\[[^]]+lib-test-libsym3.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_2 \\[[^]]+lib-test-libsym3.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_3 \\[[^]]+lib-test-libsym3.so\\]" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
config_clear(sh);
sh->hide_tid = 1;
LOCAL_TEST(data1, DATA_CNT(1), test_libsym());
PASSED();
return 0;
}
static int test_lib1lib2lib3(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, -1, "test_libsym1_1 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_2 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_3 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_1 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_2 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_3 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_1 \\[[^]]+lib-test-libsym3.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_2 \\[[^]]+lib-test-libsym3.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_3 \\[[^]]+lib-test-libsym3.so\\]" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
config_clear(sh);
sh->hide_tid = 1;
LOCAL_TEST(data1, DATA_CNT(1), test_libsym());
PASSED();
return 0;
}
static int test_sym1(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_1 \\[[^]]+lib-test-libsym1.so\\]" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
config_clear(sh);
sh->hide_tid = 1;
LOCAL_TEST(data1, DATA_CNT(1), test_libsym());
PASSED();
return 0;
}
static int test_sym2sym3(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, -1, "test_libsym2_2 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_3 \\[[^]]+lib-test-libsym3.so\\]" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
config_clear(sh);
sh->hide_tid = 1;
LOCAL_TEST(data1, DATA_CNT(1), test_libsym());
PASSED();
return 0;
}
static int test_omit_sym1(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_2 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_3 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_1 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_2 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_3 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_1 \\[[^]]+lib-test-libsym3.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_2 \\[[^]]+lib-test-libsym3.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_3 \\[[^]]+lib-test-libsym3.so\\]" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
config_clear(sh);
sh->hide_tid = 1;
LOCAL_TEST(data1, DATA_CNT(1), test_libsym());
PASSED();
return 0;
}
static int test_omit_sym2sym3(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, -1, "test_libsym1_1 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_2 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym1_3 \\[[^]]+lib-test-libsym1.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_1 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym2_2 \\[[^]]+lib-test-libsym2.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_1 \\[[^]]+lib-test-libsym3.so\\]" },
{ RE_TEST_TYPE_STR, -1, -1, "test_libsym3_3 \\[[^]]+lib-test-libsym3.so\\]" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
config_clear(sh);
sh->hide_tid = 1;
LOCAL_TEST(data1, DATA_CNT(1), test_libsym());
PASSED();
return 0;
}
int main(int argc, char **argv)
{
struct lt_config_shared *sh;
char *test;
if (argc != 2)
return -1;
test = argv[1];
sh = config_init();
if (!sh)
return -1;
if (!strcmp(test, "all"))
TEST(test_all);
else if (!strcmp(test, "lib1"))
TEST(test_lib1);
else if (!strcmp(test, "lib2"))
TEST(test_lib2);
else if (!strcmp(test, "lib3"))
TEST(test_lib3);
else if (!strcmp(test, "lib1lib2"))
TEST(test_lib1lib2);
else if (!strcmp(test, "lib2lib3"))
TEST(test_lib2lib3);
else if (!strcmp(test, "lib1lib2lib3"))
TEST(test_lib1lib2lib3);
else if (!strcmp(test, "sym1"))
TEST(test_sym1);
else if (!strcmp(test, "sym2sym3"))
TEST(test_sym2sym3);
else if (!strcmp(test, "omit_sym1"))
TEST(test_omit_sym1);
else if (!strcmp(test, "omit_sym2sym3"))
TEST(test_omit_sym2sym3);
return 0;
}
latrace-0.5.11.orig/test/lib-test-libsym1.c 0000644 0000000 0000000 00000000132 11620260065 015254 0 ustar void test_libsym1_1(void) { }
void test_libsym1_2(void) { }
void test_libsym1_3(void) { }
latrace-0.5.11.orig/test/Makefile 0000644 0000000 0000000 00000002761 11620260065 013461 0 ustar
LDFLAGS+=-L.
lib-test-common.so: test/lib-test-common.o
$(QUIET_LD)$(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) -o $@ $^
lib-test-args.so: test/lib-test-args.o
$(QUIET_LD)$(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) -o $@ $^
lib-test-libsym1.so: test/lib-test-libsym1.o
$(QUIET_LD)$(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) -o $@ $^
lib-test-libsym2.so: test/lib-test-libsym2.o
$(QUIET_LD)$(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) -o $@ $^
lib-test-libsym3.so: test/lib-test-libsym3.o
$(QUIET_LD)$(CC) $(CFLAGS) -fPIC -shared $(LDFLAGS) -o $@ $^
test-common: test/test-lib.o test/test-common.o
$(QUIET_LD)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ lib-test-common.so
test-args: test/test-lib.o test/test-args.o test/sysdeps/$(CONFIG_SYSDEP_DIR)/test-args.o
$(QUIET_LD)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ lib-test-args.so
test-kill: test/test-kill.o
$(QUIET_LD)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
test-libsym: test/test-libsym.o test/test-lib.o
$(QUIET_LD)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ lib-test-libsym1.so lib-test-libsym2.so lib-test-libsym3.so
OBJS+=test/test-lib.o
PROGRAMS+=\
lib-test-args.so \
test-args
OBJS+=\
test/lib-test-args.o \
test/test-args.o \
test/sysdeps/$(CONFIG_SYSDEP_DIR)/test-args.o
PROGRAMS+=\
lib-test-common.so \
test-common
OBJS+=\
test/lib-test-common.o \
test/test-common.o
PROGRAMS+=\
lib-test-libsym1.so \
lib-test-libsym2.so \
lib-test-libsym3.so \
test-libsym
OBJS+=\
test/test-libsym.o \
test/lib-test-libsym1.o
PROGRAMS+=\
test-kill
OBJS+=\
test/test-kill.o
latrace-0.5.11.orig/test/lib-test-args.conf 0000644 0000000 0000000 00000004054 11566455051 015354 0 ustar
char test_char_1(char a);
char test_char_2(char a, char b);
char test_char_3(char a, char b, char c);
char test_char_4(char a, char b, char c, char d);
char test_char_5(char a, char b, char c, char d, char e);
char test_char_6(char a, char b, char c, char d, char e, char f);
char test_char_7(char a, char b, char c, char d, char e, char f, char g);
char test_char_8(char a, char b, char c, char d, char e, char f, char g, char h);
char test_char_9(char a, char b, char c, char d, char e, char f, char g, char h, char i);
short test_short_1(short a);
short test_short_2(short a, short b);
short test_short_3(short a, short b, short c);
short test_short_4(short a, short b, short c, short d);
short test_short_5(short a, short b, short c, short d, short e);
short test_short_6(short a, short b, short c, short d, short e, short f);
short test_short_7(short a, short b, short c, short d, short e, short f, short g);
short test_short_8(short a, short b, short c, short d, short e, short f, short g, short h);
short test_short_9(short a, short b, short c, short d, short e, short f, short g, short h, short i);
int test_int_1(int a);
int test_int_2(int a, int b);
int test_int_3(int a, int b, int c);
int test_int_4(int a, int b, int c, int d);
int test_int_5(int a, int b, int c, int d, int e);
int test_int_6(int a, int b, int c, int d, int e, int f);
int test_int_7(int a, int b, int c, int d, int e, int f, int g);
int test_int_8(int a, int b, int c, int d, int e, int f, int g, int h);
int test_int_9(int a, int b, int c, int d, int e, int f, int g, int h, int i);
long test_long_1(long a);
long test_long_2(long a, long b);
long test_long_3(long a, long b, long c);
long test_long_4(long a, long b, long c, long d);
long test_long_5(long a, long b, long c, long d, long e);
long test_long_6(long a, long b, long c, long d, long e, long f);
long test_long_7(long a, long b, long c, long d, long e, long f, long g);
long test_long_8(long a, long b, long c, long d, long e, long f, long g, long h);
long test_long_9(long a, long b, long c, long d, long e, long f, long g, long h, long i);
latrace-0.5.11.orig/test/test-args-long-64.c 0000644 0000000 0000000 00000006561 11620260065 015264 0 ustar
#include
int test_long(struct lt_config_shared *sh)
{
struct re_test_data data1[] = {
{ RE_TEST_TYPE_STR, 0, 36, "test_long_1\\(a = 1152921504606846975\\)" },
{ RE_TEST_TYPE_STR, 37, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_1 = -1152921504606846975" },
};
struct re_test_data data2[] = {
{ RE_TEST_TYPE_STR, 0, 47, "test_long_2\\(a = 123410, b = -12391243214298120\\)" },
{ RE_TEST_TYPE_STR, 48, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_2 = 1876433041361794928" },
};
struct re_test_data data3[] = {
{ RE_TEST_TYPE_STR, 0, 38, "test_long_3\\(a = 1, b = -2, c = 234217\\)" },
{ RE_TEST_TYPE_STR, 39, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_3 = -468434" },
};
struct re_test_data data4[] = {
{ RE_TEST_TYPE_STR, 0, 61, "test_long_4\\(a = 1999990880043210, b = 2, c = 9119999, d = -1\\)" },
{ RE_TEST_TYPE_STR, 62, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_4 = 7830125791102782868" },
};
struct re_test_data data5[] = {
{ RE_TEST_TYPE_STR, 0, 63, "test_long_5\\(a = -1, b = 2147483647, c = 13, d = 100, e = 34121\\)" },
{ RE_TEST_TYPE_STR, 64, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_5 = -95256576375073100" },
};
struct re_test_data data6[] = {
{ RE_TEST_TYPE_STR, 0, 91, "test_long_6\\(a = 100, b = 20432143210, c = -345436543, d = 12, e = 9999999999999, f = -1324\\)" },
{ RE_TEST_TYPE_STR, 92, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_6 = -4763653747676887424" },
};
struct re_test_data data7[] = {
{ RE_TEST_TYPE_STR, 0, 71, "test_long_7\\(a = 1, b = 24321, c = -3, d = 4, e = 432145, f = 6, g = 27\\)" },
{ RE_TEST_TYPE_STR, 72, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_7 = -20431825971480" },
};
struct re_test_data data8[] = {
{ RE_TEST_TYPE_STR, 0, 96, "test_long_8\\(a = -11111, b = 214321543, c = 30, d = -4, e = 51432123, f = -123, g = 7000, h = 76\\)" },
{ RE_TEST_TYPE_STR, 97, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_8 = 0" },
};
struct re_test_data data9[] = {
{ RE_TEST_TYPE_STR, 0, 100, "test_long_9\\(a = -10, b = 1, c = 3, d = 124321432234134, e = 9, f = 3, g = 14321311, h = -99, i = 10\\)" },
{ RE_TEST_TYPE_STR, 101, -1, "\\[.*lib-test-args.so\\] \\{" },
{ RE_TEST_TYPE_STR, -1, -1, "\\} test_long_9 = -3544365624466803272" },
};
#define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data))
CONFIG_CLEAR_ARGS(sh);
LOCAL_TEST(data1, DATA_CNT(1), test_long_1(1152921504606846975));
LOCAL_TEST(data2, DATA_CNT(2), test_long_2(123410, -12391243214298120));
LOCAL_TEST(data3, DATA_CNT(3), test_long_3(1, -2, 234217));
LOCAL_TEST(data4, DATA_CNT(4), test_long_4(1999990880043210, 2, 9119999, -1));
LOCAL_TEST(data5, DATA_CNT(5), test_long_5(-1, 2147483647, 13, 100, 34121));
LOCAL_TEST(data6, DATA_CNT(6), test_long_6(100, 20432143210, -345436543, 12, 9999999999999, -1324));
LOCAL_TEST(data7, DATA_CNT(7), test_long_7(1, 24321, -3, 4, 432145, 6, 27));
LOCAL_TEST(data8, DATA_CNT(8), test_long_8(-11111, 214321543, 30, -4, 51432123, -123, 7000, 76));
LOCAL_TEST(data9, DATA_CNT(9), test_long_9(-10, 1, 3, 124321432234134, 9, 3, 14321311, -99, 10));
PASSED();
return 0;
}
latrace-0.5.11.orig/test/test-kill.c 0000644 0000000 0000000 00000001216 11620260065 014067 0 ustar
#include
#include
static int exit_flag = 0;
static void sig_term_handler(int sig)
{
exit_flag = 1;
}
int main(int argc, char **argv)
{
int ignore = 0;
int handlers = 1;;
if (argc != 2)
return -1;
/*
* 1 - handlers
* 2 - no handlers
* 3 - ignore term/int
*/
switch(*argv[1]) {
case '1': handlers = 1; break;
case '2': handlers = 0; break;
case '3': ignore = 1; break;
default:
return -1;
}
if (handlers) {
if ((signal(SIGTERM, sig_term_handler) == SIG_ERR) ||
(signal(SIGINT, sig_term_handler) == SIG_ERR))
return -1;
}
while(!exit_flag || ignore) {
usleep(100);
}
return 0;
}
latrace-0.5.11.orig/.gitignore 0000644 0000000 0000000 00000000514 11565510552 013033 0 ustar LATRACE-CFLAGS
autom4te.cache/
config.log
config.status
configure
deps.make
doc/asciidoc.conf
doc/latrace.1
doc/latrace.html
doc/latrace.xml
latrace
libltaudit.so.0.5.7
src/args-bison.c
src/args-bison.h
src/args-bison.output
src/args-flex.c
src/autoconf.h
src/autoconf.make
*.o
debian/files
debian/stamp-build
debian/substvars
latrace-0.5.11.orig/doc/ 0000755 0000000 0000000 00000000000 11620260065 011601 5 ustar latrace-0.5.11.orig/doc/asciidoc.conf 0000644 0000000 0000000 00000000153 11566425145 014240 0 ustar [attributes]
author = Jiri Olsa
email = olsajiri@gmail.com
date = May 2011
revision = 0.5.11
latrace-0.5.11.orig/doc/latrace.txt 0000644 0000000 0000000 00000033521 11620260065 013761 0 ustar latrace(1)
==========
Jiri Olsa
NAME
----
latrace - LD_AUDIT 2.4+ libc frontend
SYNOPSIS
--------
latrace [-snltfvhiBdISbcCyYLpoaNADVTFERq] command [arg ... ]
DESCRIPTION
-----------
The latrace tracer is able to run a command and display its dynamic library calls using
a LD_AUDIT libc feature, available from libc version 2.4 onward. It is also capable
to measure and display various statistics of dynamic calls. See <>
for more details.
If the header file with functions' declarations is provided, latrace will display
functions's arguments. The header file file syntax is similar to the C language, with
several exceptions See <> for more details.
The latrace by default fully operates inside of the traced program. However
another "pipe mode" is available to move the main work to the tracer - the latrace
binary. See <> for more details.
The latrace use is similar to strace(1) and ltrace(1).
OPTIONS
-------
-l, --libs lib1[,lib2,...]::
audit from and to lib1, lib2 ...
-t, --libs-to lib1[,lib2,...]::
audit to lib1, lib2 ...
-f, --libs-from lib1[,lib2,...]::
audit from lib1, lib2 ...
-s, --sym sym1[,sym2,...]::
audit symbols sym1, sym2 ...
-n, --sym-omit sym1[,sym2,...]::
omit symbols sym1, sym2 ...
-L, --lib-subst s1[,s2,...]::
objsearch LD_AUDIT interface (See <>)
-c, --counts::
display statistics counts of symbols - implies pipe mode (see <>)
an no symbol output is displayed
-C, --sort-counts stat::
implies -c, plus sort the statistics by stat with following values:
time,per,call,ucall,lib,sym (default is call)
-p, --pipe::
use pipe to latrace process to send audit data (see <>)
-N, --conf::
config file (see <>)
-A, --enable-args::
enable arguments output (definitions from /etc/latrace.conf)
-D, --detail-args::
display struct arguments in more detail
-a, --args file::
specify arguments definition file, implies -A (without the default
definition file of course)
-y, --framesize number::
framesize for storing the stack before pltexit (default 100)
-Y, --no-framesize-check::
disable framesize check
-F, --no-follow-fork::
dont follow fork calls (childs). This is just supressing the latrace
output from new childs. The nature of the *LD_AUDIT* feature prevents to
disable it completely.
-E, --no-follow-exec::
dont follow exec calls
-S, --timestamp::
display timestamp for each symbol
-b, --flow-below sym1[,sym2,...]::
display flow for sym1, sym2 ...
-I, --no-indent-sym::
do no indent symbols based on the their stack depth
-i, --indent-sym indent_size::
indent size specification in indent_size
-B, --braces::
allways display '{' '}' for the around the symbol body
-d, --demangle::
C++ demangle symbols on the output
-T, --hide-tid::
dont display thread id
-o, --output file::
store output to file
-R, --ctl-config::
controled config feature
-q, --disable::
run with disabled auditing
-v, --verbose::
verbose output
-V, --version::
display version
-h, --help::
display help
EXAMPLES
--------
- The simplest way to run latrace is like this:
+
latrace cat
- To see the argument values specified by default config file run:
+
latrace -A cat
- Same as above but using the pipe mode to get all the end symbols printed:
+
latrace -Ap cat
- To see the argument values specified by specified config file run:
+
latrace -a latrace.conf cat
- To get output only for specified symbol (eg. read and write) run:
+
latrace -A -s read,write cat
- To get flow under the specified symbol (eg. sysconf) run:
+
latrace -b sysconf kill
- To get output only for specified library (eg. libproc) run:
+
latrace -Al libproc w
- To get symbol statistics run:
+
latrace -c ls
- To get symbol statistics sorted by time run:
+
latrace -C time ls
- To get output stored to the text file run:
+
latrace -o output.latrace ls
- To change the libkrava1.so dependency to the libkrava2.so run one of these:
+
latrace -L krava1%krava2 ex
+
latrace -L krava1~libkrava2.so ex
+
latrace -L libkrava1.so=libkrava2.so ex
[[DISCUSSION]]
DISCUSSION
----------
[[NAMESCHECK]]
NAMES CHECK
~~~~~~~~~~~
For options *"-l -t -f -s -n -b"* the *** symbol can be used to switch to the
substring search. If it is not specified, the exact search for the name is done.
Examples:
-s "*krava" checks for symbols with "krava" substring.
-s "krava" checks only for "krava" symbol
LD_AUDIT
~~~~~~~~
This is just a brief and vague description of the *LD_AUDIT* feature.
For more information look to *rtld-audit(7)* man done by Petr Baudis or study the
glibc/latrace source code. Very brief explanation follows.
The libc dynamic linker audit feature allows to trace/audit program's
symbols/libraries. The feature is enabled by the *LD_AUDIT* environment
variable. This variable must contain path to the audit shared library.
This audit library needs to follow specific interface. The interface functions
will be then called by the dynamic linker appropriatelly.
The audit library needs to export following symbols (the "la_PLTENTER" and
"la_PLTEXIT" names are architecture dependent).
"la_activity"
"la_objsearch"
"la_objopen"
"la_preinit"
"la_symbind32"
"la_symbind64"
"la_PLTENTER"
"la_PLTEXIT"
"la_objclose"
As for the latrace package the audit shared library is called libltaudit.so.
[[OBJSEARCH]]
OBJSEARCH
~~~~~~~~~
The objsearch *LD_AUDIT* interface provide means for changing traced program
shared object names/locations. The -L option argument should have
following form:
__-L s1[,s2,...]__ where sN is __src [=%~] dst__
The _src_ is the source pattern/name and _dst_ is the destination name/pattern.
[horizontal]
=:: Comparing src with the library name. If matched, replace the library name with dst.
library name - /lib/krava1.so
src - /lib/krava1.so
dst - /lib/krava2.so
final library name - /lib/krava2.so
%:: Looking for the src in the library name. If found, replace the src with dst part.
library name - /lib/krava1.so
src - krava1
dst - krava2
final library name - /lib/krava2.so
~:: Looking for the src in the library name. If found, replace the library name with dst.
library name - /lib/krava1.so
src - krava1
dst - /lib/krava2.so
final library name - /lib/krava2.so
[[PIPEMODE]]
PIPE mode
~~~~~~~~~
The *latrace* can work in two modes. The first one *native* does does the
output directly in the traced program process. The other one, *pipe* mode use
the IPC fifo mechanism to send the data from the traced process to the latrace
process. The latrace process is then responsible for the output. Using the
pipe mode you loose the traced program standard output context with printed
symbols.
By using the *pipe* mode, the latrace is not dependent on the trace program
usage/manipulation of the standard output descriptor. Also the symbol
statistics counts __-c, -C options__ use the *pipe* mode to transfer symbol
information to the latrace binary, and the latrace binary does the counts
at the end.
[[CONFIG]]
CONFIG
~~~~~~
The latrace provide possibility to enable/disable some of the options
by means of configuration file. Some of the options are linked to the
command line arguments some of them are not. When latrace starts the
global configuration file is read. This file is usually being placed
in here:
/etc/latrace.d/latrace.conf
Having default values read from this file, user can overload any of them
by command line options or by supling another config file via *-N, --conf*
option.
The configuration file syntax is roughly:
...........................................
INCLUDE
OPTIONS {
OPTION1 = VALUE
OPTION2 = YES|NO
...
OPTIONN = VALUE
}
# comment
...........................................
*Configuration file options*
HEADERS = FILE::
-a, --args
INDENT_SYM = VALUE::
-i, --indent-sym
PIPE = BOOL::
-p, --pipe
TIMESTAMP = BOOL::
-S, --timestamp
FRAMESIZE = VALUE::
-y, --framesize
FRAMESIZE_CHECK = BOOL::
-Y, --no-framesize-check
HIDE_TID = BOOL::
-T, --hide-tid
FOLLOW_FORK = BOOL::
-F, --no-follow-fork
FOLLOW_EXEC = BOOL::
-E, --no-follow-exec
DEMANGLE = BOOL::
-d, --demangle
BRACES = BOOL::
-B, --braces
ENABLE_ARGS = BOOL::
-A, --enable-args
DETAIL_ARGS = BOOL::
-D, --detail-args
OUTPUT_TTY = FILE::
- stores tracee terminal output to the file
LIBS = LIB1[,LIB2,...]::
-l, --libs
LIBS_TO = LIB1[,LIB2,...]::
-t, --libs-to
LIBS_FROM = LIB1[,LIB2,...]::
-f, --libs-from
SYM = SYM1[,SYM2,...]::
-s, --sym
SYM_OMIT = SYM1[,SYM2,...]::
-n, --sym-omit
SYM_BELOW = SYM1[,SYM2,...]::
-b, --flow-below
SYM_NOEXIT = SYM1[,SYM2,...]::
- symbols which do no run exit callback (plt_exit)
ARGS_STRING_POINTER_LENGTH = BOOL::
- function arguments - display string length and pointer value
[[HEADERS]]
HEADERS
~~~~~~
The latrace header file allows user to define symbols as an classic C
functions with arguments. Argument names will be displayed together with values
as the latrace output. The more arguments are defined, the more performance and
memory penalties should be expected.
The package is delivered with several predefined header files for the most
commonly used functions. List of the glibc header files used follows
(the list mostly follows the ltrace header files list, and author is willing to
update it according to the needs)
ctype.h dirent.h dlfcn.h fcntl.h getopt.h inet.h ioctl.h
libintl.h libio.h locale.h misc.h mman.h ncurses.h netdb.h
pthread.h pwd.h resource.h signal.h socket.h stat.h stdio.h
stdlib.h string.h syslog.h term.h termios.h time.h typedefs.h
unistd.h utmp.h wait.h
The latrace header files are usually stored under directory:
/etc/latrace.d/headers/
User can specify single header file using command line option or configuration
file. This file then can include other needed headers. As already mentioned,
the latrace config file syntax lightly follows the C language syntax. Following
part describes the latrace config file language.
- Several **POD types** (plain old data), are hardcoded in latrace. Size of those
arguments is determined by the sizeof macro. The list follows.
+
void
char u_char
short u_short
int u_int
long u_long
llong u_llong # (long long)
float double
- The *typedef* keyword allows to specify new type based on the already existing one
(POD or typedefed). Eventhough there's a way for multiple pointer layers in the type
definition (*), only one is taken.
+
..............................
typedef base_type new_type;
typedef base_type * new_type;
typedef base_type ** new_type;
..............................
- *Comments* follow the C style /\* \*/ logic.
+
++ /\* comments \*/ ++
- The *include* keyword allows to include another config file.
+
++ #include "filename"++
- The *struct* keyword allows to define the structure. The syntax folows following
grammar rules.
+
...........................................
START:: struct NAME { STRUCT_DEF };
STRUCT_DEF:: DEF | EMPTY
DEF:: NAME NAME |
NAME '*' NAME |
struct NAME NAME |
struct NAME '*' NAME
NAME:: [-0-9a-zA-Z_]+
...........................................
- The *function* definition follows following syntax (DEF and NAME are the same as
for struct definition).
+
..........................................
START:: DEF '(' ARGS ')' ';'
ARGS:: ARGS ',' DEF | DEF | EMPTY
..........................................
- The *enum* definition follows following syntax (NAME is same as for struct
definition).
+
..................................................
START:: ENUM NAME '{' ENUM_DEF '}' ';'
ENUM_DEF:: ENUM_DEF ',' ENUM_ELEM | ENUM_ELEM
ENUM_ELEM:: NAME '=' NAME | NAME
..................................................
- Example of a simple latrace config file.
+
............................................
---[ cut here ]-----------------------------
enum krava {
krava1 = 1,
krava2,
krava3 = 100
};
#include "krava.conf"
typedef u_int pid_t;
struct ex_st {
pid_t p;
int cnt;
char *name;
};
int f1(pid_t p, struct ex_st *k);
int f2(char* name, struct ex_st k, int k = krava);
struct ex_st* f3(pid_t *p, struct ex_st k);
---[ cut here ]-----------------------------
............................................
- Arrays are not supported yet, so there's no way to define some structures. For
such a structures use void* type where the structure argu- ment is passed by
pointer. If it is passed by value, there's no workaround so far (aside from
filling the structure body with POD types up to the actual length of the
structure :).
- Variable argument lists (va_list/...) are not supported yet. The function
definition needs to stop before the first variable argument list argument.
PORTS
-----
The latrace should work on any glibc system with LD_AUDIT support.
However arguments details are architecture specific and need special
support inside latrace itself.
Author is willing to port the latrace to any architecture, as long as he got an
access to corresponding system. Currently functional ports are:
[horizontal]
*x86*:: ok
*x86_64*:: ok
*arm*:: ok
BUGS
----
MANY, plz report bugs to or .
You can also visit the http://people.redhat.com/jolsa/latrace/ page to see the
latest release notes information.
LD_AUDIT related glibc bugs:
- *Bug 7055 (no longer reproducible)*
- *Bug 9893 (FIXED in 2.10)*
- *Bug 3924 (FIXED in 2.7-2)*
AUTHOR
------
Jiri Olsa
CONTRIBUTORS
------------
- Nix
- Akos Pasztory
- Artur Skawina
- Dr. David Alan Gilbert
- Sebastian Pipping
LICENSE
-------
This is free software, distributed under the *GPLv3* license.
SEE ALSO
--------
**strace(1), ltrace(1)**
latrace-0.5.11.orig/doc/asciidoc.conf.in 0000644 0000000 0000000 00000000172 11565510552 014642 0 ustar [attributes]
author = Jiri Olsa
email = olsajiri@gmail.com
date = @CONFIG_DATE@
revision = @CONFIG_VERSION@
latrace-0.5.11.orig/doc/Makefile 0000644 0000000 0000000 00000001057 11565510552 013253 0 ustar
MANMAN=doc/latrace.1
MANTXT=doc/latrace.txt
MANXML=doc/latrace.xml
MANHTML=doc/latrace.html
.PHONY: doc man htmlman
doc: $(MANMAN) $(MANHTML)
$(MANMAN): $(MANTXT)
$(QUIET_ASCIIDOC)$(ASCIIDOC) -f doc/asciidoc.conf -b docbook -d manpage -o $(MANXML) $(MANTXT)
$(QUIET_XMLTO)$(XMLTO) -o doc man $(MANXML)
$(MANHTML): $(MANTXT)
$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -d manpage --unsafe -o $(MANHTML) $(MANTXT)
clean::
$(call remove, $(MANXML) $(MANHTML) $(MANMAN))
ifneq ($(XMLTO),:)
install:: doc
$(call install,$(MANMAN),$(mandir)/man1,644)
endif
latrace-0.5.11.orig/src/ 0000755 0000000 0000000 00000000000 11620260065 011623 5 ustar latrace-0.5.11.orig/src/autoconf.h.in 0000644 0000000 0000000 00000002042 11620260065 014215 0 ustar /*
Copyright (C) 2008, 2009, 2010 Jiri Olsa
This file is part of the latrace.
The latrace is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The latrace 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the latrace (file COPYING). If not, see
.
*/
#ifndef AUTOCONF_H
/* Temporary directory prefix. */
#undef CONFIG_LT_CONFIG
/* Version define. */
#undef CONFIG_VERSION
/* Argument display support. */
#undef CONFIG_ARCH_HAVE_ARGS
/* liberty */
#undef CONFIG_LIBERTY
/* large file support */
#undef _LARGE_FILES
#undef _FILE_OFFSET_BITS
#endif
latrace-0.5.11.orig/src/args-flex.l 0000644 0000000 0000000 00000004246 11566455051 013710 0 ustar /*
Copyright (C) 2008, 2009, 2010 Jiri Olsa
This file is part of the latrace.
The latrace is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The latrace 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the latrace (file COPYING). If not, see
.
*/
%option prefix="lt_args_"
%{
#include
#include "config.h"
#include "args-bison.h"
#include "lib-include.h"
extern struct lt_include *lt_args_sinc;
%}
alphnum [-0-9a-zA-Z_]
name ({alphnum})+
filename ([-0-9a-zA-Z\./_])+
%x comment include
%%
"/*" BEGIN(comment);
[^*\n]* /* eat anything that's not a '*' */
"*"+[^*/\n]* /* eat up '*'s not followed by '/'s */
\n { lt_inc_stack(lt_args_sinc)->lineno++; }
"*"+"/" BEGIN(INITIAL);
"#include" { BEGIN(include); return INCLUDE; }
{filename} { lt_args_lval.s = strdup(lt_args_text); return FILENAME; }
"\"" { return '"'; }
\n { BEGIN(INITIAL); }
. { ; }
"extern" { ; }
"const" { ; }
<> { return END; }
"struct" { return STRUCT; }
"enum" { return ENUM; }
"typedef" { return TYPEDEF; }
{name} { lt_args_lval.s = strdup(lt_args_text); return NAME; }
"\*"+ { return POINTER; }
")" { return ')'; }
"(" { return '('; }
"}" { return '}'; }
"{" { return '{'; }
";" { return ';'; }
"," { return ','; }
"=" { return '='; }
\ { ; }
\n { lt_inc_stack(lt_args_sinc)->lineno++; }
. { ; }
%%
#ifndef yywrap
int yywrap()
{
return 1;
/* XXX not to get the compiler 'not used' warning */
yyunput(0, NULL);
input();
}
#endif
void lt_args_error(const char *m)
{
printf("header file [%s] line %d: %s\n",
lt_inc_stack(lt_args_sinc)->file,
lt_inc_stack(lt_args_sinc)->lineno,
m);
}
latrace-0.5.11.orig/src/config.c 0000644 0000000 0000000 00000042145 11620260065 013242 0 ustar /*
Copyright (C) 2008, 2009, 2010 Jiri Olsa
This file is part of the latrace.
The latrace is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The latrace 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the latrace (file COPYING). If not, see
.
*/
#include
#include
#include
#include
#include
#include "config.h"
#include "lib-include.h"
extern FILE *lt_config_in;
int lt_config_parse();
void lt_config__switch_to_buffer (YY_BUFFER_STATE new_buffer );
void lt_config__delete_buffer (YY_BUFFER_STATE b );
YY_BUFFER_STATE lt_config__create_buffer (FILE *file,int size );
static struct lt_include inc = {
.stack_idx = 0,
.create_buffer = lt_config__create_buffer,
.switch_to_buffer = lt_config__switch_to_buffer,
.delete_buffer = lt_config__delete_buffer,
.in = <_config_in,
};
int lt_config_parse_init(struct lt_config_app *cfg, struct lt_include *inc);
static void usage() NORETURN;
static void usage()
{
printf("usage: latrace [-ltfsbcCpADaoyIiBdvTFELVh] command [arg ... ]\n\n");
printf(" -l, --libs lib1,lib2... audit from and to lib1, lib2 ...\n");
printf(" -t, --libs-to lib1,lib2... audit to lib1, lib2 ...\n");
printf(" -f, --libs-from lib1,lib2... audit from lib1, lib2 ...\n");
printf(" -s, --sym sym1,sym2... audit symbols sym1, sym2 ... \n");
printf(" -n, --sym-omit sym1,sym2... omit symbols sym1, sym2 ... \n");
printf(" -L, --lib-subst s1,s2... objsearch LD_AUDIT interface (see man page)\n");
printf("\n");
printf(" -c, --counts display statistics counts of symbols\n");
printf(" -C, --sort-counts stat implies -c, plus sort the statistics by 'stat':\n");
printf(" time,per,call,ucall,lib,sym (default is call)\n");
printf(" -p, --pipe use pipe to latrace process to send audit data\n");
printf(" latrace app is then the one displaying the output\n");
printf(" -N, --conf config file\n");
printf("\n");
#ifndef CONFIG_ARCH_HAVE_ARGS
printf(" -[ADa] arguments display support not compiled in\n");
#else
printf(" -A, --enable-args enable arguments output (definitions from headers)\n");
printf(" -D, --detail-args display struct arguments in more detail\n");
printf(" -a, --args file arguments definition file, implies \'-A\'\n");
#endif
printf("\n");
printf(" -y, --framesize number framesize for storing the stack before pltexit (default 1000)\n");
printf(" -Y, --no-framesize-check disable framesize check\n");
printf(" -F, --no-follow-fork dont follow fork calls - childs\n");
printf(" -E, --no-follow-exec dont follow exec calls\n");
printf("\n");
printf(" -S, --timestamp display timestamp for each symbol\n");
printf(" -b, --flow-below sym1,sym2... display flow only for sym1, sym2 ... \n");
printf(" -I, --no-indent-sym do not indent symbols based on the their stack depth\n");
printf(" -i, --indent-sym indent_size specify indent size specification\n");
printf(" -B, --braces allways display braces {}\n");
printf(" -d, --demangle run the symbol name throught the C++ demangler\n");
printf(" -T, --hide-tid dont display thread id\n");
printf(" -o, --output file store output to file\n");
printf("\n");
printf(" -R, --ctl-config controled config\n");
printf(" -q, --disable disable auditing\n");
printf("\n");
printf(" -v, --verbose verbose output\n");
printf(" -V, --version display version\n");
printf(" -h, --help display help\n");
printf("\n");
exit(1);
}
static void version() NORETURN;
static void version()
{
printf("latrace version " CONFIG_VERSION "\n");
exit(0);
}
static struct lt_config_tv counts_sort[] = {
{ .type = LT_CSORT_TIME, .name = "time" },
{ .type = LT_CSORT_PERCENT, .name = "per" },
{ .type = LT_CSORT_CALL, .name = "call" },
{ .type = LT_CSORT_UCALL, .name = "ucall" },
{ .type = LT_CSORT_LIB, .name = "lib" },
{ .type = LT_CSORT_SYM, .name = "sym" }
};
#define COUNTS_SORT_NUM (sizeof(counts_sort)/sizeof(struct lt_config_tv))
static int get_type(struct lt_config_app *cfg, struct lt_config_tv *tv,
int num, char *name)
{
int i;
for(i = 0; i < num; i++)
if (!strcmp(name, tv[i].name))
return tv[i].type;
printf("failed to find name: %s\n", name);
return -1;
}
/* read conf file */
static int read_config(struct lt_config_app *cfg, char *file)
{
int ret = 0;
lt_config_parse_init(cfg, &inc);
PRINT_VERBOSE(cfg, 1, "config file %s\n", file);
if (lt_inc_open(cfg->sh, &inc, file))
return -1;
if (lt_config_parse()) {
printf("failed to parse config file %s\n", file);
ret = -1;
}
return ret;
}
#define CHECK_BOOL(str, sval, ival) \
do { \
if (ival != -1) \
val = ival; \
else if (!strcmp(sval, "YES")) \
val = 1; \
else if (!strcmp(sval, "NO")) \
val = 0; \
else \
return -1; \
} while(0)
#define CHECK_INT(val, sval, ival) \
do { \
val = ival; \
if (val == -1) \
val = atoi(sval); \
} while(0)
static int process_option_val(struct lt_config_app *cfg, int idx,
char *sval, int ival)
{
int val;
PRINT_VERBOSE(cfg, 1, "option idx %d, sval %s, ival %d\n",
idx, sval, ival);
switch(idx) {
case LT_OPT_HEADERS:
strcpy(lt_sh(cfg, args_def), sval);
PRINT_VERBOSE(cfg, 1, "HEADERS '%s'\n",
lt_sh(cfg, args_def));
break;
case LT_OPT_INDENT_SYM:
CHECK_INT(val, sval, ival);
lt_sh(cfg, indent_size) = val;
PRINT_VERBOSE(cfg, 1, "INDENT_SYM %d\n",
lt_sh(cfg, indent_size));
break;
case LT_OPT_PIPE:
CHECK_BOOL(val, sval, ival);
lt_sh(cfg, pipe) = val;
PRINT_VERBOSE(cfg, 1, "PIPE %d\n",
lt_sh(cfg, pipe));
break;
case LT_OPT_TIMESTAMP:
CHECK_BOOL(val, sval, ival);
lt_sh(cfg, timestamp) = val;
PRINT_VERBOSE(cfg, 1, "TIMESTAMP %d\n",
lt_sh(cfg, timestamp));
break;
case LT_OPT_FRAMESIZE:
CHECK_INT(val, sval, ival);
lt_sh(cfg, framesize) = val;
PRINT_VERBOSE(cfg, 1, "FRAMESIZE %d\n",
lt_sh(cfg, framesize));
break;
case LT_OPT_FRAMESIZE_CHECK:
CHECK_BOOL(val, sval, ival);
lt_sh(cfg, framesize_check) = val;
PRINT_VERBOSE(cfg, 1, "FRAMESIZE_CHECK %d\n",
lt_sh(cfg, framesize_check));
break;
case LT_OPT_HIDE_TID:
CHECK_BOOL(val, sval, ival);
lt_sh(cfg, hide_tid) = val;
PRINT_VERBOSE(cfg, 1, "HIDE_TID %d\n",
lt_sh(cfg, hide_tid));
break;
case LT_OPT_FOLLOW_FORK:
CHECK_BOOL(val, sval, ival);
lt_sh(cfg, not_follow_fork) = !val;
PRINT_VERBOSE(cfg, 1, "NOT FOLLOW_FORK %d\n",
lt_sh(cfg, not_follow_fork));
break;
case LT_OPT_FOLLOW_EXEC:
CHECK_BOOL(val, sval, ival);
lt_sh(cfg, not_follow_exec) = !val;
PRINT_VERBOSE(cfg, 1, "NOT FOLLOW_EXEC %d\n",
lt_sh(cfg, not_follow_exec));
break;
case LT_OPT_DEMANGLE:
CHECK_BOOL(val, sval, ival);
lt_sh(cfg, demangle) = val;
PRINT_VERBOSE(cfg, 1, "DEMANGLE %d\n",
lt_sh(cfg, demangle));
break;
case LT_OPT_BRACES:
CHECK_BOOL(val, sval, ival);
lt_sh(cfg, braces) = val;
PRINT_VERBOSE(cfg, 1, "BRACES %d\n",
lt_sh(cfg, braces));
break;
case LT_OPT_ENABLE_ARGS:
CHECK_BOOL(val, sval, ival);
lt_sh(cfg, args_enabled) = val;
PRINT_VERBOSE(cfg, 1, "ENABLE_ARGS %d\n",
lt_sh(cfg, args_enabled));
break;
case LT_OPT_DETAIL_ARGS:
CHECK_BOOL(val, sval, ival);
lt_sh(cfg, args_detailed) = val;
PRINT_VERBOSE(cfg, 1, "DETAIL_ARGS %d\n",
lt_sh(cfg, args_detailed));
break;
case LT_OPT_OUTPUT_TTY:
cfg->output_tty = 1;
strcpy(cfg->output_tty_file, sval);
PRINT_VERBOSE(cfg, 1, "OUTPUT_TTY '%s'\n",
cfg->output_tty_file);
break;
case LT_OPT_LIBS:
strcpy(lt_sh(cfg, libs_both), sval);
PRINT_VERBOSE(cfg, 1, "LIBS '%s'\n",
lt_sh(cfg, libs_both));
break;
case LT_OPT_LIBS_TO:
strcpy(lt_sh(cfg, libs_to), sval);
PRINT_VERBOSE(cfg, 1, "LIBS_TO '%s'\n",
lt_sh(cfg, libs_to));
break;
case LT_OPT_LIBS_FROM:
strcpy(lt_sh(cfg, libs_from), sval);
PRINT_VERBOSE(cfg, 1, "LIBS_FROM '%s'\n",
lt_sh(cfg, libs_from));
break;
case LT_OPT_SYM:
strcpy(lt_sh(cfg, symbols), sval);
PRINT_VERBOSE(cfg, 1, "SYM '%s'\n",
lt_sh(cfg, symbols));
break;
case LT_OPT_SYM_OMIT:
strcpy(lt_sh(cfg, symbols_omit), sval);
PRINT_VERBOSE(cfg, 1, "SYM_OMIT '%s'\n",
lt_sh(cfg, symbols_omit));
break;
case LT_OPT_SYM_BELOW:
strcpy(lt_sh(cfg, flow_below), sval);
PRINT_VERBOSE(cfg, 1, "SYM_BELOW '%s'\n",
lt_sh(cfg, flow_below));
break;
case LT_OPT_SYM_NOEXIT:
strcpy(lt_sh(cfg, symbols_noexit), sval);
PRINT_VERBOSE(cfg, 1, "SYM_NOEXIT '%s'\n",
lt_sh(cfg, symbols_noexit));
break;
case LT_OPT_ARGS_STRING_POINTER_LENGTH:
CHECK_BOOL(val, sval, ival);
lt_sh(cfg, args_string_pointer_length) = val;
PRINT_VERBOSE(cfg, 1, "ARGS_STRING_POINTER_LENGTH %d\n",
lt_sh(cfg, args_detailed));
break;
default:
return -1;
}
return 0;
}
static int process_option(struct lt_config_app *cfg, struct lt_config_opt *opt)
{
return process_option_val(cfg, opt->idx, opt->sval, opt->nval);
}
int lt_config_opt_process(struct lt_config_app *cfg, struct lt_list_head *list)
{
struct lt_config_opt *opt;
lt_list_for_each_entry(opt, list, list) {
int ret;
ret = process_option(cfg, opt);
if (ret)
return ret;
}
return 0;
}
struct lt_config_opt *lt_config_opt_new(struct lt_config_app *cfg,
int idx, char *sval, long nval)
{
struct lt_config_opt *opt;
opt = malloc(sizeof(*opt));
if (!opt)
return NULL;
lt_init_list_head(&opt->list);
opt->idx = idx;
opt->sval = sval ? strdup(sval) : NULL;
opt->nval = nval;
PRINT_VERBOSE(cfg, 1, "idx %d = %s, %d\n",
opt->idx, opt->sval , opt->nval);
return opt;
}
int lt_config_ln_add(struct lt_list_head *head, char *name)
{
struct lt_config_ln *ln = malloc(sizeof(*ln));
if (!ln)
return -1;
ln->name = strdup(name);
lt_init_list_head(&ln->list);
lt_list_add_tail(&ln->list, head);
return 0;
}
int lt_config_ln_fill(struct lt_list_head *head, char *buf, int size)
{
struct lt_config_ln *ln, *n;
int first = 1;
char *b = buf;
buf[0] = 0x00;
lt_list_for_each_entry_safe(ln, n, head, list) {
int ret;
ret = snprintf(b, size, "%s%s",
first ? "" : ",",
ln->name);
if (ret >= size)
return -1;
size -= ret;
b += ret;
first = 0;
lt_list_del(&ln->list);
free(ln->name);
free(ln);
}
return 0;
}
int lt_config(struct lt_config_app *cfg, int argc, char **argv)
{
memset(cfg, 0, sizeof(*cfg));
cfg->sh = cfg->sh_storage.sh = &cfg->sh_storage;
/* default values settings */
lt_sh(cfg, magic) = LT_CONFIG_MAGIC;
lt_sh(cfg, framesize) = 1000;
lt_sh(cfg, framesize_check) = 1;
lt_sh(cfg, fout) = stdout;
lt_sh(cfg, indent_sym) = 1;
lt_sh(cfg, indent_size) = 2;
lt_sh(cfg, args_maxlen) = LR_ARGS_MAXLEN;
lt_sh(cfg, args_detail_maxlen) = LR_ARGS_DETAIL_MAXLEN;
cfg->csort = LT_CSORT_CALL;
cfg->output_tty_fd = -1;
/* read the default config file first */
if (read_config(cfg, LT_CONF_DIR "/latrace.conf")) {
printf("failed: read config file '" LT_CONF_DIR "/latrace.conf'\n");
usage();
}
while (1) {
int c;
int option_index = 0;
static struct option long_options[] = {
{"sym", required_argument, 0, 's'},
{"sym-omit", required_argument, 0, 'n'},
{"libs", required_argument, 0, 'l'},
{"libs-to", required_argument, 0, 't'},
{"libs-from", required_argument, 0, 'f'},
{"no-indent-sym", no_argument, 0, 'I'},
{"indent-sym", required_argument, 0, 'i'},
{"braces", no_argument, 0, 'B'},
{"demangle", no_argument, 0, 'd'},
{"timestamp", required_argument, 0, 'S'},
{"flow-below", required_argument, 0, 'b'},
{"counts", no_argument, 0, 'c'},
{"sort-counts", required_argument, 0, 'C'},
{"pipe", no_argument, 0, 'p'},
{"output", required_argument, 0, 'o'},
{"conf", required_argument, 0, 'N'},
{"args", required_argument, 0, 'a'},
{"enable-args", required_argument, 0, 'A'},
{"detail-args", required_argument, 0, 'D'},
{"framesize", required_argument, 0, 'y'},
{"no-framesize-check ", no_argument, 0, 'Y'},
{"lib-subst", required_argument, 0, 'L'},
{"verbose", no_argument, 0, 'v'},
{"hide-tid", no_argument, 0, 'T'},
{"no-follow-fork", no_argument, 0, 'F'},
{"no-follow-exec", no_argument, 0, 'E'},
{"disable", no_argument, 0, 'q'},
{"ctl-config", no_argument, 0, 'R'},
{"version", no_argument, 0, 'V'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
c = getopt_long(argc, argv, "+s:n:l:t:f:vhi:BdISb:cC:y:YL:po:a:N:ADVTFERq",
long_options, &option_index);
if (c == -1)
break;
switch (c) {
case 'l':
if (strlen(optarg) >= LT_LIBS_MAXSIZE)
return -1;
process_option_val(cfg, LT_OPT_LIBS, optarg, -1);
break;
case 't':
if (strlen(optarg) >= LT_LIBS_MAXSIZE)
return -1;
process_option_val(cfg, LT_OPT_LIBS_TO, optarg, -1);
break;
case 'f':
if (strlen(optarg) >= LT_LIBS_MAXSIZE)
return -1;
process_option_val(cfg, LT_OPT_LIBS_FROM, optarg, -1);
break;
case 's':
if (strlen(optarg) >= LT_SYMBOLS_MAXSIZE)
return -1;
process_option_val(cfg, LT_OPT_SYM, optarg, -1);
break;
case 'n':
if (strlen(optarg) >= LT_SYMBOLS_MAXSIZE)
return -1;
process_option_val(cfg, LT_OPT_SYM_OMIT, optarg, -1);
break;
case 'b':
if (strlen(optarg) >= LT_SYMBOLS_MAXSIZE)
return -1;
process_option_val(cfg, LT_OPT_SYM_BELOW, optarg, -1);
break;
case 'v':
lt_sh(cfg, verbose)++;
break;
case 'S':
process_option_val(cfg, LT_OPT_TIMESTAMP, NULL, 1);
break;
case 'T':
process_option_val(cfg, LT_OPT_HIDE_TID, NULL, 1);
break;
case 'F':
process_option_val(cfg, LT_OPT_FOLLOW_FORK, NULL, 0);
break;
case 'E':
process_option_val(cfg, LT_OPT_FOLLOW_EXEC, NULL, 0);
break;
case 'i':
lt_sh(cfg, indent_size) = atoi(optarg);
break;
case 'B':
process_option_val(cfg, LT_OPT_BRACES, NULL, 0);
break;
case 'd':
#ifndef CONFIG_LIBERTY
printf("demangle support not compiled in," \
" liberty not found\n");
break;
#endif
process_option_val(cfg, LT_OPT_DEMANGLE, NULL, 0);
break;
case 'I':
lt_sh(cfg, indent_sym) = 0;
break;
case 'y':
process_option_val(cfg, LT_OPT_FRAMESIZE, optarg, -1);
break;
case 'Y':
process_option_val(cfg, LT_OPT_FRAMESIZE_CHECK, NULL, 0);
break;
case 'L':
if (strlen(optarg) > LT_SYMBOLS_MAXSIZE)
return -1;
strncpy(lt_sh(cfg, libs_subst), optarg, strlen(optarg));
break;
case 'C':
if (-1 == (cfg->csort = get_type(cfg, counts_sort, COUNTS_SORT_NUM, optarg)))
usage();
/* falling through */
case 'c':
lt_sh(cfg, counts) = 1;
/* falling through */
case 'p':
process_option_val(cfg, LT_OPT_PIPE, NULL, 1);
break;
#ifndef CONFIG_ARCH_HAVE_ARGS
case 'a':
case 'A':
case 'D':
printf("Arguments display support not compiled in");
break;
#else
case 'a':
process_option_val(cfg, LT_OPT_HEADERS, optarg, -1);
/* falling through */
case 'A':
process_option_val(cfg, LT_OPT_ENABLE_ARGS, NULL, 1);
break;
case 'D':
process_option_val(cfg, LT_OPT_DETAIL_ARGS, NULL, 1);
break;
#endif /* CONFIG_ARCH_HAVE_ARGS */
case 'N':
/* read user-specifide config file */
if (read_config(cfg, optarg)) {
printf("failed: read config file '%s'\n", optarg);
usage();
}
break;
case 'o':
strcpy(lt_sh(cfg, output), optarg);
break;
case 'q':
lt_sh(cfg, disabled) = 1;
break;
case 'R':
lt_sh(cfg, ctl_config) = 1;
break;
case 'V':
version();
break;
case 'h':
usage();
break;
default:
printf("unknown option '%c'", c);
} // switch (c)
} // while(1)
if (optind < argc) {
int i_arg = 1;
cfg->prog = argv[optind++];
cfg->arg[0] = cfg->prog;
while ((optind < argc) && (i_arg < LT_NUM_ARG)) {
cfg->arg[i_arg++] = argv[optind++];
}
cfg->arg_num = i_arg;
}
if (!cfg->prog) {
printf("failed: no program specified\n");
usage();
}
if ((lt_sh(cfg, pipe)) && (*lt_sh(cfg, output)) &&
(NULL == (lt_sh(cfg, fout) = fopen(lt_sh(cfg, output), "w")))) {
printf("failed to fopen output file %s\n", lt_sh(cfg, output));
usage();
}
return 0;
}
latrace-0.5.11.orig/src/latrace.c 0000644 0000000 0000000 00000003624 11620260065 013407 0 ustar /*
Copyright (C) 2008, 2009, 2010 Jiri Olsa
This file is part of the latrace.
The latrace is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The latrace 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the latrace (file COPYING). If not, see
.
*/
#include
#include
#include "config.h"
static struct lt_config_app cfg;
enum {
LT_TYPE_UNKNOWN,
LT_TYPE_LATRACE,
LT_TYPE_CTL,
};
struct lt_type {
char *name;
int type;
};
static struct lt_type types[] = {
{ .name = "latrace", .type = LT_TYPE_LATRACE },
{ .name = "latrace-ctl", .type = LT_TYPE_CTL },
};
#define TYPES_COUNT (sizeof(types)/sizeof(struct lt_type))
static int get_type(char *name)
{
int i;
char *cname = strrchr(name, '/');
if (!cname)
cname = name;
else
cname++;
for(i = 0; i < TYPES_COUNT; i++) {
struct lt_type *type = &types[i];
if (!strcmp(cname, type->name))
return type->type;
}
return LT_TYPE_UNKNOWN;
}
static int main_latrace(int argc, char **argv)
{
int ret;
if (-1 == lt_config(&cfg, argc, argv))
return -1;
ret = lt_run(&cfg);
if ((lt_sh(&cfg, pipe)) && (*lt_sh(&cfg, output)))
fclose(lt_sh(&cfg, fout));
if (lt_sh(&cfg, counts))
lt_stats_show(&cfg);
return ret;
}
int main(int argc, char **argv)
{
switch(get_type(argv[0])) {
case LT_TYPE_LATRACE:
return main_latrace(argc, argv);
case LT_TYPE_CTL:
return main_ctl(argc, argv);
}
printf("wtf..\n");
return -1;
}
latrace-0.5.11.orig/src/autoconf.h 0000644 0000000 0000000 00000002100 11566422640 013613 0 ustar /* src/autoconf.h. Generated from autoconf.h.in by configure. */
/*
Copyright (C) 2008, 2009, 2010 Jiri Olsa
This file is part of the latrace.
The latrace is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The latrace 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the latrace (file COPYING). If not, see
.
*/
#ifndef AUTOCONF_H
/* Temporary directory prefix. */
#define CONFIG_LT_CONFIG "/tmp/lt-config"
/* Version define. */
#define CONFIG_VERSION "0.5.11"
/* Argument display support. */
#define CONFIG_ARCH_HAVE_ARGS 1
/* liberty */
#define CONFIG_LIBERTY 1
#endif
latrace-0.5.11.orig/src/stats.c 0000644 0000000 0000000 00000016772 11566455051 013154 0 ustar /*
Copyright (C) 2008, 2009, 2010 Jiri Olsa
This file is part of the latrace.
The latrace is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The latrace 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the latrace (file COPYING). If not, see
.
*/
#include
#include
#include
#include
#include
#include "config.h"
struct timeval tv_program_start;
struct timeval tv_program_stop;
/* res = a - b*/
static int tv_sub(struct timeval *res, struct timeval *a, struct timeval *b)
{
res->tv_sec = a->tv_sec - b->tv_sec;
if (a->tv_usec > b->tv_usec)
res->tv_usec = a->tv_usec - b->tv_usec;
else {
res->tv_usec = a->tv_usec + (1000000 - b->tv_usec);
if (res->tv_sec)
res->tv_sec--;
}
return 0;
}
/* res = a + b*/
static int tv_add(struct timeval *res, struct timeval *a, struct timeval *b)
{
struct timeval tv;
tv.tv_sec = a->tv_sec + b->tv_sec;
tv.tv_usec = a->tv_usec + b->tv_usec;
if (tv.tv_usec > 1000000) {
tv.tv_usec -= 1000000;
tv.tv_sec++;
}
*res = tv;
return 0;
}
int lt_stats_alloc(struct lt_config_app *cfg, struct lt_thread *t)
{
int i;
if (!t->sym_array) {
if (!hcreate_r(t->sym_max = LT_SYM_HMAX, &t->sym_htab)) {
perror("hcreate_r failed");
return -1;
}
t->sym_array = (struct lt_stats_sym**) malloc(
t->sym_max * sizeof(struct lt_stats_sym*));
if (!t->sym_array) {
perror("malloc failed");
return -1;
}
return 0;
}
PRINT_VERBOSE(cfg, 1,
"too bad, out of symbols, reallocation... %p - %d\n",
t->sym_array, t->sym_cnt);
/* hash table reallocation */
t->sym_max += LT_SYM_HMAX;
hdestroy_r(&t->sym_htab);
PRINT_VERBOSE(cfg, 1, "%s\n", "creating new hash table");
if (!hcreate_r(t->sym_max, &t->sym_htab)) {
perror("hcreate_r failed");
return -1;
}
t->sym_array = (struct lt_stats_sym**) realloc(t->sym_array,
t->sym_max * sizeof(struct lt_stats_sym*));
if (!t->sym_array) {
perror("realloc failed");
return -1;
}
PRINT_VERBOSE(cfg, 1,
"adding symbols to new hash table %p\n",
t->sym_array);
for(i = 0; i < t->sym_cnt; i++) {
ENTRY e, *ep;
struct lt_stats_sym *sym;
sym = t->sym_array[i];
e.key = sym->name;
e.data = sym;
PRINT_VERBOSE(cfg, 1, "adding symbol %s\n", sym->name);
if (0 == hsearch_r(e, ENTER, &ep, &t->sym_htab)) {
printf("failed to add hash item during reallocation\n");
return -1;
}
}
PRINT_VERBOSE(cfg, 1, "%s\n", "reallocation ok");
return 0;
}
int lt_stats_sym(struct lt_config_app *cfg, struct lt_thread *t,
struct lt_fifo_msym* m)
{
ENTRY e, *ep;
char buf[1000];
struct lt_stats_sym *sym;
jmp_buf env;
int realloc = 0;
sprintf(buf, "%s%s", m->data + m->sym, m->data + m->lib);
e.key = strdup(buf);
e.data = 0;
/* array got out of space */
if ((t->sym_cnt == t->sym_max) && (-1 == lt_stats_alloc(cfg, t)))
return -1;
/* hash table got out of space */
if (setjmp(env))
realloc = 1;
if (0 == hsearch_r(e, ENTER, &ep, &t->sym_htab)) {
if (!realloc) {
if (-1 == lt_stats_alloc(cfg, t))
return -1;
longjmp(env, 1);
}
return -1;
}
if (!ep->data) {
sym = malloc(sizeof(struct lt_stats_sym));
memset(sym, 0, sizeof(struct lt_stats_sym));
ep->data = sym;
sym->name = e.key;
sym->sym = strdup(m->data + m->sym);
sym->lib = strdup(m->data + m->lib);
t->sym_array[t->sym_cnt] = sym;
t->sym_cnt++;
PRINT_VERBOSE(cfg, 1,
"adding symbol %d %s\n", t->sym_cnt, sym->name);
} else
free(e.key);
sym = ep->data;
if (FIFO_MSG_TYPE_ENTRY == m->h.type) {
sym->call++;
sym->tv_cur = m->h.tv;
}
if (FIFO_MSG_TYPE_EXIT == m->h.type) {
struct timeval tv;
tv_sub(&tv, &m->h.tv, &sym->tv_cur);
tv_add(&sym->tv_all, &sym->tv_all, &tv);
}
return 0;
}
static int csort;
static int qsort_compar(const void *a, const void *b)
{
struct lt_stats_sym *data_a = *((struct lt_stats_sym**) a);
struct lt_stats_sym *data_b = *((struct lt_stats_sym**) b);
if (csort == LT_CSORT_TIME) {
if (data_a->tv_all.tv_sec != data_b->tv_all.tv_sec)
return data_b->tv_all.tv_sec - data_a->tv_all.tv_sec;
return data_b->tv_all.tv_usec - data_a->tv_all.tv_usec;
}
if (csort == LT_CSORT_PERCENT) {
int percent_a = data_a->percent * 100000;
int percent_b = data_b->percent * 100000;
return percent_b - percent_a;
}
if (csort == LT_CSORT_CALL) {
return data_b->call - data_a->call;
}
if (csort == LT_CSORT_UCALL) {
return data_b->usec_call - data_a->usec_call;
}
if (csort == LT_CSORT_LIB) {
int ret = strcmp(data_a->lib, data_b->lib);
if (ret)
return ret;
return strcmp(data_a->sym, data_b->sym);
}
if (csort == LT_CSORT_SYM) {
int ret = strcmp(data_a->sym, data_b->sym);
if (ret)
return ret;
return strcmp(data_a->lib, data_b->lib);
}
return 0;
}
static int lt_stats_show_thread(struct lt_config_app *cfg, struct lt_thread *t)
{
int i;
struct timeval tv_thread_real;
struct timeval tv_thread_accu = { 0, 0};
float time_global;
PRINT_VERBOSE(cfg, 1, "%s\n", "counting total time");
for(i = 0; i < t->sym_cnt; i++) {
struct lt_stats_sym *sym = t->sym_array[i];
tv_add(&tv_thread_accu, &tv_thread_accu, &sym->tv_all);
}
time_global = tv_thread_accu.tv_sec * 1000000 + tv_thread_accu.tv_usec;
PRINT_VERBOSE(cfg, 1, "%s\n", "counting post mortem statistics");
for(i = 0; i < t->sym_cnt; i++) {
struct lt_stats_sym *sym = t->sym_array[i];
u_int time_sym = sym->tv_all.tv_sec*1000000 + sym->tv_all.tv_usec;
sym->percent = time_sym / (time_global/100);
sym->usec_call = time_sym/sym->call;
}
PRINT_VERBOSE(cfg, 1, "%s\n", "sorting");
csort = cfg->csort;
qsort(t->sym_array, t->sym_cnt, sizeof(struct lt_stats_sym*), qsort_compar);
PRINT_VERBOSE(cfg, 1, "%s\n", "printing");
tv_sub(&tv_thread_real, &t->tv_stop, &t->tv_start);
printf("\nThread %d (runtime %u.%06u sec)\n",
t->tid, (u_int) tv_thread_real.tv_sec, (u_int) tv_thread_real.tv_usec);
printf("%3s %-6s %10s %10s %10s %-30s\n",
"sec", "usec", "%", "usec/call", "calls", "symbol");
printf("%3s %-6s %10s %10s %10s %-30s\n",
"---", "------", "----------", "----------", "----------", "------------------------------");
for(i = 0; i < t->sym_cnt; i++) {
struct lt_stats_sym *sym = t->sym_array[i];
/* sec:usec */
printf("%3u:%06u ", (u_int) sym->tv_all.tv_sec, (u_int) sym->tv_all.tv_usec);
/* % */
printf("%10f ", sym->percent);
/* usec/call */
printf("%10u ", sym->usec_call);
/* call */
printf("%10u ", sym->call);
if (LT_CSORT_LIB == cfg->csort) {
/* calls symbol */
printf("%s ", sym->lib);
printf("%s\n", sym->sym);
} else {
printf("%s@", sym->sym);
printf("%s\n", sym->lib);
}
}
return 0;
}
int lt_stats_show(struct lt_config_app *cfg)
{
struct lt_thread *t;
struct timeval tv_program_real;
tv_sub(&tv_program_real, &tv_program_stop, &tv_program_start);
printf("\n--------------------------------------------------------------------------\n");
printf("Statistics for [%s] total runtime: %u.%06u sec\n",
cfg->prog,
(u_int) tv_program_real.tv_sec,
(u_int) tv_program_real.tv_usec);
for(t = lt_thread_first(cfg); t; t = lt_thread_next(cfg))
lt_stats_show_thread(cfg, t);
return 0;
}
latrace-0.5.11.orig/src/audit-init.c 0000644 0000000 0000000 00000013757 11620260065 014053 0 ustar /*
Copyright (C) 2008, 2009, 2010 Jiri Olsa
This file is part of the latrace.
The latrace is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The latrace 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the latrace (file COPYING). If not, see
.
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "config.h"
struct lt_config_audit cfg;
static int init_ctl_config(char *file)
{
void *sh;
int len;
int page = sysconf(_SC_PAGE_SIZE);
int fd;
if (-1 == (fd = open(file, O_RDWR))) {
perror("open failed");
return -1;
}
/* align the shared config length */
len = sizeof(struct lt_config_shared);
len = (len + page) & ~(page - 1);
sh = mmap(NULL, len,
PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0);
if ((void *) -1 == sh) {
PRINT_VERBOSE(&cfg, 1,
"mmap failed: %s\n", strerror(errno));
return -1;
}
/* switching to the mmaped shared config */
cfg.sh = sh;
/* PRINT_VERBOSE magic */
cfg.sh->sh = sh;
return 0;
}
static int read_config(char *dir)
{
int fd;
off_t len;
char file[LT_MAXFILE];
memset(&cfg, 0, sizeof(cfg));
cfg.dir = dir;
sprintf(file, "%s/config", dir);
if (-1 == (fd = open(file, O_RDONLY))) {
perror("open failed");
return -1;
}
if (-1 == read(fd, &cfg.sh_storage, sizeof(cfg.sh_storage))) {
perror("read failed");
return -1;
}
if (-1 == (len = lseek(fd, 0, SEEK_END))) {
perror("lseek failed");
return -1;
}
if (len != sizeof(cfg.sh_storage)) {
printf("config file size differs\n");
return -1;
}
if (LT_CONFIG_MAGIC != cfg.sh_storage.magic) {
printf("config file magic check failed\n");
return -1;
}
cfg.sh = cfg.sh_storage.sh = &cfg.sh_storage;
/*
* If we are not controled, we can close the file,
* since we read everything we needed.
*/
close(fd);
if (lt_sh(&cfg, ctl_config) && init_ctl_config(file))
printf("ctl config failed, carring on with standard\n");
return 0;
}
static int get_names(struct lt_config_audit *cfg, char *names, char **ptr)
{
char* s;
int cnt = 0;
PRINT_VERBOSE(cfg, 1, "names: [%s] max: %d\n",
names, LT_NAMES_MAX);
s = strchr(names, LT_NAMES_SEP);
while(NULL != (s = strchr(names, LT_NAMES_SEP)) && (cnt < LT_NAMES_MAX)) {
*s = 0x0;
PRINT_VERBOSE(cfg, 1, "got: %s", names);
ptr[cnt++] = names;
names = ++s;
}
if (cnt) {
ptr[cnt++] = names;
PRINT_VERBOSE(cfg, 1, "got: %s\n", names);
}
if (!cnt && *names) {
ptr[0] = names;
cnt = 1;
PRINT_VERBOSE(cfg, 1, "got: %s\n", names);
}
ptr[cnt] = NULL;
if (!cnt)
return -1;
PRINT_VERBOSE(cfg, 1, "got %d entries\n", cnt);
return cnt;
}
int audit_init(int argc, char **argv, char **env)
{
if (-1 == read_config(getenv("LT_DIR")))
return -1;
#ifdef CONFIG_ARCH_HAVE_ARGS
/* -Aa */
if (lt_sh(&cfg, args_enabled) && lt_args_init(cfg.sh))
return -1;
#endif
/* -t */
if ((*lt_sh(&cfg, libs_to)) &&
(-1 == (cfg.libs_to_cnt = get_names(&cfg, lt_sh(&cfg, libs_to),
cfg.libs_to)))) {
printf("latrace failed to parse libs to\n");
return -1;
}
/* -f */
if ((*lt_sh(&cfg, libs_from)) &&
(-1 == (cfg.libs_from_cnt = get_names(&cfg, lt_sh(&cfg, libs_from),
cfg.libs_from)))) {
printf("latrace failed to parse libs from\n");
return -1;
}
/* -l */
if ((*lt_sh(&cfg, libs_both)) &&
(-1 == (cfg.libs_both_cnt = get_names(&cfg, lt_sh(&cfg, libs_both),
cfg.libs_both)))) {
printf("latrace failed to parse libs from\n");
return -1;
}
/* -s */
if ((*lt_sh(&cfg, symbols)) &&
(-1 == (cfg.symbols_cnt = get_names(&cfg, lt_sh(&cfg, symbols),
cfg.symbols)))) {
printf("latrace failed to parse symbols\n");
return -1;
}
/* -n */
if ((*lt_sh(&cfg, symbols_omit)) &&
(-1 == (cfg.symbols_omit_cnt = get_names(&cfg, lt_sh(&cfg, symbols_omit),
cfg.symbols_omit)))) {
printf("latrace failed to parse symbols to omit\n");
return -1;
}
/* SYM_NOEXIT option */
if ((*lt_sh(&cfg, symbols_noexit)) &&
(-1 == (cfg.symbols_noexit_cnt = get_names(&cfg, lt_sh(&cfg, symbols_noexit),
cfg.symbols_noexit)))) {
printf("latrace failed to parse noexit symbols\n");
return -1;
}
/* -b */
if ((*lt_sh(&cfg, flow_below)) &&
(-1 == (cfg.flow_below_cnt = get_names(&cfg, lt_sh(&cfg, flow_below),
cfg.flow_below)))) {
printf("latrace failed to parse symbols in flow-below option\n");
return -1;
}
/* -L */
if (*lt_sh(&cfg, libs_subst)) {
char *ptr[LT_NAMES_MAX];
int cnt;
if (-1 == (cnt = get_names(&cfg, lt_sh(&cfg, libs_subst), ptr))) {
printf("latrace failed to parse input for subst option\n");
return -1;
}
if (-1 == lt_objsearch_init(&cfg, ptr, cnt)) {
printf("latrace failed to nitialize subst option\n");
return -1;
}
}
/* -o FIXME put fout out of the shared structure */
lt_sh(&cfg, fout) = stdout;
if ((*lt_sh(&cfg, output)) &&
(NULL == (lt_sh(&cfg, fout) = fopen(lt_sh(&cfg, output), "w")))) {
printf("latrace failed to open output file %s\n", lt_sh(&cfg, output));
return -1;
}
/* -E */
if (lt_sh(&cfg, not_follow_exec))
unsetenv("LD_AUDIT");
/* -F */
if (lt_sh(&cfg, not_follow_fork))
lt_sh(&cfg, pid) = getpid();
/* enable global symbols if needed */
lt_sh(&cfg, global_symbols) = lt_sh(&cfg, args_enabled);
PRINT_VERBOSE(&cfg, 1, "global_symbols %d\n", lt_sh(&cfg, global_symbols));
cfg.init_ok = 1;
return 0;
}
void finalize(void) __attribute__((destructor));
void
finalize(void)
{
if ((!lt_sh(&cfg, pipe)) && (*lt_sh(&cfg, output)))
fclose(lt_sh(&cfg, fout));
}
latrace-0.5.11.orig/src/stack.c 0000644 0000000 0000000 00000005275 11565510552 013114 0 ustar
#include
#include
#include
#include
#include "config.h"
static __thread void *stack_start = NULL;
static __thread void *stack_end = NULL;
static unsigned long get_stack_size(struct lt_config_audit *cfg)
{
struct rlimit rlim;
if (getrlimit(RLIMIT_STACK, &rlim))
return 0;
PRINT_VERBOSE(cfg, 1, "stack cur size: %lx, max: %lx\n",
rlim.rlim_cur, rlim.rlim_max);
return rlim.rlim_cur;
}
/* find and update current stack boundaries */
static int load_stack(struct lt_config_audit *cfg, void *sp)
{
FILE *maps;
char line[128];
int found = 0;
void *start, *end;
unsigned long stack_size;
maps = fopen("/proc/self/maps", "r");
if (!maps) {
PRINT_VERBOSE(cfg, 1, "failed to open maps: %s\n",
strerror(errno));
return -1;
}
stack_size = get_stack_size(cfg);
/* XXX any sane idea what to do now ?*/
if (!stack_size)
return -1;
/* scan all memory maps to see if we fit inside one */
while (!found && fgets(line, sizeof(line), maps)) {
int m = -1;
/* we care only about private rw mappings */
if (2 != sscanf(line, "%p-%p rw%*cp %*x %*x:%*x %*u %n",
&start, &end, &m))
continue;
if (m < 0)
continue;
PRINT_VERBOSE(cfg, 1, "line start %08lx, end %08lx\n",
start, end);
/* What if the new stack is not GROWSDOWN,
bounded by RLIMIT_STACK? */
if (!strncmp(&line[m], "[stack]", 7)) {
void *new_start = end - stack_size;
/* [stack] might not yet be mapped,
use rlimit as lower bound */
if (new_start < start)
start = new_start;
}
found = ((start < sp) && (sp < end));
PRINT_VERBOSE(cfg, 1, "final start %p, end %p, sp %p, in %d\n",
start, end, sp, found);
}
fclose(maps);
if (found) {
stack_start = start;
stack_end = end;
}
return found ? 0 : -1;
}
/* check the current stack pointer and check its boundaries */
int lt_stack_framesize(struct lt_config_audit *cfg, La_regs *regs)
{
void *sp_top, *sp_bottom;
void *sp = (void*) regs->sp_reg;
unsigned int framesize = lt_sh(cfg, framesize);
if (!lt_sh(cfg, framesize_check))
return framesize;
/* got here first time, or we are out of bounds */
if (!stack_start ||
(sp < stack_start || sp > stack_end)) {
/* we are screeeeeewed */
if (load_stack(cfg, sp))
return framesize;
}
/* FIXME what about stacks growing up.. */
sp_top = sp + framesize;
if (sp_top > stack_end) {
framesize = stack_end - sp - sizeof(void*);
PRINT_VERBOSE(cfg, 1,
"top reached, framesize changed to %lu\n",
framesize);
}
sp_bottom = sp - framesize;
if (sp_bottom < stack_start) {
framesize = sp - stack_start;
PRINT_VERBOSE(cfg, 1,
"bottom reached, framesize changed to %lu\n",
framesize);
}
return framesize;
}
latrace-0.5.11.orig/src/lib-include.h 0000644 0000000 0000000 00000003275 11566455051 014204 0 ustar /*
Copyright (C) 2011 Jiri Olsa
This file is part of the latrace.
The latrace is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The latrace 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the latrace (file COPYING). If not, see
.
*/
#ifndef LIB_INCLUDE_H
#define LIB_INCLUDE_H
#include
#include "config.h"
#define MAX_INCLUDE_DEPTH 10
struct lt_include_stack {
FILE *in;
void *buf;
char *file;
int lineno;
};
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
typedef YY_BUFFER_STATE (*yy_create_buffer_t)(FILE*, int);
typedef void (*yy_switch_to_buffer_t)(YY_BUFFER_STATE);
typedef void (*yy_delete_buffer_t)(YY_BUFFER_STATE);
struct lt_include {
struct lt_include_stack stack[MAX_INCLUDE_DEPTH];
int stack_idx;
FILE **in;
yy_create_buffer_t create_buffer;
yy_switch_to_buffer_t switch_to_buffer;
yy_delete_buffer_t delete_buffer;
};
int lt_inc_open(struct lt_config_shared *cfg, struct lt_include *inc,
char *file);
int lt_inc_close(struct lt_config_shared *cfg, struct lt_include *inc);
struct lt_include_stack* lt_inc_stack(struct lt_include *inc);
#endif /* LIB_INCLUDE_H */
latrace-0.5.11.orig/src/config-bison.y 0000644 0000000 0000000 00000013521 11620260065 014374 0 ustar /*
Copyright (C) 2011 Jiri Olsa
This file is part of the latrace.
The latrace is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The latrace 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with the latrace (file COPYING). If not, see
.
*/
%name-prefix "lt_config_"
%{
#include
#include
#include "config.h"
#include "lib-include.h"
struct lt_include *lt_config_sinc;
static struct lt_config_app *scfg;
int lt_config_lex(void);
void lt_config_error(const char *m);
#define ERROR(fmt, args...) \
do { \
char ebuf[1024]; \
sprintf(ebuf, fmt, ## args); \
lt_config_error(ebuf); \
YYERROR; \
} while(0)
static LT_LIST_HEAD(opt_list);
#define OPTION_ADD(idx, sval, nval) \
do { \
struct lt_config_opt *opt; \
opt = lt_config_opt_new(scfg, idx, sval, nval); \
if (!opt) \
ERROR("failed to process option\n"); \
lt_list_add_tail(&opt->list, &opt_list); \
} while(0)
static struct lt_list_head ln_names;
%}
%token INCLUDE NAME BOOL VALUE END
%token OPTIONS
%token OPT_HEADERS OPT_INDENT_SYM OPT_PIPE
%token OPT_TIMESTAMP OPT_FRAMESIZE OPT_FRAMESIZE_CHECK
%token OPT_HIDE_TID OPT_FOLLOW_FORK OPT_FOLLOW_EXEC
%token OPT_DEMANGLE OPT_BRACES OPT_ENABLE_ARGS
%token OPT_DETAIL_ARGS OPT_OUTPUT_TTY
%token OPT_LIBS OPT_LIBS_TO OPT_LIBS_FROM
%token OPT_SYM OPT_SYM_OMIT OPT_SYM_BELOW OPT_SYM_NOEXIT
%token OPT_ARGS_STRING_POINTER_LENGTH
%union
{
char *s;
unsigned long l;
}
%type NAME
%type BOOL
%type VALUE
%%
entry:
entry include_def
|
entry options_def
|
entry END
{
if (lt_inc_close(scfg->sh, lt_config_sinc))
return 0;
}
|
/* left blank intentionally */
include_def: INCLUDE '"' NAME '"'
{
if (lt_inc_open(scfg->sh, lt_config_sinc, $3))
ERROR("failed to process include");
}
options_def: OPTIONS '{' OPTIONS_DEF '}'
{
struct lt_config_opt *opt, *opth;
if (lt_config_opt_process(scfg, &opt_list))
ERROR("failed to process options");
lt_list_for_each_entry_safe(opt, opth, &opt_list, list) {
lt_list_del(&opt->list);
free(opt);
}
}
OPTIONS_DEF:
OPTIONS_DEF OPT_HEADERS '=' '"' NAME '"'
{
OPTION_ADD(LT_OPT_HEADERS, $5, -1);
}
|
OPTIONS_DEF OPT_INDENT_SYM '=' VALUE
{
OPTION_ADD(LT_OPT_INDENT_SYM, NULL, $4);
}
|
OPTIONS_DEF OPT_PIPE '=' BOOL
{
OPTION_ADD(LT_OPT_PIPE, $4, -1);
}
|
OPTIONS_DEF OPT_TIMESTAMP '=' BOOL
{
OPTION_ADD(LT_OPT_TIMESTAMP, $4, -1);
}
|
OPTIONS_DEF OPT_FRAMESIZE '=' VALUE
{
OPTION_ADD(LT_OPT_FRAMESIZE, NULL, $4);
}
|
OPTIONS_DEF OPT_FRAMESIZE_CHECK '=' BOOL
{
OPTION_ADD(LT_OPT_FRAMESIZE_CHECK, $4, -1);
}
|
OPTIONS_DEF OPT_HIDE_TID '=' BOOL
{
OPTION_ADD(LT_OPT_HIDE_TID, $4, -1);
}
|
OPTIONS_DEF OPT_FOLLOW_FORK '=' BOOL
{
OPTION_ADD(LT_OPT_FOLLOW_FORK, $4, -1);
}
|
OPTIONS_DEF OPT_FOLLOW_EXEC '=' BOOL
{
OPTION_ADD(LT_OPT_FOLLOW_EXEC, $4, -1);
}
|
OPTIONS_DEF OPT_DEMANGLE '=' BOOL
{
OPTION_ADD(LT_OPT_DEMANGLE, $4, -1);
}
|
OPTIONS_DEF OPT_BRACES '=' BOOL
{
OPTION_ADD(LT_OPT_BRACES, $4, -1);
}
|
OPTIONS_DEF OPT_ENABLE_ARGS '=' BOOL
{
OPTION_ADD(LT_OPT_ENABLE_ARGS, $4, -1);
}
|
OPTIONS_DEF OPT_DETAIL_ARGS '=' BOOL
{
OPTION_ADD(LT_OPT_DETAIL_ARGS, $4, -1);
}
|
OPTIONS_DEF OPT_OUTPUT_TTY '=' '"' NAME '"'
{
OPTION_ADD(LT_OPT_OUTPUT_TTY, $5, -1);
}
|
OPTIONS_DEF OPT_LIBS '=' list_names_comma
{
char libs[LT_LIBS_MAXSIZE];
if (lt_config_ln_fill(&ln_names, libs, LT_LIBS_MAXSIZE))
ERROR("failed to process libs option");
OPTION_ADD(LT_OPT_LIBS, libs, -1);
}
|
OPTIONS_DEF OPT_LIBS_TO '=' list_names_comma
{
char libs_to[LT_LIBS_MAXSIZE];
if (lt_config_ln_fill(&ln_names, libs_to, LT_LIBS_MAXSIZE))
ERROR("failed to process libs_to option");
OPTION_ADD(LT_OPT_LIBS_TO, libs_to, -1);
}
|
OPTIONS_DEF OPT_LIBS_FROM '=' list_names_comma
{
char libs_from[LT_LIBS_MAXSIZE];
if (lt_config_ln_fill(&ln_names, libs_from, LT_LIBS_MAXSIZE))
ERROR("failed to process libs_from option");
OPTION_ADD(LT_OPT_LIBS_FROM, libs_from, -1);
}
|
OPTIONS_DEF OPT_SYM '=' list_names_comma
{
char sym[LT_LIBS_MAXSIZE];
if (lt_config_ln_fill(&ln_names, sym, LT_LIBS_MAXSIZE))
ERROR("failed to process sym option");
OPTION_ADD(LT_OPT_SYM, sym, -1);
}
|
OPTIONS_DEF OPT_SYM_OMIT '=' list_names_comma
{
char sym_omit[LT_SYMBOLS_MAXSIZE];
if (lt_config_ln_fill(&ln_names, sym_omit, LT_SYMBOLS_MAXSIZE))
ERROR("failed to process sym_omit option");
OPTION_ADD(LT_OPT_SYM_OMIT, sym_omit, -1);
}
|
OPTIONS_DEF OPT_SYM_BELOW '=' list_names_comma
{
char sym_below[LT_SYMBOLS_MAXSIZE];
if (lt_config_ln_fill(&ln_names, sym_below, LT_SYMBOLS_MAXSIZE))
ERROR("failed to process sym_below option");
OPTION_ADD(LT_OPT_SYM_BELOW, sym_below, -1);
}
|
OPTIONS_DEF OPT_SYM_NOEXIT '=' list_names_comma
{
char sym_noexit[LT_SYMBOLS_MAXSIZE];
if (lt_config_ln_fill(&ln_names, sym_noexit, LT_SYMBOLS_MAXSIZE))
ERROR("failed to process sym_below option");
OPTION_ADD(LT_OPT_SYM_NOEXIT, sym_noexit, -1);
}
|
OPTIONS_DEF OPT_ARGS_STRING_POINTER_LENGTH '=' BOOL
{
OPTION_ADD(LT_OPT_ARGS_STRING_POINTER_LENGTH, $4, -1);
}
|
/* left blank intentionally */
list_names_comma:
list_names_comma ',' NAME
{
if (lt_config_ln_add(&ln_names, $3))
ERROR("failed to add list name");
}
|
NAME
{
if (lt_config_ln_add(&ln_names, $1))
ERROR("failed to add list name");
}
%%
int lt_config_parse_init(struct lt_config_app *cfg, struct lt_include *inc)
{
scfg = cfg;
lt_config_sinc = inc;
lt_init_list_head(&ln_names);
return 0;
}
latrace-0.5.11.orig/src/tty.c 0000644 0000000 0000000 00000004723 11620260065 012615 0 ustar
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include