debian/0000775000000000000000000000000012044471127007172 5ustar debian/README.source0000664000000000000000000000141112040075556011350 0ustar apitrace for Debian ------------------- Upstream ships with embedded copies of zlib, libpng, libsnappy, and libqjson. The buildsystem is patched to use the system copies of these libraries for the UI tools, but the tracing wrappers use a statically linked copy of the bundled libsnappy to minimise the possibility of symbol conflicts when tracing third-party applications. Upstream also ships with headers for MSVC, which are unused. The thirdparty/ directory also contains GL extension headers in glext/, these are used in preference to the system-wide headers to ensure that the tracer can proxy all the calls it knows about, not just those that the system's Mesa library knows about. -- Christopher James Halse Rogers , Tue, 21 Aug 2012 11:46:26 +1000 debian/apitrace-gl-frontend.install0000664000000000000000000000021312040075556014565 0ustar usr/bin/apitrace usr/bin/eglretrace usr/bin/glretrace usr/bin/qapitrace debian/qapitrace.desktop usr/share/applications usr/lib/apitrace debian/apitrace-gl-tracers.install0000664000000000000000000000013712040075556014416 0ustar usr/lib/*/apitrace/wrappers usr/share/doc/* usr/share/doc/apitrace-gl-tracers/ etc/apitrace.d debian/changelog0000664000000000000000000000031412044471127011042 0ustar apitrace (3.0+git20121018.d1c301f7-0ubuntu1) raring; urgency=low * Initial release (Closes: #636679, LP: #813848) -- Christopher James Halse Rogers Mon, 13 Feb 2012 16:32:44 +1100 debian/compat0000664000000000000000000000000212040075556010372 0ustar 9 debian/control0000664000000000000000000000410312040075556010575 0ustar Source: apitrace Section: graphics Priority: optional Maintainer: Christopher James Halse Rogers Build-Depends: debhelper (>= 9), cmake, libgl1-mesa-dev, libegl1-mesa-dev, libgles1-mesa-dev, libgles2-mesa-dev, libqt4-dev, libqtwebkit-dev, libqjson-dev, libsnappy-dev, libpng12-dev, pkg-config, python, zlib1g-dev, Standards-Version: 3.9.3 Homepage: https://github.com/apitrace/apitrace Vcs-Git: git://git.debian.org/pkg-xorg/app/apitrace.git Vcs-Browser: http://git.debian.org/?p=pkg-xorg/app/apitrace.git;a=summary Package: apitrace-gl-frontend Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, apitrace-gl-tracers (= ${binary:Version}), python, python-imaging, Description: tools for debugging OpenGL applications and drivers - tracing frontends apitrace is a suite of tools for debugging OpenGL applications and drivers. It includes a tool to generate a trace of all the OpenGL calls an applicaton makes and a tool for replaying these traces and inspecting the rendering and OpenGL state during the program's execution. . This makes it useful for identifying the sources of graphical corruption in OpenGL applications. . This package contains frontends for the apitrace tool, making it easy to trace applicatons and replay, compare, profile, and modify existing traces. Package: apitrace-gl-tracers Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, Pre-Depends: ${misc:Pre-Depends} Multi-Arch: same Description: tools for debugging OpenGL applications and drivers - application tracer apitrace is a suite of tools for debugging OpenGL applications and drivers. It includes a tool to generate a trace of all the OpenGL calls an applicaton makes and a tool for replaying these traces and inspecting the rendering and OpenGL state during the program's execution. . This makes it useful for identifying the sources of graphical corruption in OpenGL applications. . This package contains the components required to trace the OpenGL calls made by an application and record them into a trace file for later replay and debugging. debian/copyright0000664000000000000000000002750212040075556011135 0ustar Format: http://dep.debian.net/deps/dep5 Upstream-Name: apitrace Source: https://github.com/apitrace/apitrace Files: * Copyright: © 2011 Jose Fonseca, Zack Rusin © 2008-2010 VMware, Inc. License: Expat Files: debian/* Copyright: 2011 Christopher James Halse Rogers License: Expat Files: thirdparty/glxext/* Copyright: © 2007-2011 The Khronos Group Inc. License: Expat Files: thirdparty/libpng/* Copyright: © 2004, 2006-2011 Glenn Randers-Pehrson License: libpng This code is released under the libpng license. . libpng versions 1.2.6, August 15, 2004, through 1.5.2, March 31, 2011, are Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.2.5 with the following individual added to the list of Contributing Authors . Cosmin Truta . libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.0.6 with the following individuals added to the list of Contributing Authors . Simon-Pierre Cadieux Eric S. Raymond Gilles Vollant . and with the following additions to the disclaimer: . There is no warranty against interference with your enjoyment of the library or against infringement. There is no warranty that our efforts or the library will fulfill any of your particular purposes or needs. This library is provided with all faults, and the entire risk of satisfactory quality, performance, accuracy, and effort is with the user. . libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-0.96, with the following individuals added to the list of Contributing Authors: . Tom Lane Glenn Randers-Pehrson Willem van Schaik . libpng versions 0.89, June 1996, through 0.96, May 1997, are Copyright (c) 1996, 1997 Andreas Dilger Distributed according to the same disclaimer and license as libpng-0.88, with the following individuals added to the list of Contributing Authors: . John Bowler Kevin Bracey Sam Bushell Magnus Holmgren Greg Roelofs Tom Tanner . libpng versions 0.5, May 1995, through 0.88, January 1996, are Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. . For the purposes of this copyright and license, "Contributing Authors" is defined as the following set of individuals: . Andreas Dilger Dave Martindale Guy Eric Schalnat Paul Schmidt Tim Wegner . The PNG Reference Library is supplied "AS IS". The Contributing Authors and Group 42, Inc. disclaim all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The Contributing Authors and Group 42, Inc. assume no liability for direct, indirect, incidental, special, exemplary, or consequential damages, which may result from the use of the PNG Reference Library, even if advised of the possibility of such damage. . Permission is hereby granted to use, copy, modify, and distribute this source code, or portions hereof, for any purpose, without fee, subject to the following restrictions: . 1. The origin of this source code must not be misrepresented. . 2. Altered versions must be plainly marked as such and must not be misrepresented as being the original source. . 3. This Copyright notice may not be removed or altered from any source or altered source distribution. . The Contributing Authors and Group 42, Inc. specifically permit, without fee, and encourage the use of this source code as a component to supporting the PNG file format in commercial products. If you use this source code in a product, acknowledgment is not required but would be appreciated. Files: thirdparty/zlib/* Copyright: © 1995-2005 Jean-loup Gailly and Mark Adler License: zlib This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. . Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: . 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Files: thirdparty/snappy/* Copyright: © 2011 Google Inc. License: other All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: thirdparty/msvc/inttypes.h Copyright: © 2006 Alexander Chemeris License: BSD-3-clause Files: thirdparty/msvc/stdint.h Copyright: © 2006-2008 Alexander Chemeris License: BSD-3-clause Files: thirdparty/msvc/stdbool.h Copyright: © 2007-2010 VMware, Inc. License: Expat Files: thirdparty/qjson/parser* thirdparty/qjson/*_scanner.* thirdparty/qjson/qjson* thirdparty/qjson/qobjecthelper.* thirdparty/qjson/serializer*.* Copyright: © 2008,2009 Flavio Castelli © 2009 Michael Leupold © 2009 Till Adam © 2009 Pino Toscano License: LGPL-2+ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. . You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. . On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/LGPL-2'. Files: thirdparty/qjson/json_parser.* thirdparty/qjson/*.hh Copyright: © 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc License: GPL-2+ | other 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 2, 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. . As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. . This special exception was added by the Free Software Foundation in version 2.2 of Bison. . On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. License: BSD-3-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . 3. The name of the author may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/gbp.conf0000664000000000000000000000016312040075556010613 0ustar [DEFAULT] debian-branch = debian-unstable upstream-branch = upstream-unstable pristine-tar = True sign-tags = True debian/patches/0000775000000000000000000000000012040076066010620 5ustar debian/patches/01_multiarchify.patch0000664000000000000000000001276112040075556014653 0ustar commit 0b5a6d413c801a6620e23c6643973e2a99f90787 Author: Christopher James Halse Rogers Date: Mon Aug 20 14:25:22 2012 +1000 linux: Use relative wrapper name and LD_LIBRARY_PATH. This allows the dynamic linker to load whatever wrapper DSO is appropriate, making tracing on multiarch system much easier Signed-off-by: Christopher James Halse Rogers Forwarded: yes Index: apitrace/CMakeLists.txt =================================================================== --- apitrace.orig/CMakeLists.txt 2012-08-20 16:40:25.256045212 +1000 +++ apitrace/CMakeLists.txt 2012-08-20 17:11:59.831944053 +1000 @@ -243,6 +243,7 @@ set (SCRIPTS_INSTALL_DIR ${LIB_INSTALL_DIR}/scripts) set (WRAPPER_INSTALL_DIR ${LIB_ARCH_INSTALL_DIR}/wrappers) +set (CONFIG_INSTALL_DIR /etc/apitrace.d) # Expose the binary/install directories to source # @@ -254,7 +255,8 @@ -DAPITRACE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" -DAPITRACE_SCRIPTS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${SCRIPTS_INSTALL_DIR}" -DAPITRACE_WRAPPERS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${WRAPPER_INSTALL_DIR}" -) + -DAPITRACE_CONFIG_INSTALL_DIR="${CONFIG_INSTALL_DIR}") + ############################################################################## @@ -360,6 +362,24 @@ DESTINATION ${DOC_INSTALL_DIR} ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + # Generate wrapper config file + add_custom_command(OUTPUT ${ARCH_SUBDIR}.conf + COMMAND sh -c "echo ${CMAKE_INSTALL_PREFIX}/${WRAPPER_INSTALL_DIR} >${ARCH_SUBDIR}.conf") + + add_custom_target(wrapper_config + ALL + DEPENDS + ${CMAKE_BINARY_DIR}/${ARCH_SUBDIR}.conf + ) + + install (FILES + ${CMAKE_BINARY_DIR}/${ARCH_SUBDIR}.conf + DESTINATION + ${CONFIG_INSTALL_DIR} + ) +endif() + set (CPACK_PACKAGE_VERSION_MAJOR "3") set (CPACK_PACKAGE_VERSION_MINOR "0") Index: apitrace/common/trace_tools_trace.cpp =================================================================== --- apitrace.orig/common/trace_tools_trace.cpp 2012-08-20 16:40:25.256045212 +1000 +++ apitrace/common/trace_tools_trace.cpp 2012-08-20 17:10:37.935948428 +1000 @@ -29,6 +29,7 @@ #include #include +#include #include "os_string.hpp" #include "os_process.hpp" @@ -45,11 +46,106 @@ #elif defined(_WIN32) #define GL_TRACE_WRAPPER "opengl32.dll" #else +#define LIBRARY_SEARCH_VARIABLE "LD_LIBRARY_PATH" #define TRACE_VARIABLE "LD_PRELOAD" #define GL_TRACE_WRAPPER "glxtrace.so" #define EGL_TRACE_WRAPPER "egltrace.so" #endif +#ifdef LIBRARY_SEARCH_VARIABLE +#include +#include +#include +#include +#include +#include +#include + +/* TODO: This should either be a C++11 TR 2-style directory iterator + * implementation or should just use libboost-filesystem. + */ + +class DirectoryListing { +public: + DirectoryListing(os::String path); + ~DirectoryListing(); + + os::String next(); + +private: + const os::String basepath; + struct dirent *entry; + DIR *dir; + int error; +}; + +DirectoryListing::DirectoryListing(os::String path) : basepath(path) +{ + error = 0; + + int len = offsetof(struct dirent, d_name) + pathconf(path, _PC_NAME_MAX) + 1; + entry = static_cast(malloc(len)); + dir = opendir(path); + + if (dir == NULL) + error = errno; +} + +DirectoryListing::~DirectoryListing() +{ + closedir(dir); + free(entry); +} + +os::String DirectoryListing::next(void) +{ + struct dirent *result; + + if (error) + return os::String(); + + error = readdir_r(dir, entry, &result); + if (result == NULL) + return os::String(); + + os::String filename(basepath); + filename.join(entry->d_name); + + return filename; +} + +static os::String +findAllWrappers(const char *wrapperFilename) +{ + os::String conffilePath; + os::String wrapperPaths; + DirectoryListing conffileListing(APITRACE_CONFIG_INSTALL_DIR); + + conffilePath = conffileListing.next(); + while (conffilePath.length() > 0) { + std::ifstream conffile(conffilePath); + os::String wrapperPath; + while(conffile.good()) { + char path[PATH_MAX]; + conffile.getline(path, PATH_MAX); + wrapperPath = path; + wrapperPath.join(wrapperFilename); + if (wrapperPath.exists()) { + wrapperPaths.append(path); + wrapperPaths.append(":"); + } + } + conffilePath = conffileListing.next(); + } + + /* Trim off trailing ':' */ + if (wrapperPaths.length() > 0) + wrapperPaths.truncate(wrapperPaths.length() - 1); + + return wrapperPaths; +} + +#endif /* LIBRARY_SEARCH_VARIABLE */ static os::String findWrapper(const char *wrapperFilename) @@ -176,6 +272,18 @@ wrapperPath.trimFilename(); #endif +#if defined(LIBRARY_SEARCH_VARIABLE) + os::String wrapperPaths = findAllWrappers(wrapperFilename); + if (verbose) { + std::cerr << LIBRARY_SEARCH_VARIABLE << "=" << wrapperPaths.str() << "\n"; + } + os::setEnvironment(LIBRARY_SEARCH_VARIABLE, wrapperPaths.str()); + /* If we set the library search path, the linker will find the wrapper + * for the appropriate architecture itself; we need only supply the name + */ + wrapperPath = wrapperFilename; +#endif + #if defined(TRACE_VARIABLE) if (verbose) { std::cerr << TRACE_VARIABLE << "=" << wrapperPath.str() << "\n"; debian/patches/series0000664000000000000000000000007412040075556012041 0ustar 01_multiarchify.patch 02_use_system_libpng_snappy_zlib.diff debian/patches/02_use_system_libpng_snappy_zlib.diff0000664000000000000000000001062712040076066020126 0ustar Description: Link against system libraries for zlib, libsnappy, and libpng Author: Christopher James Halse Rogers Forwarded: not-needed Index: apitrace/CMakeLists.txt =================================================================== --- apitrace.orig/CMakeLists.txt 2012-10-19 08:59:55.000000000 +1100 +++ apitrace/CMakeLists.txt 2012-10-19 09:00:05.801094746 +1100 @@ -159,23 +159,24 @@ # - on unices to prevent symbol collisions when tracing applications that link # against other versions of these libraries -set (ZLIB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib) -set (ZLIB_LIBRARIES z_bundled) -add_subdirectory (thirdparty/zlib EXCLUDE_FROM_ALL) - +find_package (ZLIB REQUIRED) include_directories (${ZLIB_INCLUDE_DIRS}) -set (SNAPPY_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/snappy) -set (SNAPPY_LIBRARIES snappy_bundled) -add_subdirectory (thirdparty/snappy EXCLUDE_FROM_ALL) +# +# libSnappy doesn't ship a pc file, because it is made of hate +# +#find_package (SNAPPY REQUIRED) +set (SNAPPY_INCLUDE_DIRS "") +set (SNAPPY_LIBRARIES -lsnappy) include_directories (${SNAPPY_INCLUDE_DIRS}) -set (PNG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libpng) -set (PNG_DEFINITIONS "") -set (PNG_LIBRARIES png_bundled) +set (BUNDLED_SNAPPY_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/snappy) +set (BUNDLED_SNAPPY_LIBRARIES snappy_bundled) +add_subdirectory (thirdparty/snappy EXCLUDE_FROM_ALL) + -add_subdirectory (thirdparty/libpng EXCLUDE_FROM_ALL) +find_package (PNG REQUIRED) include_directories (${PNG_INCLUDE_DIR}) add_definitions (${PNG_DEFINITIONS}) Index: apitrace/common/trace_file_zlib.cpp =================================================================== --- apitrace.orig/common/trace_file_zlib.cpp 2012-08-17 12:29:29.000000000 +1000 +++ apitrace/common/trace_file_zlib.cpp 2012-10-19 09:00:05.801094746 +1100 @@ -31,7 +31,6 @@ #include #include -#include // for lseek #ifdef _WIN32 @@ -44,6 +43,7 @@ #include "os.hpp" #include +#include using namespace trace; @@ -70,6 +70,7 @@ private: gzFile m_gzFile; double m_endOffset; + int raw_fd; }; ZLibFile::ZLibFile(const std::string &filename, @@ -86,18 +87,23 @@ bool ZLibFile::rawOpen(const std::string &filename, File::Mode mode) { - m_gzFile = gzopen(filename.c_str(), - (mode == File::Write) ? "wb" : "rb"); + FILE *file = fopen(filename.c_str(), + (mode == File::Write) ? "wb" : "rb") ; + if (file == NULL) + return false; + + raw_fd = fileno(file); + m_gzFile = gzdopen(raw_fd, + (mode == File::Write) ? "wb" : "rb"); if (mode == File::Read && m_gzFile) { //XXX: unfortunately zlib doesn't support // SEEK_END or we could've done: //m_endOffset = gzseek(m_gzFile, 0, SEEK_END); //gzrewind(m_gzFile); - gz_state *state = (gz_state *)m_gzFile; - off_t loc = lseek(state->fd, 0, SEEK_CUR); - m_endOffset = lseek(state->fd, 0, SEEK_END); - lseek(state->fd, loc, SEEK_SET); + off_t loc = lseek(raw_fd, 0, SEEK_CUR); + m_endOffset = lseek(raw_fd, 0, SEEK_END); + lseek(raw_fd, loc, SEEK_SET); } return m_gzFile != NULL; @@ -149,8 +155,7 @@ int ZLibFile::rawPercentRead() { - gz_state *state = (gz_state *)m_gzFile; - return 100 * (lseek(state->fd, 0, SEEK_CUR) / m_endOffset); + return 100 * (lseek(raw_fd, 0, SEEK_CUR) / m_endOffset); } Index: apitrace/wrappers/CMakeLists.txt =================================================================== --- apitrace.orig/wrappers/CMakeLists.txt 2012-10-19 08:58:34.000000000 +1100 +++ apitrace/wrappers/CMakeLists.txt 2012-10-19 09:01:06.181091522 +1100 @@ -7,6 +7,7 @@ ${CMAKE_SOURCE_DIR}/helpers ${CMAKE_BINARY_DIR}/dispatch ${CMAKE_SOURCE_DIR}/dispatch + ${BUNDLED_SNAPPY_INCLUDE_DIRS} ) add_library (common_trace STATIC @@ -344,8 +345,7 @@ glproc_gl common_trace common - ${ZLIB_LIBRARIES} - ${SNAPPY_LIBRARIES} + ${BUNDLED_SNAPPY_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} dl ) @@ -392,8 +392,7 @@ glproc_egl common_trace common - ${ZLIB_LIBRARIES} - ${SNAPPY_LIBRARIES} + ${BUNDLED_SNAPPY_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} dl ) debian/qapitrace.desktop0000664000000000000000000000027412040075556012543 0ustar [Desktop Entry] Version=1.0 Type=Application Name=Apitrace Retracer Comment=Play back and inspect traces generated by apitrace Exec=qapitrace %f Categories=Development;Debugger;Profiling; debian/rules0000775000000000000000000000202412040075556010252 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # # Modified to make a template file for a multi-binary package with separated # build-arch and build-indep targets by Bill Allombert 2001 # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) override_dh_auto_configure: dh_auto_configure -- -DENABLE_EGL=YES -DENABLE_GUI=YES override_dh_install: # Remove some files we don't want, then fail if there's anything left -rm debian/tmp/usr/share/doc/apitrace/LICENSE dh_install --fail-missing override_dh_clean: # The buildsystem doesn't clean the generate python bytecode find . -name *.pyc -delete dh_clean %: dh $@ --parallel debian/source/0000775000000000000000000000000012040075556010474 5ustar debian/source/format0000664000000000000000000000001412040075556011702 0ustar 3.0 (quilt) debian/watch0000664000000000000000000000025712040075556010231 0ustar version=3 opts=filenamemangle=s/\/apitrace\/apitrace\/tarball\/(.*)/apitrace-$1\.tar\.gz/ \ https://github.com/apitrace/apitrace/downloads /apitrace/apitrace/tarball/(.*)