]> git.cworth.org Git - apitrace/commitdiff
cli: Rename replay -> retrace.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 18 Nov 2012 15:45:27 +0000 (15:45 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 19 Nov 2012 08:59:53 +0000 (08:59 +0000)
For consistency with the current terminology.

cli/CMakeLists.txt
cli/cli.hpp
cli/cli_dump_images.cpp
cli/cli_main.cpp
cli/cli_replay.cpp [deleted file]
cli/cli_retrace.cpp [new file with mode: 0644]

index a0ffb71e5d629bcadcfee97b27879f4becf5da0d..ed998810925b686cbbc840673b1d3e0a20eefbf8 100644 (file)
@@ -8,7 +8,7 @@ add_executable (apitrace
     cli_pager.cpp
     cli_pickle.cpp
     cli_repack.cpp
     cli_pager.cpp
     cli_pickle.cpp
     cli_repack.cpp
-    cli_replay.cpp
+    cli_retrace.cpp
     cli_trace.cpp
     cli_trim.cpp
 )
     cli_trace.cpp
     cli_trim.cpp
 )
index c701f522175dd2e5117e7e3e9b429b84fa49385b..c35cb3ac9eb6144cea3eb898dc4db092eae97007 100644 (file)
@@ -47,7 +47,7 @@ extern const Command dump_command;
 extern const Command dump_images_command;
 extern const Command pickle_command;
 extern const Command repack_command;
 extern const Command dump_images_command;
 extern const Command pickle_command;
 extern const Command repack_command;
-extern const Command replay_command;
+extern const Command retrace_command;
 extern const Command trace_command;
 extern const Command trim_command;
 
 extern const Command trace_command;
 extern const Command trim_command;
 
index 2a856c78b670cfc9c2b3d981ee204d90318fdb13..594f001e4c7b68ddc656d3ff0897a3792bf6b355 100644 (file)
@@ -116,14 +116,6 @@ command(int argc, char *argv[])
         output = prefix.str();
     }
 
         output = prefix.str();
     }
 
-    /* FIXME: It would be cleaner to pull the replaying of the trace
-     * in-process here and generate the images directly. But that
-     * pulls in a non-trivial amount of the existing 'retrace' code,
-     * along with dependencies on GL, etc.
-     *
-     * It will definitely make sense to do that once all that code has
-     * already been pulled in for the "apitrace retrace" (or "apitrace
-     * replay") command. */
     std::vector<const char *> command;
 
     os::String glretracePath = trace::findProgram("glretrace");
     std::vector<const char *> command;
 
     os::String glretracePath = trace::findProgram("glretrace");
index 66827174a706aaf5a0388e74f5e0e4ef44c1735e..040adcf82928c56f8a35b76617ddeb72b11e1689 100644 (file)
@@ -73,7 +73,7 @@ static const Command * commands[] = {
     &dump_images_command,
     &pickle_command,
     &repack_command,
     &dump_images_command,
     &pickle_command,
     &repack_command,
-    &replay_command,
+    &retrace_command,
     &trace_command,
     &trim_command,
     &help_command
     &trace_command,
     &trim_command,
     &help_command
diff --git a/cli/cli_replay.cpp b/cli/cli_replay.cpp
deleted file mode 100644 (file)
index aaa68e2..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*********************************************************************
- *
- * Copyright 2011 Jose Fonseca
- * Copyright 2012 Intel Corporation
- * 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.
- *
- *********************************************************************/
-
-#include <string.h>
-#include <limits.h> // for CHAR_MAX
-#include <getopt.h>
-#include <iostream>
-
-#include "cli.hpp"
-
-#include "os_string.hpp"
-#include "os_process.hpp"
-
-#include "trace_resource.hpp"
-
-static const char *synopsis = "Replay a trace.";
-
-static void
-usage(void)
-{
-    std::cout << "usage apitrace replay [OPTIONS] TRACE_FILE\n"
-              << synopsis << "\n"
-           "\n"
-           "    -h, --help             Show this help message and exit\n"
-           "    -w, --wait             Wait for user termination after the last frame\n"
-           "\n";
-}
-
-const static char *
-shortOptions = "hw";
-
-const static struct option
-longOptions[] = {
-    {"help", no_argument, 0, 'h'},
-    {"wait", required_argument, 0, 'w'},
-    {0, 0, 0, 0}
-};
-
-static int
-command(int argc, char *argv[])
-{
-    bool wait = false;
-    const char *filename;
-
-    int opt;
-    while ((opt = getopt_long(argc, argv, shortOptions, longOptions, NULL)) != -1) {
-        switch (opt) {
-        case 'h':
-            usage();
-            return 0;
-        case 'w':
-            wait = true;
-            break;
-        default:
-            std::cerr << "error: unexpected option `" << opt << "`\n";
-            usage();
-            return 1;
-        }
-    }
-
-    if (optind >= argc) {
-        std::cerr << "error: apitrace replay requires a trace file as an argument.\n";
-        usage();
-        return 1;
-    }
-
-    if (optind < argc - 1) { 
-        std::cerr << "error: apitrace replay can accept only a single trace file argument.\n";
-        usage();
-        return 1;
-    }
-
-    filename = argv[optind];
-
-    /* FIXME: It would be cleaner to pull the replaying of the trace
-     * in-process here and generate the images directly. But that
-     * pulls in a non-trivial amount of the existing 'retrace' code,
-     * along with dependencies on GL, etc.
-     */
-    std::vector<const char *> command;
-
-    os::String glretracePath = trace::findProgram("glretrace");
-    command.push_back(glretracePath);
-
-    if (wait) {
-        command.push_back("--wait");
-    }
-
-    command.push_back(filename);
-    command.push_back(NULL);
-
-    return os::execute((char * const *)&command[0]);
-}
-
-const Command replay_command = {
-    "replay",
-    synopsis,
-    usage,
-    command
-};
diff --git a/cli/cli_retrace.cpp b/cli/cli_retrace.cpp
new file mode 100644 (file)
index 0000000..f88d7df
--- /dev/null
@@ -0,0 +1,120 @@
+/*********************************************************************
+ *
+ * Copyright 2011 Jose Fonseca
+ * Copyright 2012 Intel Corporation
+ * 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.
+ *
+ *********************************************************************/
+
+#include <string.h>
+#include <limits.h> // for CHAR_MAX
+#include <getopt.h>
+#include <iostream>
+
+#include "cli.hpp"
+
+#include "os_string.hpp"
+#include "os_process.hpp"
+
+#include "trace_resource.hpp"
+
+static const char *synopsis = "Replay a trace.";
+
+static void
+usage(void)
+{
+    std::cout << "usage apitrace retrace [OPTIONS] TRACE_FILE\n"
+              << synopsis << "\n"
+           "\n"
+           "    -h, --help             Show this help message and exit\n"
+           "    -w, --wait             Wait for user termination after the last frame\n"
+           "\n";
+}
+
+const static char *
+shortOptions = "hw";
+
+const static struct option
+longOptions[] = {
+    {"help", no_argument, 0, 'h'},
+    {"wait", required_argument, 0, 'w'},
+    {0, 0, 0, 0}
+};
+
+static int
+command(int argc, char *argv[])
+{
+    bool wait = false;
+    const char *filename;
+
+    int opt;
+    while ((opt = getopt_long(argc, argv, shortOptions, longOptions, NULL)) != -1) {
+        switch (opt) {
+        case 'h':
+            usage();
+            return 0;
+        case 'w':
+            wait = true;
+            break;
+        default:
+            std::cerr << "error: unexpected option `" << opt << "`\n";
+            usage();
+            return 1;
+        }
+    }
+
+    if (optind >= argc) {
+        std::cerr << "error: apitrace retrace requires a trace file as an argument.\n";
+        usage();
+        return 1;
+    }
+
+    if (optind < argc - 1) { 
+        std::cerr << "error: apitrace retrace can accept only a single trace file argument.\n";
+        usage();
+        return 1;
+    }
+
+    filename = argv[optind];
+
+    std::vector<const char *> command;
+
+    os::String glretracePath = trace::findProgram("glretrace");
+    command.push_back(glretracePath);
+
+    if (wait) {
+        command.push_back("--wait");
+    }
+
+    command.push_back(filename);
+    command.push_back(NULL);
+
+    return os::execute((char * const *)&command[0]);
+}
+
+const Command retrace_command = {
+    "retrace",
+    synopsis,
+    usage,
+    command
+};