From: José Fonseca Date: Fri, 15 Apr 2011 08:34:20 +0000 (+0100) Subject: Rename dump -> tracedump. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=e4688f2a2fa7bf93eb46ecf978c0bbfd2fe81a25;p=apitrace Rename dump -> tracedump. Dump is a too generic name to be, for example, in /usr/bin/. --- diff --git a/.gitignore b/.gitignore index 0a45575..cdd2823 100644 --- a/.gitignore +++ b/.gitignore @@ -28,12 +28,12 @@ d3d10_1.cpp d3d8.cpp d3d9.cpp ddraw.cpp -dump dxsdk glproc.hpp glretrace glretrace_gl.cpp glretrace_state.cpp glxtrace.cpp +tracedump traces wgltrace.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 19ef467..fefd349 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,8 +209,8 @@ endif (WIN32) add_library (trace trace_model.cpp trace_parser.cpp ${os}) -add_executable (dump dump.cpp) -target_link_libraries (dump trace) +add_executable (tracedump tracedump.cpp) +target_link_libraries (tracedump trace) add_custom_command ( OUTPUT glretrace_gl.cpp diff --git a/README b/README index 8091a41..8fc78a1 100644 --- a/README +++ b/README @@ -89,7 +89,7 @@ http://www.cmake.org/Wiki/CmakeMingw for detailed instructions. * View the trace with - /path/to/dump application.trace + /path/to/tracedump application.trace * Replay the trace with @@ -105,7 +105,7 @@ http://www.cmake.org/Wiki/CmakeMingw for detailed instructions. * View the trace with - /path/to/dump application.trace + /path/to/tracedump application.trace * Replay the trace with diff --git a/dump.cpp b/dump.cpp deleted file mode 100644 index 22f62e3..0000000 --- a/dump.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/************************************************************************** - * - * Copyright 2010 VMware, Inc. - * All Rights Reserved. - * - * 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. - * - **************************************************************************/ - - -/* - * Simple utility to dump a trace to standard output. - */ - - -#include "trace_parser.hpp" - - -int main(int argc, char **argv) -{ - for (int i = 1; i < argc; ++i) { - Trace::Parser p; - if (p.open(argv[i])) { - Trace::Call *call; - call = p.parse_call(); - while (call) { - std::cout << *call; - delete call; - call = p.parse_call(); - } - } - } - return 0; -} diff --git a/scripts/tracediff.sh b/scripts/tracediff.sh index 95ec5d2..01f3834 100755 --- a/scripts/tracediff.sh +++ b/scripts/tracediff.sh @@ -26,13 +26,13 @@ set -e -DUMP=${DUMP:-`dirname "$0"`/dump} +TRACEDUMP=${TRACEDUMP:-`dirname "$0"`/tracedump} -$DUMP +$TRACEDUMP stripdump () { # http://www.theeggeadventure.com/wikimedia/index.php/Linux_Tips#Use_sed_to_remove_ANSI_colors - $DUMP "$1" \ + $TRACEDUMP "$1" \ | sed \ -e 's/\x1b\[[0-9]\{1,2\}\(;[0-9]\{1,2\}\)\{0,2\}m//g' \ -e 's/\r$//g' \ diff --git a/tracedump.cpp b/tracedump.cpp new file mode 100644 index 0000000..22f62e3 --- /dev/null +++ b/tracedump.cpp @@ -0,0 +1,50 @@ +/************************************************************************** + * + * Copyright 2010 VMware, Inc. + * All Rights Reserved. + * + * 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. + * + **************************************************************************/ + + +/* + * Simple utility to dump a trace to standard output. + */ + + +#include "trace_parser.hpp" + + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + Trace::Parser p; + if (p.open(argv[i])) { + Trace::Call *call; + call = p.parse_call(); + while (call) { + std::cout << *call; + delete call; + call = p.parse_call(); + } + } + } + return 0; +}