OSDN Git Service

Merge "Fix format specifiers for size_t types" am: 0d77698233
authorSamuel Tan <samueltan@google.com>
Thu, 17 Dec 2015 03:03:30 +0000 (03:03 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Thu, 17 Dec 2015 03:03:30 +0000 (03:03 +0000)
am: 656186456f

* commit '656186456f2413831bc0127ac6843ca6f2d8e66e':
  Fix format specifiers for size_t types

186 files changed:
cmds/atrace/atrace.cpp
cmds/atrace/atrace.rc
cmds/cmd/Android.mk [new file with mode: 0644]
cmds/cmd/MODULE_LICENSE_APACHE2 [new file with mode: 0644]
cmds/cmd/NOTICE [new file with mode: 0644]
cmds/cmd/cmd.cpp [new file with mode: 0644]
cmds/dumpstate/Android.mk
cmds/dumpstate/dumpstate.cpp
cmds/dumpstate/dumpstate.h
cmds/dumpstate/dumpstate.rc
cmds/dumpstate/libdumpstate_default.cpp
cmds/dumpstate/utils.cpp
cmds/flatland/GLHelper.cpp
cmds/installd/Android.mk
cmds/installd/commands.cpp
cmds/installd/commands.h [new file with mode: 0644]
cmds/installd/globals.cpp [new file with mode: 0644]
cmds/installd/globals.h [new file with mode: 0644]
cmds/installd/installd.cpp
cmds/installd/installd.h [deleted file]
cmds/installd/installd_constants.h [new file with mode: 0644]
cmds/installd/installd_deps.h [new file with mode: 0644]
cmds/installd/tests/installd_utils_test.cpp
cmds/installd/utils.cpp
cmds/installd/utils.h [new file with mode: 0644]
cmds/servicemanager/servicemanager.rc
data/etc/android.hardware.sensor.ambient_temperature.xml [new file with mode: 0644]
data/etc/android.hardware.sensor.relative_humidity.xml [new file with mode: 0644]
data/etc/android.hardware.type.automotive.xml [new file with mode: 0644]
data/etc/android.software.freeform_window_management.xml [new file with mode: 0644]
data/etc/android.software.picture_in_picture.xml [new file with mode: 0644]
data/etc/car_core_hardware.xml [new file with mode: 0644]
include/android/keycodes.h
include/binder/IBinder.h
include/binder/IProcessInfoService.h
include/binder/IResultReceiver.h [new file with mode: 0644]
include/gui/BufferItem.h
include/gui/BufferQueueConsumer.h
include/gui/BufferQueueCore.h
include/gui/BufferQueueProducer.h
include/gui/BufferSlot.h
include/gui/CpuConsumer.h
include/gui/GLConsumer.h
include/gui/IGraphicBufferConsumer.h
include/gui/IGraphicBufferProducer.h
include/gui/Surface.h
include/gui/SurfaceComposerClient.h
include/gui/SurfaceControl.h
include/input/InputEventLabels.h
include/input/KeyCharacterMap.h
include/media/drm/DrmAPI.h
include/media/openmax/OMX_AsString.h
include/media/openmax/OMX_Video.h
include/private/gui/LayerState.h
include/private/ui/RegionHelper.h
include/ui/Rect.h
libs/binder/Android.mk
libs/binder/Binder.cpp
libs/binder/BpBinder.cpp
libs/binder/IProcessInfoService.cpp
libs/binder/IResultReceiver.cpp [new file with mode: 0644]
libs/gui/BufferItem.cpp
libs/gui/BufferItemConsumer.cpp
libs/gui/BufferQueueConsumer.cpp
libs/gui/BufferQueueCore.cpp
libs/gui/BufferQueueProducer.cpp
libs/gui/BufferSlot.cpp
libs/gui/ConsumerBase.cpp
libs/gui/CpuConsumer.cpp
libs/gui/GLConsumer.cpp
libs/gui/IGraphicBufferConsumer.cpp
libs/gui/IGraphicBufferProducer.cpp
libs/gui/ISurfaceComposer.cpp
libs/gui/LayerState.cpp
libs/gui/Sensor.cpp
libs/gui/StreamSplitter.cpp
libs/gui/Surface.cpp
libs/gui/SurfaceComposerClient.cpp
libs/gui/SurfaceControl.cpp
libs/gui/tests/BufferQueue_test.cpp
libs/gui/tests/CpuConsumer_test.cpp
libs/gui/tests/GLTest.h
libs/gui/tests/IGraphicBufferProducer_test.cpp
libs/gui/tests/StreamSplitter_test.cpp
libs/gui/tests/SurfaceTextureClient_test.cpp
libs/gui/tests/SurfaceTextureFBO_test.cpp
libs/gui/tests/SurfaceTextureGLThreadToGL_test.cpp
libs/gui/tests/SurfaceTextureGLToGL.h
libs/gui/tests/SurfaceTextureGLToGL_test.cpp
libs/gui/tests/SurfaceTextureGL_test.cpp
libs/gui/tests/SurfaceTextureMultiContextGL.h
libs/gui/tests/SurfaceTextureMultiContextGL_test.cpp
libs/gui/tests/Surface_test.cpp
libs/gui/tests/TextureRenderer.cpp
libs/input/KeyCharacterMap.cpp
libs/ui/FramebufferNativeWindow.cpp
libs/ui/GraphicBuffer.cpp
libs/ui/Rect.cpp
libs/ui/Region.cpp
opengl/libs/Android.mk
opengl/libs/EGL/Loader.cpp
opengl/libs/EGL/egl.cpp
opengl/libs/EGL/eglApi.cpp
opengl/libs/EGL/egl_display.cpp
opengl/libs/EGL/egl_tls.h
opengl/libs/EGL/trace.cpp [deleted file]
opengl/libs/GLES_trace/.gitignore [deleted file]
opengl/libs/GLES_trace/Android.mk [deleted file]
opengl/libs/GLES_trace/DESIGN.txt [deleted file]
opengl/libs/GLES_trace/dev.make [deleted file]
opengl/libs/GLES_trace/proto/gltrace.proto [deleted file]
opengl/libs/GLES_trace/src/gltrace_api.cpp [deleted file]
opengl/libs/GLES_trace/src/gltrace_api.h [deleted file]
opengl/libs/GLES_trace/src/gltrace_context.cpp [deleted file]
opengl/libs/GLES_trace/src/gltrace_context.h [deleted file]
opengl/libs/GLES_trace/src/gltrace_egl.cpp [deleted file]
opengl/libs/GLES_trace/src/gltrace_egl.h [deleted file]
opengl/libs/GLES_trace/src/gltrace_eglapi.cpp [deleted file]
opengl/libs/GLES_trace/src/gltrace_fixup.cpp [deleted file]
opengl/libs/GLES_trace/src/gltrace_fixup.h [deleted file]
opengl/libs/GLES_trace/src/gltrace_hooks.cpp [deleted file]
opengl/libs/GLES_trace/src/gltrace_hooks.h [deleted file]
opengl/libs/GLES_trace/src/gltrace_transport.cpp [deleted file]
opengl/libs/GLES_trace/src/gltrace_transport.h [deleted file]
opengl/libs/GLES_trace/tools/genapi.py [deleted file]
opengl/libs/GLES_trace/tools/testgenapi.py [deleted file]
opengl/libs/glestrace.h [deleted file]
opengl/libs/tools/genfiles
opengl/libs/tools/gltracegen [deleted file]
opengl/libs/trace.in [deleted file]
opengl/tools/glgen/specs/egl/checks.spec
opengl/tools/glgen/specs/gles11/checks.spec
opengl/tools/glgen/specs/jsr239/glspec-checks
opengl/tools/glgen/src/JniCodeEmitter.java
opengl/tools/glgen/stubs/egl/eglCreatePbufferFromClientBuffer.cpp
opengl/tools/glgen/stubs/egl/eglCreateWindowSurface.cpp
opengl/tools/glgen/stubs/gles11/GLES31Header.java-if
opengl/tools/glgen/stubs/gles11/glGetActiveAttrib.cpp
opengl/tools/glgen/stubs/gles11/glGetActiveUniform.cpp
opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.cpp
opengl/tools/glgen/stubs/gles11/glGetShaderSource.cpp
opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.cpp
services/inputflinger/InputReader.cpp
services/inputflinger/InputReader.h
services/inputflinger/host/Android.mk
services/inputflinger/host/InputDriver.cpp
services/inputflinger/host/InputDriver.h
services/inputflinger/host/InputHost.cpp
services/inputflinger/host/InputHost.h
services/inputflinger/host/inputflinger.rc [new file with mode: 0644]
services/sensorservice/CorrectedGyroSensor.cpp
services/sensorservice/Fusion.cpp
services/sensorservice/Fusion.h
services/sensorservice/GravitySensor.cpp
services/sensorservice/OrientationSensor.cpp
services/sensorservice/RotationVectorSensor.cpp
services/sensorservice/RotationVectorSensor.h
services/sensorservice/SensorFusion.cpp
services/sensorservice/SensorFusion.h
services/sensorservice/SensorService.cpp
services/sensorservice/SensorService.h
services/surfaceflinger/Client.cpp
services/surfaceflinger/DispSync.cpp
services/surfaceflinger/DispSync.h
services/surfaceflinger/DisplayHardware/FloatRect.h
services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp
services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h
services/surfaceflinger/EventLog/EventLogTags.logtags
services/surfaceflinger/Layer.cpp
services/surfaceflinger/Layer.h
services/surfaceflinger/MessageQueue.cpp
services/surfaceflinger/MonitoredProducer.cpp
services/surfaceflinger/MonitoredProducer.h
services/surfaceflinger/RenderEngine/RenderEngine.cpp
services/surfaceflinger/SurfaceFlinger.cpp
services/surfaceflinger/SurfaceFlinger.h
services/surfaceflinger/SurfaceFlingerConsumer.cpp
services/surfaceflinger/SurfaceFlingerConsumer.h
services/surfaceflinger/tests/Transaction_test.cpp
services/surfaceflinger/tests/resize/Android.mk [deleted file]
services/surfaceflinger/tests/resize/resize.cpp [deleted file]
services/surfaceflinger/tests/screencap/Android.mk [deleted file]
services/surfaceflinger/tests/screencap/screencap.cpp [deleted file]
services/surfaceflinger/tests/transform/Android.mk [deleted file]
services/surfaceflinger/tests/transform/TransformTest.cpp [deleted file]

index 81c8967..4d4e0ce 100644 (file)
@@ -99,6 +99,7 @@ static const TracingCategory k_categories[] = {
         { REQ,      "/sys/kernel/debug/tracing/events/sched/sched_switch/enable" },
         { REQ,      "/sys/kernel/debug/tracing/events/sched/sched_wakeup/enable" },
         { OPT,      "/sys/kernel/debug/tracing/events/sched/sched_blocked_reason/enable" },
+        { OPT,      "/sys/kernel/debug/tracing/events/sched/sched_cpu_hotplug/enable" },
     } },
     { "irq",        "IRQ Events",   0, {
         { REQ,      "/sys/kernel/debug/tracing/events/irq/enable" },
@@ -107,6 +108,7 @@ static const TracingCategory k_categories[] = {
     { "freq",       "CPU Frequency",    0, {
         { REQ,      "/sys/kernel/debug/tracing/events/power/cpu_frequency/enable" },
         { OPT,      "/sys/kernel/debug/tracing/events/power/clock_set_rate/enable" },
+        { OPT,      "/sys/kernel/debug/tracing/events/power/cpu_frequency_limits/enable" },
     } },
     { "membus",     "Memory Bus Utilization", 0, {
         { REQ,      "/sys/kernel/debug/tracing/events/memory_bus/enable" },
@@ -156,6 +158,9 @@ static const TracingCategory k_categories[] = {
         { REQ,      "/sys/kernel/debug/tracing/events/binder/binder_locked/enable" },
         { REQ,      "/sys/kernel/debug/tracing/events/binder/binder_unlock/enable" },
     } },
+    { "pagecache",  "Page cache", 0, {
+        { REQ,      "/sys/kernel/debug/tracing/events/filemap/enable" },
+    } },
 };
 
 /* Command line options */
index 74c8d43..c2f8891 100644 (file)
@@ -13,9 +13,11 @@ on boot
     chown root shell /sys/kernel/debug/tracing/events/sched/sched_switch/enable
     chown root shell /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable
     chown root shell /sys/kernel/debug/tracing/events/sched/sched_blocked_reason/enable
+    chown root shell /sys/kernel/debug/tracing/events/sched/sched_cpu_hotplug/enable
     chown root shell /sys/kernel/debug/tracing/events/power/cpu_frequency/enable
     chown root shell /sys/kernel/debug/tracing/events/power/cpu_idle/enable
     chown root shell /sys/kernel/debug/tracing/events/power/clock_set_rate/enable
+    chown root shell /sys/kernel/debug/tracing/events/power/cpu_frequency_limits/enable
     chown root shell /sys/kernel/debug/tracing/events/cpufreq_interactive/enable
     chown root shell /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_direct_reclaim_begin/enable
     chown root shell /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_direct_reclaim_end/enable
@@ -36,9 +38,11 @@ on boot
     chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_switch/enable
     chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable
     chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_blocked_reason/enable
+    chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_cpu_hotplug/enable
     chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_frequency/enable
     chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_idle/enable
     chmod 0664 /sys/kernel/debug/tracing/events/power/clock_set_rate/enable
+    chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_frequency_limits/enable
     chmod 0664 /sys/kernel/debug/tracing/events/cpufreq_interactive/enable
     chmod 0664 /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_direct_reclaim_begin/enable
     chmod 0664 /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_direct_reclaim_end/enable
diff --git a/cmds/cmd/Android.mk b/cmds/cmd/Android.mk
new file mode 100644 (file)
index 0000000..ac2f4c0
--- /dev/null
@@ -0,0 +1,20 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+       cmd.cpp
+
+LOCAL_SHARED_LIBRARIES := \
+       libutils \
+       liblog \
+       libbinder
+       
+
+ifeq ($(TARGET_OS),linux)
+       LOCAL_CFLAGS += -DXP_UNIX
+       #LOCAL_SHARED_LIBRARIES += librt
+endif
+
+LOCAL_MODULE:= cmd
+
+include $(BUILD_EXECUTABLE)
diff --git a/cmds/cmd/MODULE_LICENSE_APACHE2 b/cmds/cmd/MODULE_LICENSE_APACHE2
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/cmds/cmd/NOTICE b/cmds/cmd/NOTICE
new file mode 100644 (file)
index 0000000..c5b1efa
--- /dev/null
@@ -0,0 +1,190 @@
+
+   Copyright (c) 2005-2008, The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
diff --git a/cmds/cmd/cmd.cpp b/cmds/cmd/cmd.cpp
new file mode 100644 (file)
index 0000000..ed740d3
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "cmd"
+
+#include <utils/Log.h>
+#include <binder/Parcel.h>
+#include <binder/ProcessState.h>
+#include <binder/IResultReceiver.h>
+#include <binder/IServiceManager.h>
+#include <binder/TextOutput.h>
+#include <utils/Vector.h>
+
+#include <getopt.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+using namespace android;
+
+static int sort_func(const String16* lhs, const String16* rhs)
+{
+    return lhs->compare(*rhs);
+}
+
+class MyResultReceiver : public BnResultReceiver
+{
+public:
+    virtual void send(int32_t /*resultCode*/) {
+    }
+};
+
+int main(int argc, char* const argv[])
+{
+    signal(SIGPIPE, SIG_IGN);
+    sp<ProcessState> proc = ProcessState::self();
+    proc->startThreadPool();
+
+    sp<IServiceManager> sm = defaultServiceManager();
+    fflush(stdout);
+    if (sm == NULL) {
+        ALOGE("Unable to get default service manager!");
+        aerr << "cmd: Unable to get default service manager!" << endl;
+        return 20;
+    }
+
+    if (argc == 1) {
+        aout << "cmd: no service specified; use -l to list all services" << endl;
+        return 20;
+    }
+
+    if ((argc == 2) && (strcmp(argv[1], "-l") == 0)) {
+        Vector<String16> services = sm->listServices();
+        services.sort(sort_func);
+        aout << "Currently running services:" << endl;
+
+        for (size_t i=0; i<services.size(); i++) {
+            sp<IBinder> service = sm->checkService(services[i]);
+            if (service != NULL) {
+                aout << "  " << services[i] << endl;
+            }
+        }
+        return 0;
+    }
+
+    Vector<String16> args;
+    for (int i=2; i<argc; i++) {
+        args.add(String16(argv[i]));
+    }
+    String16 cmd = String16(argv[1]);
+    sp<IBinder> service = sm->checkService(cmd);
+    if (service == NULL) {
+        aerr << "Can't find service: " << argv[1] << endl;
+        return 20;
+    }
+
+    // TODO: block until a result is returned to MyResultReceiver.
+    IBinder::shellCommand(service, STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO, args,
+            new MyResultReceiver());
+    return 0;
+}
index 6442701..4ab8d3d 100644 (file)
@@ -15,6 +15,8 @@ LOCAL_SRC_FILES := dumpstate.cpp utils.cpp
 LOCAL_MODULE := dumpstate
 
 LOCAL_SHARED_LIBRARIES := libcutils liblog libselinux
+# ZipArchive support, the order matters here to get all symbols.
+LOCAL_STATIC_LIBRARIES := libziparchive libz libbase
 LOCAL_HAL_STATIC_LIBRARIES := libdumpstate
 LOCAL_CFLAGS += -Wall -Wno-unused-parameter -std=gnu99
 LOCAL_INIT_RC := dumpstate.rc
index 08c6aa7..a08014d 100644 (file)
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <libgen.h>
 #include <limits.h>
+#include <memory>
+#include <regex>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string>
 #include <string.h>
 #include <sys/capability.h>
 #include <sys/prctl.h>
@@ -30,6 +34,7 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
+#include <android-base/stringprintf.h>
 #include <cutils/properties.h>
 
 #include "private/android_filesystem_config.h"
 #include <cutils/log.h>
 
 #include "dumpstate.h"
+#include "ScopedFd.h"
+#include "ziparchive/zip_writer.h"
+
+using android::base::StringPrintf;
 
 /* read before root is shed */
 static char cmdline_buf[16384] = "(unknown)";
 static const char *dump_traces_path = NULL;
 
-static char screenshot_path[PATH_MAX] = "";
-
 #define PSTORE_LAST_KMSG "/sys/fs/pstore/console-ramoops"
 
 #define RAFT_DIR "/data/misc/raft/"
@@ -263,7 +270,7 @@ static unsigned long logcat_timeout(const char *name) {
 /* End copy from system/core/logd/LogBuffer.cpp */
 
 /* dumps the current system state to stdout */
-static void dumpstate() {
+static void dumpstate(const std::string& screenshot_path) {
     unsigned long timeout;
     time_t now = time(NULL);
     char build[PROPERTY_VALUE_MAX], fingerprint[PROPERTY_VALUE_MAX];
@@ -316,7 +323,7 @@ static void dumpstate() {
     dump_file("KERNEL SYNC", "/d/sync");
 
     run_command("PROCESSES AND THREADS", 10, "ps", "-Z", "-t", "-p", "-P", NULL);
-    run_command("LIBRANK", 10, "librank", NULL);
+    run_command("LIBRANK", 10, SU_PATH, "root", "librank", NULL);
 
     do_dmesg();
 
@@ -324,10 +331,10 @@ static void dumpstate() {
     for_each_pid(do_showmap, "SMAPS OF ALL PROCESSES");
     for_each_tid(show_wchan, "BLOCKED PROCESS WAIT-CHANNELS");
 
-    if (screenshot_path[0]) {
-        ALOGI("taking screenshot\n");
-        run_command(NULL, 10, "/system/bin/screencap", "-p", screenshot_path, NULL);
-        ALOGI("wrote screenshot: %s\n", screenshot_path);
+    if (!screenshot_path.empty()) {
+        ALOGI("taking late screenshot\n");
+        take_screenshot(screenshot_path);
+        ALOGI("wrote screenshot: %s\n", screenshot_path.c_str());
     }
 
     // dump_file("EVENT LOG TAGS", "/etc/event-log-tags");
@@ -589,12 +596,14 @@ static void usage() {
     fprintf(stderr, "usage: dumpstate [-b soundfile] [-e soundfile] [-o file [-d] [-p] [-z]] [-s] [-q]\n"
             "  -o: write to file (instead of stdout)\n"
             "  -d: append date to filename (requires -o)\n"
+            "  -z: generates zipped file (requires -o)\n"
             "  -p: capture screenshot to filename.png (requires -o)\n"
             "  -s: write output to control socket (for init)\n"
             "  -b: play sound file instead of vibrate, at beginning of job\n"
             "  -e: play sound file instead of vibrate, at end of job\n"
             "  -q: disable vibrate\n"
-            "  -B: send broadcast when finished (requires -o and -p)\n"
+            "  -B: send broadcast when finished (requires -o)\n"
+            "  -P: send broadacast when started and update system properties on progress (requires -o and -B)\n"
                 );
 }
 
@@ -608,14 +617,77 @@ static void vibrate(FILE* vibrator, int ms) {
     fflush(vibrator);
 }
 
+/* generates a zipfile on 'path' with an entry with the contents of 'tmp_path'
+   and removes the temporary file.
+ */
+static bool generate_zip_file(std::string tmp_path, std::string path,
+                             std::string entry_name, time_t entry_time) {
+    std::unique_ptr<FILE, int(*)(FILE*)> file(fopen(path.c_str(), "wb"), fclose);
+    if (!file) {
+        ALOGE("fopen(%s, 'wb'): %s\n", path.c_str(), strerror(errno));
+        return false;
+    }
+
+    ZipWriter writer(file.get());
+    int32_t err = writer.StartEntryWithTime(entry_name.c_str(), ZipWriter::kCompress, entry_time);
+    if (err) {
+        ALOGE("writer.StartEntryWithTime(%s): %s\n", entry_name.c_str(), ZipWriter::ErrorCodeString(err));
+        return false;
+    }
+
+    ScopedFd fd(TEMP_FAILURE_RETRY(open(tmp_path.c_str(), O_RDONLY | O_NONBLOCK | O_CLOEXEC)));
+    if (fd.get() == -1) {
+        ALOGE("open(%s): %s\n", tmp_path.c_str(), strerror(errno));
+        return false;
+    }
+
+    while (1) {
+        std::vector<uint8_t> buffer(65536);
+        ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fd.get(), buffer.data(), sizeof(buffer)));
+        if (bytes_read == 0) {
+            break;
+        } else if (bytes_read == -1) {
+            ALOGE("read(%s): %s\n", tmp_path.c_str(), strerror(errno));
+            return false;
+       }
+       err = writer.WriteBytes(buffer.data(), bytes_read);
+       if (err) {
+           ALOGE("writer.WriteBytes(): %s\n", ZipWriter::ErrorCodeString(err));
+           return false;
+       }
+    }
+
+    err = writer.FinishEntry();
+    if (err) {
+        ALOGE("writer.FinishEntry(): %s\n", ZipWriter::ErrorCodeString(err));
+        return false;
+    }
+
+    err = writer.Finish();
+    if (err) {
+        ALOGE("writer.Finish(): %s\n", ZipWriter::ErrorCodeString(err));
+        return false;
+    }
+
+    if (remove(tmp_path.c_str())) {
+        ALOGE("remove(%s): %s\n", tmp_path.c_str(), strerror(errno));
+        return false;
+    }
+
+    return true;
+}
+
+
 int main(int argc, char *argv[]) {
     struct sigaction sigact;
     int do_add_date = 0;
+    int do_zip_file = 0;
     int do_vibrate = 1;
     char* use_outfile = 0;
     int use_socket = 0;
     int do_fb = 0;
     int do_broadcast = 0;
+    int do_early_screenshot = 0;
 
     if (getuid() != 0) {
         // Old versions of the adb client would call the
@@ -643,15 +715,17 @@ int main(int argc, char *argv[]) {
 
     /* parse arguments */
     int c;
-    while ((c = getopt(argc, argv, "dho:svqzpB")) != -1) {
+    while ((c = getopt(argc, argv, "dho:svqzpPB")) != -1) {
         switch (c) {
-            case 'd': do_add_date = 1;       break;
-            case 'o': use_outfile = optarg;  break;
-            case 's': use_socket = 1;        break;
+            case 'd': do_add_date = 1;          break;
+            case 'z': do_zip_file = 1;          break;
+            case 'o': use_outfile = optarg;     break;
+            case 's': use_socket = 1;           break;
             case 'v': break;  // compatibility no-op
-            case 'q': do_vibrate = 0;        break;
-            case 'p': do_fb = 1;             break;
-            case 'B': do_broadcast = 1;      break;
+            case 'q': do_vibrate = 0;           break;
+            case 'p': do_fb = 1;                break;
+            case 'P': do_update_progress = 1;   break;
+            case 'B': do_broadcast = 1;         break;
             case '?': printf("\n");
             case 'h':
                 usage();
@@ -659,24 +733,108 @@ int main(int argc, char *argv[]) {
         }
     }
 
+    if ((do_zip_file || do_add_date || do_update_progress || do_broadcast) && !use_outfile) {
+        usage();
+        exit(1);
+    }
+
+    if (do_update_progress && !do_broadcast) {
+        usage();
+        exit(1);
+    }
+
+    do_early_screenshot = do_update_progress;
+
     // If we are going to use a socket, do it as early as possible
     // to avoid timeouts from bugreport.
     if (use_socket) {
         redirect_to_socket(stdout, "dumpstate");
     }
 
+    /* full path of the directory where the bug report files will be written */
+    std::string bugreport_dir;
+
+    /* full path of the temporary file containing the bug report */
+    std::string tmp_path;
+
+    /* full path of the temporary file containing the screenshot (when requested) */
+    std::string screenshot_path;
+
+    /* base name (without suffix or extensions) of the bug report files */
+    std::string base_name;
+
+    /* suffix of the bug report files - it's typically the date (when invoked with -d),
+     * although it could be changed by the user using a system property */
+    std::string suffix;
+
+    /* pointer to the actual path, be it zip or text */
+    std::string path;
+
+    time_t now = time(NULL);
+
+    /* redirect output if needed */
+    bool is_redirecting = !use_socket && use_outfile;
+
+    if (is_redirecting) {
+        bugreport_dir = dirname(use_outfile);
+        base_name = basename(use_outfile);
+        if (do_add_date) {
+            char date[80];
+            strftime(date, sizeof(date), "%Y-%m-%d-%H-%M-%S", localtime(&now));
+            suffix = date;
+        } else {
+            suffix = "undated";
+        }
+        if (do_fb) {
+            // TODO: if dumpstate was an object, the paths could be internal variables and then
+            // we could have a function to calculate the derived values, such as:
+            //     screenshot_path = GetPath(".png");
+            screenshot_path = bugreport_dir + "/" + base_name + "-" + suffix + ".png";
+        }
+        tmp_path = bugreport_dir + "/" + base_name + "-" + suffix + ".tmp";
+
+        ALOGD("Bugreport dir: %s\nBase name: %s\nSuffix: %s\nTemporary path: %s\n"
+                "Screenshot path: %s\n", bugreport_dir.c_str(), base_name.c_str(), suffix.c_str(),
+                tmp_path.c_str(), screenshot_path.c_str());
+
+        if (do_update_progress) {
+            std::vector<std::string> am_args = {
+                 "--receiver-permission", "android.permission.DUMP",
+                 "--es", "android.intent.extra.NAME", suffix,
+                 "--ei", "android.intent.extra.PID", std::to_string(getpid()),
+                 "--ei", "android.intent.extra.MAX", std::to_string(WEIGHT_TOTAL),
+            };
+            send_broadcast("android.intent.action.BUGREPORT_STARTED", am_args);
+        }
+    }
+
     /* open the vibrator before dropping root */
-    FILE *vibrator = 0;
+    std::unique_ptr<FILE, int(*)(FILE*)> vibrator(NULL, fclose);
     if (do_vibrate) {
-        vibrator = fopen("/sys/class/timed_output/vibrator/enable", "we");
+        vibrator.reset(fopen("/sys/class/timed_output/vibrator/enable", "we"));
         if (vibrator) {
-            vibrate(vibrator, 150);
+            vibrate(vibrator.get(), 150);
+        }
+    }
+
+    if (do_fb && do_early_screenshot) {
+        if (screenshot_path.empty()) {
+            // should not have happened
+            ALOGE("INTERNAL ERROR: skipping early screenshot because path was not set");
+        } else {
+            ALOGI("taking early screenshot\n");
+            take_screenshot(screenshot_path);
+            ALOGI("wrote screenshot: %s\n", screenshot_path.c_str());
+            if (chown(screenshot_path.c_str(), AID_SHELL, AID_SHELL)) {
+                ALOGE("Unable to change ownership of screenshot file %s: %s\n",
+                        screenshot_path.c_str(), strerror(errno));
+            }
         }
     }
 
     /* read /proc/cmdline before dropping root */
     FILE *cmdline = fopen("/proc/cmdline", "re");
-    if (cmdline != NULL) {
+    if (cmdline) {
         fgets(cmdline_buf, sizeof(cmdline_buf), cmdline);
         fclose(cmdline);
     }
@@ -726,59 +884,103 @@ int main(int argc, char *argv[]) {
         return -1;
     }
 
-    /* redirect output if needed */
-    char path[PATH_MAX], tmp_path[PATH_MAX];
-    pid_t gzip_pid = -1;
-
-    if (!use_socket && use_outfile) {
-        strlcpy(path, use_outfile, sizeof(path));
-        if (do_add_date) {
-            char date[80];
-            time_t now = time(NULL);
-            strftime(date, sizeof(date), "-%Y-%m-%d-%H-%M-%S", localtime(&now));
-            strlcat(path, date, sizeof(path));
-        }
-        if (do_fb) {
-            strlcpy(screenshot_path, path, sizeof(screenshot_path));
-            strlcat(screenshot_path, ".png", sizeof(screenshot_path));
-        }
-        strlcat(path, ".txt", sizeof(path));
-        strlcpy(tmp_path, path, sizeof(tmp_path));
-        strlcat(tmp_path, ".tmp", sizeof(tmp_path));
-        redirect_to_file(stdout, tmp_path);
+    if (is_redirecting) {
+        /* TODO: rather than generating a text file now and zipping it later,
+           it would be more efficient to redirect stdout to the zip entry
+           directly, but the libziparchive doesn't support that option yet. */
+        redirect_to_file(stdout, const_cast<char*>(tmp_path.c_str()));
     }
 
-    dumpstate();
+    dumpstate(do_early_screenshot ? "": screenshot_path);
 
     /* done */
     if (vibrator) {
         for (int i = 0; i < 3; i++) {
-            vibrate(vibrator, 75);
+            vibrate(vibrator.get(), 75);
             usleep((75 + 50) * 1000);
         }
-        fclose(vibrator);
     }
 
-    /* wait for gzip to finish, otherwise it might get killed when we exit */
-    if (gzip_pid > 0) {
+    /* close output if needed */
+    if (is_redirecting) {
         fclose(stdout);
-        waitpid(gzip_pid, NULL, 0);
     }
 
-    /* rename the (now complete) .tmp file to its final location */
-    if (use_outfile && rename(tmp_path, path)) {
-        fprintf(stderr, "rename(%s, %s): %s\n", tmp_path, path, strerror(errno));
+    /* rename or zip the (now complete) .tmp file to its final location */
+    if (use_outfile) {
+
+        /* check if user changed the suffix using system properties */
+        char key[PROPERTY_KEY_MAX];
+        char value[PROPERTY_VALUE_MAX];
+        sprintf(key, "dumpstate.%d.name", getpid());
+        property_get(key, value, "");
+        bool change_suffix= false;
+        if (value[0]) {
+            /* must whitelist which characters are allowed, otherwise it could cross directories */
+            std::regex valid_regex("^[-_a-zA-Z0-9]+$");
+            if (std::regex_match(value, valid_regex)) {
+                change_suffix = true;
+            } else {
+                ALOGE("invalid suffix provided by user: %s", value);
+            }
+        }
+        if (change_suffix) {
+            ALOGI("changing suffix from %s to %s", suffix.c_str(), value);
+            suffix = value;
+            if (!screenshot_path.empty()) {
+                std::string new_screenshot_path =
+                        bugreport_dir + "/" + base_name + "-" + suffix + ".png";
+                if (rename(screenshot_path.c_str(), new_screenshot_path.c_str())) {
+                    ALOGE("rename(%s, %s): %s\n", screenshot_path.c_str(),
+                            new_screenshot_path.c_str(), strerror(errno));
+                } else {
+                    screenshot_path = new_screenshot_path;
+                }
+            }
+        }
+
+        bool do_text_file = true;
+        if (do_zip_file) {
+            ALOGD("Generating .zip bugreport");
+            path = bugreport_dir + "/" + base_name + "-" + suffix + ".zip";
+            if (!generate_zip_file(tmp_path, path, base_name + "-" + suffix + ".txt", now)) {
+                ALOGE("Failed to generate zip file; sending text bugreport instead\n");
+                do_text_file = true;
+            } else {
+                do_text_file = false;
+            }
+        }
+        if (do_text_file) {
+            ALOGD("Generating .txt bugreport");
+            path = bugreport_dir + "/" + base_name + "-" + suffix + ".txt";
+            if (rename(tmp_path.c_str(), path.c_str())) {
+                ALOGE("rename(%s, %s): %s\n", tmp_path.c_str(), path.c_str(), strerror(errno));
+                path.clear();
+            }
+        }
     }
 
     /* tell activity manager we're done */
-    if (do_broadcast && use_outfile && do_fb) {
-        run_command(NULL, 5, "/system/bin/am", "broadcast", "--user", "0",
-                "-a", "android.intent.action.BUGREPORT_FINISHED",
-                "--es", "android.intent.extra.BUGREPORT", path,
-                "--es", "android.intent.extra.SCREENSHOT", screenshot_path,
-                "--receiver-permission", "android.permission.DUMP", NULL);
+    if (do_broadcast) {
+        if (!path.empty()) {
+            ALOGI("Final bugreport path: %s\n", path.c_str());
+            std::vector<std::string> am_args = {
+                 "--receiver-permission", "android.permission.DUMP",
+                 "--ei", "android.intent.extra.PID", std::to_string(getpid()),
+                 "--es", "android.intent.extra.BUGREPORT", path
+            };
+            if (do_fb) {
+                am_args.push_back("--es");
+                am_args.push_back("android.intent.extra.SCREENSHOT");
+                am_args.push_back(screenshot_path);
+            }
+            send_broadcast("android.intent.action.BUGREPORT_FINISHED", am_args);
+        } else {
+            ALOGE("Skipping finished broadcast because bugreport could not be generated\n");
+        }
     }
 
+    ALOGD("Final progress: %d/%d (originally %d)\n", progress, weight_total, WEIGHT_TOTAL);
     ALOGI("done\n");
 
     return 0;
index 3b6abc1..df9721d 100644 (file)
 #ifndef _DUMPSTATE_H_
 #define _DUMPSTATE_H_
 
+/* When defined, skips the real dumps and just print the section headers.
+   Useful when debugging dumpstate itself. */
+//#define _DUMPSTATE_DRY_RUN_
+
+#ifdef _DUMPSTATE_DRY_RUN_
+#define ON_DRY_RUN_RETURN(X) return X
+#define ON_DRY_RUN(code) code
+#else
+#define ON_DRY_RUN_RETURN(X)
+#define ON_DRY_RUN(code)
+#endif
+
+
 #include <time.h>
 #include <unistd.h>
 #include <stdbool.h>
 #include <stdio.h>
+#include <vector>
 
 #define SU_PATH "/system/xbin/su"
 
@@ -31,6 +45,32 @@ extern "C" {
 typedef void (for_each_pid_func)(int, const char *);
 typedef void (for_each_tid_func)(int, int, const char *);
 
+/* Estimated total weight of bugreport generation.
+ *
+ * Each section contributes to the total weight by an individual weight, so the overall progress
+ * can be calculated by dividing the all completed weight by the total weight.
+ *
+ * This value is defined empirically and it need to be adjusted as more sections are added.
+ *
+ * It does not need to match the exact sum of all sections, but ideally it should to be slight more
+ * than such sum: a value too high will cause the bugreport to finish before the user expected (for
+ * example, jumping from 70% to 100%), while a value too low will cause the progress to fluctuate
+ * down (for example, from 70% to 50%, since the actual max will be automatically increased every
+ * time it is reached).
+ */
+static const int WEIGHT_TOTAL = 4000;
+
+/* Most simple commands have 10 as timeout, so 5 is a good estimate */
+static const int WEIGHT_FILE = 5;
+
+/*
+ * TOOD: the dumpstate internal state is getting fragile; for example, this variable is defined
+ * here, declared at utils.cpp, and used on utils.cpp and dumpstate.cpp.
+ * It would be better to take advantage of the C++ migration and encapsulate the state in an object,
+ * but that will be better handled in a major C++ refactoring, which would also get rid of other C
+ * idioms (like using std::string instead of char*, removing varargs, etc...) */
+extern int do_update_progress, progress, weight_total;
+
 /* prints the contents of a file */
 int dump_file(const char *title, const char *path);
 
@@ -52,6 +92,17 @@ int dump_files(const char *title, const char *dir,
 /* forks a command and waits for it to finish -- terminate args with NULL */
 int run_command(const char *title, int timeout_seconds, const char *command, ...);
 
+/* forks a command and waits for it to finish
+   first element of args is the command, and last must be NULL.
+   command is always ran, even when _DUMPSTATE_DRY_RUN_ is defined. */
+int run_command_always(const char *title, int timeout_seconds, const char *args[]);
+
+/* sends a broadcast using Activity Manager */
+void send_broadcast(const std::string& action, const std::vector<std::string>& args);
+
+/* updates the overall progress of dumpstate by the given weight increment */
+void update_progress(int weight);
+
 /* prints all the system properties */
 void print_properties();
 
@@ -88,11 +139,14 @@ void play_sound(const char *path);
 /* Implemented by libdumpstate_board to dump board-specific info */
 void dumpstate_board();
 
-/* dump eMMC Extended CSD data */
-void dump_emmc_ecsd(const char *ext_csd_path);
+/* Takes a screenshot and save it to the given file */
+void take_screenshot(const std::string& path);
 
 #ifdef __cplusplus
 }
 #endif
 
+/* dump eMMC Extended CSD data */
+void dump_emmc_ecsd(const char *ext_csd_path);
+
 #endif /* _DUMPSTATE_H_ */
index 4cd1803..e21fd7c 100644 (file)
@@ -8,3 +8,13 @@ service dumpstate /system/bin/dumpstate -s
     socket dumpstate stream 0660 shell log
     disabled
     oneshot
+
+# bugreportplus is an enhanced version of bugreport that provides a better
+# user interface (like displaying progress and allowing user to enter details).
+# It's typically triggered by the power button or developer settings.
+# TODO: remove the -p option when screenshot is taken by Shell
+service bugreportplus /system/bin/dumpstate -d -p -B -P -z \
+        -o /data/data/com.android.shell/files/bugreports/bugreport
+    class main
+    disabled
+    oneshot
index c3e0262..d448c74 100644 (file)
@@ -23,6 +23,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string>
 #include <string.h>
 #include <sys/inotify.h>
 #include <sys/stat.h>
 #include <sys/klog.h>
 #include <time.h>
 #include <unistd.h>
+#include <vector>
 #include <sys/prctl.h>
 
+#define LOG_TAG "dumpstate"
 #include <cutils/debugger.h>
+#include <cutils/log.h>
 #include <cutils/properties.h>
 #include <cutils/sockets.h>
 #include <private/android_filesystem_config.h>
@@ -46,10 +50,12 @@ static const int64_t NANOS_PER_SEC = 1000000000;
 
 /* list of native processes to include in the native dumps */
 static const char* native_processes_to_dump[] = {
+        "/system/bin/audioserver",
         "/system/bin/drmserver",
         "/system/bin/mediaserver",
         "/system/bin/sdcard",
         "/system/bin/surfaceflinger",
+        "/system/bin/vehicle_network_service",
         NULL,
 };
 
@@ -60,6 +66,7 @@ static uint64_t nanotime() {
 }
 
 void for_each_userid(void (*func)(int), const char *header) {
+    ON_DRY_RUN_RETURN();
     DIR *d;
     struct dirent *de;
 
@@ -122,14 +129,15 @@ static void for_each_pid_helper(int pid, const char *cmdline, void *arg) {
 }
 
 void for_each_pid(for_each_pid_func func, const char *header) {
-    __for_each_pid(for_each_pid_helper, header, (void *) func);
+    ON_DRY_RUN_RETURN();
+  __for_each_pid(for_each_pid_helper, header, (void *)func);
 }
 
 static void for_each_tid_helper(int pid, const char *cmdline, void *arg) {
     DIR *d;
     struct dirent *de;
     char taskpath[255];
-    for_each_tid_func *func = (for_each_tid_func*) arg;
+    for_each_tid_func *func = (for_each_tid_func *) arg;
 
     sprintf(taskpath, "/proc/%d/task", pid);
 
@@ -174,10 +182,12 @@ static void for_each_tid_helper(int pid, const char *cmdline, void *arg) {
 }
 
 void for_each_tid(for_each_tid_func func, const char *header) {
+    ON_DRY_RUN_RETURN();
     __for_each_pid(for_each_tid_helper, header, (void *) func);
 }
 
 void show_wchan(int pid, int tid, const char *name) {
+    ON_DRY_RUN_RETURN();
     char path[255];
     char buffer[255];
     int fd;
@@ -208,6 +218,7 @@ out_close:
 
 void do_dmesg() {
     printf("------ KERNEL LOG (dmesg) ------\n");
+    ON_DRY_RUN_RETURN();
     /* Get size of kernel buffer */
     int size = klogctl(KLOG_SIZE_BUFFER, NULL, 0);
     if (size <= 0) {
@@ -241,11 +252,16 @@ void do_showmap(int pid, const char *name) {
 }
 
 static int _dump_file_from_fd(const char *title, const char *path, int fd) {
-    if (title) printf("------ %s (%s", title, path);
-
     if (title) {
+        printf("------ %s (%s", title, path);
+
         struct stat st;
-        if (memcmp(path, "/proc/", 6) && memcmp(path, "/sys/", 5) && !fstat(fd, &st)) {
+        // Only show the modification time of non-device files.
+        size_t path_len = strlen(path);
+        if ((path_len < 6 || memcmp(path, "/proc/", 6)) &&
+                (path_len < 5 || memcmp(path, "/sys/", 5)) &&
+                (path_len < 3 || memcmp(path, "/d/", 3)) &&
+                !fstat(fd, &st)) {
             char stamp[80];
             time_t mtime = st.st_mtime;
             strftime(stamp, sizeof(stamp), "%Y-%m-%d %H:%M:%S", localtime(&mtime));
@@ -253,6 +269,7 @@ static int _dump_file_from_fd(const char *title, const char *path, int fd) {
         }
         printf(") ------\n");
     }
+    ON_DRY_RUN({ update_progress(WEIGHT_FILE); close(fd); return 0; });
 
     bool newline = false;
     fd_set read_set;
@@ -290,6 +307,7 @@ static int _dump_file_from_fd(const char *title, const char *path, int fd) {
             }
         }
     }
+    update_progress(WEIGHT_FILE);
     close(fd);
 
     if (!newline) printf("\n");
@@ -302,7 +320,6 @@ int dump_file(const char *title, const char *path) {
     int fd = TEMP_FAILURE_RETRY(open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC));
     if (fd < 0) {
         int err = errno;
-        if (title) printf("------ %s (%s) ------\n", title, path);
         printf("*** %s: %s\n", path, strerror(err));
         if (title) printf("\n");
         return -1;
@@ -328,6 +345,7 @@ int dump_files(const char *title, const char *dir,
     if (title) {
         printf("------ %s (%s) ------\n", title, dir);
     }
+    ON_DRY_RUN_RETURN(0);
 
     if (dir[strlen(dir) - 1] == '/') {
         ++slash;
@@ -387,9 +405,11 @@ int dump_file_from_fd(const char *title, const char *path, int fd) {
     int flags = fcntl(fd, F_GETFL);
     if (flags == -1) {
         printf("*** %s: failed to get flags on fd %d: %s\n", path, fd, strerror(errno));
+        close(fd);
         return -1;
     } else if (!(flags & O_NONBLOCK)) {
         printf("*** %s: fd must have O_NONBLOCK set.\n", path);
+        close(fd);
         return -1;
     }
     return _dump_file_from_fd(title, path, fd);
@@ -439,9 +459,37 @@ bool waitpid_with_timeout(pid_t pid, int timeout_seconds, int* status) {
     return true;
 }
 
-/* forks a command and waits for it to finish */
 int run_command(const char *title, int timeout_seconds, const char *command, ...) {
     fflush(stdout);
+
+    const char *args[1024] = {command};
+    size_t arg;
+    va_list ap;
+    va_start(ap, command);
+    if (title) printf("------ %s (%s", title, command);
+    for (arg = 1; arg < sizeof(args) / sizeof(args[0]); ++arg) {
+        args[arg] = va_arg(ap, const char *);
+        if (args[arg] == NULL) break;
+        if (title) printf(" %s", args[arg]);
+    }
+    if (title) printf(") ------\n");
+    fflush(stdout);
+
+    ON_DRY_RUN({ update_progress(timeout_seconds); va_end(ap); return 0; });
+
+    int status = run_command_always(title, timeout_seconds, args);
+    va_end(ap);
+    return status;
+}
+
+/* forks a command and waits for it to finish */
+int run_command_always(const char *title, int timeout_seconds, const char *args[]) {
+    /* TODO: for now we're simplifying the progress calculation by using the timeout as the weight.
+     * It's a good approximation for most cases, except when calling dumpsys, where its weight
+     * should be much higher proportionally to its timeout. */
+    int weight = timeout_seconds;
+
+    const char *command = args[0];
     uint64_t start = nanotime();
     pid_t pid = fork();
 
@@ -453,8 +501,6 @@ int run_command(const char *title, int timeout_seconds, const char *command, ...
 
     /* handle child case */
     if (pid == 0) {
-        const char *args[1024] = {command};
-        size_t arg;
 
         /* make sure the child dies when dumpstate dies */
         prctl(PR_SET_PDEATHSIG, SIGKILL);
@@ -465,17 +511,6 @@ int run_command(const char *title, int timeout_seconds, const char *command, ...
         sigact.sa_handler = SIG_IGN;
         sigaction(SIGPIPE, &sigact, NULL);
 
-        va_list ap;
-        va_start(ap, command);
-        if (title) printf("------ %s (%s", title, command);
-        for (arg = 1; arg < sizeof(args) / sizeof(args[0]); ++arg) {
-            args[arg] = va_arg(ap, const char *);
-            if (args[arg] == NULL) break;
-            if (title) printf(" %s", args[arg]);
-        }
-        if (title) printf(") ------\n");
-        fflush(stdout);
-
         execvp(command, (char**) args);
         printf("*** exec(%s): %s\n", command, strerror(errno));
         fflush(stdout);
@@ -511,9 +546,28 @@ int run_command(const char *title, int timeout_seconds, const char *command, ...
     }
     if (title) printf("[%s: %.3fs elapsed]\n\n", command, (float)elapsed / NANOS_PER_SEC);
 
+    if (weight > 0) {
+        update_progress(weight);
+    }
     return status;
 }
 
+void send_broadcast(const std::string& action, const std::vector<std::string>& args) {
+    if (args.size() > 1000) {
+        fprintf(stderr, "send_broadcast: too many arguments (%d)\n", (int) args.size());
+        return;
+    }
+    const char *am_args[1024] = { "/system/bin/am", "broadcast", "--user", "0",
+                                  "-a", action.c_str() };
+    size_t am_index = 5; // Starts at the index of last initial value above.
+    for (const std::string& arg : args) {
+        am_args[++am_index] = arg.c_str();
+    }
+    // Always terminate with NULL.
+    am_args[am_index + 1] = NULL;
+    run_command_always(NULL, 5, am_args);
+}
+
 size_t num_props = 0;
 static char* props[2000];
 
@@ -532,12 +586,13 @@ static int compare_prop(const void *a, const void *b) {
 
 /* prints all the system properties */
 void print_properties() {
+    printf("------ SYSTEM PROPERTIES ------\n");
+    ON_DRY_RUN_RETURN();
     size_t i;
     num_props = 0;
     property_list(print_prop, NULL);
     qsort(&props, num_props, sizeof(props[0]), compare_prop);
 
-    printf("------ SYSTEM PROPERTIES ------\n");
     for (i = 0; i < num_props; ++i) {
         fputs(props[i], stdout);
         free(props[i]);
@@ -611,6 +666,7 @@ static bool should_dump_native_traces(const char* path) {
 
 /* dump Dalvik and native stack traces, return the trace file location (NULL if none) */
 const char *dump_traces() {
+    ON_DRY_RUN_RETURN(NULL);
     const char* result = NULL;
 
     char traces_path[PROPERTY_VALUE_MAX] = "";
@@ -764,6 +820,7 @@ error_close_fd:
 }
 
 void dump_route_tables() {
+    ON_DRY_RUN_RETURN();
     const char* const RT_TABLES_PATH = "/data/misc/net/rt_tables";
     dump_file("RT_TABLES", RT_TABLES_PATH);
     FILE* fp = fopen(RT_TABLES_PATH, "re");
@@ -782,6 +839,53 @@ void dump_route_tables() {
     fclose(fp);
 }
 
+/* overall progress */
+int progress = 0;
+int do_update_progress = 0; // Set by dumpstate.cpp
+int weight_total = WEIGHT_TOTAL;
+
+// TODO: make this function thread safe if sections are generated in parallel.
+void update_progress(int delta) {
+    if (!do_update_progress) return;
+
+    progress += delta;
+
+    char key[PROPERTY_KEY_MAX];
+    char value[PROPERTY_VALUE_MAX];
+
+    // adjusts max on the fly
+    if (progress > weight_total) {
+        int new_total = weight_total * 1.2;
+        fprintf(stderr, "Adjusting total weight from %d to %d\n", weight_total, new_total);
+        weight_total = new_total;
+        sprintf(key, "dumpstate.%d.max", getpid());
+        sprintf(value, "%d", weight_total);
+        int status = property_set(key, value);
+        if (status) {
+            ALOGW("Could not update max weight by setting system property %s to %s: %d\n",
+                    key, value, status);
+        }
+    }
+
+    sprintf(key, "dumpstate.%d.progress", getpid());
+    sprintf(value, "%d", progress);
+
+    // stderr is ignored on normal invocations, but useful when calling /system/bin/dumpstate
+    // directly for debuggging.
+    fprintf(stderr, "Setting progress (%s): %s/%d\n", key, value, weight_total);
+
+    int status = property_set(key, value);
+    if (status) {
+        ALOGW("Could not update progress by setting system property %s to %s: %d\n",
+                key, value, status);
+    }
+}
+
+void take_screenshot(const std::string& path) {
+    const char *args[] = { "/system/bin/screencap", "-p", path.c_str(), NULL };
+    run_command_always(NULL, 10, args);
+}
+
 void dump_emmc_ecsd(const char *ext_csd_path) {
     static const size_t EXT_CSD_REV = 192;
     static const size_t EXT_PRE_EOL_INFO = 267;
index 3155766..ddf3aa8 100644 (file)
@@ -207,7 +207,7 @@ bool GLHelper::createNamedSurfaceTexture(GLuint name, uint32_t w, uint32_t h,
     sp<GLConsumer> glc = new GLConsumer(consumer, name,
             GL_TEXTURE_EXTERNAL_OES, false, true);
     glc->setDefaultBufferSize(w, h);
-    glc->setDefaultMaxBufferCount(3);
+    producer->setMaxDequeuedBufferCount(2);
     glc->setConsumerUsageBits(GRALLOC_USAGE_HW_COMPOSER);
 
     sp<ANativeWindow> anw = new Surface(producer);
index eaeeb22..488de0f 100644 (file)
@@ -1,6 +1,6 @@
 LOCAL_PATH := $(call my-dir)
 
-common_src_files := commands.cpp utils.cpp
+common_src_files := commands.cpp globals.cpp utils.cpp
 common_cflags := -Wall -Werror
 
 #
@@ -41,3 +41,7 @@ LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
 LOCAL_INIT_RC := installd.rc
 LOCAL_CLANG := true
 include $(BUILD_EXECUTABLE)
+
+# Tests.
+
+include $(LOCAL_PATH)/tests/Android.mk
\ No newline at end of file
index 1b99582..7544e4d 100644 (file)
 ** limitations under the License.
 */
 
-#include "installd.h"
+#include "commands.h"
+
+#include <errno.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/capability.h>
+#include <sys/file.h>
+#include <sys/resource.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #include <android-base/stringprintf.h>
 #include <android-base/logging.h>
+#include <cutils/fs.h>
+#include <cutils/log.h>               // TODO: Move everything to base/logging.
 #include <cutils/sched_policy.h>
 #include <diskusage/dirsize.h>
 #include <logwrap/logwrap.h>
-#include <system/thread_defs.h>
+#include <private/android_filesystem_config.h>
 #include <selinux/android.h>
+#include <system/thread_defs.h>
 
-#include <inttypes.h>
-#include <sys/capability.h>
-#include <sys/file.h>
-#include <unistd.h>
+#include <globals.h>
+#include <installd_deps.h>
+#include <utils.h>
+
+#ifndef LOG_TAG
+#define LOG_TAG "installd"
+#endif
 
 using android::base::StringPrintf;
 
-/* Directory records that are used in execution of commands. */
-dir_rec_t android_data_dir;
-dir_rec_t android_asec_dir;
-dir_rec_t android_app_dir;
-dir_rec_t android_app_private_dir;
-dir_rec_t android_app_lib_dir;
-dir_rec_t android_media_dir;
-dir_rec_t android_mnt_expand_dir;
-dir_rec_array_t android_system_dirs;
+namespace android {
+namespace installd {
 
 static const char* kCpPath = "/system/bin/cp";
 
-int install(const char *uuid, const char *pkgname, uid_t uid, gid_t gid, const char *seinfo)
-{
+int install(const char *uuid, const char *pkgname, uid_t uid, gid_t gid, const char *seinfo) {
     if ((uid < AID_SYSTEM) || (gid < AID_SYSTEM)) {
         ALOGE("invalid uid/gid: %d %d\n", uid, gid);
         return -1;
     }
 
-    std::string _pkgdir(create_data_user_package_path(uuid, 0, pkgname));
-    const char* pkgdir = _pkgdir.c_str();
-
-    if (mkdir(pkgdir, 0751) < 0) {
-        ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
-        return -1;
-    }
-    if (chmod(pkgdir, 0751) < 0) {
-        ALOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno));
-        unlink(pkgdir);
-        return -1;
-    }
-
-    if (selinux_android_setfilecon(pkgdir, pkgname, seinfo, uid) < 0) {
-        ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno));
-        unlink(pkgdir);
-        return -errno;
-    }
-
-    if (chown(pkgdir, uid, gid) < 0) {
-        ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
-        unlink(pkgdir);
-        return -1;
-    }
-
-    return 0;
-}
-
-int uninstall(const char *uuid, const char *pkgname, userid_t userid)
-{
-    std::string _pkgdir(create_data_user_package_path(uuid, userid, pkgname));
-    const char* pkgdir = _pkgdir.c_str();
-
-    /* delete contents AND directory, no exceptions */
-    return delete_dir_contents(pkgdir, 1, NULL);
+    return make_user_data(uuid, pkgname, uid, 0, seinfo);
 }
 
-int renamepkg(const char *oldpkgname, const char *newpkgname)
-{
-    char oldpkgdir[PKG_PATH_MAX];
-    char newpkgdir[PKG_PATH_MAX];
-
-    if (create_pkg_path(oldpkgdir, oldpkgname, PKG_DIR_POSTFIX, 0))
-        return -1;
-    if (create_pkg_path(newpkgdir, newpkgname, PKG_DIR_POSTFIX, 0))
-        return -1;
+int uninstall(const char *uuid, const char *pkgname, userid_t userid) {
+    std::string ce_package_path(create_data_user_package_path(uuid, userid, pkgname));
+    std::string de_package_path(create_data_user_de_package_path(uuid, userid, pkgname));
 
-    if (rename(oldpkgdir, newpkgdir) < 0) {
-        ALOGE("cannot rename dir '%s' to '%s': %s\n", oldpkgdir, newpkgdir, strerror(errno));
-        return -errno;
-    }
-    return 0;
+    int res = 0;
+    res |= delete_dir_contents_and_dir(ce_package_path);
+    // TODO: include result once 25796509 is fixed
+    delete_dir_contents_and_dir(de_package_path);
+    return res;
 }
 
 int fix_uid(const char *uuid, const char *pkgname, uid_t uid, gid_t gid)
@@ -113,6 +80,7 @@ int fix_uid(const char *uuid, const char *pkgname, uid_t uid, gid_t gid)
         return -1;
     }
 
+    // TODO: handle user_de paths
     std::string _pkgdir(create_data_user_package_path(uuid, 0, pkgname));
     const char* pkgdir = _pkgdir.c_str();
 
@@ -137,39 +105,47 @@ int fix_uid(const char *uuid, const char *pkgname, uid_t uid, gid_t gid)
     return 0;
 }
 
-int delete_user_data(const char *uuid, const char *pkgname, userid_t userid)
-{
-    std::string _pkgdir(create_data_user_package_path(uuid, userid, pkgname));
-    const char* pkgdir = _pkgdir.c_str();
+int delete_user_data(const char *uuid, const char *pkgname, userid_t userid) {
+    std::string ce_package_path(create_data_user_package_path(uuid, userid, pkgname));
+    std::string de_package_path(create_data_user_de_package_path(uuid, userid, pkgname));
 
-    return delete_dir_contents(pkgdir, 0, NULL);
+    int res = 0;
+    res |= delete_dir_contents(ce_package_path);
+    // TODO: include result once 25796509 is fixed
+    delete_dir_contents(de_package_path);
+    return res;
 }
 
-int make_user_data(const char *uuid, const char *pkgname, uid_t uid, userid_t userid, const char* seinfo)
-{
-    std::string _pkgdir(create_data_user_package_path(uuid, userid, pkgname));
-    const char* pkgdir = _pkgdir.c_str();
+int make_user_data(const char *uuid, const char *pkgname, uid_t uid, userid_t userid,
+        const char* seinfo) {
+    std::string ce_package_path(create_data_user_package_path(uuid, userid, pkgname));
+    std::string de_package_path(create_data_user_de_package_path(uuid, userid, pkgname));
 
-    if (mkdir(pkgdir, 0751) < 0) {
-        ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno));
-        return -errno;
+    const char* c_ce_package_path = ce_package_path.c_str();
+    const char* c_de_package_path = de_package_path.c_str();
+
+    if (fs_prepare_dir(c_ce_package_path, 0751, uid, uid) == -1) {
+        PLOG(ERROR) << "Failed to prepare " << ce_package_path;
+        unlink(c_ce_package_path);
+        return -1;
     }
-    if (chmod(pkgdir, 0751) < 0) {
-        ALOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno));
-        unlink(pkgdir);
-        return -errno;
+    if (selinux_android_setfilecon(c_ce_package_path, pkgname, seinfo, uid) < 0) {
+        PLOG(ERROR) << "Failed to setfilecon " << ce_package_path;
+        unlink(c_ce_package_path);
+        return -1;
     }
 
-    if (selinux_android_setfilecon(pkgdir, pkgname, seinfo, uid) < 0) {
-        ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno));
-        unlink(pkgdir);
-        return -errno;
+    if (fs_prepare_dir(c_de_package_path, 0751, uid, uid) == -1) {
+        PLOG(ERROR) << "Failed to prepare " << de_package_path;
+        unlink(c_de_package_path);
+        // TODO: include result once 25796509 is fixed
+        return 0;
     }
-
-    if (chown(pkgdir, uid, uid) < 0) {
-        ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno));
-        unlink(pkgdir);
-        return -errno;
+    if (selinux_android_setfilecon(c_de_package_path, pkgname, seinfo, uid) < 0) {
+        PLOG(ERROR) << "Failed to setfilecon " << de_package_path;
+        unlink(c_de_package_path);
+        // TODO: include result once 25796509 is fixed
+        return 0;
     }
 
     return 0;
@@ -213,6 +189,7 @@ int copy_complete_app(const char *from_uuid, const char *to_uuid,
     }
 
     // Copy private data for all known users
+    // TODO: handle user_de paths
     for (auto user : users) {
         std::string from(create_data_user_package_path(from_uuid, user, package_name));
         std::string to(create_data_user_package_path(to_uuid, user, package_name));
@@ -293,30 +270,27 @@ int make_user_config(userid_t userid)
     return 0;
 }
 
-int delete_user(const char *uuid, userid_t userid)
-{
-    int status = 0;
+int delete_user(const char *uuid, userid_t userid) {
+    int res = 0;
 
     std::string data_path(create_data_user_path(uuid, userid));
-    if (delete_dir_contents(data_path.c_str(), 1, NULL) != 0) {
-        status = -1;
-    }
-
+    std::string data_de_path(create_data_user_de_path(uuid, userid));
     std::string media_path(create_data_media_path(uuid, userid));
-    if (delete_dir_contents(media_path.c_str(), 1, NULL) != 0) {
-        status = -1;
-    }
+
+    res |= delete_dir_contents_and_dir(data_path);
+    res |= delete_dir_contents_and_dir(data_de_path);
+    res |= delete_dir_contents_and_dir(media_path);
 
     // Config paths only exist on internal storage
     if (uuid == nullptr) {
         char config_path[PATH_MAX];
         if ((create_user_config_path(config_path, userid) != 0)
                 || (delete_dir_contents(config_path, 1, NULL) != 0)) {
-            status = -1;
+            res = -1;
         }
     }
 
-    return status;
+    return res;
 }
 
 int delete_cache(const char *uuid, const char *pkgname, userid_t userid)
@@ -453,8 +427,8 @@ int move_dex(const char *src, const char *dst, const char *instruction_set)
         return -1;
     }
 
-    if (create_cache_path(src_dex, src, instruction_set)) return -1;
-    if (create_cache_path(dst_dex, dst, instruction_set)) return -1;
+    if (!create_cache_path(src_dex, src, instruction_set)) return -1;
+    if (!create_cache_path(dst_dex, dst, instruction_set)) return -1;
 
     ALOGV("move %s -> %s\n", src_dex, dst_dex);
     if (rename(src_dex, dst_dex) < 0) {
@@ -474,7 +448,7 @@ int rm_dex(const char *path, const char *instruction_set)
         return -1;
     }
 
-    if (create_cache_path(dex_path, path, instruction_set)) return -1;
+    if (!create_cache_path(dex_path, path, instruction_set)) return -1;
 
     ALOGV("unlink %s\n", dex_path);
     if (unlink(dex_path) < 0) {
@@ -528,7 +502,7 @@ int get_size(const char *uuid, const char *pkgname, int userid, const char *apkp
     }
 
     /* count the cached dexfile as code */
-    if (!create_cache_path(path, apkpath, instruction_set)) {
+    if (create_cache_path(path, apkpath, instruction_set)) {
         if (stat(path, &s) == 0) {
             codesize += stat_size(&s);
         }
@@ -559,6 +533,7 @@ int get_size(const char *uuid, const char *pkgname, int userid, const char *apkp
     }
 
     for (auto user : users) {
+        // TODO: handle user_de directories
         std::string _pkgdir(create_data_user_package_path(uuid, user, pkgname));
         const char* pkgdir = _pkgdir.c_str();
 
@@ -621,51 +596,11 @@ int get_size(const char *uuid, const char *pkgname, int userid, const char *apkp
     return 0;
 }
 
-int create_cache_path(char path[PKG_PATH_MAX], const char *src, const char *instruction_set)
-{
-    char *tmp;
-    int srclen;
-    int dstlen;
-
-    srclen = strlen(src);
-
-        /* demand that we are an absolute path */
-    if ((src == 0) || (src[0] != '/') || strstr(src,"..")) {
-        return -1;
-    }
-
-    if (srclen > PKG_PATH_MAX) {        // XXX: PKG_NAME_MAX?
-        return -1;
-    }
-
-    dstlen = srclen + strlen(DALVIK_CACHE_PREFIX) +
-        strlen(instruction_set) +
-        strlen(DALVIK_CACHE_POSTFIX) + 2;
-
-    if (dstlen > PKG_PATH_MAX) {
-        return -1;
-    }
-
-    sprintf(path,"%s%s/%s%s",
-            DALVIK_CACHE_PREFIX,
-            instruction_set,
-            src + 1, /* skip the leading / */
-            DALVIK_CACHE_POSTFIX);
-
-    for(tmp = path + strlen(DALVIK_CACHE_PREFIX) + strlen(instruction_set) + 1; *tmp; tmp++) {
-        if (*tmp == '/') {
-            *tmp = '@';
-        }
-    }
-
-    return 0;
-}
-
 static int split_count(const char *str)
 {
   char *ctx;
   int count = 0;
-  char buf[PROPERTY_VALUE_MAX];
+  char buf[kPropertyValueMax];
 
   strncpy(buf, str, sizeof(buf));
   char *pBuf = buf;
@@ -694,7 +629,7 @@ static int split(char *buf, const char **argv)
 }
 
 static void run_patchoat(int input_fd, int oat_fd, const char* input_file_name,
-    const char* output_file_name, const char *pkgname __unused, const char *instruction_set)
+    const char* output_file_name, const char *pkgname ATTRIBUTE_UNUSED, const char *instruction_set)
 {
     static const int MAX_INT_LEN = 12;      // '-'+10dig+'\0' -OR- 0x+8dig
     static const unsigned int MAX_INSTRUCTION_SET_LEN = 7;
@@ -734,8 +669,8 @@ static void run_patchoat(int input_fd, int oat_fd, const char* input_file_name,
 }
 
 static bool check_boolean_property(const char* property_name, bool default_value = false) {
-    char tmp_property_value[PROPERTY_VALUE_MAX];
-    bool have_property = property_get(property_name, tmp_property_value, nullptr) > 0;
+    char tmp_property_value[kPropertyValueMax];
+    bool have_property = get_property(property_name, tmp_property_value, nullptr) > 0;
     if (!have_property) {
         return default_value;
     }
@@ -754,50 +689,50 @@ static void run_dex2oat(int zip_fd, int oat_fd, const char* input_file_name,
         return;
     }
 
-    char dex2oat_Xms_flag[PROPERTY_VALUE_MAX];
-    bool have_dex2oat_Xms_flag = property_get("dalvik.vm.dex2oat-Xms", dex2oat_Xms_flag, NULL) > 0;
+    char dex2oat_Xms_flag[kPropertyValueMax];
+    bool have_dex2oat_Xms_flag = get_property("dalvik.vm.dex2oat-Xms", dex2oat_Xms_flag, NULL) > 0;
 
-    char dex2oat_Xmx_flag[PROPERTY_VALUE_MAX];
-    bool have_dex2oat_Xmx_flag = property_get("dalvik.vm.dex2oat-Xmx", dex2oat_Xmx_flag, NULL) > 0;
+    char dex2oat_Xmx_flag[kPropertyValueMax];
+    bool have_dex2oat_Xmx_flag = get_property("dalvik.vm.dex2oat-Xmx", dex2oat_Xmx_flag, NULL) > 0;
 
-    char dex2oat_compiler_filter_flag[PROPERTY_VALUE_MAX];
-    bool have_dex2oat_compiler_filter_flag = property_get("dalvik.vm.dex2oat-filter",
+    char dex2oat_compiler_filter_flag[kPropertyValueMax];
+    bool have_dex2oat_compiler_filter_flag = get_property("dalvik.vm.dex2oat-filter",
                                                           dex2oat_compiler_filter_flag, NULL) > 0;
 
-    char dex2oat_threads_buf[PROPERTY_VALUE_MAX];
-    bool have_dex2oat_threads_flag = property_get(post_bootcomplete
+    char dex2oat_threads_buf[kPropertyValueMax];
+    bool have_dex2oat_threads_flag = get_property(post_bootcomplete
                                                       ? "dalvik.vm.dex2oat-threads"
                                                       : "dalvik.vm.boot-dex2oat-threads",
                                                   dex2oat_threads_buf,
                                                   NULL) > 0;
-    char dex2oat_threads_arg[PROPERTY_VALUE_MAX + 2];
+    char dex2oat_threads_arg[kPropertyValueMax + 2];
     if (have_dex2oat_threads_flag) {
         sprintf(dex2oat_threads_arg, "-j%s", dex2oat_threads_buf);
     }
 
-    char dex2oat_isa_features_key[PROPERTY_KEY_MAX];
+    char dex2oat_isa_features_key[kPropertyKeyMax];
     sprintf(dex2oat_isa_features_key, "dalvik.vm.isa.%s.features", instruction_set);
-    char dex2oat_isa_features[PROPERTY_VALUE_MAX];
-    bool have_dex2oat_isa_features = property_get(dex2oat_isa_features_key,
+    char dex2oat_isa_features[kPropertyValueMax];
+    bool have_dex2oat_isa_features = get_property(dex2oat_isa_features_key,
                                                   dex2oat_isa_features, NULL) > 0;
 
-    char dex2oat_isa_variant_key[PROPERTY_KEY_MAX];
+    char dex2oat_isa_variant_key[kPropertyKeyMax];
     sprintf(dex2oat_isa_variant_key, "dalvik.vm.isa.%s.variant", instruction_set);
-    char dex2oat_isa_variant[PROPERTY_VALUE_MAX];
-    bool have_dex2oat_isa_variant = property_get(dex2oat_isa_variant_key,
+    char dex2oat_isa_variant[kPropertyValueMax];
+    bool have_dex2oat_isa_variant = get_property(dex2oat_isa_variant_key,
                                                  dex2oat_isa_variant, NULL) > 0;
 
     const char *dex2oat_norelocation = "-Xnorelocate";
     bool have_dex2oat_relocation_skip_flag = false;
 
-    char dex2oat_flags[PROPERTY_VALUE_MAX];
-    int dex2oat_flags_count = property_get("dalvik.vm.dex2oat-flags",
+    char dex2oat_flags[kPropertyValueMax];
+    int dex2oat_flags_count = get_property("dalvik.vm.dex2oat-flags",
                                  dex2oat_flags, NULL) <= 0 ? 0 : split_count(dex2oat_flags);
     ALOGV("dalvik.vm.dex2oat-flags=%s\n", dex2oat_flags);
 
     // If we booting without the real /data, don't spend time compiling.
-    char vold_decrypt[PROPERTY_VALUE_MAX];
-    bool have_vold_decrypt = property_get("vold.decrypt", vold_decrypt, "") > 0;
+    char vold_decrypt[kPropertyValueMax];
+    bool have_vold_decrypt = get_property("vold.decrypt", vold_decrypt, "") > 0;
     bool skip_compilation = (have_vold_decrypt &&
                              (strcmp(vold_decrypt, "trigger_restart_min_framework") == 0 ||
                              (strcmp(vold_decrypt, "1") == 0)));
@@ -815,11 +750,11 @@ static void run_dex2oat(int zip_fd, int oat_fd, const char* input_file_name,
     char oat_fd_arg[strlen("--oat-fd=") + MAX_INT_LEN];
     char oat_location_arg[strlen("--oat-location=") + PKG_PATH_MAX];
     char instruction_set_arg[strlen("--instruction-set=") + MAX_INSTRUCTION_SET_LEN];
-    char instruction_set_variant_arg[strlen("--instruction-set-variant=") + PROPERTY_VALUE_MAX];
-    char instruction_set_features_arg[strlen("--instruction-set-features=") + PROPERTY_VALUE_MAX];
-    char dex2oat_Xms_arg[strlen("-Xms") + PROPERTY_VALUE_MAX];
-    char dex2oat_Xmx_arg[strlen("-Xmx") + PROPERTY_VALUE_MAX];
-    char dex2oat_compiler_filter_arg[strlen("--compiler-filter=") + PROPERTY_VALUE_MAX];
+    char instruction_set_variant_arg[strlen("--instruction-set-variant=") + kPropertyValueMax];
+    char instruction_set_features_arg[strlen("--instruction-set-features=") + kPropertyValueMax];
+    char dex2oat_Xms_arg[strlen("-Xms") + kPropertyValueMax];
+    char dex2oat_Xmx_arg[strlen("-Xmx") + kPropertyValueMax];
+    char dex2oat_compiler_filter_arg[strlen("--compiler-filter=") + kPropertyValueMax];
     bool have_dex2oat_swap_fd = false;
     char dex2oat_swap_fd[strlen("--swap-fd=") + MAX_INT_LEN];
 
@@ -859,9 +794,9 @@ static void run_dex2oat(int zip_fd, int oat_fd, const char* input_file_name,
 
     // Check whether all apps should be compiled debuggable.
     if (!debuggable) {
-        char prop_buf[PROPERTY_VALUE_MAX];
+        char prop_buf[kPropertyValueMax];
         debuggable =
-                (property_get("dalvik.vm.always_debuggable", prop_buf, "0") > 0) &&
+                (get_property("dalvik.vm.always_debuggable", prop_buf, "0") > 0) &&
                 (prop_buf[0] == '1');
     }
 
@@ -929,32 +864,6 @@ static void run_dex2oat(int zip_fd, int oat_fd, const char* input_file_name,
     ALOGE("execv(%s) failed: %s\n", DEX2OAT_BIN, strerror(errno));
 }
 
-static int wait_child(pid_t pid)
-{
-    int status;
-    pid_t got_pid;
-
-    while (1) {
-        got_pid = waitpid(pid, &status, 0);
-        if (got_pid == -1 && errno == EINTR) {
-            printf("waitpid interrupted, retrying\n");
-        } else {
-            break;
-        }
-    }
-    if (got_pid != pid) {
-        ALOGW("waitpid failed: wanted %d, got %d: %s\n",
-            (int) pid, (int) got_pid, strerror(errno));
-        return 1;
-    }
-
-    if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
-        return 0;
-    } else {
-        return status;      /* always nonzero */
-    }
-}
-
 /*
  * Whether dexopt should use a swap file when compiling an APK.
  *
@@ -976,8 +885,8 @@ static bool ShouldUseSwapFileForDexopt() {
     }
 
     // Check the "override" property. If it exists, return value == "true".
-    char dex2oat_prop_buf[PROPERTY_VALUE_MAX];
-    if (property_get("dalvik.vm.dex2oat-swap", dex2oat_prop_buf, "") > 0) {
+    char dex2oat_prop_buf[kPropertyValueMax];
+    if (get_property("dalvik.vm.dex2oat-swap", dex2oat_prop_buf, "") > 0) {
         if (strcmp(dex2oat_prop_buf, "true") == 0) {
             return true;
         } else {
@@ -1001,42 +910,6 @@ static bool ShouldUseSwapFileForDexopt() {
     return kDefaultProvideSwapFile;
 }
 
-/*
- * Computes the odex file for the given apk_path and instruction_set.
- * /system/framework/whatever.jar -> /system/framework/oat/<isa>/whatever.odex
- *
- * Returns false if it failed to determine the odex file path.
- */
-static bool calculate_odex_file_path(char path[PKG_PATH_MAX],
-                                     const char *apk_path,
-                                     const char *instruction_set)
-{
-    if (strlen(apk_path) + strlen("oat/") + strlen(instruction_set)
-        + strlen("/") + strlen("odex") + 1 > PKG_PATH_MAX) {
-      ALOGE("apk_path '%s' may be too long to form odex file path.\n", apk_path);
-      return false;
-    }
-
-    strcpy(path, apk_path);
-    char *end = strrchr(path, '/');
-    if (end == NULL) {
-      ALOGE("apk_path '%s' has no '/'s in it?!\n", apk_path);
-      return false;
-    }
-    const char *apk_end = apk_path + (end - path); // strrchr(apk_path, '/');
-
-    strcpy(end + 1, "oat/");       // path = /system/framework/oat/\0
-    strcat(path, instruction_set); // path = /system/framework/oat/<isa>\0
-    strcat(path, apk_end);         // path = /system/framework/oat/<isa>/whatever.jar\0
-    end = strrchr(path, '.');
-    if (end == NULL) {
-      ALOGE("apk_path '%s' has no extension.\n", apk_path);
-      return false;
-    }
-    strcpy(end + 1, "odex");
-    return true;
-}
-
 static void SetDex2OatAndPatchOatScheduling(bool set_to_bg) {
     if (set_to_bg) {
         if (set_sched_policy(0, SP_BACKGROUND) < 0) {
@@ -1083,11 +956,11 @@ int dexopt(const char *apk_path, uid_t uid, const char *pkgname, const char *ins
             ALOGE("invalid oat_dir '%s'\n", oat_dir);
             return -1;
         }
-        if (calculate_oat_file_path(out_path, oat_dir, apk_path, instruction_set)) {
+        if (!calculate_oat_file_path(out_path, oat_dir, apk_path, instruction_set)) {
             return -1;
         }
     } else {
-        if (create_cache_path(out_path, apk_path, instruction_set)) {
+        if (!create_cache_path(out_path, apk_path, instruction_set)) {
             return -1;
         }
     }
@@ -1244,7 +1117,11 @@ fail:
 int mark_boot_complete(const char* instruction_set)
 {
   char boot_marker_path[PKG_PATH_MAX];
-  sprintf(boot_marker_path,"%s%s/.booting", DALVIK_CACHE_PREFIX, instruction_set);
+  sprintf(boot_marker_path,
+          "%s/%s/%s/.booting",
+          android_data_dir.path,
+          DALVIK_CACHE,
+          instruction_set);
 
   ALOGV("mark_boot_complete : %s", boot_marker_path);
   if (unlink(boot_marker_path) != 0) {
@@ -1694,13 +1571,8 @@ fail:
     return -1;
 }
 
-int restorecon_data(const char* uuid, const char* pkgName,
-                    const char* seinfo, uid_t uid)
-{
-    struct dirent *entry;
-    DIR *d;
-    struct stat s;
-    int ret = 0;
+int restorecon_data(const char* uuid, const char* pkgName, const char* seinfo, appid_t appid) {
+    int res = 0;
 
     // SELINUX_ANDROID_RESTORECON_DATADATA flag is set by libselinux. Not needed here.
     unsigned int flags = SELINUX_ANDROID_RESTORECON_RECURSE;
@@ -1710,53 +1582,25 @@ int restorecon_data(const char* uuid, const char* pkgName,
         return -1;
     }
 
-    // Special case for owner on internal storage
-    if (uuid == nullptr) {
-        std::string path(create_data_user_package_path(nullptr, 0, pkgName));
-
-        if (selinux_android_restorecon_pkgdir(path.c_str(), seinfo, uid, flags) < 0) {
-            PLOG(ERROR) << "restorecon failed for " << path;
-            ret |= -1;
-        }
-    }
-
-    // Relabel package directory for all secondary users.
-    std::string userdir(create_data_path(uuid) + "/" + SECONDARY_USER_PREFIX);
-    d = opendir(userdir.c_str());
-    if (d == NULL) {
-        return -1;
-    }
-
-    while ((entry = readdir(d))) {
-        if (entry->d_type != DT_DIR) {
-            continue;
-        }
-
-        const char *user = entry->d_name;
-        // Ignore "." and ".."
-        if (!strcmp(user, ".") || !strcmp(user, "..")) {
-            continue;
-        }
+    // Relabel package directory for all users
+    std::vector<userid_t> users = get_known_users(uuid);
+    for (auto user : users) {
+        uid_t uid = multiuser_get_uid(user, appid);
 
-        // user directories start with a number
-        if (user[0] < '0' || user[0] > '9') {
-            ALOGE("Expecting numbered directory during restorecon. Instead got '%s'.", user);
-            continue;
-        }
+        std::string ce_package_path(create_data_user_package_path(uuid, user, pkgName));
+        std::string de_package_path(create_data_user_de_package_path(uuid, user, pkgName));
 
-        std::string pkgdir(StringPrintf("%s%s/%s", userdir.c_str(), user, pkgName));
-        if (stat(pkgdir.c_str(), &s) < 0) {
-            continue;
+        if (selinux_android_restorecon_pkgdir(ce_package_path.c_str(), seinfo, uid, flags) < 0) {
+            PLOG(ERROR) << "restorecon failed for " << ce_package_path;
+            res = -1;
         }
-
-        if (selinux_android_restorecon_pkgdir(pkgdir.c_str(), seinfo, s.st_uid, flags) < 0) {
-            PLOG(ERROR) << "restorecon failed for " << pkgdir;
-            ret |= -1;
+        if (selinux_android_restorecon_pkgdir(de_package_path.c_str(), seinfo, uid, flags) < 0) {
+            PLOG(ERROR) << "restorecon failed for " << de_package_path;
+            // TODO: include result once 25796509 is fixed
         }
     }
 
-    closedir(d);
-    return ret;
+    return res;
 }
 
 int create_oat_dir(const char* oat_dir, const char* instruction_set)
@@ -1815,29 +1659,5 @@ int link_file(const char* relative_path, const char* from_base, const char* to_b
     return 0;
 }
 
-int calculate_oat_file_path(char path[PKG_PATH_MAX], const char *oat_dir, const char *apk_path,
-        const char *instruction_set) {
-    char *file_name_start;
-    char *file_name_end;
-
-    file_name_start = strrchr(apk_path, '/');
-    if (file_name_start == NULL) {
-         ALOGE("apk_path '%s' has no '/'s in it\n", apk_path);
-        return -1;
-    }
-    file_name_end = strrchr(apk_path, '.');
-    if (file_name_end < file_name_start) {
-        ALOGE("apk_path '%s' has no extension\n", apk_path);
-        return -1;
-    }
-
-    // Calculate file_name
-    int file_name_len = file_name_end - file_name_start - 1;
-    char file_name[file_name_len + 1];
-    memcpy(file_name, file_name_start + 1, file_name_len);
-    file_name[file_name_len] = '\0';
-
-    // <apk_parent_dir>/oat/<isa>/<file_name>.odex
-    snprintf(path, PKG_PATH_MAX, "%s/%s/%s.odex", oat_dir, instruction_set, file_name);
-    return 0;
-}
+}  // namespace installd
+}  // namespace android
diff --git a/cmds/installd/commands.h b/cmds/installd/commands.h
new file mode 100644 (file)
index 0000000..55a6e62
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+
+#ifndef COMMANDS_H_
+#define COMMANDS_H_
+
+#include <inttypes.h>
+#include <unistd.h>
+
+#include <cutils/multiuser.h>
+
+#include <installd_constants.h>
+
+namespace android {
+namespace installd {
+
+int install(const char *uuid, const char *pkgname, uid_t uid, gid_t gid, const char *seinfo);
+int uninstall(const char *uuid, const char *pkgname, userid_t userid);
+int renamepkg(const char *oldpkgname, const char *newpkgname);
+int fix_uid(const char *uuid, const char *pkgname, uid_t uid, gid_t gid);
+int delete_user_data(const char *uuid, const char *pkgname, userid_t userid);
+int make_user_data(const char *uuid, const char *pkgname, uid_t uid,
+        userid_t userid, const char* seinfo);
+int copy_complete_app(const char* from_uuid, const char *to_uuid,
+        const char *package_name, const char *data_app_name, appid_t appid,
+        const char* seinfo);
+int make_user_config(userid_t userid);
+int delete_user(const char *uuid, userid_t userid);
+int delete_cache(const char *uuid, const char *pkgname, userid_t userid);
+int delete_code_cache(const char *uuid, const char *pkgname, userid_t userid);
+int move_dex(const char *src, const char *dst, const char *instruction_set);
+int rm_dex(const char *path, const char *instruction_set);
+int protect(char *pkgname, gid_t gid);
+int get_size(const char *uuid, const char *pkgname, int userid,
+        const char *apkpath, const char *libdirpath,
+        const char *fwdlock_apkpath, const char *asecpath,
+        const char *instruction_set, int64_t *codesize, int64_t *datasize,
+        int64_t *cachesize, int64_t *asecsize);
+int free_cache(const char *uuid, int64_t free_size);
+int dexopt(const char *apk_path, uid_t uid, const char *pkgName, const char *instruction_set,
+           int dexopt_needed, const char* oat_dir, int dexopt_flags);
+int mark_boot_complete(const char *instruction_set);
+int movefiles();
+int linklib(const char* uuid, const char* pkgname, const char* asecLibDir, int userId);
+int idmap(const char *target_path, const char *overlay_path, uid_t uid);
+int restorecon_data(const char *uuid, const char* pkgName, const char* seinfo, uid_t uid);
+int create_oat_dir(const char* oat_dir, const char *instruction_set);
+int rm_package_dir(const char* apk_path);
+int move_package_dir(char path[PKG_PATH_MAX], const char *oat_dir, const char *apk_path,
+                            const char *instruction_set);
+int link_file(const char *relative_path, const char *from_base, const char *to_base);
+
+}  // namespace installd
+}  // namespace android
+
+#endif  // COMMANDS_H_
diff --git a/cmds/installd/globals.cpp b/cmds/installd/globals.cpp
new file mode 100644 (file)
index 0000000..bee2790
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+** Copyright 2015, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <cutils/log.h>               // TODO: Move everything to base::logging.
+
+#include <globals.h>
+#include <installd_constants.h>
+#include <utils.h>
+
+#ifndef LOG_TAG
+#define LOG_TAG "installd"
+#endif
+
+namespace android {
+namespace installd {
+
+/* Directory records that are used in execution of commands. */
+dir_rec_t android_app_dir;
+dir_rec_t android_app_ephemeral_dir;
+dir_rec_t android_app_lib_dir;
+dir_rec_t android_app_private_dir;
+dir_rec_t android_asec_dir;
+dir_rec_t android_data_dir;
+dir_rec_t android_media_dir;
+dir_rec_t android_mnt_expand_dir;
+
+dir_rec_array_t android_system_dirs;
+
+/**
+ * Initialize all the global variables that are used elsewhere. Returns 0 upon
+ * success and -1 on error.
+ */
+void free_globals() {
+    size_t i;
+
+    for (i = 0; i < android_system_dirs.count; i++) {
+        if (android_system_dirs.dirs[i].path != NULL) {
+            free(android_system_dirs.dirs[i].path);
+        }
+    }
+
+    free(android_system_dirs.dirs);
+}
+
+bool init_globals_from_data_and_root(const char* data, const char* root) {
+    // Get the android data directory.
+    if (get_path_from_string(&android_data_dir, data) < 0) {
+        return false;
+    }
+
+    // Get the android app directory.
+    if (copy_and_append(&android_app_dir, &android_data_dir, APP_SUBDIR) < 0) {
+        return false;
+    }
+
+    // Get the android protected app directory.
+    if (copy_and_append(&android_app_private_dir, &android_data_dir, PRIVATE_APP_SUBDIR) < 0) {
+        return false;
+    }
+
+    // Get the android ephemeral app directory.
+    if (copy_and_append(&android_app_ephemeral_dir, &android_data_dir, EPHEMERAL_APP_SUBDIR) < 0) {
+        return -1;
+    }
+
+    // Get the android app native library directory.
+    if (copy_and_append(&android_app_lib_dir, &android_data_dir, APP_LIB_SUBDIR) < 0) {
+        return false;
+    }
+
+    // Get the sd-card ASEC mount point.
+    if (get_path_from_env(&android_asec_dir, "ASEC_MOUNTPOINT") < 0) {
+        return false;
+    }
+
+    // Get the android media directory.
+    if (copy_and_append(&android_media_dir, &android_data_dir, MEDIA_SUBDIR) < 0) {
+        return false;
+    }
+
+    // Get the android external app directory.
+    if (get_path_from_string(&android_mnt_expand_dir, "/mnt/expand/") < 0) {
+        return false;
+    }
+
+    // Take note of the system and vendor directories.
+    android_system_dirs.count = 4;
+
+    android_system_dirs.dirs = (dir_rec_t*) calloc(android_system_dirs.count, sizeof(dir_rec_t));
+    if (android_system_dirs.dirs == NULL) {
+        ALOGE("Couldn't allocate array for dirs; aborting\n");
+        return false;
+    }
+
+    dir_rec_t android_root_dir;
+    if (get_path_from_string(&android_root_dir, root) < 0) {
+        return false;
+    }
+
+    android_system_dirs.dirs[0].path = build_string2(android_root_dir.path, APP_SUBDIR);
+    android_system_dirs.dirs[0].len = strlen(android_system_dirs.dirs[0].path);
+
+    android_system_dirs.dirs[1].path = build_string2(android_root_dir.path, PRIV_APP_SUBDIR);
+    android_system_dirs.dirs[1].len = strlen(android_system_dirs.dirs[1].path);
+
+    android_system_dirs.dirs[2].path = strdup("/vendor/app/");
+    android_system_dirs.dirs[2].len = strlen(android_system_dirs.dirs[2].path);
+
+    android_system_dirs.dirs[3].path = strdup("/oem/app/");
+    android_system_dirs.dirs[3].len = strlen(android_system_dirs.dirs[3].path);
+
+    return true;
+}
+
+}  // namespace installd
+}  // namespace android
diff --git a/cmds/installd/globals.h b/cmds/installd/globals.h
new file mode 100644 (file)
index 0000000..2e61f85
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#ifndef GLOBALS_H_
+#define GLOBALS_H_
+
+#include <inttypes.h>
+
+namespace android {
+namespace installd {
+
+/* data structures */
+
+struct dir_rec_t {
+    char* path;
+    size_t len;
+};
+
+struct dir_rec_array_t {
+    size_t count;
+    dir_rec_t* dirs;
+};
+
+extern dir_rec_t android_app_dir;
+extern dir_rec_t android_app_ephemeral_dir;
+extern dir_rec_t android_app_lib_dir;
+extern dir_rec_t android_app_private_dir;
+extern dir_rec_t android_asec_dir;
+extern dir_rec_t android_data_dir;
+extern dir_rec_t android_media_dir;
+extern dir_rec_t android_mnt_expand_dir;
+
+extern dir_rec_array_t android_system_dirs;
+
+void free_globals();
+bool init_globals_from_data_and_root(const char* data, const char* root);
+
+}  // namespace installd
+}  // namespace android
+
+#endif  // GLOBALS_H_
index 30e4f8b..17ae521 100644 (file)
 ** limitations under the License.
 */
 
-#include "installd.h"
-
-#include <android-base/logging.h>
-
-#include <sys/capability.h>
-#include <sys/prctl.h>
+#include <fcntl.h>
 #include <selinux/android.h>
 #include <selinux/avc.h>
+#include <sys/capability.h>
+#include <sys/prctl.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+
+#include <android-base/logging.h>
+#include <cutils/fs.h>
+#include <cutils/log.h>               // TODO: Move everything to base::logging.
+#include <cutils/properties.h>
+#include <cutils/sockets.h>
+#include <private/android_filesystem_config.h>
+
+#include <commands.h>
+#include <globals.h>
+#include <installd_constants.h>
+#include <installd_deps.h>  // Need to fill in requirements of commands.
+#include <utils.h>
+
+#ifndef LOG_TAG
+#define LOG_TAG "installd"
+#endif
+#define SOCKET_PATH "installd"
 
 #define BUFFER_MAX    1024  /* input buffer for commands */
 #define TOKEN_MAX     16    /* max number of arguments in buffer */
 #define REPLY_MAX     256   /* largest reply allowed */
 
+
+namespace android {
+namespace installd {
+
+// Check that installd-deps sizes match cutils sizes.
+static_assert(kPropertyKeyMax == PROPERTY_KEY_MAX, "Size mismatch.");
+static_assert(kPropertyValueMax == PROPERTY_VALUE_MAX, "Size mismatch.");
+
+////////////////////////
+// Plug-in functions. //
+////////////////////////
+
+int get_property(const char *key, char *value, const char *default_value) {
+    return property_get(key, value, default_value);
+}
+
+// Compute the output path of
+bool calculate_oat_file_path(char path[PKG_PATH_MAX],
+                             const char *oat_dir,
+                             const char *apk_path,
+                             const char *instruction_set) {
+    char *file_name_start;
+    char *file_name_end;
+
+    file_name_start = strrchr(apk_path, '/');
+    if (file_name_start == NULL) {
+        ALOGE("apk_path '%s' has no '/'s in it\n", apk_path);
+        return false;
+    }
+    file_name_end = strrchr(apk_path, '.');
+    if (file_name_end < file_name_start) {
+        ALOGE("apk_path '%s' has no extension\n", apk_path);
+        return false;
+    }
+
+    // Calculate file_name
+    int file_name_len = file_name_end - file_name_start - 1;
+    char file_name[file_name_len + 1];
+    memcpy(file_name, file_name_start + 1, file_name_len);
+    file_name[file_name_len] = '\0';
+
+    // <apk_parent_dir>/oat/<isa>/<file_name>.odex
+    snprintf(path, PKG_PATH_MAX, "%s/%s/%s.odex", oat_dir, instruction_set, file_name);
+    return true;
+}
+
+/*
+ * Computes the odex file for the given apk_path and instruction_set.
+ * /system/framework/whatever.jar -> /system/framework/oat/<isa>/whatever.odex
+ *
+ * Returns false if it failed to determine the odex file path.
+ */
+bool calculate_odex_file_path(char path[PKG_PATH_MAX],
+                              const char *apk_path,
+                              const char *instruction_set) {
+    if (strlen(apk_path) + strlen("oat/") + strlen(instruction_set)
+            + strlen("/") + strlen("odex") + 1 > PKG_PATH_MAX) {
+        ALOGE("apk_path '%s' may be too long to form odex file path.\n", apk_path);
+        return false;
+    }
+
+    strcpy(path, apk_path);
+    char *end = strrchr(path, '/');
+    if (end == NULL) {
+        ALOGE("apk_path '%s' has no '/'s in it?!\n", apk_path);
+        return false;
+    }
+    const char *apk_end = apk_path + (end - path); // strrchr(apk_path, '/');
+
+    strcpy(end + 1, "oat/");       // path = /system/framework/oat/\0
+    strcat(path, instruction_set); // path = /system/framework/oat/<isa>\0
+    strcat(path, apk_end);         // path = /system/framework/oat/<isa>/whatever.jar\0
+    end = strrchr(path, '.');
+    if (end == NULL) {
+        ALOGE("apk_path '%s' has no extension.\n", apk_path);
+        return false;
+    }
+    strcpy(end + 1, "odex");
+    return true;
+}
+
+bool create_cache_path(char path[PKG_PATH_MAX],
+                       const char *src,
+                       const char *instruction_set) {
+    size_t srclen = strlen(src);
+
+        /* demand that we are an absolute path */
+    if ((src == 0) || (src[0] != '/') || strstr(src,"..")) {
+        return false;
+    }
+
+    if (srclen > PKG_PATH_MAX) {        // XXX: PKG_NAME_MAX?
+        return false;
+    }
+
+    size_t dstlen =
+        android_data_dir.len +
+        strlen(DALVIK_CACHE) +
+        1 +
+        strlen(instruction_set) +
+        srclen +
+        strlen(DALVIK_CACHE_POSTFIX) + 2;
+
+    if (dstlen > PKG_PATH_MAX) {
+        return false;
+    }
+
+    sprintf(path,"%s%s/%s/%s%s",
+            android_data_dir.path,
+            DALVIK_CACHE,
+            instruction_set,
+            src + 1, /* skip the leading / */
+            DALVIK_CACHE_POSTFIX);
+
+    char* tmp =
+            path +
+            android_data_dir.len +
+            strlen(DALVIK_CACHE) +
+            1 +
+            strlen(instruction_set) + 1;
+
+    for(; *tmp; tmp++) {
+        if (*tmp == '/') {
+            *tmp = '@';
+        }
+    }
+
+    return true;
+}
+
+
 static char* parse_null(char* arg) {
     if (strcmp(arg, "!") == 0) {
         return nullptr;
@@ -35,64 +183,59 @@ static char* parse_null(char* arg) {
     }
 }
 
-static int do_ping(char **arg __unused, char reply[REPLY_MAX] __unused)
+static int do_ping(char **arg ATTRIBUTE_UNUSED, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return 0;
 }
 
-static int do_install(char **arg, char reply[REPLY_MAX] __unused)
+static int do_install(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return install(parse_null(arg[0]), arg[1], atoi(arg[2]), atoi(arg[3]), arg[4]); /* uuid, pkgname, uid, gid, seinfo */
 }
 
-static int do_dexopt(char **arg, char reply[REPLY_MAX] __unused)
+static int do_dexopt(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     /* apk_path, uid, pkgname, instruction_set, dexopt_needed, oat_dir, dexopt_flags */
     return dexopt(arg[0], atoi(arg[1]), arg[2], arg[3], atoi(arg[4]),
                   arg[5], atoi(arg[6]));
 }
 
-static int do_mark_boot_complete(char **arg, char reply[REPLY_MAX] __unused)
+static int do_mark_boot_complete(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return mark_boot_complete(arg[0] /* instruction set */);
 }
 
-static int do_move_dex(char **arg, char reply[REPLY_MAX] __unused)
+static int do_move_dex(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return move_dex(arg[0], arg[1], arg[2]); /* src, dst, instruction_set */
 }
 
-static int do_rm_dex(char **arg, char reply[REPLY_MAX] __unused)
+static int do_rm_dex(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return rm_dex(arg[0], arg[1]); /* pkgname, instruction_set */
 }
 
-static int do_remove(char **arg, char reply[REPLY_MAX] __unused)
+static int do_remove(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return uninstall(parse_null(arg[0]), arg[1], atoi(arg[2])); /* uuid, pkgname, userid */
 }
 
-static int do_rename(char **arg, char reply[REPLY_MAX] __unused)
-{
-    return renamepkg(arg[0], arg[1]); /* oldpkgname, newpkgname */
-}
-
-static int do_fixuid(char **arg, char reply[REPLY_MAX] __unused)
+static int do_fixuid(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return fix_uid(parse_null(arg[0]), arg[1], atoi(arg[2]), atoi(arg[3])); /* uuid, pkgname, uid, gid */
 }
 
-static int do_free_cache(char **arg, char reply[REPLY_MAX] __unused) /* TODO int:free_size */
+static int do_free_cache(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED) /* TODO int:free_size */
 {
     return free_cache(parse_null(arg[0]), (int64_t)atoll(arg[1])); /* uuid, free_size */
 }
 
-static int do_rm_cache(char **arg, char reply[REPLY_MAX] __unused)
+static int do_rm_cache(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return delete_cache(parse_null(arg[0]), arg[1], atoi(arg[2])); /* uuid, pkgname, userid */
 }
 
-static int do_rm_code_cache(char **arg, char reply[REPLY_MAX] __unused)
+static int do_rm_code_cache(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return delete_code_cache(parse_null(arg[0]), arg[1], atoi(arg[2])); /* uuid, pkgname, userid */
 }
@@ -118,67 +261,67 @@ static int do_get_size(char **arg, char reply[REPLY_MAX])
     return res;
 }
 
-static int do_rm_user_data(char **arg, char reply[REPLY_MAX] __unused)
+static int do_rm_user_data(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return delete_user_data(parse_null(arg[0]), arg[1], atoi(arg[2])); /* uuid, pkgname, userid */
 }
 
-static int do_cp_complete_app(char **arg, char reply[REPLY_MAX] __unused)
+static int do_cp_complete_app(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     // from_uuid, to_uuid, package_name, data_app_name, appid, seinfo
     return copy_complete_app(parse_null(arg[0]), parse_null(arg[1]), arg[2], arg[3], atoi(arg[4]), arg[5]);
 }
 
-static int do_mk_user_data(char **arg, char reply[REPLY_MAX] __unused)
+static int do_mk_user_data(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return make_user_data(parse_null(arg[0]), arg[1], atoi(arg[2]), atoi(arg[3]), arg[4]);
                              /* uuid, pkgname, uid, userid, seinfo */
 }
 
-static int do_mk_user_config(char **arg, char reply[REPLY_MAX] __unused)
+static int do_mk_user_config(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return make_user_config(atoi(arg[0])); /* userid */
 }
 
-static int do_rm_user(char **arg, char reply[REPLY_MAX] __unused)
+static int do_rm_user(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return delete_user(parse_null(arg[0]), atoi(arg[1])); /* uuid, userid */
 }
 
-static int do_movefiles(char **arg __unused, char reply[REPLY_MAX] __unused)
+static int do_movefiles(char **arg ATTRIBUTE_UNUSED, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return movefiles();
 }
 
-static int do_linklib(char **arg, char reply[REPLY_MAX] __unused)
+static int do_linklib(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return linklib(parse_null(arg[0]), arg[1], arg[2], atoi(arg[3]));
 }
 
-static int do_idmap(char **arg, char reply[REPLY_MAX] __unused)
+static int do_idmap(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return idmap(arg[0], arg[1], atoi(arg[2]));
 }
 
-static int do_restorecon_data(char **arg, char reply[REPLY_MAX] __attribute__((unused)))
+static int do_restorecon_data(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     return restorecon_data(parse_null(arg[0]), arg[1], arg[2], atoi(arg[3]));
                              /* uuid, pkgName, seinfo, uid*/
 }
 
-static int do_create_oat_dir(char **arg, char reply[REPLY_MAX] __unused)
+static int do_create_oat_dir(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     /* oat_dir, instruction_set */
     return create_oat_dir(arg[0], arg[1]);
 }
 
-static int do_rm_package_dir(char **arg, char reply[REPLY_MAX] __unused)
+static int do_rm_package_dir(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     /* oat_dir */
     return rm_package_dir(arg[0]);
 }
 
-static int do_link_file(char **arg, char reply[REPLY_MAX] __unused)
+static int do_link_file(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
 {
     /* relative_path, from_base, to_base */
     return link_file(arg[0], arg[1], arg[2]);
@@ -198,7 +341,6 @@ struct cmdinfo cmds[] = {
     { "movedex",              3, do_move_dex },
     { "rmdex",                2, do_rm_dex },
     { "remove",               3, do_remove },
-    { "rename",               2, do_rename },
     { "fixuid",               4, do_fixuid },
     { "freecache",            2, do_free_cache },
     { "rmcache",              3, do_rm_cache },
@@ -320,89 +462,22 @@ done:
     return 0;
 }
 
-/**
- * Initialize all the global variables that are used elsewhere. Returns 0 upon
- * success and -1 on error.
- */
-void free_globals() {
-    size_t i;
-
-    for (i = 0; i < android_system_dirs.count; i++) {
-        if (android_system_dirs.dirs[i].path != NULL) {
-            free(android_system_dirs.dirs[i].path);
-        }
-    }
-
-    free(android_system_dirs.dirs);
-}
-
-int initialize_globals() {
-    // Get the android data directory.
-    if (get_path_from_env(&android_data_dir, "ANDROID_DATA") < 0) {
-        return -1;
-    }
-
-    // Get the android app directory.
-    if (copy_and_append(&android_app_dir, &android_data_dir, APP_SUBDIR) < 0) {
-        return -1;
-    }
-
-    // Get the android protected app directory.
-    if (copy_and_append(&android_app_private_dir, &android_data_dir, PRIVATE_APP_SUBDIR) < 0) {
-        return -1;
-    }
-
-    // Get the android app native library directory.
-    if (copy_and_append(&android_app_lib_dir, &android_data_dir, APP_LIB_SUBDIR) < 0) {
-        return -1;
-    }
-
-    // Get the sd-card ASEC mount point.
-    if (get_path_from_env(&android_asec_dir, "ASEC_MOUNTPOINT") < 0) {
-        return -1;
+bool initialize_globals() {
+    const char* data_path = getenv("ANDROID_DATA");
+    if (data_path == nullptr) {
+        ALOGE("Could not find ANDROID_DATA");
+        return false;
     }
-
-    // Get the android media directory.
-    if (copy_and_append(&android_media_dir, &android_data_dir, MEDIA_SUBDIR) < 0) {
-        return -1;
-    }
-
-    // Get the android external app directory.
-    if (get_path_from_string(&android_mnt_expand_dir, "/mnt/expand/") < 0) {
-        return -1;
-    }
-
-    // Take note of the system and vendor directories.
-    android_system_dirs.count = 4;
-
-    android_system_dirs.dirs = (dir_rec_t*) calloc(android_system_dirs.count, sizeof(dir_rec_t));
-    if (android_system_dirs.dirs == NULL) {
-        ALOGE("Couldn't allocate array for dirs; aborting\n");
-        return -1;
-    }
-
-    dir_rec_t android_root_dir;
-    if (get_path_from_env(&android_root_dir, "ANDROID_ROOT") < 0) {
-        ALOGE("Missing ANDROID_ROOT; aborting\n");
-        return -1;
+    const char* root_path = getenv("ANDROID_ROOT");
+    if (root_path == nullptr) {
+        ALOGE("Could not find ANDROID_ROOT");
+        return false;
     }
 
-    android_system_dirs.dirs[0].path = build_string2(android_root_dir.path, APP_SUBDIR);
-    android_system_dirs.dirs[0].len = strlen(android_system_dirs.dirs[0].path);
-
-    android_system_dirs.dirs[1].path = build_string2(android_root_dir.path, PRIV_APP_SUBDIR);
-    android_system_dirs.dirs[1].len = strlen(android_system_dirs.dirs[1].path);
-
-    android_system_dirs.dirs[2].path = strdup("/vendor/app/");
-    android_system_dirs.dirs[2].len = strlen(android_system_dirs.dirs[2].path);
-
-    android_system_dirs.dirs[3].path = strdup("/oem/app/");
-    android_system_dirs.dirs[3].len = strlen(android_system_dirs.dirs[3].path);
-
-    return 0;
+    return init_globals_from_data_and_root(data_path, root_path);
 }
 
-int initialize_directories() {
+static int initialize_directories() {
     int res = -1;
 
     // Read current filesystem layout version to handle upgrade paths
@@ -656,7 +731,7 @@ static int log_callback(int type, const char *fmt, ...) {
     return 0;
 }
 
-int main(const int argc __unused, char *argv[]) {
+static int installd_main(const int argc ATTRIBUTE_UNUSED, char *argv[]) {
     char buf[BUFFER_MAX];
     struct sockaddr addr;
     socklen_t alen;
@@ -672,7 +747,7 @@ int main(const int argc __unused, char *argv[]) {
     cb.func_log = log_callback;
     selinux_set_callback(SELINUX_CB_LOG, cb);
 
-    if (initialize_globals() < 0) {
+    if (!initialize_globals()) {
         ALOGE("Could not initialize globals; exiting.\n");
         exit(1);
     }
@@ -734,3 +809,10 @@ int main(const int argc __unused, char *argv[]) {
 
     return 0;
 }
+
+}  // namespace installd
+}  // namespace android
+
+int main(const int argc, char *argv[]) {
+    return android::installd::installd_main(argc, argv);
+}
diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h
deleted file mode 100644 (file)
index 8c48b88..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
-**
-** Copyright 2008, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
-
-#define LOG_TAG "installd"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <utime.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <string>
-#include <vector>
-
-#include <cutils/fs.h>
-#include <cutils/sockets.h>
-#include <cutils/log.h>
-#include <cutils/properties.h>
-#include <cutils/multiuser.h>
-
-#include <private/android_filesystem_config.h>
-
-#if defined(__APPLE__)
-#include <sys/mount.h>
-#else
-#include <sys/statfs.h>
-#endif
-
-#define SOCKET_PATH "installd"
-
-
-/* elements combined with a valid package name to form paths */
-
-#define PRIMARY_USER_PREFIX    "data/"
-#define SECONDARY_USER_PREFIX  "user/"
-
-#define PKG_DIR_POSTFIX        ""
-
-#define PKG_LIB_POSTFIX        "/lib"
-
-#define CACHE_DIR_POSTFIX      "/cache"
-#define CODE_CACHE_DIR_POSTFIX "/code_cache"
-
-#define APP_SUBDIR             "app/" // sub-directory under ANDROID_DATA
-#define PRIV_APP_SUBDIR        "priv-app/" // sub-directory under ANDROID_DATA
-
-#define APP_LIB_SUBDIR         "app-lib/" // sub-directory under ANDROID_DATA
-
-#define MEDIA_SUBDIR           "media/" // sub-directory under ANDROID_DATA
-
-/* other handy constants */
-
-#define PRIVATE_APP_SUBDIR     "app-private/" // sub-directory under ANDROID_DATA
-
-#define DALVIK_CACHE_PREFIX    "/data/dalvik-cache/"
-#define DALVIK_CACHE_POSTFIX   "/classes.dex"
-
-#define UPDATE_COMMANDS_DIR_PREFIX  "/system/etc/updatecmds/"
-
-#define IDMAP_PREFIX           "/data/resource-cache/"
-#define IDMAP_SUFFIX           "@idmap"
-
-#define PKG_NAME_MAX  128   /* largest allowed package name */
-#define PKG_PATH_MAX  256   /* max size of any path we use */
-
-/* dexopt needed flags matching those in dalvik.system.DexFile */
-#define DEXOPT_DEX2OAT_NEEDED        1
-#define DEXOPT_PATCHOAT_NEEDED       2
-#define DEXOPT_SELF_PATCHOAT_NEEDED  3
-
-/****************************************************************************
- * IMPORTANT: These values are passed from Java code. Keep them in sync with
- * frameworks/base/services/core/java/com/android/server/pm/Installer.java
- ***************************************************************************/
-constexpr int DEXOPT_PUBLIC       = 1 << 1;
-constexpr int DEXOPT_SAFEMODE     = 1 << 2;
-constexpr int DEXOPT_DEBUGGABLE   = 1 << 3;
-constexpr int DEXOPT_BOOTCOMPLETE = 1 << 4;
-constexpr int DEXOPT_USEJIT       = 1 << 5;
-
-/* all known values for dexopt flags */
-constexpr int DEXOPT_MASK =
-    DEXOPT_PUBLIC
-    | DEXOPT_SAFEMODE
-    | DEXOPT_DEBUGGABLE
-    | DEXOPT_BOOTCOMPLETE
-    | DEXOPT_USEJIT;
-
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
-
-/* data structures */
-
-typedef struct {
-    char* path;
-    size_t len;
-} dir_rec_t;
-
-typedef struct {
-    size_t count;
-    dir_rec_t* dirs;
-} dir_rec_array_t;
-
-extern dir_rec_t android_app_dir;
-extern dir_rec_t android_app_private_dir;
-extern dir_rec_t android_app_lib_dir;
-extern dir_rec_t android_data_dir;
-extern dir_rec_t android_asec_dir;
-extern dir_rec_t android_media_dir;
-extern dir_rec_t android_mnt_expand_dir;
-extern dir_rec_array_t android_system_dirs;
-
-typedef struct cache_dir_struct {
-    struct cache_dir_struct* parent;
-    int32_t childCount;
-    int32_t hiddenCount;
-    int32_t deleted;
-    char name[];
-} cache_dir_t;
-
-typedef struct {
-    cache_dir_t* dir;
-    time_t modTime;
-    char name[];
-} cache_file_t;
-
-typedef struct {
-    size_t numDirs;
-    size_t availDirs;
-    cache_dir_t** dirs;
-    size_t numFiles;
-    size_t availFiles;
-    cache_file_t** files;
-    size_t numCollected;
-    void* memBlocks;
-    int8_t* curMemBlockAvail;
-    int8_t* curMemBlockEnd;
-} cache_t;
-
-/* util.c */
-
-int create_pkg_path(char path[PKG_PATH_MAX],
-                    const char *pkgname,
-                    const char *postfix,
-                    userid_t userid);
-
-std::string create_data_path(const char* volume_uuid);
-
-std::string create_data_app_path(const char* volume_uuid);
-
-std::string create_data_app_package_path(const char* volume_uuid, const char* package_name);
-
-std::string create_data_user_path(const char* volume_uuid, userid_t userid);
-
-std::string create_data_user_package_path(const char* volume_uuid,
-        userid_t user, const char* package_name);
-
-std::string create_data_media_path(const char* volume_uuid, userid_t userid);
-
-std::vector<userid_t> get_known_users(const char* volume_uuid);
-
-int create_user_config_path(char path[PKG_PATH_MAX], userid_t userid);
-
-int create_move_path(char path[PKG_PATH_MAX],
-                     const char* pkgname,
-                     const char* leaf,
-                     userid_t userid);
-
-int is_valid_package_name(const char* pkgname);
-
-int create_cache_path(char path[PKG_PATH_MAX], const char *src,
-                      const char *instruction_set);
-
-int delete_dir_contents(const char *pathname,
-                        int also_delete_dir,
-                        int (*exclusion_predicate)(const char *name, const int is_dir));
-
-int delete_dir_contents_fd(int dfd, const char *name);
-
-int copy_dir_files(const char *srcname, const char *dstname, uid_t owner, gid_t group);
-
-int lookup_media_dir(char basepath[PATH_MAX], const char *dir);
-
-int64_t data_disk_free(const std::string& data_path);
-
-cache_t* start_cache_collection();
-
-void add_cache_files(cache_t* cache, const char *basepath, const char *cachedir);
-
-void clear_cache_files(const std::string& data_path, cache_t* cache, int64_t free_size);
-
-void finish_cache_collection(cache_t* cache);
-
-int validate_system_app_path(const char* path);
-
-int get_path_from_env(dir_rec_t* rec, const char* var);
-
-int get_path_from_string(dir_rec_t* rec, const char* path);
-
-int copy_and_append(dir_rec_t* dst, const dir_rec_t* src, const char* suffix);
-
-int validate_apk_path(const char *path);
-int validate_apk_path_subdirs(const char *path);
-
-int append_and_increment(char** dst, const char* src, size_t* dst_size);
-
-char *build_string2(const char *s1, const char *s2);
-char *build_string3(const char *s1, const char *s2, const char *s3);
-
-int ensure_dir(const char* path, mode_t mode, uid_t uid, gid_t gid);
-int ensure_media_user_dirs(const char* uuid, userid_t userid);
-int ensure_config_user_dirs(userid_t userid);
-
-/* commands.c */
-
-int install(const char *uuid, const char *pkgname, uid_t uid, gid_t gid, const char *seinfo);
-int uninstall(const char *uuid, const char *pkgname, userid_t userid);
-int renamepkg(const char *oldpkgname, const char *newpkgname);
-int fix_uid(const char *uuid, const char *pkgname, uid_t uid, gid_t gid);
-int delete_user_data(const char *uuid, const char *pkgname, userid_t userid);
-int make_user_data(const char *uuid, const char *pkgname, uid_t uid,
-        userid_t userid, const char* seinfo);
-int copy_complete_app(const char* from_uuid, const char *to_uuid,
-        const char *package_name, const char *data_app_name, appid_t appid,
-        const char* seinfo);
-int make_user_config(userid_t userid);
-int delete_user(const char *uuid, userid_t userid);
-int delete_cache(const char *uuid, const char *pkgname, userid_t userid);
-int delete_code_cache(const char *uuid, const char *pkgname, userid_t userid);
-int move_dex(const char *src, const char *dst, const char *instruction_set);
-int rm_dex(const char *path, const char *instruction_set);
-int protect(char *pkgname, gid_t gid);
-int get_size(const char *uuid, const char *pkgname, int userid,
-        const char *apkpath, const char *libdirpath,
-        const char *fwdlock_apkpath, const char *asecpath,
-        const char *instruction_set, int64_t *codesize, int64_t *datasize,
-        int64_t *cachesize, int64_t *asecsize);
-int free_cache(const char *uuid, int64_t free_size);
-int dexopt(const char *apk_path, uid_t uid, const char *pkgName, const char *instruction_set,
-           int dexopt_needed, const char* oat_dir, int dexopt_flags);
-int mark_boot_complete(const char *instruction_set);
-int movefiles();
-int linklib(const char* uuid, const char* pkgname, const char* asecLibDir, int userId);
-int idmap(const char *target_path, const char *overlay_path, uid_t uid);
-int restorecon_data(const char *uuid, const char* pkgName, const char* seinfo, uid_t uid);
-int create_oat_dir(const char* oat_dir, const char *instruction_set);
-int rm_package_dir(const char* apk_path);
-int calculate_oat_file_path(char path[PKG_PATH_MAX], const char *oat_dir, const char *apk_path,
-                            const char *instruction_set);
-int move_package_dir(char path[PKG_PATH_MAX], const char *oat_dir, const char *apk_path,
-                            const char *instruction_set);
-int link_file(const char *relative_path, const char *from_base, const char *to_base);
diff --git a/cmds/installd/installd_constants.h b/cmds/installd/installd_constants.h
new file mode 100644 (file)
index 0000000..058db4c
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#ifndef INSTALLD_CONSTANTS_H_
+#define INSTALLD_CONSTANTS_H_
+
+namespace android {
+namespace installd {
+
+/* elements combined with a valid package name to form paths */
+
+constexpr const char* PRIMARY_USER_PREFIX = "data/";
+constexpr const char* SECONDARY_USER_PREFIX = "user/";
+
+constexpr const char* PKG_DIR_POSTFIX = "";
+
+constexpr const char* PKG_LIB_POSTFIX = "/lib";
+
+constexpr const char* CACHE_DIR_POSTFIX = "/cache";
+constexpr const char* CODE_CACHE_DIR_POSTFIX = "/code_cache";
+
+constexpr const char* APP_SUBDIR = "app/"; // sub-directory under ANDROID_DATA
+constexpr const char* PRIV_APP_SUBDIR = "priv-app/"; // sub-directory under ANDROID_DATA
+constexpr const char* EPHEMERAL_APP_SUBDIR = "app-ephemeral/"; // sub-directory under ANDROID_DATA
+
+constexpr const char* APP_LIB_SUBDIR = "app-lib/"; // sub-directory under ANDROID_DATA
+
+constexpr const char* MEDIA_SUBDIR = "media/"; // sub-directory under ANDROID_DATA
+
+/* other handy constants */
+
+constexpr const char* PRIVATE_APP_SUBDIR = "app-private/"; // sub-directory under ANDROID_DATA
+
+// This is used as a string literal, can't be constants. TODO: std::string...
+#define DALVIK_CACHE "dalvik-cache"
+constexpr const char* DALVIK_CACHE_POSTFIX = "/classes.dex";
+
+constexpr const char* UPDATE_COMMANDS_DIR_PREFIX = "/system/etc/updatecmds/";
+
+constexpr const char* IDMAP_PREFIX = "/data/resource-cache/";
+constexpr const char* IDMAP_SUFFIX = "@idmap";
+
+constexpr size_t PKG_NAME_MAX = 128u;   /* largest allowed package name */
+constexpr size_t PKG_PATH_MAX = 256u;   /* max size of any path we use */
+
+/* dexopt needed flags matching those in dalvik.system.DexFile */
+constexpr int DEXOPT_DEX2OAT_NEEDED       = 1;
+constexpr int DEXOPT_PATCHOAT_NEEDED      = 2;
+constexpr int DEXOPT_SELF_PATCHOAT_NEEDED = 3;
+
+/****************************************************************************
+ * IMPORTANT: These values are passed from Java code. Keep them in sync with
+ * frameworks/base/services/core/java/com/android/server/pm/Installer.java
+ ***************************************************************************/
+constexpr int DEXOPT_PUBLIC       = 1 << 1;
+constexpr int DEXOPT_SAFEMODE     = 1 << 2;
+constexpr int DEXOPT_DEBUGGABLE   = 1 << 3;
+constexpr int DEXOPT_BOOTCOMPLETE = 1 << 4;
+constexpr int DEXOPT_USEJIT       = 1 << 5;
+
+/* all known values for dexopt flags */
+constexpr int DEXOPT_MASK =
+    DEXOPT_PUBLIC
+    | DEXOPT_SAFEMODE
+    | DEXOPT_DEBUGGABLE
+    | DEXOPT_BOOTCOMPLETE
+    | DEXOPT_USEJIT;
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
+
+}  // namespace installd
+}  // namespace android
+
+#endif  // INSTALLD_CONSTANTS_H_
diff --git a/cmds/installd/installd_deps.h b/cmds/installd/installd_deps.h
new file mode 100644 (file)
index 0000000..5ff46e6
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#ifndef INSTALLD_DEPS_H_
+#define INSTALLD_DEPS_H_
+
+#include <inttypes.h>
+
+#include <installd_constants.h>
+
+namespace android {
+namespace installd {
+
+// Dependencies for a full binary. These functions need to be provided to
+// figure out parts of the configuration.
+
+// Retrieve a system property. Same API as cutils, just renamed.
+extern int get_property(const char *key,
+                        char *value,
+                        const char *default_value);
+// Size constants. Should be checked to be equal to the cutils requirements.
+constexpr size_t kPropertyKeyMax = 32u;
+constexpr size_t kPropertyValueMax = 92u;
+
+// Compute the output path for dex2oat.
+extern bool calculate_oat_file_path(char path[PKG_PATH_MAX],
+                                    const char *oat_dir,
+                                    const char *apk_path,
+                                    const char *instruction_set);
+// Compute the output path for patchoat.
+//
+// Computes the odex file for the given apk_path and instruction_set, e.g.,
+// /system/framework/whatever.jar -> /system/framework/oat/<isa>/whatever.odex
+//
+// Returns false if it failed to determine the odex file path.
+//
+extern bool calculate_odex_file_path(char path[PKG_PATH_MAX],
+                                     const char *apk_path,
+                                     const char *instruction_set);
+
+// Compute the output path into the dalvik cache.
+extern bool create_cache_path(char path[PKG_PATH_MAX],
+                              const char *src,
+                              const char *instruction_set);
+
+// Initialize globals. May be implemented with the helper in globals.h.
+extern bool initialize_globals();
+
+}  // namespace installd
+}  // namespace android
+
+#endif  // INSTALLD_DEPS_H_
index 5e397f9..ff69f4b 100644 (file)
@@ -19,7 +19,9 @@
 
 #include <gtest/gtest.h>
 
-#include "installd.h"
+#include <commands.h>
+#include <globals.h>
+#include <utils.h>
 
 #undef LOG_TAG
 #define LOG_TAG "utils_test"
@@ -44,6 +46,7 @@
         "shared_prefs_shared_prefs_shared_prefs_shared_prefs_shared_prefs_shared_prefs_"
 
 namespace android {
+namespace installd {
 
 class UtilsTest : public testing::Test {
 protected:
@@ -319,8 +322,8 @@ TEST_F(UtilsTest, CreatePkgPath_LongPkgNameSuccess) {
     EXPECT_EQ(0, create_pkg_path(path, pkgname, "", 0))
             << "Should successfully be able to create package name.";
 
-    const char *prefix = TEST_DATA_DIR PRIMARY_USER_PREFIX;
-    size_t offset = strlen(prefix);
+    std::string prefix = std::string(TEST_DATA_DIR) + PRIMARY_USER_PREFIX;
+    size_t offset = prefix.length();
 
     EXPECT_STREQ(pkgname, path + offset)
              << "Package path should be a really long string of a's";
@@ -358,7 +361,10 @@ TEST_F(UtilsTest, CreatePkgPath_PrimaryUser) {
     EXPECT_EQ(0, create_pkg_path(path, "com.example.package", "", 0))
             << "Should return error because postfix is too long.";
 
-    EXPECT_STREQ(TEST_DATA_DIR PRIMARY_USER_PREFIX "com.example.package", path)
+    std::string p = std::string(TEST_DATA_DIR)
+                    + PRIMARY_USER_PREFIX
+                    + "com.example.package";
+    EXPECT_STREQ(p.c_str(), path)
             << "Package path should be in /data/data/";
 }
 
@@ -368,7 +374,10 @@ TEST_F(UtilsTest, CreatePkgPath_SecondaryUser) {
     EXPECT_EQ(0, create_pkg_path(path, "com.example.package", "", 1))
             << "Should successfully create package path.";
 
-    EXPECT_STREQ(TEST_DATA_DIR SECONDARY_USER_PREFIX "1/com.example.package", path)
+    std::string p = std::string(TEST_DATA_DIR)
+                    + SECONDARY_USER_PREFIX
+                    + "1/com.example.package";
+    EXPECT_STREQ(p.c_str(), path)
             << "Package path should be in /data/user/";
 }
 
@@ -499,4 +508,5 @@ TEST_F(UtilsTest, CreateDataUserPackagePath) {
             create_data_user_package_path("57f8f4bc-abf4-655f-bf67-946fc0f9f25b", 10, "com.example"));
 }
 
-}
+}  // namespace installd
+}  // namespace android
index a98fec5..92a9565 100644 (file)
 ** limitations under the License.
 */
 
-#include "installd.h"
+#include "utils.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+
+#if defined(__APPLE__)
+#include <sys/mount.h>
+#else
+#include <sys/statfs.h>
+#endif
 
-#include <android-base/stringprintf.h>
 #include <android-base/logging.h>
+#include <android-base/stringprintf.h>
+#include <cutils/fs.h>
+#include <cutils/log.h>
+#include <private/android_filesystem_config.h>
+
+#include "globals.h"  // extern variables.
 
+#ifndef LOG_TAG
+#define LOG_TAG "installd"
+#endif
 #define CACHE_NOISY(x) //x
 
 using android::base::StringPrintf;
 
+namespace android {
+namespace installd {
+
 /**
  * Check that given string is valid filename, and that it attempts no
  * parent or child directory traversal.
@@ -64,6 +87,15 @@ std::string create_data_user_package_path(const char* volume_uuid,
             create_data_user_path(volume_uuid, user).c_str(), package_name);
 }
 
+std::string create_data_user_de_package_path(const char* volume_uuid,
+        userid_t user, const char* package_name) {
+    CHECK(is_valid_filename(package_name));
+    CHECK(is_valid_package_name(package_name) == 0);
+
+    return StringPrintf("%s/%s",
+            create_data_user_de_path(volume_uuid, user).c_str(), package_name);
+}
+
 int create_pkg_path(char path[PKG_PATH_MAX], const char *pkgname,
         const char *postfix, userid_t userid) {
     if (is_valid_package_name(pkgname) != 0) {
@@ -115,6 +147,14 @@ std::string create_data_user_path(const char* volume_uuid, userid_t userid) {
 }
 
 /**
+ * Create the path name for device encrypted user data for a certain userid.
+ */
+std::string create_data_user_de_path(const char* volume_uuid, userid_t userid) {
+    std::string data(create_data_path(volume_uuid));
+    return StringPrintf("%s/user_de/%u", data.c_str(), userid);
+}
+
+/**
  * Create the path name for media for a certain userid.
  */
 std::string create_data_media_path(const char* volume_uuid, userid_t userid) {
@@ -167,7 +207,7 @@ int create_user_config_path(char path[PATH_MAX], userid_t userid) {
 int create_move_path(char path[PKG_PATH_MAX],
     const char* pkgname,
     const char* leaf,
-    userid_t userid __unused)
+    userid_t userid ATTRIBUTE_UNUSED)
 {
     if ((android_data_dir.len + strlen(PRIMARY_USER_PREFIX) + strlen(pkgname) + strlen(leaf) + 1)
             >= PKG_PATH_MAX) {
@@ -288,6 +328,14 @@ static int _delete_dir_contents(DIR *d,
     return result;
 }
 
+int delete_dir_contents(const std::string& pathname) {
+    return delete_dir_contents(pathname.c_str(), 0, NULL);
+}
+
+int delete_dir_contents_and_dir(const std::string& pathname) {
+    return delete_dir_contents(pathname.c_str(), 1, NULL);
+}
+
 int delete_dir_contents(const char *pathname,
                         int also_delete_dir,
                         int (*exclusion_predicate)(const char*, const int))
@@ -1054,6 +1102,8 @@ static int validate_apk_path_internal(const char *path, int maxSubdirs) {
         dir = &android_app_dir;
     } else if (!strncmp(path, android_app_private_dir.path, android_app_private_dir.len)) {
         dir = &android_app_private_dir;
+    } else if (!strncmp(path, android_app_ephemeral_dir.path, android_app_ephemeral_dir.len)) {
+        dir = &android_app_ephemeral_dir;
     } else if (!strncmp(path, android_asec_dir.path, android_asec_dir.len)) {
         dir = &android_asec_dir;
     } else if (!strncmp(path, android_mnt_expand_dir.path, android_mnt_expand_dir.len)) {
@@ -1143,3 +1193,32 @@ int ensure_config_user_dirs(userid_t userid) {
 
    return 0;
 }
+
+int wait_child(pid_t pid)
+{
+    int status;
+    pid_t got_pid;
+
+    while (1) {
+        got_pid = waitpid(pid, &status, 0);
+        if (got_pid == -1 && errno == EINTR) {
+            printf("waitpid interrupted, retrying\n");
+        } else {
+            break;
+        }
+    }
+    if (got_pid != pid) {
+        ALOGW("waitpid failed: wanted %d, got %d: %s\n",
+            (int) pid, (int) got_pid, strerror(errno));
+        return 1;
+    }
+
+    if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
+        return 0;
+    } else {
+        return status;      /* always nonzero */
+    }
+}
+
+}  // namespace installd
+}  // namespace android
diff --git a/cmds/installd/utils.h b/cmds/installd/utils.h
new file mode 100644 (file)
index 0000000..4d6b66e
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#ifndef UTILS_H_
+#define UTILS_H_
+
+#include <string>
+#include <vector>
+
+#include <dirent.h>
+#include <inttypes.h>
+#include <unistd.h>
+#include <utime.h>
+
+#include <cutils/multiuser.h>
+
+#include <installd_constants.h>
+
+namespace android {
+namespace installd {
+
+struct dir_rec_t;
+
+typedef struct cache_dir_struct {
+    struct cache_dir_struct* parent;
+    int32_t childCount;
+    int32_t hiddenCount;
+    int32_t deleted;
+    char name[];
+} cache_dir_t;
+
+typedef struct {
+    cache_dir_t* dir;
+    time_t modTime;
+    char name[];
+} cache_file_t;
+
+typedef struct {
+    size_t numDirs;
+    size_t availDirs;
+    cache_dir_t** dirs;
+    size_t numFiles;
+    size_t availFiles;
+    cache_file_t** files;
+    size_t numCollected;
+    void* memBlocks;
+    int8_t* curMemBlockAvail;
+    int8_t* curMemBlockEnd;
+} cache_t;
+
+int create_pkg_path(char path[PKG_PATH_MAX],
+                    const char *pkgname,
+                    const char *postfix,
+                    userid_t userid);
+
+std::string create_data_path(const char* volume_uuid);
+
+std::string create_data_app_path(const char* volume_uuid);
+
+std::string create_data_app_package_path(const char* volume_uuid, const char* package_name);
+
+// TODO: finish refactoring to "_ce"
+std::string create_data_user_path(const char* volume_uuid, userid_t userid);
+std::string create_data_user_de_path(const char* volume_uuid, userid_t userid);
+
+std::string create_data_user_package_path(const char* volume_uuid,
+        userid_t user, const char* package_name);
+std::string create_data_user_de_package_path(const char* volume_uuid,
+        userid_t user, const char* package_name);
+
+std::string create_data_media_path(const char* volume_uuid, userid_t userid);
+
+std::vector<userid_t> get_known_users(const char* volume_uuid);
+
+int create_user_config_path(char path[PKG_PATH_MAX], userid_t userid);
+
+int create_move_path(char path[PKG_PATH_MAX],
+                     const char* pkgname,
+                     const char* leaf,
+                     userid_t userid);
+
+int is_valid_package_name(const char* pkgname);
+
+int delete_dir_contents(const std::string& pathname);
+int delete_dir_contents_and_dir(const std::string& pathname);
+
+int delete_dir_contents(const char *pathname,
+                        int also_delete_dir,
+                        int (*exclusion_predicate)(const char *name, const int is_dir));
+
+int delete_dir_contents_fd(int dfd, const char *name);
+
+int copy_dir_files(const char *srcname, const char *dstname, uid_t owner, gid_t group);
+
+int lookup_media_dir(char basepath[PATH_MAX], const char *dir);
+
+int64_t data_disk_free(const std::string& data_path);
+
+cache_t* start_cache_collection();
+
+void add_cache_files(cache_t* cache, const char *basepath, const char *cachedir);
+
+void clear_cache_files(const std::string& data_path, cache_t* cache, int64_t free_size);
+
+void finish_cache_collection(cache_t* cache);
+
+int validate_system_app_path(const char* path);
+
+int get_path_from_env(dir_rec_t* rec, const char* var);
+
+int get_path_from_string(dir_rec_t* rec, const char* path);
+
+int copy_and_append(dir_rec_t* dst, const dir_rec_t* src, const char* suffix);
+
+int validate_apk_path(const char *path);
+int validate_apk_path_subdirs(const char *path);
+
+int append_and_increment(char** dst, const char* src, size_t* dst_size);
+
+char *build_string2(const char *s1, const char *s2);
+char *build_string3(const char *s1, const char *s2, const char *s3);
+
+int ensure_dir(const char* path, mode_t mode, uid_t uid, gid_t gid);
+int ensure_media_user_dirs(const char* uuid, userid_t userid);
+int ensure_config_user_dirs(userid_t userid);
+
+int wait_child(pid_t pid);
+
+}  // namespace installd
+}  // namespace android
+
+#endif  // UTILS_H_
index b70fda7..0d07a70 100644 (file)
@@ -5,6 +5,8 @@ service servicemanager /system/bin/servicemanager
     critical
     onrestart restart healthd
     onrestart restart zygote
+    onrestart restart audioserver
     onrestart restart media
     onrestart restart surfaceflinger
+    onrestart restart inputflinger
     onrestart restart drm
diff --git a/data/etc/android.hardware.sensor.ambient_temperature.xml b/data/etc/android.hardware.sensor.ambient_temperature.xml
new file mode 100644 (file)
index 0000000..8ad140e
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Feature for devices with an ambient temperature sensor. -->
+<permissions>
+    <feature name="android.hardware.sensor.ambient_temperature" />
+</permissions>
diff --git a/data/etc/android.hardware.sensor.relative_humidity.xml b/data/etc/android.hardware.sensor.relative_humidity.xml
new file mode 100644 (file)
index 0000000..b9432d3
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Feature for devices with a relative humidity sensor. -->
+<permissions>
+    <feature name="android.hardware.sensor.relative_humidity" />
+</permissions>
diff --git a/data/etc/android.hardware.type.automotive.xml b/data/etc/android.hardware.type.automotive.xml
new file mode 100644 (file)
index 0000000..a9b4b05
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- These features determine that the device running android is a car. -->
+<permissions>
+    <feature name="android.hardware.type.automotive" />
+</permissions>
diff --git a/data/etc/android.software.freeform_window_management.xml b/data/etc/android.software.freeform_window_management.xml
new file mode 100644 (file)
index 0000000..58512dc
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<permissions>
+    <feature name="android.software.freeform_window_management" />
+</permissions>
diff --git a/data/etc/android.software.picture_in_picture.xml b/data/etc/android.software.picture_in_picture.xml
new file mode 100644 (file)
index 0000000..d5e058d
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<permissions>
+    <feature name="android.software.picture_in_picture" />
+</permissions>
diff --git a/data/etc/car_core_hardware.xml b/data/etc/car_core_hardware.xml
new file mode 100644 (file)
index 0000000..8ed8460
--- /dev/null
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- These are the hardware components that all handheld devices
+     must include. Devices with optional hardware must also include extra
+     hardware files, per the comments below.
+
+     Handheld devices include phones, mobile Internet devices (MIDs),
+     Personal Media Players (PMPs), small tablets (7" or less), and similar
+     devices.
+-->
+<permissions>
+    <feature name="android.hardware.audio.output" />
+    <feature name="android.hardware.camera" />
+    <feature name="android.hardware.location" />
+    <feature name="android.hardware.location.network" />
+    <feature name="android.hardware.sensor.compass" />
+    <feature name="android.hardware.sensor.accelerometer" />
+    <feature name="android.hardware.bluetooth" />
+    <feature name="android.hardware.touchscreen" />
+    <feature name="android.hardware.microphone" />
+    <feature name="android.hardware.screen.landscape" />
+    <!-- Feature to specify if the device is a car -->
+    <feature name="android.hardware.type.automotive" />
+
+    <!-- basic system services -->
+    <feature name="android.software.app_widgets" />
+    <feature name="android.software.connectionservice" />
+    <feature name="android.software.voice_recognizers" notLowRam="true" />
+    <feature name="android.software.backup" />
+    <feature name="android.software.home_screen" />
+    <feature name="android.software.input_methods" />
+    <feature name="android.software.print" />
+
+    <!-- Feature to specify if the device supports adding device admins. -->
+    <feature name="android.software.device_admin" />
+
+    <!-- Feature to specify if the device support managed users. -->
+    <feature name="android.software.managed_users" />
+
+    <!-- devices with GPS must include android.hardware.location.gps.xml -->
+    <!-- devices with an autofocus camera and/or flash must include either
+         android.hardware.camera.autofocus.xml or
+         android.hardware.camera.autofocus-flash.xml -->
+    <!-- devices with a front facing camera must include
+         android.hardware.camera.front.xml -->
+    <!-- devices with WiFi must also include android.hardware.wifi.xml -->
+    <!-- devices that support multitouch must include the most appropriate one
+         of these files:
+
+         If only partial (non-independent) pointers are supported:
+         android.hardware.touchscreen.multitouch.xml
+
+         If up to 4 independently tracked pointers are supported:
+         include android.hardware.touchscreen.multitouch.distinct.xml
+
+         If 5 or more independently tracked pointers are supported:
+         include android.hardware.touchscreen.multitouch.jazzhand.xml
+
+         ONLY ONE of the above should be included. -->
+    <!-- devices with an ambient light sensor must also include
+         android.hardware.sensor.light.xml -->
+    <!-- devices with a proximity sensor must also include
+         android.hardware.sensor.proximity.xml -->
+    <!-- GSM phones must also include android.hardware.telephony.gsm.xml -->
+    <!-- CDMA phones must also include android.hardware.telephony.cdma.xml -->
+    <!-- Devices that have low-latency audio stacks suitable for apps like
+         VoIP may include android.hardware.audio.low_latency.xml. ONLY apps
+         that meet the requirements specified in the CDD may include this. -->
+</permissions>
index 421abe5..67e28da 100644 (file)
@@ -732,12 +732,32 @@ enum {
     AKEYCODE_STEM_2 = 266,
     /** Generic stem key 3 for Wear */
     AKEYCODE_STEM_3 = 267,
+    /** Directional Pad Up-Left */
+    AKEYCODE_DPAD_UP_LEFT    = 268,
+    /** Directional Pad Down-Left */
+    AKEYCODE_DPAD_DOWN_LEFT  = 269,
+    /** Directional Pad Up-Right */
+    AKEYCODE_DPAD_UP_RIGHT   = 270,
+    /** Directional Pad Down-Right */
+    AKEYCODE_DPAD_DOWN_RIGHT = 271,
+    /** Skip forward media key */
     AKEYCODE_MEDIA_SKIP_FORWARD = 272,
+    /** Skip backward media key */
     AKEYCODE_MEDIA_SKIP_BACKWARD = 273,
+    /** Step forward media key.
+     * Steps media forward one from at a time. */
     AKEYCODE_MEDIA_STEP_FORWARD = 274,
+    /** Step backward media key.
+     * Steps media backward one from at a time. */
     AKEYCODE_MEDIA_STEP_BACKWARD = 275,
     /** Put device to sleep unless a wakelock is held. */
-    AKEYCODE_SOFT_SLEEP = 276
+    AKEYCODE_SOFT_SLEEP = 276,
+    /** Cut key. */
+    AKEYCODE_CUT = 277,
+    /** Copy key. */
+    AKEYCODE_COPY = 278,
+    /** Paste key. */
+    AKEYCODE_PASTE = 279
 
     // NOTE: If you add a new keycode here you must also add it to several other files.
     //       Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
index d98d4c5..5f1e87c 100644 (file)
@@ -37,6 +37,7 @@ class BBinder;
 class BpBinder;
 class IInterface;
 class Parcel;
+class IResultReceiver;
 
 /**
  * Base class and low-level protocol for a remotable object.
@@ -54,6 +55,7 @@ public:
 
         PING_TRANSACTION        = B_PACK_CHARS('_','P','N','G'),
         DUMP_TRANSACTION        = B_PACK_CHARS('_','D','M','P'),
+        SHELL_COMMAND_TRANSACTION = B_PACK_CHARS('_','C','M','D'),
         INTERFACE_TRANSACTION   = B_PACK_CHARS('_', 'N', 'T', 'F'),
         SYSPROPS_TRANSACTION    = B_PACK_CHARS('_', 'S', 'P', 'R'),
 
@@ -79,6 +81,9 @@ public:
     virtual bool            isBinderAlive() const = 0;
     virtual status_t        pingBinder() = 0;
     virtual status_t        dump(int fd, const Vector<String16>& args) = 0;
+    static  status_t        shellCommand(const sp<IBinder>& target, int in, int out, int err,
+                                         Vector<String16>& args,
+                                         const sp<IResultReceiver>& resultReceiver);
 
     virtual status_t        transact(   uint32_t code,
                                         const Parcel& data,
index dc62f45..34ce0f0 100644 (file)
@@ -31,8 +31,14 @@ public:
                                                   /*in*/ int32_t* pids,
                                                   /*out*/ int32_t* states) = 0;
 
+    virtual status_t    getProcessStatesAndOomScoresFromPids( size_t length,
+                                                  /*in*/ int32_t* pids,
+                                                  /*out*/ int32_t* states,
+                                                  /*out*/ int32_t* scores) = 0;
+
     enum {
         GET_PROCESS_STATES_FROM_PIDS = IBinder::FIRST_CALL_TRANSACTION,
+        GET_PROCESS_STATES_AND_OOM_SCORES_FROM_PIDS,
     };
 };
 
diff --git a/include/binder/IResultReceiver.h b/include/binder/IResultReceiver.h
new file mode 100644 (file)
index 0000000..02dc6a6
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+#ifndef ANDROID_IRESULT_RECEIVER_H
+#define ANDROID_IRESULT_RECEIVER_H
+
+#include <binder/IInterface.h>
+
+namespace android {
+
+// ----------------------------------------------------------------------
+
+class IResultReceiver : public IInterface
+{
+public:
+    DECLARE_META_INTERFACE(ResultReceiver);
+
+    virtual void send(int32_t resultCode) = 0;
+
+    enum {
+        OP_SEND = IBinder::FIRST_CALL_TRANSACTION
+    };
+};
+
+// ----------------------------------------------------------------------
+
+class BnResultReceiver : public BnInterface<IResultReceiver>
+{
+public:
+    virtual status_t    onTransact( uint32_t code,
+                                    const Parcel& data,
+                                    Parcel* reply,
+                                    uint32_t flags = 0);
+};
+
+// ----------------------------------------------------------------------
+
+}; // namespace android
+
+#endif // ANDROID_IRESULT_RECEIVER_H
+
index 145efe6..370f5d5 100644 (file)
@@ -98,13 +98,8 @@ class BufferItem : public Flattenable<BufferItem> {
         };
     };
 
-    union {
-        // mSlot is the slot index of this buffer (default INVALID_BUFFER_SLOT).
-        int mSlot;
-
-        // mBuf is the former name for mSlot
-        int mBuf;
-    };
+    // mSlot is the slot index of this buffer (default INVALID_BUFFER_SLOT).
+    int mSlot;
 
     // mIsDroppable whether this buffer was queued with the
     // property that it can be replaced by a new buffer for the purpose of
@@ -123,6 +118,13 @@ class BufferItem : public Flattenable<BufferItem> {
     // Describes the portion of the surface that has been modified since the
     // previous frame
     Region mSurfaceDamage;
+
+    // Indicates that the BufferQueue is in single buffer mode
+    bool mSingleBufferMode;
+
+    // Indicates that this buffer was queued by the producer. When in single
+    // buffer mode acquire() can return a BufferItem that wasn't in the queue.
+    bool mQueuedBuffer;
 };
 
 } // namespace android
index cde302f..b2daae4 100644 (file)
@@ -100,20 +100,8 @@ public:
     // is 1x1.
     virtual status_t setDefaultBufferSize(uint32_t width, uint32_t height);
 
-    // setDefaultMaxBufferCount sets the default value for the maximum buffer
-    // count (the initial default is 2). If the producer has requested a
-    // buffer count using setBufferCount, the default buffer count will only
-    // take effect if the producer sets the count back to zero.
-    //
-    // The count must be between 2 and NUM_BUFFER_SLOTS, inclusive.
-    virtual status_t setDefaultMaxBufferCount(int bufferCount);
-
-    // disableAsyncBuffer disables the extra buffer used in async mode
-    // (when both producer and consumer have set their "isControlledByApp"
-    // flag) and has dequeueBuffer() return WOULD_BLOCK instead.
-    //
-    // This can only be called before connect().
-    virtual status_t disableAsyncBuffer();
+    // see IGraphicBufferConsumer::setMaxBufferCount
+    virtual status_t setMaxBufferCount(int bufferCount);
 
     // setMaxAcquiredBufferCount sets the maximum number of buffers that can
     // be acquired by the consumer at one time (default 1).  This call will
index 99134ea..fbd5114 100644 (file)
@@ -85,38 +85,32 @@ private:
     // getMinUndequeuedBufferCountLocked returns the minimum number of buffers
     // that must remain in a state other than DEQUEUED. The async parameter
     // tells whether we're in asynchronous mode.
-    int getMinUndequeuedBufferCountLocked(bool async) const;
+    int getMinUndequeuedBufferCountLocked() const;
 
     // getMinMaxBufferCountLocked returns the minimum number of buffers allowed
     // given the current BufferQueue state. The async parameter tells whether
     // we're in asynchonous mode.
-    int getMinMaxBufferCountLocked(bool async) const;
+    int getMinMaxBufferCountLocked() const;
 
     // getMaxBufferCountLocked returns the maximum number of buffers that can be
     // allocated at once. This value depends on the following member variables:
     //
-    //     mDequeueBufferCannotBlock
+    //     mMaxDequeuedBufferCount
     //     mMaxAcquiredBufferCount
-    //     mDefaultMaxBufferCount
-    //     mOverrideMaxBufferCount
-    //     async parameter
+    //     mMaxBufferCount
+    //     mAsyncMode
+    //     mDequeueBufferCannotBlock
     //
     // Any time one of these member variables is changed while a producer is
     // connected, mDequeueCondition must be broadcast.
-    int getMaxBufferCountLocked(bool async) const;
-
-    // setDefaultMaxBufferCountLocked sets the maximum number of buffer slots
-    // that will be used if the producer does not override the buffer slot
-    // count. The count must be between 2 and NUM_BUFFER_SLOTS, inclusive. The
-    // initial default is 2.
-    status_t setDefaultMaxBufferCountLocked(int count);
+    int getMaxBufferCountLocked() const;
 
     // freeBufferLocked frees the GraphicBuffer and sync resources for the
     // given slot.
-    void freeBufferLocked(int slot);
+    void freeBufferLocked(int slot, bool validate = true);
 
     // freeAllBuffersLocked frees the GraphicBuffer and sync resources for
-    // all slots.
+    // all slots, even if they're currently dequeued, queued, or acquired.
     void freeAllBuffersLocked();
 
     // stillTracking returns true iff the buffer item is still being tracked
@@ -192,21 +186,10 @@ private:
     // a buffer attached
     std::list<int> mFreeBuffers;
 
-    // mOverrideMaxBufferCount is the limit on the number of buffers that will
-    // be allocated at one time. This value is set by the producer by calling
-    // setBufferCount. The default is 0, which means that the producer doesn't
-    // care about the number of buffers in the pool. In that case,
-    // mDefaultMaxBufferCount is used as the limit.
-    int mOverrideMaxBufferCount;
-
     // mDequeueCondition is a condition variable used for dequeueBuffer in
     // synchronous mode.
     mutable Condition mDequeueCondition;
 
-    // mUseAsyncBuffer indicates whether an extra buffer is used in async mode
-    // to prevent dequeueBuffer from blocking.
-    bool mUseAsyncBuffer;
-
     // mDequeueBufferCannotBlock indicates whether dequeueBuffer is allowed to
     // block. This flag is set during connect when both the producer and
     // consumer are controlled by the application.
@@ -229,11 +212,9 @@ private:
     // is specified.
     android_dataspace mDefaultBufferDataSpace;
 
-    // mDefaultMaxBufferCount is the default limit on the number of buffers that
-    // will be allocated at one time. This default limit is set by the consumer.
-    // The limit (as opposed to the default limit) may be overriden by the
-    // producer.
-    int mDefaultMaxBufferCount;
+    // mMaxBufferCount is the limit on the number of buffers that will be
+    // allocated at one time. This limit can be set by the consumer.
+    int mMaxBufferCount;
 
     // mMaxAcquiredBufferCount is the number of buffers that the consumer may
     // acquire at one time. It defaults to 1, and can be changed by the consumer
@@ -242,6 +223,11 @@ private:
     // the value returned for the MIN_UNDEQUEUED_BUFFERS query to the producer.
     int mMaxAcquiredBufferCount;
 
+    // mMaxDequeuedBufferCount is the number of buffers that the producer may
+    // dequeue at one time. It defaults to 1, and can be changed by the producer
+    // via setMaxDequeuedBufferCount.
+    int mMaxDequeuedBufferCount;
+
     // mBufferHasBeenQueued is true once a buffer has been queued. It is reset
     // when something causes all buffers to be freed (e.g., changing the buffer
     // count).
@@ -280,6 +266,37 @@ private:
     // number will fail.
     uint32_t mGenerationNumber;
 
+    // mAsyncMode indicates whether or not async mode is enabled.
+    // In async mode an extra buffer will be allocated to allow the producer to
+    // enqueue buffers without blocking.
+    bool mAsyncMode;
+
+    // mSingleBufferMode indicates whether or not single buffer mode is enabled.
+    // In single buffer mode, the last buffer that was dequeued is cached and
+    // returned to all calls to dequeueBuffer and acquireBuffer. This allows the
+    // consumer and producer to access the same buffer simultaneously.
+    bool mSingleBufferMode;
+
+    // When single buffer mode is enabled, this tracks which slot contains the
+    // shared buffer.
+    int mSingleBufferSlot;
+
+    // Cached data about the shared buffer in single buffer mode
+    struct SingleBufferCache {
+        SingleBufferCache(Rect _crop, uint32_t _transform, int _scalingMode,
+                android_dataspace _dataspace)
+        : crop(_crop),
+          transform(_transform),
+          scalingMode(_scalingMode),
+          dataspace(_dataspace) {
+        };
+
+        Rect crop;
+        uint32_t transform;
+        uint32_t scalingMode;
+        android_dataspace dataspace;
+    } mSingleBufferCache;
+
 }; // class BufferQueueCore
 
 } // namespace android
index 9754a89..5fe5ce0 100644 (file)
@@ -39,22 +39,11 @@ public:
     // flags indicating that previously-returned buffers are no longer valid.
     virtual status_t requestBuffer(int slot, sp<GraphicBuffer>* buf);
 
-    // setBufferCount updates the number of available buffer slots.  If this
-    // method succeeds, buffer slots will be both unallocated and owned by
-    // the BufferQueue object (i.e. they are not owned by the producer or
-    // consumer).
-    //
-    // This will fail if the producer has dequeued any buffers, or if
-    // bufferCount is invalid.  bufferCount must generally be a value
-    // between the minimum undequeued buffer count (exclusive) and NUM_BUFFER_SLOTS
-    // (inclusive).  It may also be set to zero (the default) to indicate
-    // that the producer does not wish to set a value.  The minimum value
-    // can be obtained by calling query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS,
-    // ...).
-    //
-    // This may only be called by the producer.  The consumer will be told
-    // to discard buffers through the onBuffersReleased callback.
-    virtual status_t setBufferCount(int bufferCount);
+    // see IGraphicsBufferProducer::setMaxDequeuedBufferCount
+    virtual status_t setMaxDequeuedBufferCount(int maxDequeuedBuffers);
+
+    // see IGraphicsBufferProducer::setAsyncMode
+    virtual status_t setAsyncMode(bool async);
 
     // dequeueBuffer gets the next buffer slot index for the producer to use.
     // If a buffer slot is available then that slot index is written to the
@@ -92,7 +81,7 @@ public:
     // In both cases, the producer will need to call requestBuffer to get a
     // GraphicBuffer handle for the returned slot.
     virtual status_t dequeueBuffer(int *outSlot, sp<Fence>* outFence,
-            bool async, uint32_t width, uint32_t height, PixelFormat format,
+            uint32_t width, uint32_t height, PixelFormat format,
             uint32_t usage);
 
     // See IGraphicBufferProducer::detachBuffer
@@ -128,7 +117,7 @@ public:
     //
     // The buffer will not be overwritten until the fence signals.  The fence
     // will usually be the one obtained from dequeueBuffer.
-    virtual void cancelBuffer(int slot, const sp<Fence>& fence);
+    virtual status_t cancelBuffer(int slot, const sp<Fence>& fence);
 
     // Query native window attributes.  The "what" values are enumerated in
     // window.h (e.g. NATIVE_WINDOW_FORMAT).
@@ -169,7 +158,7 @@ public:
     virtual status_t setSidebandStream(const sp<NativeHandle>& stream);
 
     // See IGraphicBufferProducer::allocateBuffers
-    virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
+    virtual void allocateBuffers(uint32_t width, uint32_t height,
             PixelFormat format, uint32_t usage);
 
     // See IGraphicBufferProducer::allowAllocation
@@ -181,6 +170,12 @@ public:
     // See IGraphicBufferProducer::getConsumerName
     virtual String8 getConsumerName() const override;
 
+    // See IGraphicBufferProducer::getNextFrameNumber
+    virtual uint64_t getNextFrameNumber() const override;
+
+    // See IGraphicBufferProducer::setSingleBufferMode
+    virtual status_t setSingleBufferMode(bool singleBufferMode);
+
 private:
     // This is required by the IBinder::DeathRecipient interface
     virtual void binderDied(const wp<IBinder>& who);
@@ -190,8 +185,8 @@ private:
     // mode (producer and consumer controlled by the application). If it blocks,
     // it will release mCore->mMutex while blocked so that other operations on
     // the BufferQueue may succeed.
-    status_t waitForFreeSlotThenRelock(const char* caller, bool async,
-            int* found, status_t* returnFlags) const;
+    status_t waitForFreeSlotThenRelock(const char* caller, int* found,
+            status_t* returnFlags) const;
 
     sp<BufferQueueCore> mCore;
 
index 6085e11..17a654a 100644 (file)
@@ -29,11 +29,153 @@ namespace android {
 
 class Fence;
 
+// BufferState tracks the states in which a buffer slot can be.
+struct BufferState {
+
+    // All slots are initially FREE (not dequeued, queued, acquired, or shared).
+    BufferState()
+    : mDequeueCount(0),
+      mQueueCount(0),
+      mAcquireCount(0),
+      mShared(false) {
+    }
+
+    uint32_t mDequeueCount;
+    uint32_t mQueueCount;
+    uint32_t mAcquireCount;
+    bool mShared;
+
+    // A buffer can be in one of five states, represented as below:
+    //
+    //         | mShared | mDequeueCount | mQueueCount | mAcquireCount |
+    // --------|---------|---------------|-------------|---------------|
+    // FREE    |  false  |       0       |      0      |       0       |
+    // DEQUEUED|  false  |       1       |      0      |       0       |
+    // QUEUED  |  false  |       0       |      1      |       0       |
+    // ACQUIRED|  false  |       0       |      0      |       1       |
+    // SHARED  |  true   |      any      |     any     |      any      |
+    //
+    // FREE indicates that the buffer is available to be dequeued by the
+    // producer. The slot is "owned" by BufferQueue. It transitions to DEQUEUED
+    // when dequeueBuffer is called.
+    //
+    // DEQUEUED indicates that the buffer has been dequeued by the producer, but
+    // has not yet been queued or canceled. The producer may modify the
+    // buffer's contents as soon as the associated release fence is signaled.
+    // The slot is "owned" by the producer. It can transition to QUEUED (via
+    // queueBuffer or attachBuffer) or back to FREE (via cancelBuffer or
+    // detachBuffer).
+    //
+    // QUEUED indicates that the buffer has been filled by the producer and
+    // queued for use by the consumer. The buffer contents may continue to be
+    // modified for a finite time, so the contents must not be accessed until
+    // the associated fence is signaled. The slot is "owned" by BufferQueue. It
+    // can transition to ACQUIRED (via acquireBuffer) or to FREE (if another
+    // buffer is queued in asynchronous mode).
+    //
+    // ACQUIRED indicates that the buffer has been acquired by the consumer. As
+    // with QUEUED, the contents must not be accessed by the consumer until the
+    // acquire fence is signaled. The slot is "owned" by the consumer. It
+    // transitions to FREE when releaseBuffer (or detachBuffer) is called. A
+    // detached buffer can also enter the ACQUIRED state via attachBuffer.
+    //
+    // SHARED indicates that this buffer is being used in single-buffer
+    // mode. It can be in any combination of the other states at the same time,
+    // except for FREE (since that excludes being in any other state). It can
+    // also be dequeued, queued, or acquired multiple times.
+
+    inline bool isFree() const {
+        return !isAcquired() && !isDequeued() && !isQueued();
+    }
+
+    inline bool isDequeued() const {
+        return mDequeueCount > 0;
+    }
+
+    inline bool isQueued() const {
+        return mQueueCount > 0;
+    }
+
+    inline bool isAcquired() const {
+        return mAcquireCount > 0;
+    }
+
+    inline bool isShared() const {
+        return mShared;
+    }
+
+    inline void reset() {
+        *this = BufferState();
+    }
+
+    const char* string() const;
+
+    inline void dequeue() {
+        mDequeueCount++;
+    }
+
+    inline void detachProducer() {
+        if (mDequeueCount > 0) {
+            mDequeueCount--;
+        }
+    }
+
+    inline void attachProducer() {
+        mDequeueCount++;
+    }
+
+    inline void queue() {
+        if (mDequeueCount > 0) {
+            mDequeueCount--;
+        }
+        mQueueCount++;
+    }
+
+    inline void cancel() {
+        if (mDequeueCount > 0) {
+            mDequeueCount--;
+        }
+    }
+
+    inline void freeQueued() {
+        if (mQueueCount > 0) {
+            mQueueCount--;
+        }
+    }
+
+    inline void acquire() {
+        if (mQueueCount > 0) {
+            mQueueCount--;
+        }
+        mAcquireCount++;
+    }
+
+    inline void acquireNotInQueue() {
+        mAcquireCount++;
+    }
+
+    inline void release() {
+        if (mAcquireCount > 0) {
+            mAcquireCount--;
+        }
+    }
+
+    inline void detachConsumer() {
+        if (mAcquireCount > 0) {
+            mAcquireCount--;
+        }
+    }
+
+    inline void attachConsumer() {
+        mAcquireCount++;
+    }
+};
+
 struct BufferSlot {
 
     BufferSlot()
     : mEglDisplay(EGL_NO_DISPLAY),
-      mBufferState(BufferSlot::FREE),
+      mBufferState(),
       mRequestBufferCalled(false),
       mFrameNumber(0),
       mEglFence(EGL_NO_SYNC_KHR),
@@ -49,47 +191,6 @@ struct BufferSlot {
     // mEglDisplay is the EGLDisplay used to create EGLSyncKHR objects.
     EGLDisplay mEglDisplay;
 
-    // BufferState represents the different states in which a buffer slot
-    // can be.  All slots are initially FREE.
-    enum BufferState {
-        // FREE indicates that the buffer is available to be dequeued
-        // by the producer.  The buffer may be in use by the consumer for
-        // a finite time, so the buffer must not be modified until the
-        // associated fence is signaled.
-        //
-        // The slot is "owned" by BufferQueue.  It transitions to DEQUEUED
-        // when dequeueBuffer is called.
-        FREE = 0,
-
-        // DEQUEUED indicates that the buffer has been dequeued by the
-        // producer, but has not yet been queued or canceled.  The
-        // producer may modify the buffer's contents as soon as the
-        // associated ready fence is signaled.
-        //
-        // The slot is "owned" by the producer.  It can transition to
-        // QUEUED (via queueBuffer) or back to FREE (via cancelBuffer).
-        DEQUEUED = 1,
-
-        // QUEUED indicates that the buffer has been filled by the
-        // producer and queued for use by the consumer.  The buffer
-        // contents may continue to be modified for a finite time, so
-        // the contents must not be accessed until the associated fence
-        // is signaled.
-        //
-        // The slot is "owned" by BufferQueue.  It can transition to
-        // ACQUIRED (via acquireBuffer) or to FREE (if another buffer is
-        // queued in asynchronous mode).
-        QUEUED = 2,
-
-        // ACQUIRED indicates that the buffer has been acquired by the
-        // consumer.  As with QUEUED, the contents must not be accessed
-        // by the consumer until the fence is signaled.
-        //
-        // The slot is "owned" by the consumer.  It transitions to FREE
-        // when releaseBuffer is called.
-        ACQUIRED = 3
-    };
-
     static const char* bufferStateName(BufferState state);
 
     // mBufferState is the current state of this buffer slot.
index 3b07a31..b7aa463 100644 (file)
@@ -67,6 +67,25 @@ class CpuConsumer : public ConsumerBase
         uint8_t    *dataCr;
         uint32_t    chromaStride;
         uint32_t    chromaStep;
+
+        LockedBuffer() :
+            data(NULL),
+            width(0),
+            height(0),
+            format(PIXEL_FORMAT_NONE),
+            stride(0),
+            crop(Rect::EMPTY_RECT),
+            transform(0),
+            scalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
+            timestamp(0),
+            dataSpace(HAL_DATASPACE_UNKNOWN),
+            frameNumber(0),
+            flexFormat(PIXEL_FORMAT_NONE),
+            dataCb(NULL),
+            dataCr(NULL),
+            chromaStride(0),
+            chromaStep(0)
+        {}
     };
 
     // Create a new CPU consumer. The maxLockedBuffers parameter specifies
index c35c7be..0e4acee 100644 (file)
@@ -112,11 +112,6 @@ public:
     // union fence.
     void setReleaseFence(const sp<Fence>& fence);
 
-    // setDefaultMaxBufferCount sets the default limit on the maximum number
-    // of buffers that will be allocated at one time. The image producer may
-    // override the limit.
-    status_t setDefaultMaxBufferCount(int bufferCount);
-
     // getTransformMatrix retrieves the 4x4 texture coordinate transform matrix
     // associated with the texture image set by the most recent call to
     // updateTexImage.
@@ -201,6 +196,7 @@ public:
     status_t setDefaultBufferDataSpace(android_dataspace defaultDataSpace);
     status_t setConsumerUsageBits(uint32_t usage);
     status_t setTransformHint(uint32_t hint);
+    status_t setMaxAcquiredBufferCount(int maxAcquiredBuffers);
 
     // detachFromContext detaches the GLConsumer from the calling thread's
     // current OpenGL ES context.  This context must be the same as the context
index 60ec9cc..d4c9ee5 100644 (file)
@@ -188,32 +188,28 @@ public:
     // * BAD_VALUE - either w or h was zero
     virtual status_t setDefaultBufferSize(uint32_t w, uint32_t h) = 0;
 
-    // setDefaultMaxBufferCount sets the default value for the maximum buffer
-    // count (the initial default is 2). If the producer has requested a
-    // buffer count using setBufferCount, the default buffer count will only
-    // take effect if the producer sets the count back to zero.
+    // setMaxBufferCount sets the maximum value for the number of buffers used
+    // in the buffer queue (the initial default is NUM_BUFFER_SLOTS). If a call
+    // to setMaxAcquiredBufferCount (by the consumer), or a call to setAsyncMode
+    // or setMaxDequeuedBufferCount (by the producer), would cause this value to
+    // be exceeded then that call will fail. This call will fail if a producer
+    // is connected to the BufferQueue.
     //
-    // The count must be between 2 and NUM_BUFFER_SLOTS, inclusive.
+    // The count must be between 1 and NUM_BUFFER_SLOTS, inclusive. The count
+    // cannot be less than maxAcquiredBufferCount.
     //
     // Return of a value other than NO_ERROR means an error has occurred:
     // * BAD_VALUE - bufferCount was out of range (see above).
-    virtual status_t setDefaultMaxBufferCount(int bufferCount) = 0;
-
-    // disableAsyncBuffer disables the extra buffer used in async mode
-    // (when both producer and consumer have set their "isControlledByApp"
-    // flag) and has dequeueBuffer() return WOULD_BLOCK instead.
-    //
-    // This can only be called before consumerConnect().
-    //
-    // Return of a value other than NO_ERROR means an error has occurred:
-    // * INVALID_OPERATION - attempting to call this after consumerConnect.
-    virtual status_t disableAsyncBuffer() = 0;
+    // * INVALID_OPERATION - attempting to call this after a producer connected.
+    virtual status_t setMaxBufferCount(int bufferCount) = 0;
 
     // setMaxAcquiredBufferCount sets the maximum number of buffers that can
     // be acquired by the consumer at one time (default 1).  This call will
     // fail if a producer is connected to the BufferQueue.
     //
-    // maxAcquiredBuffers must be (inclusive) between 1 and MAX_MAX_ACQUIRED_BUFFERS.
+    // maxAcquiredBuffers must be (inclusive) between 1 and
+    // MAX_MAX_ACQUIRED_BUFFERS. It also cannot cause the maxBufferCount value
+    // to be exceeded.
     //
     // Return of a value other than NO_ERROR means an error has occurred:
     // * BAD_VALUE - maxAcquiredBuffers was out of range (see above).
index 9530de1..d6daca7 100644 (file)
@@ -74,33 +74,50 @@ public:
     // The slot must be in the range of [0, NUM_BUFFER_SLOTS).
     //
     // Return of a value other than NO_ERROR means an error has occurred:
-    // * NO_INIT - the buffer queue has been abandoned.
+    // * NO_INIT - the buffer queue has been abandoned or the producer is not
+    //             connected.
     // * BAD_VALUE - one of the two conditions occurred:
     //              * slot was out of range (see above)
     //              * buffer specified by the slot is not dequeued
     virtual status_t requestBuffer(int slot, sp<GraphicBuffer>* buf) = 0;
 
-    // setBufferCount sets the number of buffer slots available. Calling this
-    // will also cause all buffer slots to be emptied. The caller should empty
-    // its mirrored copy of the buffer slots when calling this method.
-    //
-    // This function should not be called when there are any dequeued buffer
-    // slots, doing so will result in a BAD_VALUE error returned.
+    // setMaxDequeuedBufferCount sets the maximum number of buffers that can be
+    // dequeued by the producer at one time. If this method succeeds, buffer
+    // slots will be both unallocated and owned by the BufferQueue object (i.e.
+    // they are not owned by the producer or consumer). Calling this will also
+    // cause all buffer slots to be emptied. If the caller is caching the
+    // contents of the buffer slots, it should empty that cache after calling
+    // this method.
     //
-    // The buffer count should be at most NUM_BUFFER_SLOTS (inclusive), but at least
-    // the minimum undequeued buffer count (exclusive). The minimum value
-    // can be obtained by calling query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS).
-    // In particular the range is (minUndequeudBuffers, NUM_BUFFER_SLOTS].
+    // This function should not be called when there are any currently dequeued
+    // buffer slots. Doing so will result in a BAD_VALUE error.
     //
-    // The buffer count may also be set to 0 (the default), to indicate that
-    // the producer does not wish to set a value.
+    // The buffer count should be at least 1 (inclusive), but at most
+    // (NUM_BUFFER_SLOTS - the minimum undequeued buffer count) (exclusive). The
+    // minimum undequeued buffer count can be obtained by calling
+    // query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS).
     //
     // Return of a value other than NO_ERROR means an error has occurred:
     // * NO_INIT - the buffer queue has been abandoned.
     // * BAD_VALUE - one of the below conditions occurred:
-    //              * bufferCount was out of range (see above)
-    //              * client has one or more buffers dequeued
-    virtual status_t setBufferCount(int bufferCount) = 0;
+    //     * bufferCount was out of range (see above)
+    //     * client has one or more buffers dequeued
+    //     * this call would cause the maxBufferCount value to be exceeded
+    virtual status_t setMaxDequeuedBufferCount(int maxDequeuedBuffers) = 0;
+
+    // Set the async flag if the producer intends to asynchronously queue
+    // buffers without blocking. Typically this is used for triple-buffering
+    // and/or when the swap interval is set to zero.
+    //
+    // Enabling async mode will internally allocate an additional buffer to
+    // allow for the asynchronous behavior. If it is not enabled queue/dequeue
+    // calls may block.
+    //
+    // Return of a value other than NO_ERROR means an error has occurred:
+    // * NO_INIT - the buffer queue has been abandoned.
+    // * BAD_VALUE - this call would cause the maxBufferCount value to be
+    //               exceeded
+    virtual status_t setAsyncMode(bool async) = 0;
 
     // dequeueBuffer requests a new buffer slot for the client to use. Ownership
     // of the slot is transfered to the client, meaning that the server will not
@@ -126,9 +143,6 @@ public:
     // fence signals. If the fence is Fence::NO_FENCE, the buffer may be written
     // immediately.
     //
-    // The async parameter sets whether we're in asynchronous mode for this
-    // dequeueBuffer() call.
-    //
     // The width and height parameters must be no greater than the minimum of
     // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv).
     // An error due to invalid dimensions might not be reported until
@@ -150,7 +164,8 @@ public:
     // success.
     //
     // Return of a negative means an error has occurred:
-    // * NO_INIT - the buffer queue has been abandoned.
+    // * NO_INIT - the buffer queue has been abandoned or the producer is not
+    //             connected.
     // * BAD_VALUE - both in async mode and buffer count was less than the
     //               max numbers of buffers that can be allocated at once.
     // * INVALID_OPERATION - cannot attach the buffer because it would cause
@@ -165,8 +180,8 @@ public:
     //
     // All other negative values are an unknown error returned downstream
     // from the graphics allocator (typically errno).
-    virtual status_t dequeueBuffer(int* slot, sp<Fence>* fence, bool async,
-            uint32_t w, uint32_t h, PixelFormat format, uint32_t usage) = 0;
+    virtual status_t dequeueBuffer(int* slot, sp<Fence>* fence, uint32_t w,
+            uint32_t h, PixelFormat format, uint32_t usage) = 0;
 
     // detachBuffer attempts to remove all ownership of the buffer in the given
     // slot from the buffer queue. If this call succeeds, the slot will be
@@ -178,7 +193,8 @@ public:
     // requestBuffer).
     //
     // Return of a value other than NO_ERROR means an error has occurred:
-    // * NO_INIT - the buffer queue has been abandoned.
+    // * NO_INIT - the buffer queue has been abandoned or the producer is not
+    //             connected.
     // * BAD_VALUE - the given slot number is invalid, either because it is
     //               out of the range [0, NUM_BUFFER_SLOTS), or because the slot
     //               it refers to is not currently dequeued and requested.
@@ -198,7 +214,8 @@ public:
     // equivalent to fence from the dequeueBuffer call.
     //
     // Return of a value other than NO_ERROR means an error has occurred:
-    // * NO_INIT - the buffer queue has been abandoned.
+    // * NO_INIT - the buffer queue has been abandoned or the producer is not
+    //             connected.
     // * BAD_VALUE - either outBuffer or outFence were NULL.
     // * NO_MEMORY - no slots were found that were both free and contained a
     //               GraphicBuffer.
@@ -217,7 +234,8 @@ public:
     // success.
     //
     // Return of a negative value means an error has occurred:
-    // * NO_INIT - the buffer queue has been abandoned.
+    // * NO_INIT - the buffer queue has been abandoned or the producer is not
+    //             connected.
     // * BAD_VALUE - outSlot or buffer were NULL, invalid combination of
     //               async mode and buffer count override, or the generation
     //               number of the buffer did not match the buffer queue.
@@ -251,7 +269,8 @@ public:
     // (refer to the documentation below).
     //
     // Return of a value other than NO_ERROR means an error has occurred:
-    // * NO_INIT - the buffer queue has been abandoned.
+    // * NO_INIT - the buffer queue has been abandoned or the producer is not
+    //             connected.
     // * BAD_VALUE - one of the below conditions occurred:
     //              * fence was NULL
     //              * scaling mode was unknown
@@ -271,23 +290,21 @@ public:
         // crop - a crop rectangle that's used as a hint to the consumer
         // scalingMode - a set of flags from NATIVE_WINDOW_SCALING_* in <window.h>
         // transform - a set of flags from NATIVE_WINDOW_TRANSFORM_* in <window.h>
-        // async - if the buffer is queued in asynchronous mode
         // fence - a fence that the consumer must wait on before reading the buffer,
         //         set this to Fence::NO_FENCE if the buffer is ready immediately
         // sticky - the sticky transform set in Surface (only used by the LEGACY
         //          camera mode).
         inline QueueBufferInput(int64_t timestamp, bool isAutoTimestamp,
                 android_dataspace dataSpace, const Rect& crop, int scalingMode,
-                uint32_t transform, bool async, const sp<Fence>& fence,
-                uint32_t sticky = 0)
+                uint32_t transform, const sp<Fence>& fence, uint32_t sticky = 0)
                 : timestamp(timestamp), isAutoTimestamp(isAutoTimestamp),
                   dataSpace(dataSpace), crop(crop), scalingMode(scalingMode),
-                  transform(transform), stickyTransform(sticky),
-                  async(async), fence(fence), surfaceDamage() { }
+                  transform(transform), stickyTransform(sticky), fence(fence),
+                  surfaceDamage() { }
         inline void deflate(int64_t* outTimestamp, bool* outIsAutoTimestamp,
                 android_dataspace* outDataSpace,
                 Rect* outCrop, int* outScalingMode,
-                uint32_t* outTransform, bool* outAsync, sp<Fence>* outFence,
+                uint32_t* outTransform, sp<Fence>* outFence,
                 uint32_t* outStickyTransform = NULL) const {
             *outTimestamp = timestamp;
             *outIsAutoTimestamp = bool(isAutoTimestamp);
@@ -295,7 +312,6 @@ public:
             *outCrop = crop;
             *outScalingMode = scalingMode;
             *outTransform = transform;
-            *outAsync = bool(async);
             *outFence = fence;
             if (outStickyTransform != NULL) {
                 *outStickyTransform = stickyTransform;
@@ -319,7 +335,6 @@ public:
         int scalingMode;
         uint32_t transform;
         uint32_t stickyTransform;
-        int async;
         sp<Fence> fence;
         Region surfaceDamage;
     };
@@ -355,8 +370,8 @@ public:
         uint32_t numPendingBuffers;
     };
 
-    virtual status_t queueBuffer(int slot,
-            const QueueBufferInput& input, QueueBufferOutput* output) = 0;
+    virtual status_t queueBuffer(int slot, const QueueBufferInput& input,
+            QueueBufferOutput* output) = 0;
 
     // cancelBuffer indicates that the client does not wish to fill in the
     // buffer associated with slot and transfers ownership of the slot back to
@@ -364,9 +379,19 @@ public:
     //
     // The buffer is not queued for use by the consumer.
     //
+    // The slot must be in the range of [0, NUM_BUFFER_SLOTS).
+    //
     // The buffer will not be overwritten until the fence signals.  The fence
     // will usually be the one obtained from dequeueBuffer.
-    virtual void cancelBuffer(int slot, const sp<Fence>& fence) = 0;
+    //
+    // Return of a value other than NO_ERROR means an error has occurred:
+    // * NO_INIT - the buffer queue has been abandoned or the producer is not
+    //             connected.
+    // * BAD_VALUE - one of the below conditions occurred:
+    //              * fence was NULL
+    //              * slot index was out of range (see above).
+    //              * the slot was not in the dequeued state
+    virtual status_t cancelBuffer(int slot, const sp<Fence>& fence) = 0;
 
     // query retrieves some information for this surface
     // 'what' tokens allowed are that of NATIVE_WINDOW_* in <window.h>
@@ -457,7 +482,7 @@ public:
     // allocated. This is most useful to avoid an allocation delay during
     // dequeueBuffer. If there are already the maximum number of buffers
     // allocated, this function has no effect.
-    virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
+    virtual void allocateBuffers(uint32_t width, uint32_t height,
             PixelFormat format, uint32_t usage) = 0;
 
     // Sets whether dequeueBuffer is allowed to allocate new buffers.
@@ -483,6 +508,16 @@ public:
 
     // Returns the name of the connected consumer.
     virtual String8 getConsumerName() const = 0;
+
+    // Returns the number of the next frame which will be dequeued.
+    virtual uint64_t getNextFrameNumber() const = 0;
+
+    // Used to enable/disable single buffer mode.
+    //
+    // In single buffer mode the last buffer that was dequeued will be cached
+    // and returned to all calls to dequeueBuffer and acquireBuffer. This allows
+    // the producer and consumer to simultaneously access the same buffer.
+    virtual status_t setSingleBufferMode(bool singleBufferMode) = 0;
 };
 
 // ----------------------------------------------------------------------------
index 72f1067..f9fc6df 100644 (file)
@@ -109,6 +109,9 @@ public:
     // See IGraphicBufferProducer::getConsumerName
     String8 getConsumerName() const;
 
+    // See IGraphicBufferProducer::getNextFrameNumber
+    uint64_t getNextFrameNumber() const;
+
 protected:
     virtual ~Surface();
 
@@ -156,6 +159,7 @@ private:
     int dispatchSetSidebandStream(va_list args);
     int dispatchSetBuffersDataSpace(va_list args);
     int dispatchSetSurfaceDamage(va_list args);
+    int dispatchSetSingleBufferMode(va_list args);
 
 protected:
     virtual int dequeueBuffer(ANativeWindowBuffer** buffer, int* fenceFd);
@@ -183,6 +187,9 @@ protected:
     virtual void setSurfaceDamage(android_native_rect_t* rects, size_t numRects);
 
 public:
+    virtual int setMaxDequeuedBufferCount(int maxDequeuedBuffers);
+    virtual int setAsyncMode(bool async);
+    virtual int setSingleBufferMode(bool singleBufferMode);
     virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds);
     virtual int unlockAndPost();
 
index 37d953e..aa48718 100644 (file)
@@ -134,6 +134,8 @@ public:
     status_t    setSize(const sp<IBinder>& id, uint32_t w, uint32_t h);
     status_t    setCrop(const sp<IBinder>& id, const Rect& crop);
     status_t    setLayerStack(const sp<IBinder>& id, uint32_t layerStack);
+    status_t    deferTransactionUntil(const sp<IBinder>& id,
+            const sp<IBinder>& handle, uint64_t frameNumber);
     status_t    destroySurface(const sp<IBinder>& id);
 
     status_t clearLayerFrameStats(const sp<IBinder>& token) const;
index 9f62f7c..993a92f 100644 (file)
@@ -69,10 +69,15 @@ public:
     status_t    setMatrix(float dsdx, float dtdx, float dsdy, float dtdy);
     status_t    setCrop(const Rect& crop);
 
+    // Defers applying any changes made in this transaction until the Layer
+    // identified by handle reaches the given frameNumber
+    status_t deferTransactionUntil(sp<IBinder> handle, uint64_t frameNumber);
+
     static status_t writeSurfaceToParcel(
             const sp<SurfaceControl>& control, Parcel* parcel);
 
     sp<Surface> getSurface() const;
+    sp<IBinder> getHandle() const;
 
     status_t clearLayerFrameStats() const;
     status_t getLayerFrameStats(FrameStats* outStats) const;
index f0a6238..b7012eb 100644 (file)
@@ -307,11 +307,18 @@ static const InputEventLabel KEYCODES[] = {
     DEFINE_KEYCODE(STEM_1),
     DEFINE_KEYCODE(STEM_2),
     DEFINE_KEYCODE(STEM_3),
+    DEFINE_KEYCODE(DPAD_UP_LEFT),
+    DEFINE_KEYCODE(DPAD_DOWN_LEFT),
+    DEFINE_KEYCODE(DPAD_UP_RIGHT),
+    DEFINE_KEYCODE(DPAD_DOWN_RIGHT),
     DEFINE_KEYCODE(MEDIA_SKIP_FORWARD),
     DEFINE_KEYCODE(MEDIA_SKIP_BACKWARD),
     DEFINE_KEYCODE(MEDIA_STEP_FORWARD),
     DEFINE_KEYCODE(MEDIA_STEP_BACKWARD),
     DEFINE_KEYCODE(SOFT_SLEEP),
+    DEFINE_KEYCODE(CUT),
+    DEFINE_KEYCODE(COPY),
+    DEFINE_KEYCODE(PASTE),
 
     { NULL, 0 }
 };
index eb5840e..7935927 100644 (file)
@@ -31,6 +31,9 @@
 #include <utils/Unicode.h>
 #include <utils/RefBase.h>
 
+// Maximum number of keys supported by KeyCharacterMaps
+#define MAX_KEYS 8192
+
 namespace android {
 
 /**
index 272881b..985d919 100644 (file)
@@ -220,9 +220,6 @@ namespace android {
                                                   Vector<uint8_t> &certificate,
                                                   Vector<uint8_t> &wrapped_key) = 0;
 
-        // Remove device provisioning.
-        virtual status_t unprovisionDevice() = 0;
-
         // A means of enforcing the contractual requirement for a concurrent stream
         // limit per subscriber across devices is provided via SecureStop.  SecureStop
         // is a means of securely monitoring the lifetime of sessions. Since playback
index ae8430d..5bfec61 100644 (file)
@@ -714,6 +714,8 @@ inline static const char *asString(OMX_VIDEO_CODINGTYPE i, const char *def = "??
         case OMX_VIDEO_CodingVP8:        return "VP8";
         case OMX_VIDEO_CodingVP9:        return "VP9";
         case OMX_VIDEO_CodingHEVC:       return "HEVC";
+        case OMX_VIDEO_CodingDolbyAVC:   return "DolbyAVC";
+        case OMX_VIDEO_CodingDolbyHEVC:  return "DolbyHEVC";
         default:                         return def;
     }
 }
index decc410..7b6df89 100644 (file)
@@ -88,6 +88,8 @@ typedef enum OMX_VIDEO_CODINGTYPE {
     OMX_VIDEO_CodingVP8,        /**< Google VP8, formerly known as On2 VP8 */
     OMX_VIDEO_CodingVP9,        /**< Google VP9 */
     OMX_VIDEO_CodingHEVC,       /**< ITU H.265/HEVC */
+    OMX_VIDEO_CodingDolbyAVC,   /**< DolbyVision H.264/AVC */
+    OMX_VIDEO_CodingDolbyHEVC,  /**< DolbyVision H.265/HEVC */
     OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
     OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
     OMX_VIDEO_CodingMax = 0x7FFFFFFF
index cbe8733..5cf316f 100644 (file)
@@ -52,17 +52,17 @@ struct layer_state_t {
         eFlagsChanged               = 0x00000040,
         eLayerStackChanged          = 0x00000080,
         eCropChanged                = 0x00000100,
+        eDeferTransaction           = 0x00000200
     };
 
     layer_state_t()
         :   what(0),
             x(0), y(0), z(0), w(0), h(0), layerStack(0),
             alpha(0), flags(0), mask(0),
-            reserved(0)
+            reserved(0), crop(Rect::INVALID_RECT), frameNumber(0)
     {
         matrix.dsdx = matrix.dtdy = 1.0f;
         matrix.dsdy = matrix.dtdx = 0.0f;
-        crop.makeInvalid();
     }
 
     status_t    write(Parcel& output) const;
@@ -88,6 +88,8 @@ struct layer_state_t {
             uint8_t         reserved;
             matrix22_t      matrix;
             Rect            crop;
+            sp<IBinder>     handle;
+            uint64_t        frameNumber;
             // non POD must be last. see write/read
             Region          transparentRegion;
 };
@@ -117,6 +119,8 @@ struct DisplayState {
         eDisplaySizeChanged         = 0x08
     };
 
+    DisplayState();
+
     uint32_t what;
     sp<IBinder> token;
     sp<IGraphicBufferProducer> surface;
index 8c190dd..84eb100 100644 (file)
@@ -72,7 +72,7 @@ public:
     }
 
     void operator()(region_rasterizer& rasterizer) {
-        RECT current;
+        RECT current(Rect::EMPTY_RECT);
         do {
             SpannerInner spannerInner(spanner.lhs, spanner.rhs);
             int inside = spanner.next(current.top, current.bottom);
index 3886f93..6310502 100644 (file)
@@ -32,13 +32,12 @@ public:
     typedef ARect::value_type value_type;
 
     static const Rect INVALID_RECT;
+    static const Rect EMPTY_RECT;
 
     // we don't provide copy-ctor and operator= on purpose
     // because we want the compiler generated versions
 
-    inline Rect() {
-      left = right = top = bottom = 0;
-    }
+    inline Rect() : Rect(INVALID_RECT) {}
 
     inline Rect(int32_t w, int32_t h) {
         left = top = 0;
index adb9674..9862f9e 100644 (file)
@@ -27,6 +27,8 @@ sources := \
     IPCThreadState.cpp \
     IPermissionController.cpp \
     IProcessInfoService.cpp \
+    IResultReceiver.cpp \
+    ProcessInfoService.cpp \
     IServiceManager.cpp \
     MemoryBase.cpp \
     MemoryDealer.cpp \
index e39093d..c4d47ca 100644 (file)
@@ -20,6 +20,7 @@
 #include <utils/misc.h>
 #include <binder/BpBinder.h>
 #include <binder/IInterface.h>
+#include <binder/IResultReceiver.h>
 #include <binder/Parcel.h>
 
 #include <stdio.h>
@@ -59,6 +60,24 @@ bool IBinder::checkSubclass(const void* /*subclassID*/) const
     return false;
 }
 
+
+status_t IBinder::shellCommand(const sp<IBinder>& target, int in, int out, int err,
+    Vector<String16>& args, const sp<IResultReceiver>& resultReceiver)
+{
+    Parcel send;
+    Parcel reply;
+    send.writeFileDescriptor(in);
+    send.writeFileDescriptor(out);
+    send.writeFileDescriptor(err);
+    const size_t numArgs = args.size();
+    send.writeInt32(numArgs);
+    for (size_t i = 0; i < numArgs; i++) {
+        send.writeString16(args[i]);
+    }
+    send.writeStrongBinder(resultReceiver != NULL ? IInterface::asBinder(resultReceiver) : NULL);
+    return target->transact(SHELL_COMMAND_TRANSACTION, send, &reply);
+}
+
 // ---------------------------------------------------------------------------
 
 class BBinder::Extras
@@ -129,7 +148,7 @@ status_t BBinder::unlinkToDeath(
     return INVALID_OPERATION;
 }
 
-    status_t BBinder::dump(int /*fd*/, const Vector<String16>& /*args*/)
+status_t BBinder::dump(int /*fd*/, const Vector<String16>& /*args*/)
 {
     return NO_ERROR;
 }
@@ -204,6 +223,25 @@ status_t BBinder::onTransact(
             return dump(fd, args);
         }
 
+        case SHELL_COMMAND_TRANSACTION: {
+            int in = data.readFileDescriptor();
+            int out = data.readFileDescriptor();
+            int err = data.readFileDescriptor();
+            int argc = data.readInt32();
+            Vector<String16> args;
+            for (int i = 0; i < argc && data.dataAvail() > 0; i++) {
+               args.add(data.readString16());
+            }
+            sp<IResultReceiver> resultReceiver = IResultReceiver::asInterface(
+                    data.readStrongBinder());
+
+            // XXX can't add virtuals until binaries are updated.
+            //return shellCommand(in, out, err, args, resultReceiver);
+            if (resultReceiver != NULL) {
+                resultReceiver->send(INVALID_OPERATION);
+            }
+        }
+
         case SYSPROPS_TRANSACTION: {
             report_sysprop_change();
             return NO_ERROR;
index 345ba20..c0e0296 100644 (file)
@@ -20,6 +20,7 @@
 #include <binder/BpBinder.h>
 
 #include <binder/IPCThreadState.h>
+#include <binder/IResultReceiver.h>
 #include <utils/Log.h>
 
 #include <stdio.h>
index d86eb27..c37920d 100644 (file)
@@ -49,6 +49,39 @@ public:
         return reply.readInt32();
     }
 
+    virtual status_t getProcessStatesAndOomScoresFromPids(size_t length,
+            /*in*/ int32_t* pids, /*out*/ int32_t* states, /*out*/ int32_t* scores)
+    {
+        Parcel data, reply;
+        data.writeInterfaceToken(IProcessInfoService::getInterfaceDescriptor());
+        data.writeInt32Array(length, pids);
+        // write length of output arrays, used by java AIDL stubs
+        data.writeInt32(length);
+        data.writeInt32(length);
+        status_t err = remote()->transact(
+                GET_PROCESS_STATES_AND_OOM_SCORES_FROM_PIDS, data, &reply);
+        if (err != NO_ERROR
+                || ((err = reply.readExceptionCode()) != NO_ERROR)) {
+            return err;
+        }
+        int32_t replyLen = reply.readInt32();
+        if (static_cast<size_t>(replyLen) != length) {
+            return NOT_ENOUGH_DATA;
+        }
+        if (replyLen > 0 && (err = reply.read(
+                states, length * sizeof(*states))) != NO_ERROR) {
+            return err;
+        }
+        replyLen = reply.readInt32();
+        if (static_cast<size_t>(replyLen) != length) {
+            return NOT_ENOUGH_DATA;
+        }
+        if (replyLen > 0 && (err = reply.read(
+                scores, length * sizeof(*scores))) != NO_ERROR) {
+            return err;
+        }
+        return reply.readInt32();
+    }
 };
 
 IMPLEMENT_META_INTERFACE(ProcessInfoService, "android.os.IProcessInfoService");
@@ -84,6 +117,38 @@ status_t BnProcessInfoService::onTransact( uint32_t code, const Parcel& data, Pa
             reply->writeInt32(res);
             return NO_ERROR;
         } break;
+        case GET_PROCESS_STATES_AND_OOM_SCORES_FROM_PIDS: {
+            CHECK_INTERFACE(IProcessInfoService, data, reply);
+            int32_t arrayLen = data.readInt32();
+            if (arrayLen <= 0) {
+                reply->writeNoException();
+                reply->writeInt32(0);
+                reply->writeInt32(NOT_ENOUGH_DATA);
+                return NO_ERROR;
+            }
+
+            size_t len = static_cast<size_t>(arrayLen);
+            int32_t pids[len];
+            status_t res = data.read(pids, len * sizeof(*pids));
+
+            // Ignore output array length returned in the parcel here, as the
+            // states array must always be the same length as the input PIDs array.
+            int32_t states[len];
+            int32_t scores[len];
+            for (size_t i = 0; i < len; i++) {
+                states[i] = -1;
+                scores[i] = -10000;
+            }
+            if (res == NO_ERROR) {
+                res = getProcessStatesAndOomScoresFromPids(
+                        len, /*in*/ pids, /*out*/ states, /*out*/ scores);
+            }
+            reply->writeNoException();
+            reply->writeInt32Array(len, states);
+            reply->writeInt32Array(len, scores);
+            reply->writeInt32(res);
+            return NO_ERROR;
+        } break;
         default:
             return BBinder::onTransact(code, data, reply, flags);
     }
diff --git a/libs/binder/IResultReceiver.cpp b/libs/binder/IResultReceiver.cpp
new file mode 100644 (file)
index 0000000..2a22b69
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "ResultReceiver"
+
+#include <binder/IResultReceiver.h>
+
+#include <utils/Log.h>
+#include <binder/Parcel.h>
+#include <utils/String8.h>
+
+#include <private/binder/Static.h>
+
+namespace android {
+
+// ----------------------------------------------------------------------
+
+class BpResultReceiver : public BpInterface<IResultReceiver>
+{
+public:
+    BpResultReceiver(const sp<IBinder>& impl)
+        : BpInterface<IResultReceiver>(impl)
+    {
+    }
+
+    virtual void send(int32_t resultCode) {
+        Parcel data;
+        data.writeInterfaceToken(IResultReceiver::getInterfaceDescriptor());
+        data.writeInt32(resultCode);
+        remote()->transact(OP_SEND, data, NULL, IBinder::FLAG_ONEWAY);
+    }
+};
+
+IMPLEMENT_META_INTERFACE(ResultReceiver, "com.android.internal.os.IResultReceiver");
+
+// ----------------------------------------------------------------------
+
+status_t BnResultReceiver::onTransact(
+    uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
+{
+    switch(code) {
+        case OP_SEND: {
+            CHECK_INTERFACE(IResultReceiver, data, reply);
+            int32_t resultCode = data.readInt32();
+            send(resultCode);
+            if (reply != NULL) {
+                reply->writeNoException();
+            }
+            return NO_ERROR;
+        } break;
+        default:
+            return BBinder::onTransact(code, data, reply, flags);
+    }
+}
+
+}; // namespace android
index 8f64ae0..de8ff70 100644 (file)
@@ -24,6 +24,9 @@
 namespace android {
 
 BufferItem::BufferItem() :
+    mGraphicBuffer(NULL),
+    mFence(NULL),
+    mCrop(Rect::INVALID_RECT),
     mTransform(0),
     mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
     mTimestamp(0),
@@ -33,8 +36,10 @@ BufferItem::BufferItem() :
     mSlot(INVALID_BUFFER_SLOT),
     mIsDroppable(false),
     mAcquireCalled(false),
-    mTransformToDisplayInverse(false) {
-    mCrop.makeInvalid();
+    mTransformToDisplayInverse(false),
+    mSurfaceDamage(),
+    mSingleBufferMode(false),
+    mQueuedBuffer(true) {
 }
 
 BufferItem::~BufferItem() {}
index 578b8d9..6f4c89d 100644 (file)
@@ -78,7 +78,7 @@ status_t BufferItemConsumer::acquireBuffer(BufferItem *item,
         }
     }
 
-    item->mGraphicBuffer = mSlots[item->mBuf].mGraphicBuffer;
+    item->mGraphicBuffer = mSlots[item->mSlot].mGraphicBuffer;
 
     return OK;
 }
@@ -89,9 +89,9 @@ status_t BufferItemConsumer::releaseBuffer(const BufferItem &item,
 
     Mutex::Autolock _l(mMutex);
 
-    err = addReleaseFenceLocked(item.mBuf, item.mGraphicBuffer, releaseFence);
+    err = addReleaseFenceLocked(item.mSlot, item.mGraphicBuffer, releaseFence);
 
-    err = releaseBufferLocked(item.mBuf, item.mGraphicBuffer, EGL_NO_DISPLAY,
+    err = releaseBufferLocked(item.mSlot, item.mGraphicBuffer, EGL_NO_DISPLAY,
             EGL_NO_SYNC_KHR);
     if (err != OK) {
         BI_LOGE("Failed to release buffer: %s (%d)",
index bb3e1b0..6f9f21f 100644 (file)
@@ -50,7 +50,7 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer,
         // buffer before releasing the old one.
         int numAcquiredBuffers = 0;
         for (int s = 0; s < BufferQueueDefs::NUM_BUFFER_SLOTS; ++s) {
-            if (mSlots[s].mBufferState == BufferSlot::ACQUIRED) {
+            if (mSlots[s].mBufferState.isAcquired()) {
                 ++numAcquiredBuffers;
             }
         }
@@ -60,10 +60,13 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer,
             return INVALID_OPERATION;
         }
 
-        // Check if the queue is empty.
+        bool sharedBufferAvailable = mCore->mSingleBufferMode &&
+                mCore->mSingleBufferSlot !=
+                BufferQueueCore::INVALID_BUFFER_SLOT;
+
         // In asynchronous mode the list is guaranteed to be one buffer deep,
         // while in synchronous mode we use the oldest buffer.
-        if (mCore->mQueue.empty()) {
+        if (mCore->mQueue.empty() && !sharedBufferAvailable) {
             return NO_BUFFER_AVAILABLE;
         }
 
@@ -72,7 +75,9 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer,
         // If expectedPresent is specified, we may not want to return a buffer yet.
         // If it's specified and there's more than one buffer queued, we may want
         // to drop a buffer.
-        if (expectedPresent != 0) {
+        // Skip this if we're in single buffer mode and the queue is empty,
+        // since in that case we'll just return the shared buffer.
+        if (expectedPresent != 0 && !mCore->mQueue.empty()) {
             const int MAX_REASONABLE_NSEC = 1000000000ULL; // 1 second
 
             // The 'expectedPresent' argument indicates when the buffer is expected
@@ -130,8 +135,19 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer,
                         desiredPresent, expectedPresent, mCore->mQueue.size());
                 if (mCore->stillTracking(front)) {
                     // Front buffer is still in mSlots, so mark the slot as free
-                    mSlots[front->mSlot].mBufferState = BufferSlot::FREE;
-                    mCore->mFreeBuffers.push_back(front->mSlot);
+                    mSlots[front->mSlot].mBufferState.freeQueued();
+
+                    // After leaving single buffer mode, the shared buffer will
+                    // still be around. Mark it as no longer shared if this
+                    // operation causes it to be free.
+                    if (!mCore->mSingleBufferMode &&
+                            mSlots[front->mSlot].mBufferState.isFree()) {
+                        mSlots[front->mSlot].mBufferState.mShared = false;
+                    }
+                    // Don't put the shared buffer on the free list.
+                    if (!mSlots[front->mSlot].mBufferState.isShared()) {
+                        mCore->mFreeBuffers.push_back(front->mSlot);
+                    }
                     listener = mCore->mConnectedProducerListener;
                     ++numDroppedBuffers;
                 }
@@ -162,17 +178,56 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer,
                     systemTime(CLOCK_MONOTONIC));
         }
 
-        int slot = front->mSlot;
-        *outBuffer = *front;
+        int slot = BufferQueueCore::INVALID_BUFFER_SLOT;
+
+        if (sharedBufferAvailable && mCore->mQueue.empty()) {
+            // make sure the buffer has finished allocating before acquiring it
+            mCore->waitWhileAllocatingLocked();
+
+            slot = mCore->mSingleBufferSlot;
+
+            // Recreate the BufferItem for the shared buffer from the data that
+            // was cached when it was last queued.
+            outBuffer->mGraphicBuffer = mSlots[slot].mGraphicBuffer;
+            outBuffer->mFence = Fence::NO_FENCE;
+            outBuffer->mCrop = mCore->mSingleBufferCache.crop;
+            outBuffer->mTransform = mCore->mSingleBufferCache.transform &
+                    ~static_cast<uint32_t>(
+                    NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY);
+            outBuffer->mScalingMode = mCore->mSingleBufferCache.scalingMode;
+            outBuffer->mDataSpace = mCore->mSingleBufferCache.dataspace;
+            outBuffer->mFrameNumber = mCore->mFrameCounter;
+            outBuffer->mSlot = slot;
+            outBuffer->mAcquireCalled = mSlots[slot].mAcquireCalled;
+            outBuffer->mTransformToDisplayInverse =
+                    (mCore->mSingleBufferCache.transform &
+                    NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY) != 0;
+            outBuffer->mSurfaceDamage = Region::INVALID_REGION;
+            outBuffer->mSingleBufferMode = true;
+            outBuffer->mQueuedBuffer = false;
+        } else {
+            slot = front->mSlot;
+            *outBuffer = *front;
+        }
+
+        outBuffer->mSingleBufferMode = mCore->mSingleBufferMode;
+
         ATRACE_BUFFER_INDEX(slot);
 
         BQ_LOGV("acquireBuffer: acquiring { slot=%d/%" PRIu64 " buffer=%p }",
-                slot, front->mFrameNumber, front->mGraphicBuffer->handle);
+                slot, outBuffer->mFrameNumber, outBuffer->mGraphicBuffer->handle);
         // If the front buffer is still being tracked, update its slot state
-        if (mCore->stillTracking(front)) {
+        if (mCore->stillTracking(outBuffer)) {
             mSlots[slot].mAcquireCalled = true;
             mSlots[slot].mNeedsCleanupOnRelease = false;
-            mSlots[slot].mBufferState = BufferSlot::ACQUIRED;
+            // Don't decrease the queue count if the BufferItem wasn't
+            // previously in the queue. This happens in single buffer mode when
+            // the queue is empty and the BufferItem is created above.
+            if (mCore->mQueue.empty()) {
+                mSlots[slot].mBufferState.acquireNotInQueue();
+            } else {
+                mSlots[slot].mBufferState.acquire();
+            }
             mSlots[slot].mFence = Fence::NO_FENCE;
         }
 
@@ -207,24 +262,31 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer,
 status_t BufferQueueConsumer::detachBuffer(int slot) {
     ATRACE_CALL();
     ATRACE_BUFFER_INDEX(slot);
-    BQ_LOGV("detachBuffer(C): slot %d", slot);
+    BQ_LOGV("detachBuffer: slot %d", slot);
     Mutex::Autolock lock(mCore->mMutex);
 
     if (mCore->mIsAbandoned) {
-        BQ_LOGE("detachBuffer(C): BufferQueue has been abandoned");
+        BQ_LOGE("detachBuffer: BufferQueue has been abandoned");
         return NO_INIT;
     }
 
+    if (mCore->mSingleBufferMode) {
+        BQ_LOGE("detachBuffer: detachBuffer not allowed in single buffer"
+                "mode");
+        return BAD_VALUE;
+    }
+
     if (slot < 0 || slot >= BufferQueueDefs::NUM_BUFFER_SLOTS) {
-        BQ_LOGE("detachBuffer(C): slot index %d out of range [0, %d)",
+        BQ_LOGE("detachBuffer: slot index %d out of range [0, %d)",
                 slot, BufferQueueDefs::NUM_BUFFER_SLOTS);
         return BAD_VALUE;
-    } else if (mSlots[slot].mBufferState != BufferSlot::ACQUIRED) {
-        BQ_LOGE("detachBuffer(C): slot %d is not owned by the consumer "
-                "(state = %d)", slot, mSlots[slot].mBufferState);
+    } else if (!mSlots[slot].mBufferState.isAcquired()) {
+        BQ_LOGE("detachBuffer: slot %d is not owned by the consumer "
+                "(state = %s)", slot, mSlots[slot].mBufferState.string());
         return BAD_VALUE;
     }
 
+    mSlots[slot].mBufferState.detachConsumer();
     mCore->freeBufferLocked(slot);
     mCore->mDequeueCondition.broadcast();
     mCore->validateConsistencyLocked();
@@ -237,25 +299,31 @@ status_t BufferQueueConsumer::attachBuffer(int* outSlot,
     ATRACE_CALL();
 
     if (outSlot == NULL) {
-        BQ_LOGE("attachBuffer(P): outSlot must not be NULL");
+        BQ_LOGE("attachBuffer: outSlot must not be NULL");
         return BAD_VALUE;
     } else if (buffer == NULL) {
-        BQ_LOGE("attachBuffer(P): cannot attach NULL buffer");
+        BQ_LOGE("attachBuffer: cannot attach NULL buffer");
         return BAD_VALUE;
     }
 
     Mutex::Autolock lock(mCore->mMutex);
 
+    if (mCore->mSingleBufferMode) {
+        BQ_LOGE("attachBuffer: cannot attach a buffer in single buffer"
+                "mode");
+        return BAD_VALUE;
+    }
+
     // Make sure we don't have too many acquired buffers
     int numAcquiredBuffers = 0;
     for (int s = 0; s < BufferQueueDefs::NUM_BUFFER_SLOTS; ++s) {
-        if (mSlots[s].mBufferState == BufferSlot::ACQUIRED) {
+        if (mSlots[s].mBufferState.isAcquired()) {
             ++numAcquiredBuffers;
         }
     }
 
     if (numAcquiredBuffers >= mCore->mMaxAcquiredBufferCount + 1) {
-        BQ_LOGE("attachBuffer(P): max acquired buffer count reached: %d "
+        BQ_LOGE("attachBuffer: max acquired buffer count reached: %d "
                 "(max %d)", numAcquiredBuffers,
                 mCore->mMaxAcquiredBufferCount);
         return INVALID_OPERATION;
@@ -279,16 +347,16 @@ status_t BufferQueueConsumer::attachBuffer(int* outSlot,
         mCore->mFreeBuffers.remove(found);
     }
     if (found == BufferQueueCore::INVALID_BUFFER_SLOT) {
-        BQ_LOGE("attachBuffer(P): could not find free buffer slot");
+        BQ_LOGE("attachBuffer: could not find free buffer slot");
         return NO_MEMORY;
     }
 
     *outSlot = found;
     ATRACE_BUFFER_INDEX(*outSlot);
-    BQ_LOGV("attachBuffer(C): returning slot %d", *outSlot);
+    BQ_LOGV("attachBuffer: returning slot %d", *outSlot);
 
     mSlots[*outSlot].mGraphicBuffer = buffer;
-    mSlots[*outSlot].mBufferState = BufferSlot::ACQUIRED;
+    mSlots[*outSlot].mBufferState.attachConsumer();
     mSlots[*outSlot].mAttachedByConsumer = true;
     mSlots[*outSlot].mNeedsCleanupOnRelease = false;
     mSlots[*outSlot].mFence = Fence::NO_FENCE;
@@ -334,38 +402,45 @@ status_t BufferQueueConsumer::releaseBuffer(int slot, uint64_t frameNumber,
         Mutex::Autolock lock(mCore->mMutex);
 
         // If the frame number has changed because the buffer has been reallocated,
-        // we can ignore this releaseBuffer for the old buffer
-        if (frameNumber != mSlots[slot].mFrameNumber) {
+        // we can ignore this releaseBuffer for the old buffer.
+        // Ignore this for the shared buffer where the frame number can easily
+        // get out of sync due to the buffer being queued and acquired at the
+        // same time.
+        if (frameNumber != mSlots[slot].mFrameNumber &&
+                !mSlots[slot].mBufferState.isShared()) {
             return STALE_BUFFER_SLOT;
         }
 
-        // Make sure this buffer hasn't been queued while acquired by the consumer
-        BufferQueueCore::Fifo::iterator current(mCore->mQueue.begin());
-        while (current != mCore->mQueue.end()) {
-            if (current->mSlot == slot) {
-                BQ_LOGE("releaseBuffer: buffer slot %d pending release is "
-                        "currently queued", slot);
-                return BAD_VALUE;
-            }
-            ++current;
-        }
 
-        if (mSlots[slot].mBufferState == BufferSlot::ACQUIRED) {
+        if (mSlots[slot].mBufferState.isAcquired()) {
             mSlots[slot].mEglDisplay = eglDisplay;
             mSlots[slot].mEglFence = eglFence;
             mSlots[slot].mFence = releaseFence;
-            mSlots[slot].mBufferState = BufferSlot::FREE;
-            mCore->mFreeBuffers.push_back(slot);
+            mSlots[slot].mBufferState.release();
+
+            // After leaving single buffer mode, the shared buffer will
+            // still be around. Mark it as no longer shared if this
+            // operation causes it to be free.
+            if (!mCore->mSingleBufferMode &&
+                    mSlots[slot].mBufferState.isFree()) {
+                mSlots[slot].mBufferState.mShared = false;
+            }
+            // Don't put the shared buffer on the free list.
+            if (!mSlots[slot].mBufferState.isShared()) {
+                mCore->mFreeBuffers.push_back(slot);
+            }
+
             listener = mCore->mConnectedProducerListener;
             BQ_LOGV("releaseBuffer: releasing slot %d", slot);
         } else if (mSlots[slot].mNeedsCleanupOnRelease) {
             BQ_LOGV("releaseBuffer: releasing a stale buffer slot %d "
-                    "(state = %d)", slot, mSlots[slot].mBufferState);
+                    "(state = %s)", slot, mSlots[slot].mBufferState.string());
             mSlots[slot].mNeedsCleanupOnRelease = false;
             return STALE_BUFFER_SLOT;
         } else {
             BQ_LOGE("releaseBuffer: attempted to release buffer slot %d "
-                    "but its state was %d", slot, mSlots[slot].mBufferState);
+                    "but its state was %s", slot,
+                    mSlots[slot].mBufferState.string());
             return BAD_VALUE;
         }
 
@@ -386,17 +461,17 @@ status_t BufferQueueConsumer::connect(
     ATRACE_CALL();
 
     if (consumerListener == NULL) {
-        BQ_LOGE("connect(C): consumerListener may not be NULL");
+        BQ_LOGE("connect: consumerListener may not be NULL");
         return BAD_VALUE;
     }
 
-    BQ_LOGV("connect(C): controlledByApp=%s",
+    BQ_LOGV("connect: controlledByApp=%s",
             controlledByApp ? "true" : "false");
 
     Mutex::Autolock lock(mCore->mMutex);
 
     if (mCore->mIsAbandoned) {
-        BQ_LOGE("connect(C): BufferQueue has been abandoned");
+        BQ_LOGE("connect: BufferQueue has been abandoned");
         return NO_INIT;
     }
 
@@ -409,12 +484,12 @@ status_t BufferQueueConsumer::connect(
 status_t BufferQueueConsumer::disconnect() {
     ATRACE_CALL();
 
-    BQ_LOGV("disconnect(C)");
+    BQ_LOGV("disconnect");
 
     Mutex::Autolock lock(mCore->mMutex);
 
     if (mCore->mConsumerListener == NULL) {
-        BQ_LOGE("disconnect(C): no consumer is connected");
+        BQ_LOGE("disconnect: no consumer is connected");
         return BAD_VALUE;
     }
 
@@ -482,24 +557,29 @@ status_t BufferQueueConsumer::setDefaultBufferSize(uint32_t width,
     return NO_ERROR;
 }
 
-status_t BufferQueueConsumer::setDefaultMaxBufferCount(int bufferCount) {
+status_t BufferQueueConsumer::setMaxBufferCount(int bufferCount) {
     ATRACE_CALL();
-    Mutex::Autolock lock(mCore->mMutex);
-    return mCore->setDefaultMaxBufferCountLocked(bufferCount);
-}
 
-status_t BufferQueueConsumer::disableAsyncBuffer() {
-    ATRACE_CALL();
+    if (bufferCount < 1 || bufferCount > BufferQueueDefs::NUM_BUFFER_SLOTS) {
+        BQ_LOGE("setMaxBufferCount: invalid count %d", bufferCount);
+        return BAD_VALUE;
+    }
 
     Mutex::Autolock lock(mCore->mMutex);
 
-    if (mCore->mConsumerListener != NULL) {
-        BQ_LOGE("disableAsyncBuffer: consumer already connected");
+    if (mCore->mConnectedApi != BufferQueueCore::NO_CONNECTED_API) {
+        BQ_LOGE("setMaxBufferCount: producer is already connected");
         return INVALID_OPERATION;
     }
 
-    BQ_LOGV("disableAsyncBuffer");
-    mCore->mUseAsyncBuffer = false;
+    if (bufferCount < mCore->mMaxAcquiredBufferCount) {
+        BQ_LOGE("setMaxBufferCount: invalid buffer count (%d) less than"
+                "mMaxAcquiredBufferCount (%d)", bufferCount,
+                mCore->mMaxAcquiredBufferCount);
+        return BAD_VALUE;
+    }
+
+    mCore->mMaxBufferCount = bufferCount;
     return NO_ERROR;
 }
 
@@ -521,6 +601,17 @@ status_t BufferQueueConsumer::setMaxAcquiredBufferCount(
         return INVALID_OPERATION;
     }
 
+    if ((maxAcquiredBuffers + mCore->mMaxDequeuedBufferCount +
+            (mCore->mAsyncMode || mCore->mDequeueBufferCannotBlock ? 1 : 0)) >
+            mCore->mMaxBufferCount) {
+        BQ_LOGE("setMaxAcquiredBufferCount: %d acquired buffers would exceed "
+                "the maxBufferCount (%d) (maxDequeued %d async %d)",
+                maxAcquiredBuffers, mCore->mMaxBufferCount,
+                mCore->mMaxDequeuedBufferCount, mCore->mAsyncMode ||
+                mCore->mDequeueBufferCannotBlock);
+        return BAD_VALUE;
+    }
+
     BQ_LOGV("setMaxAcquiredBufferCount: %d", maxAcquiredBuffers);
     mCore->mMaxAcquiredBufferCount = maxAcquiredBuffers;
     return NO_ERROR;
index 851a396..c24ad19 100644 (file)
@@ -30,9 +30,6 @@
 #include <gui/ISurfaceComposer.h>
 #include <private/gui/ComposerService.h>
 
-template <typename T>
-static inline T max(T a, T b) { return a > b ? a : b; }
-
 namespace android {
 
 static String8 getUniqueName() {
@@ -55,16 +52,15 @@ BufferQueueCore::BufferQueueCore(const sp<IGraphicBufferAlloc>& allocator) :
     mQueue(),
     mFreeSlots(),
     mFreeBuffers(),
-    mOverrideMaxBufferCount(0),
     mDequeueCondition(),
-    mUseAsyncBuffer(true),
     mDequeueBufferCannotBlock(false),
     mDefaultBufferFormat(PIXEL_FORMAT_RGBA_8888),
     mDefaultWidth(1),
     mDefaultHeight(1),
     mDefaultBufferDataSpace(HAL_DATASPACE_UNKNOWN),
-    mDefaultMaxBufferCount(2),
+    mMaxBufferCount(BufferQueueDefs::NUM_BUFFER_SLOTS),
     mMaxAcquiredBufferCount(1),
+    mMaxDequeuedBufferCount(1),
     mBufferHasBeenQueued(false),
     mFrameCounter(0),
     mTransformHint(0),
@@ -72,7 +68,12 @@ BufferQueueCore::BufferQueueCore(const sp<IGraphicBufferAlloc>& allocator) :
     mIsAllocatingCondition(),
     mAllowAllocation(true),
     mBufferAge(0),
-    mGenerationNumber(0)
+    mGenerationNumber(0),
+    mAsyncMode(false),
+    mSingleBufferMode(false),
+    mSingleBufferSlot(INVALID_BUFFER_SLOT),
+    mSingleBufferCache(Rect::INVALID_RECT, 0, NATIVE_WINDOW_SCALING_MODE_FREEZE,
+            HAL_DATASPACE_UNKNOWN)
 {
     if (allocator == NULL) {
         sp<ISurfaceComposer> composer(ComposerService::getComposerService());
@@ -104,17 +105,19 @@ void BufferQueueCore::dump(String8& result, const char* prefix) const {
     }
 
     result.appendFormat("%s-BufferQueue mMaxAcquiredBufferCount=%d, "
-            "mDequeueBufferCannotBlock=%d, default-size=[%dx%d], "
-            "default-format=%d, transform-hint=%02x, FIFO(%zu)={%s}\n",
-            prefix, mMaxAcquiredBufferCount, mDequeueBufferCannotBlock,
-            mDefaultWidth, mDefaultHeight, mDefaultBufferFormat, mTransformHint,
-            mQueue.size(), fifo.string());
+            "mMaxDequeuedBufferCount=%d, mDequeueBufferCannotBlock=%d "
+            "mAsyncMode=%d, default-size=[%dx%d], default-format=%d, "
+            "transform-hint=%02x, FIFO(%zu)={%s}\n", prefix,
+            mMaxAcquiredBufferCount, mMaxDequeuedBufferCount,
+            mDequeueBufferCannotBlock, mAsyncMode, mDefaultWidth,
+            mDefaultHeight, mDefaultBufferFormat, mTransformHint, mQueue.size(),
+            fifo.string());
 
     // Trim the free buffers so as to not spam the dump
     int maxBufferCount = 0;
     for (int s = BufferQueueDefs::NUM_BUFFER_SLOTS - 1; s >= 0; --s) {
         const BufferSlot& slot(mSlots[s]);
-        if (slot.mBufferState != BufferSlot::FREE ||
+        if (!slot.mBufferState.isFree() ||
                 slot.mGraphicBuffer != NULL) {
             maxBufferCount = s + 1;
             break;
@@ -125,9 +128,9 @@ void BufferQueueCore::dump(String8& result, const char* prefix) const {
         const BufferSlot& slot(mSlots[s]);
         const sp<GraphicBuffer>& buffer(slot.mGraphicBuffer);
         result.appendFormat("%s%s[%02d:%p] state=%-8s", prefix,
-                (slot.mBufferState == BufferSlot::ACQUIRED) ? ">" : " ",
+                (slot.mBufferState.isAcquired()) ? ">" : " ",
                 s, buffer.get(),
-                BufferSlot::bufferStateName(slot.mBufferState));
+                slot.mBufferState.string());
 
         if (buffer != NULL) {
             result.appendFormat(", %p [%4ux%4u:%4u,%3X]", buffer->handle,
@@ -139,40 +142,34 @@ void BufferQueueCore::dump(String8& result, const char* prefix) const {
     }
 }
 
-int BufferQueueCore::getMinUndequeuedBufferCountLocked(bool async) const {
+int BufferQueueCore::getMinUndequeuedBufferCountLocked() const {
     // If dequeueBuffer is allowed to error out, we don't have to add an
     // extra buffer.
-    if (!mUseAsyncBuffer) {
-        return mMaxAcquiredBufferCount;
-    }
-
-    if (mDequeueBufferCannotBlock || async) {
+    if (mAsyncMode || mDequeueBufferCannotBlock) {
         return mMaxAcquiredBufferCount + 1;
     }
 
     return mMaxAcquiredBufferCount;
 }
 
-int BufferQueueCore::getMinMaxBufferCountLocked(bool async) const {
-    return getMinUndequeuedBufferCountLocked(async) + 1;
+int BufferQueueCore::getMinMaxBufferCountLocked() const {
+    return getMinUndequeuedBufferCountLocked() + 1;
 }
 
-int BufferQueueCore::getMaxBufferCountLocked(bool async) const {
-    int minMaxBufferCount = getMinMaxBufferCountLocked(async);
+int BufferQueueCore::getMaxBufferCountLocked() const {
+    int maxBufferCount = mMaxAcquiredBufferCount + mMaxDequeuedBufferCount +
+            (mAsyncMode || mDequeueBufferCannotBlock ? 1 : 0);
 
-    int maxBufferCount = max(mDefaultMaxBufferCount, minMaxBufferCount);
-    if (mOverrideMaxBufferCount != 0) {
-        assert(mOverrideMaxBufferCount >= minMaxBufferCount);
-        maxBufferCount = mOverrideMaxBufferCount;
-    }
+    // limit maxBufferCount by mMaxBufferCount always
+    maxBufferCount = std::min(mMaxBufferCount, maxBufferCount);
 
     // Any buffers that are dequeued by the producer or sitting in the queue
     // waiting to be consumed need to have their slots preserved. Such buffers
     // will temporarily keep the max buffer count up until the slots no longer
     // need to be preserved.
     for (int s = maxBufferCount; s < BufferQueueDefs::NUM_BUFFER_SLOTS; ++s) {
-        BufferSlot::BufferState state = mSlots[s].mBufferState;
-        if (state == BufferSlot::QUEUED || state == BufferSlot::DEQUEUED) {
+        BufferState state = mSlots[s].mBufferState;
+        if (state.isQueued() || state.isDequeued()) {
             maxBufferCount = s + 1;
         }
     }
@@ -180,30 +177,14 @@ int BufferQueueCore::getMaxBufferCountLocked(bool async) const {
     return maxBufferCount;
 }
 
-status_t BufferQueueCore::setDefaultMaxBufferCountLocked(int count) {
-    const int minBufferCount = mUseAsyncBuffer ? 2 : 1;
-    if (count < minBufferCount || count > BufferQueueDefs::NUM_BUFFER_SLOTS) {
-        BQ_LOGV("setDefaultMaxBufferCount: invalid count %d, should be in "
-                "[%d, %d]",
-                count, minBufferCount, BufferQueueDefs::NUM_BUFFER_SLOTS);
-        return BAD_VALUE;
-    }
-
-    BQ_LOGV("setDefaultMaxBufferCount: setting count to %d", count);
-    mDefaultMaxBufferCount = count;
-    mDequeueCondition.broadcast();
-
-    return NO_ERROR;
-}
-
-void BufferQueueCore::freeBufferLocked(int slot) {
+void BufferQueueCore::freeBufferLocked(int slot, bool validate) {
     BQ_LOGV("freeBufferLocked: slot %d", slot);
     bool hadBuffer = mSlots[slot].mGraphicBuffer != NULL;
     mSlots[slot].mGraphicBuffer.clear();
-    if (mSlots[slot].mBufferState == BufferSlot::ACQUIRED) {
+    if (mSlots[slot].mBufferState.isAcquired()) {
         mSlots[slot].mNeedsCleanupOnRelease = true;
     }
-    if (mSlots[slot].mBufferState != BufferSlot::FREE) {
+    if (!mSlots[slot].mBufferState.isFree()) {
         mFreeSlots.insert(slot);
     } else if (hadBuffer) {
         // If the slot was FREE, but we had a buffer, we need to move this slot
@@ -211,7 +192,6 @@ void BufferQueueCore::freeBufferLocked(int slot) {
         mFreeBuffers.remove(slot);
         mFreeSlots.insert(slot);
     }
-    mSlots[slot].mBufferState = BufferSlot::FREE;
     mSlots[slot].mAcquireCalled = false;
     mSlots[slot].mFrameNumber = 0;
 
@@ -221,14 +201,19 @@ void BufferQueueCore::freeBufferLocked(int slot) {
         mSlots[slot].mEglFence = EGL_NO_SYNC_KHR;
     }
     mSlots[slot].mFence = Fence::NO_FENCE;
-    validateConsistencyLocked();
+    if (validate) {
+        validateConsistencyLocked();
+    }
 }
 
 void BufferQueueCore::freeAllBuffersLocked() {
     mBufferHasBeenQueued = false;
     for (int s = 0; s < BufferQueueDefs::NUM_BUFFER_SLOTS; ++s) {
-        freeBufferLocked(s);
+        freeBufferLocked(s, false);
+        mSlots[s].mBufferState.reset();
     }
+    mSingleBufferSlot = INVALID_BUFFER_SLOT;
+    validateConsistencyLocked();
 }
 
 bool BufferQueueCore::stillTracking(const BufferItem* item) const {
@@ -261,7 +246,8 @@ void BufferQueueCore::validateConsistencyLocked() const {
         bool isInFreeBuffers =
                 std::find(mFreeBuffers.cbegin(), mFreeBuffers.cend(), slot) !=
                 mFreeBuffers.cend();
-        if (mSlots[slot].mBufferState == BufferSlot::FREE) {
+        if (mSlots[slot].mBufferState.isFree() &&
+                !mSlots[slot].mBufferState.isShared()) {
             if (mSlots[slot].mGraphicBuffer == NULL) {
                 if (!isInFreeSlots) {
                     BQ_LOGE("Slot %d is FREE but is not in mFreeSlots", slot);
@@ -285,13 +271,13 @@ void BufferQueueCore::validateConsistencyLocked() const {
             }
         } else {
             if (isInFreeSlots) {
-                BQ_LOGE("Slot %d is in mFreeSlots but is not FREE (%d)",
-                        slot, mSlots[slot].mBufferState);
+                BQ_LOGE("Slot %d is in mFreeSlots but is not FREE (%s)",
+                        slot, mSlots[slot].mBufferState.string());
                 usleep(PAUSE_TIME);
             }
             if (isInFreeBuffers) {
-                BQ_LOGE("Slot %d is in mFreeBuffers but is not FREE (%d)",
-                        slot, mSlots[slot].mBufferState);
+                BQ_LOGE("Slot %d is in mFreeBuffers but is not FREE (%s)",
+                        slot, mSlots[slot].mBufferState.string());
                 usleep(PAUSE_TIME);
             }
         }
index a941e2d..9271ed8 100644 (file)
@@ -57,13 +57,18 @@ status_t BufferQueueProducer::requestBuffer(int slot, sp<GraphicBuffer>* buf) {
         return NO_INIT;
     }
 
+    if (mCore->mConnectedApi == BufferQueueCore::NO_CONNECTED_API) {
+        BQ_LOGE("requestBuffer: BufferQueue has no connected producer");
+        return NO_INIT;
+    }
+
     if (slot < 0 || slot >= BufferQueueDefs::NUM_BUFFER_SLOTS) {
         BQ_LOGE("requestBuffer: slot index %d out of range [0, %d)",
                 slot, BufferQueueDefs::NUM_BUFFER_SLOTS);
         return BAD_VALUE;
-    } else if (mSlots[slot].mBufferState != BufferSlot::DEQUEUED) {
+    } else if (!mSlots[slot].mBufferState.isDequeued()) {
         BQ_LOGE("requestBuffer: slot %d is not owned by the producer "
-                "(state = %d)", slot, mSlots[slot].mBufferState);
+                "(state = %s)", slot, mSlots[slot].mBufferState.string());
         return BAD_VALUE;
     }
 
@@ -72,9 +77,11 @@ status_t BufferQueueProducer::requestBuffer(int slot, sp<GraphicBuffer>* buf) {
     return NO_ERROR;
 }
 
-status_t BufferQueueProducer::setBufferCount(int bufferCount) {
+status_t BufferQueueProducer::setMaxDequeuedBufferCount(
+        int maxDequeuedBuffers) {
     ATRACE_CALL();
-    BQ_LOGV("setBufferCount: count = %d", bufferCount);
+    BQ_LOGV("setMaxDequeuedBufferCount: maxDequeuedBuffers = %d",
+            maxDequeuedBuffers);
 
     sp<IConsumerListener> listener;
     { // Autolock scope
@@ -82,34 +89,41 @@ status_t BufferQueueProducer::setBufferCount(int bufferCount) {
         mCore->waitWhileAllocatingLocked();
 
         if (mCore->mIsAbandoned) {
-            BQ_LOGE("setBufferCount: BufferQueue has been abandoned");
+            BQ_LOGE("setMaxDequeuedBufferCount: BufferQueue has been "
+                    "abandoned");
             return NO_INIT;
         }
 
-        if (bufferCount > BufferQueueDefs::NUM_BUFFER_SLOTS) {
-            BQ_LOGE("setBufferCount: bufferCount %d too large (max %d)",
-                    bufferCount, BufferQueueDefs::NUM_BUFFER_SLOTS);
-            return BAD_VALUE;
-        }
-
         // There must be no dequeued buffers when changing the buffer count.
         for (int s = 0; s < BufferQueueDefs::NUM_BUFFER_SLOTS; ++s) {
-            if (mSlots[s].mBufferState == BufferSlot::DEQUEUED) {
-                BQ_LOGE("setBufferCount: buffer owned by producer");
+            if (mSlots[s].mBufferState.isDequeued()) {
+                BQ_LOGE("setMaxDequeuedBufferCount: buffer owned by producer");
                 return BAD_VALUE;
             }
         }
 
-        if (bufferCount == 0) {
-            mCore->mOverrideMaxBufferCount = 0;
-            mCore->mDequeueCondition.broadcast();
-            return NO_ERROR;
+        int bufferCount = mCore->getMinUndequeuedBufferCountLocked();
+        bufferCount += maxDequeuedBuffers;
+
+        if (bufferCount > BufferQueueDefs::NUM_BUFFER_SLOTS) {
+            BQ_LOGE("setMaxDequeuedBufferCount: bufferCount %d too large "
+                    "(max %d)", bufferCount, BufferQueueDefs::NUM_BUFFER_SLOTS);
+            return BAD_VALUE;
         }
 
-        const int minBufferSlots = mCore->getMinMaxBufferCountLocked(false);
+        const int minBufferSlots = mCore->getMinMaxBufferCountLocked();
         if (bufferCount < minBufferSlots) {
-            BQ_LOGE("setBufferCount: requested buffer count %d is less than "
-                    "minimum %d", bufferCount, minBufferSlots);
+            BQ_LOGE("setMaxDequeuedBufferCount: requested buffer count %d is "
+                    "less than minimum %d", bufferCount, minBufferSlots);
+            return BAD_VALUE;
+        }
+
+        if (bufferCount > mCore->mMaxBufferCount) {
+            BQ_LOGE("setMaxDequeuedBufferCount: %d dequeued buffers would "
+                    "exceed the maxBufferCount (%d) (maxAcquired %d async %d "
+                    "mDequeuedBufferCannotBlock %d)", maxDequeuedBuffers,
+                    mCore->mMaxBufferCount, mCore->mMaxAcquiredBufferCount,
+                    mCore->mAsyncMode, mCore->mDequeueBufferCannotBlock);
             return BAD_VALUE;
         }
 
@@ -118,7 +132,7 @@ status_t BufferQueueProducer::setBufferCount(int bufferCount) {
         // clear the queue, however, so that currently queued buffers still
         // get displayed.
         mCore->freeAllBuffersLocked();
-        mCore->mOverrideMaxBufferCount = bufferCount;
+        mCore->mMaxDequeuedBufferCount = maxDequeuedBuffers;
         mCore->mDequeueCondition.broadcast();
         listener = mCore->mConsumerListener;
     } // Autolock scope
@@ -131,8 +145,46 @@ status_t BufferQueueProducer::setBufferCount(int bufferCount) {
     return NO_ERROR;
 }
 
+status_t BufferQueueProducer::setAsyncMode(bool async) {
+    ATRACE_CALL();
+    BQ_LOGV("setAsyncMode: async = %d", async);
+
+    sp<IConsumerListener> listener;
+    { // Autolock scope
+        Mutex::Autolock lock(mCore->mMutex);
+        mCore->waitWhileAllocatingLocked();
+
+        if (mCore->mIsAbandoned) {
+            BQ_LOGE("setAsyncMode: BufferQueue has been abandoned");
+            return NO_INIT;
+        }
+
+        if ((mCore->mMaxAcquiredBufferCount + mCore->mMaxDequeuedBufferCount +
+                (async || mCore->mDequeueBufferCannotBlock ? 1 : 0)) >
+                mCore->mMaxBufferCount) {
+            BQ_LOGE("setAsyncMode(%d): this call would cause the "
+                    "maxBufferCount (%d) to be exceeded (maxAcquired %d "
+                    "maxDequeued %d mDequeueBufferCannotBlock %d)", async,
+                    mCore->mMaxBufferCount, mCore->mMaxAcquiredBufferCount,
+                    mCore->mMaxDequeuedBufferCount,
+                    mCore->mDequeueBufferCannotBlock);
+            return BAD_VALUE;
+        }
+
+        mCore->mAsyncMode = async;
+        mCore->mDequeueCondition.broadcast();
+        listener = mCore->mConsumerListener;
+    } // Autolock scope
+
+    // Call back without lock held
+    if (listener != NULL) {
+        listener->onBuffersReleased();
+    }
+    return NO_ERROR;
+}
+
 status_t BufferQueueProducer::waitForFreeSlotThenRelock(const char* caller,
-        bool async, int* found, status_t* returnFlags) const {
+        int* found, status_t* returnFlags) const {
     bool tryAgain = true;
     while (tryAgain) {
         if (mCore->mIsAbandoned) {
@@ -140,21 +192,11 @@ status_t BufferQueueProducer::waitForFreeSlotThenRelock(const char* caller,
             return NO_INIT;
         }
 
-        const int maxBufferCount = mCore->getMaxBufferCountLocked(async);
-        if (async && mCore->mOverrideMaxBufferCount) {
-            // FIXME: Some drivers are manually setting the buffer count
-            // (which they shouldn't), so we do this extra test here to
-            // handle that case. This is TEMPORARY until we get this fixed.
-            if (mCore->mOverrideMaxBufferCount < maxBufferCount) {
-                BQ_LOGE("%s: async mode is invalid with buffer count override",
-                        caller);
-                return BAD_VALUE;
-            }
-        }
+        const int maxBufferCount = mCore->getMaxBufferCountLocked();
 
         // Free up any buffers that are in slots beyond the max buffer count
         for (int s = maxBufferCount; s < BufferQueueDefs::NUM_BUFFER_SLOTS; ++s) {
-            assert(mSlots[s].mBufferState == BufferSlot::FREE);
+            assert(mSlots[s].mBufferState.isFree());
             if (mSlots[s].mGraphicBuffer != NULL) {
                 mCore->freeBufferLocked(s);
                 *returnFlags |= RELEASE_ALL_BUFFERS;
@@ -164,45 +206,24 @@ status_t BufferQueueProducer::waitForFreeSlotThenRelock(const char* caller,
         int dequeuedCount = 0;
         int acquiredCount = 0;
         for (int s = 0; s < maxBufferCount; ++s) {
-            switch (mSlots[s].mBufferState) {
-                case BufferSlot::DEQUEUED:
-                    ++dequeuedCount;
-                    break;
-                case BufferSlot::ACQUIRED:
-                    ++acquiredCount;
-                    break;
-                default:
-                    break;
+            if (mSlots[s].mBufferState.isDequeued()) {
+                ++dequeuedCount;
+            }
+            if (mSlots[s].mBufferState.isAcquired()) {
+                ++acquiredCount;
             }
         }
 
-        // Producers are not allowed to dequeue more than one buffer if they
-        // did not set a buffer count
-        if (!mCore->mOverrideMaxBufferCount && dequeuedCount) {
-            BQ_LOGE("%s: can't dequeue multiple buffers without setting the "
-                    "buffer count", caller);
+        // Producers are not allowed to dequeue more than
+        // mMaxDequeuedBufferCount buffers.
+        // This check is only done if a buffer has already been queued
+        if (mCore->mBufferHasBeenQueued &&
+                dequeuedCount >= mCore->mMaxDequeuedBufferCount) {
+            BQ_LOGE("%s: attempting to exceed the max dequeued buffer count "
+                    "(%d)", caller, mCore->mMaxDequeuedBufferCount);
             return INVALID_OPERATION;
         }
 
-        // See whether a buffer has been queued since the last
-        // setBufferCount so we know whether to perform the min undequeued
-        // buffers check below
-        if (mCore->mBufferHasBeenQueued) {
-            // Make sure the producer is not trying to dequeue more buffers
-            // than allowed
-            const int newUndequeuedCount =
-                maxBufferCount - (dequeuedCount + 1);
-            const int minUndequeuedCount =
-                mCore->getMinUndequeuedBufferCountLocked(async);
-            if (newUndequeuedCount < minUndequeuedCount) {
-                BQ_LOGE("%s: min undequeued buffer count (%d) exceeded "
-                        "(dequeued=%d undequeued=%d)",
-                        caller, minUndequeuedCount,
-                        dequeuedCount, newUndequeuedCount);
-                return INVALID_OPERATION;
-            }
-        }
-
         *found = BufferQueueCore::INVALID_BUFFER_SLOT;
 
         // If we disconnect and reconnect quickly, we can be in a state where
@@ -215,7 +236,12 @@ status_t BufferQueueProducer::waitForFreeSlotThenRelock(const char* caller,
             BQ_LOGV("%s: queue size is %zu, waiting", caller,
                     mCore->mQueue.size());
         } else {
-            if (!mCore->mFreeBuffers.empty()) {
+            // If in single buffer mode and a shared buffer exists, always
+            // return it.
+            if (mCore->mSingleBufferMode && mCore->mSingleBufferSlot !=
+                    BufferQueueCore::INVALID_BUFFER_SLOT) {
+                *found = mCore->mSingleBufferSlot;
+            } else if (!mCore->mFreeBuffers.empty()) {
                 auto slot = mCore->mFreeBuffers.begin();
                 *found = *slot;
                 mCore->mFreeBuffers.erase(slot);
@@ -241,7 +267,7 @@ status_t BufferQueueProducer::waitForFreeSlotThenRelock(const char* caller,
             // buffer (which could cause us to have to wait here), which is
             // okay, since it is only used to implement an atomic acquire +
             // release (e.g., in GLConsumer::updateTexImage())
-            if (mCore->mDequeueBufferCannotBlock &&
+            if ((mCore->mDequeueBufferCannotBlock || mCore->mAsyncMode) &&
                     (acquiredCount <= mCore->mMaxAcquiredBufferCount)) {
                 return WOULD_BLOCK;
             }
@@ -253,16 +279,26 @@ status_t BufferQueueProducer::waitForFreeSlotThenRelock(const char* caller,
 }
 
 status_t BufferQueueProducer::dequeueBuffer(int *outSlot,
-        sp<android::Fence> *outFence, bool async,
-        uint32_t width, uint32_t height, PixelFormat format, uint32_t usage) {
+        sp<android::Fence> *outFence, uint32_t width, uint32_t height,
+        PixelFormat format, uint32_t usage) {
     ATRACE_CALL();
     { // Autolock scope
         Mutex::Autolock lock(mCore->mMutex);
         mConsumerName = mCore->mConsumerName;
+
+        if (mCore->mIsAbandoned) {
+            BQ_LOGE("dequeueBuffer: BufferQueue has been abandoned");
+            return NO_INIT;
+        }
+
+        if (mCore->mConnectedApi == BufferQueueCore::NO_CONNECTED_API) {
+            BQ_LOGE("dequeueBuffer: BufferQueue has no connected producer");
+            return NO_INIT;
+        }
     } // Autolock scope
 
-    BQ_LOGV("dequeueBuffer: async=%s w=%u h=%u format=%#x, usage=%#x",
-            async ? "true" : "false", width, height, format, usage);
+    BQ_LOGV("dequeueBuffer: w=%u h=%u format=%#x, usage=%#x", width, height,
+            format, usage);
 
     if ((width && !height) || (!width && height)) {
         BQ_LOGE("dequeueBuffer: invalid size: w=%u h=%u", width, height);
@@ -293,8 +329,8 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,
 
         int found = BufferItem::INVALID_BUFFER_SLOT;
         while (found == BufferItem::INVALID_BUFFER_SLOT) {
-            status_t status = waitForFreeSlotThenRelock("dequeueBuffer", async,
-                    &found, &returnFlags);
+            status_t status = waitForFreeSlotThenRelock("dequeueBuffer", &found,
+                    &returnFlags);
             if (status != NO_ERROR) {
                 return status;
             }
@@ -313,6 +349,13 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,
             // requested attributes, we free it and attempt to get another one.
             if (!mCore->mAllowAllocation) {
                 if (buffer->needsReallocation(width, height, format, usage)) {
+                    if (mCore->mSingleBufferMode &&
+                            mCore->mSingleBufferSlot == found) {
+                        BQ_LOGE("dequeueBuffer: cannot re-allocate a shared"
+                                "buffer");
+                        return BAD_VALUE;
+                    }
+
                     mCore->freeBufferLocked(found);
                     found = BufferItem::INVALID_BUFFER_SLOT;
                     continue;
@@ -325,7 +368,15 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,
 
         attachedByConsumer = mSlots[found].mAttachedByConsumer;
 
-        mSlots[found].mBufferState = BufferSlot::DEQUEUED;
+        mSlots[found].mBufferState.dequeue();
+
+        // If single buffer mode has just been enabled, cache the slot of the
+        // first buffer that is dequeued and mark it as the shared buffer.
+        if (mCore->mSingleBufferMode && mCore->mSingleBufferSlot ==
+                BufferQueueCore::INVALID_BUFFER_SLOT) {
+            mCore->mSingleBufferSlot = found;
+            mSlots[found].mBufferState.mShared = true;
+        }
 
         const sp<GraphicBuffer>& buffer(mSlots[found].mGraphicBuffer);
         if ((buffer == NULL) ||
@@ -338,6 +389,7 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,
             mSlots[found].mEglFence = EGL_NO_SYNC_KHR;
             mSlots[found].mFence = Fence::NO_FENCE;
             mCore->mBufferAge = 0;
+            mCore->mIsAllocating = true;
 
             returnFlags |= BUFFER_NEEDS_REALLOCATION;
         } else {
@@ -370,21 +422,26 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,
         BQ_LOGV("dequeueBuffer: allocating a new buffer for slot %d", *outSlot);
         sp<GraphicBuffer> graphicBuffer(mCore->mAllocator->createGraphicBuffer(
                 width, height, format, usage, &error));
-        if (graphicBuffer == NULL) {
-            BQ_LOGE("dequeueBuffer: createGraphicBuffer failed");
-            return error;
-        }
-
         { // Autolock scope
             Mutex::Autolock lock(mCore->mMutex);
 
+            if (graphicBuffer != NULL && !mCore->mIsAbandoned) {
+                graphicBuffer->setGenerationNumber(mCore->mGenerationNumber);
+                mSlots[*outSlot].mGraphicBuffer = graphicBuffer;
+            }
+
+            mCore->mIsAllocating = false;
+            mCore->mIsAllocatingCondition.broadcast();
+
+            if (graphicBuffer == NULL) {
+                BQ_LOGE("dequeueBuffer: createGraphicBuffer failed");
+                return error;
+            }
+
             if (mCore->mIsAbandoned) {
                 BQ_LOGE("dequeueBuffer: BufferQueue has been abandoned");
                 return NO_INIT;
             }
-
-            graphicBuffer->setGenerationNumber(mCore->mGenerationNumber);
-            mSlots[*outSlot].mGraphicBuffer = graphicBuffer;
         } // Autolock scope
     }
 
@@ -418,28 +475,40 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,
 status_t BufferQueueProducer::detachBuffer(int slot) {
     ATRACE_CALL();
     ATRACE_BUFFER_INDEX(slot);
-    BQ_LOGV("detachBuffer(P): slot %d", slot);
+    BQ_LOGV("detachBuffer: slot %d", slot);
     Mutex::Autolock lock(mCore->mMutex);
 
     if (mCore->mIsAbandoned) {
-        BQ_LOGE("detachBuffer(P): BufferQueue has been abandoned");
+        BQ_LOGE("detachBuffer: BufferQueue has been abandoned");
         return NO_INIT;
     }
 
+    if (mCore->mConnectedApi == BufferQueueCore::NO_CONNECTED_API) {
+        BQ_LOGE("detachBuffer: BufferQueue has no connected producer");
+        return NO_INIT;
+    }
+
+    if (mCore->mSingleBufferMode) {
+        BQ_LOGE("detachBuffer: cannot detach a buffer in single buffer"
+                "mode");
+        return BAD_VALUE;
+    }
+
     if (slot < 0 || slot >= BufferQueueDefs::NUM_BUFFER_SLOTS) {
-        BQ_LOGE("detachBuffer(P): slot index %d out of range [0, %d)",
+        BQ_LOGE("detachBuffer: slot index %d out of range [0, %d)",
                 slot, BufferQueueDefs::NUM_BUFFER_SLOTS);
         return BAD_VALUE;
-    } else if (mSlots[slot].mBufferState != BufferSlot::DEQUEUED) {
-        BQ_LOGE("detachBuffer(P): slot %d is not owned by the producer "
-                "(state = %d)", slot, mSlots[slot].mBufferState);
+    } else if (!mSlots[slot].mBufferState.isDequeued()) {
+        BQ_LOGE("detachBuffer: slot %d is not owned by the producer "
+                "(state = %s)", slot, mSlots[slot].mBufferState.string());
         return BAD_VALUE;
     } else if (!mSlots[slot].mRequestBufferCalled) {
-        BQ_LOGE("detachBuffer(P): buffer in slot %d has not been requested",
+        BQ_LOGE("detachBuffer: buffer in slot %d has not been requested",
                 slot);
         return BAD_VALUE;
     }
 
+    mSlots[slot].mBufferState.detachProducer();
     mCore->freeBufferLocked(slot);
     mCore->mDequeueCondition.broadcast();
     mCore->validateConsistencyLocked();
@@ -460,13 +529,25 @@ status_t BufferQueueProducer::detachNextBuffer(sp<GraphicBuffer>* outBuffer,
     }
 
     Mutex::Autolock lock(mCore->mMutex);
-    mCore->waitWhileAllocatingLocked();
 
     if (mCore->mIsAbandoned) {
         BQ_LOGE("detachNextBuffer: BufferQueue has been abandoned");
         return NO_INIT;
     }
 
+    if (mCore->mConnectedApi == BufferQueueCore::NO_CONNECTED_API) {
+        BQ_LOGE("detachNextBuffer: BufferQueue has no connected producer");
+        return NO_INIT;
+    }
+
+    if (mCore->mSingleBufferMode) {
+        BQ_LOGE("detachNextBuffer: cannot detach a buffer in single buffer"
+                "mode");
+        return BAD_VALUE;
+    }
+
+    mCore->waitWhileAllocatingLocked();
+
     if (mCore->mFreeBuffers.empty()) {
         return NO_MEMORY;
     }
@@ -489,15 +570,29 @@ status_t BufferQueueProducer::attachBuffer(int* outSlot,
     ATRACE_CALL();
 
     if (outSlot == NULL) {
-        BQ_LOGE("attachBuffer(P): outSlot must not be NULL");
+        BQ_LOGE("attachBuffer: outSlot must not be NULL");
         return BAD_VALUE;
     } else if (buffer == NULL) {
-        BQ_LOGE("attachBuffer(P): cannot attach NULL buffer");
+        BQ_LOGE("attachBuffer: cannot attach NULL buffer");
         return BAD_VALUE;
     }
 
     Mutex::Autolock lock(mCore->mMutex);
-    mCore->waitWhileAllocatingLocked();
+
+    if (mCore->mIsAbandoned) {
+        BQ_LOGE("attachBuffer: BufferQueue has been abandoned");
+        return NO_INIT;
+    }
+
+    if (mCore->mConnectedApi == BufferQueueCore::NO_CONNECTED_API) {
+        BQ_LOGE("attachBuffer: BufferQueue has no connected producer");
+        return NO_INIT;
+    }
+
+    if (mCore->mSingleBufferMode) {
+        BQ_LOGE("attachBuffer: cannot atach a buffer in single buffer mode");
+        return BAD_VALUE;
+    }
 
     if (buffer->getGenerationNumber() != mCore->mGenerationNumber) {
         BQ_LOGE("attachBuffer: generation number mismatch [buffer %u] "
@@ -506,30 +601,29 @@ status_t BufferQueueProducer::attachBuffer(int* outSlot,
         return BAD_VALUE;
     }
 
+    mCore->waitWhileAllocatingLocked();
+
     status_t returnFlags = NO_ERROR;
     int found;
-    // TODO: Should we provide an async flag to attachBuffer? It seems
-    // unlikely that buffers which we are attaching to a BufferQueue will
-    // be asynchronous (droppable), but it may not be impossible.
-    status_t status = waitForFreeSlotThenRelock("attachBuffer(P)", false,
-            &found, &returnFlags);
+    status_t status = waitForFreeSlotThenRelock("attachBuffer", &found,
+            &returnFlags);
     if (status != NO_ERROR) {
         return status;
     }
 
     // This should not happen
     if (found == BufferQueueCore::INVALID_BUFFER_SLOT) {
-        BQ_LOGE("attachBuffer(P): no available buffer slots");
+        BQ_LOGE("attachBuffer: no available buffer slots");
         return -EBUSY;
     }
 
     *outSlot = found;
     ATRACE_BUFFER_INDEX(*outSlot);
-    BQ_LOGV("attachBuffer(P): returning slot %d flags=%#x",
+    BQ_LOGV("attachBuffer: returning slot %d flags=%#x",
             *outSlot, returnFlags);
 
     mSlots[*outSlot].mGraphicBuffer = buffer;
-    mSlots[*outSlot].mBufferState = BufferSlot::DEQUEUED;
+    mSlots[*outSlot].mBufferState.attachProducer();
     mSlots[*outSlot].mEglFence = EGL_NO_SYNC_KHR;
     mSlots[*outSlot].mFence = Fence::NO_FENCE;
     mSlots[*outSlot].mRequestBufferCalled = true;
@@ -547,14 +641,13 @@ status_t BufferQueueProducer::queueBuffer(int slot,
     int64_t timestamp;
     bool isAutoTimestamp;
     android_dataspace dataSpace;
-    Rect crop;
+    Rect crop(Rect::EMPTY_RECT);
     int scalingMode;
     uint32_t transform;
     uint32_t stickyTransform;
-    bool async;
     sp<Fence> fence;
     input.deflate(&timestamp, &isAutoTimestamp, &dataSpace, &crop, &scalingMode,
-            &transform, &async, &fence, &stickyTransform);
+            &transform, &fence, &stickyTransform);
     Region surfaceDamage = input.getSurfaceDamage();
 
     if (fence == NULL) {
@@ -585,25 +678,20 @@ status_t BufferQueueProducer::queueBuffer(int slot,
             return NO_INIT;
         }
 
-        const int maxBufferCount = mCore->getMaxBufferCountLocked(async);
-        if (async && mCore->mOverrideMaxBufferCount) {
-            // FIXME: Some drivers are manually setting the buffer count
-            // (which they shouldn't), so we do this extra test here to
-            // handle that case. This is TEMPORARY until we get this fixed.
-            if (mCore->mOverrideMaxBufferCount < maxBufferCount) {
-                BQ_LOGE("queueBuffer: async mode is invalid with "
-                        "buffer count override");
-                return BAD_VALUE;
-            }
+        if (mCore->mConnectedApi == BufferQueueCore::NO_CONNECTED_API) {
+            BQ_LOGE("queueBuffer: BufferQueue has no connected producer");
+            return NO_INIT;
         }
 
+        const int maxBufferCount = mCore->getMaxBufferCountLocked();
+
         if (slot < 0 || slot >= maxBufferCount) {
             BQ_LOGE("queueBuffer: slot index %d out of range [0, %d)",
                     slot, maxBufferCount);
             return BAD_VALUE;
-        } else if (mSlots[slot].mBufferState != BufferSlot::DEQUEUED) {
+        } else if (!mSlots[slot].mBufferState.isDequeued()) {
             BQ_LOGE("queueBuffer: slot %d is not owned by the producer "
-                    "(state = %d)", slot, mSlots[slot].mBufferState);
+                    "(state = %s)", slot, mSlots[slot].mBufferState.string());
             return BAD_VALUE;
         } else if (!mSlots[slot].mRequestBufferCalled) {
             BQ_LOGE("queueBuffer: slot %d was queued without requesting "
@@ -619,7 +707,7 @@ status_t BufferQueueProducer::queueBuffer(int slot,
 
         const sp<GraphicBuffer>& graphicBuffer(mSlots[slot].mGraphicBuffer);
         Rect bufferRect(graphicBuffer->getWidth(), graphicBuffer->getHeight());
-        Rect croppedRect;
+        Rect croppedRect(Rect::EMPTY_RECT);
         crop.intersect(bufferRect, &croppedRect);
         if (croppedRect != crop) {
             BQ_LOGE("queueBuffer: crop rect is not contained within the "
@@ -633,7 +721,8 @@ status_t BufferQueueProducer::queueBuffer(int slot,
         }
 
         mSlots[slot].mFence = fence;
-        mSlots[slot].mBufferState = BufferSlot::QUEUED;
+        mSlots[slot].mBufferState.queue();
+
         ++mCore->mFrameCounter;
         mSlots[slot].mFrameNumber = mCore->mFrameCounter;
 
@@ -651,11 +740,24 @@ status_t BufferQueueProducer::queueBuffer(int slot,
         item.mFrameNumber = mCore->mFrameCounter;
         item.mSlot = slot;
         item.mFence = fence;
-        item.mIsDroppable = mCore->mDequeueBufferCannotBlock || async;
+        item.mIsDroppable = mCore->mAsyncMode ||
+                mCore->mDequeueBufferCannotBlock ||
+                (mCore->mSingleBufferMode && mCore->mSingleBufferSlot == slot);
         item.mSurfaceDamage = surfaceDamage;
+        item.mSingleBufferMode = mCore->mSingleBufferMode;
+        item.mQueuedBuffer = true;
 
         mStickyTransform = stickyTransform;
 
+        // Cache the shared buffer data so that the BufferItem can be recreated.
+        if (mCore->mSingleBufferMode) {
+            mCore->mSingleBufferCache.crop = crop;
+            mCore->mSingleBufferCache.transform = transform;
+            mCore->mSingleBufferCache.scalingMode = static_cast<uint32_t>(
+                    scalingMode);
+            mCore->mSingleBufferCache.dataspace = dataSpace;
+        }
+
         if (mCore->mQueue.empty()) {
             // When the queue is empty, we can ignore mDequeueBufferCannotBlock
             // and simply queue this buffer
@@ -669,8 +771,19 @@ status_t BufferQueueProducer::queueBuffer(int slot,
                 // If the front queued buffer is still being tracked, we first
                 // mark it as freed
                 if (mCore->stillTracking(front)) {
-                    mSlots[front->mSlot].mBufferState = BufferSlot::FREE;
-                    mCore->mFreeBuffers.push_front(front->mSlot);
+                    mSlots[front->mSlot].mBufferState.freeQueued();
+
+                    // After leaving single buffer mode, the shared buffer will
+                    // still be around. Mark it as no longer shared if this
+                    // operation causes it to be free.
+                    if (!mCore->mSingleBufferMode &&
+                            mSlots[front->mSlot].mBufferState.isFree()) {
+                        mSlots[front->mSlot].mBufferState.mShared = false;
+                    }
+                    // Don't put the shared buffer on the free list.
+                    if (!mSlots[front->mSlot].mBufferState.isShared()) {
+                        mCore->mFreeBuffers.push_front(front->mSlot);
+                    }
                 }
                 // Overwrite the droppable buffer with the incoming one
                 *front = item;
@@ -731,34 +844,56 @@ status_t BufferQueueProducer::queueBuffer(int slot,
     return NO_ERROR;
 }
 
-void BufferQueueProducer::cancelBuffer(int slot, const sp<Fence>& fence) {
+status_t BufferQueueProducer::cancelBuffer(int slot, const sp<Fence>& fence) {
     ATRACE_CALL();
     BQ_LOGV("cancelBuffer: slot %d", slot);
     Mutex::Autolock lock(mCore->mMutex);
 
     if (mCore->mIsAbandoned) {
         BQ_LOGE("cancelBuffer: BufferQueue has been abandoned");
-        return;
+        return NO_INIT;
+    }
+
+    if (mCore->mConnectedApi == BufferQueueCore::NO_CONNECTED_API) {
+        BQ_LOGE("cancelBuffer: BufferQueue has no connected producer");
+        return NO_INIT;
+    }
+
+    if (mCore->mSingleBufferMode) {
+        BQ_LOGE("cancelBuffer: cannot cancel a buffer in single buffer mode");
+        return BAD_VALUE;
     }
 
     if (slot < 0 || slot >= BufferQueueDefs::NUM_BUFFER_SLOTS) {
         BQ_LOGE("cancelBuffer: slot index %d out of range [0, %d)",
                 slot, BufferQueueDefs::NUM_BUFFER_SLOTS);
-        return;
-    } else if (mSlots[slot].mBufferState != BufferSlot::DEQUEUED) {
+        return BAD_VALUE;
+    } else if (!mSlots[slot].mBufferState.isDequeued()) {
         BQ_LOGE("cancelBuffer: slot %d is not owned by the producer "
-                "(state = %d)", slot, mSlots[slot].mBufferState);
-        return;
+                "(state = %s)", slot, mSlots[slot].mBufferState.string());
+        return BAD_VALUE;
     } else if (fence == NULL) {
         BQ_LOGE("cancelBuffer: fence is NULL");
-        return;
+        return BAD_VALUE;
+    }
+
+    mSlots[slot].mBufferState.cancel();
+
+    // After leaving single buffer mode, the shared buffer will still be around.
+    // Mark it as no longer shared if this operation causes it to be free.
+    if (!mCore->mSingleBufferMode && mSlots[slot].mBufferState.isFree()) {
+        mSlots[slot].mBufferState.mShared = false;
     }
 
-    mCore->mFreeBuffers.push_front(slot);
-    mSlots[slot].mBufferState = BufferSlot::FREE;
+    // Don't put the shared buffer on the free list.
+    if (!mSlots[slot].mBufferState.isShared()) {
+        mCore->mFreeBuffers.push_front(slot);
+    }
     mSlots[slot].mFence = fence;
     mCore->mDequeueCondition.broadcast();
     mCore->validateConsistencyLocked();
+
+    return NO_ERROR;
 }
 
 int BufferQueueProducer::query(int what, int *outValue) {
@@ -787,7 +922,7 @@ int BufferQueueProducer::query(int what, int *outValue) {
             value = static_cast<int32_t>(mCore->mDefaultBufferFormat);
             break;
         case NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS:
-            value = mCore->getMinUndequeuedBufferCountLocked(false);
+            value = mCore->getMinUndequeuedBufferCountLocked();
             break;
         case NATIVE_WINDOW_STICKY_TRANSFORM:
             value = static_cast<int32_t>(mStickyTransform);
@@ -822,26 +957,26 @@ status_t BufferQueueProducer::connect(const sp<IProducerListener>& listener,
     ATRACE_CALL();
     Mutex::Autolock lock(mCore->mMutex);
     mConsumerName = mCore->mConsumerName;
-    BQ_LOGV("connect(P): api=%d producerControlledByApp=%s", api,
+    BQ_LOGV("connect: api=%d producerControlledByApp=%s", api,
             producerControlledByApp ? "true" : "false");
 
     if (mCore->mIsAbandoned) {
-        BQ_LOGE("connect(P): BufferQueue has been abandoned");
+        BQ_LOGE("connect: BufferQueue has been abandoned");
         return NO_INIT;
     }
 
     if (mCore->mConsumerListener == NULL) {
-        BQ_LOGE("connect(P): BufferQueue has no consumer");
+        BQ_LOGE("connect: BufferQueue has no consumer");
         return NO_INIT;
     }
 
     if (output == NULL) {
-        BQ_LOGE("connect(P): output was NULL");
+        BQ_LOGE("connect: output was NULL");
         return BAD_VALUE;
     }
 
     if (mCore->mConnectedApi != BufferQueueCore::NO_CONNECTED_API) {
-        BQ_LOGE("connect(P): already connected (cur=%d req=%d)",
+        BQ_LOGE("connect: already connected (cur=%d req=%d)",
                 mCore->mConnectedApi, api);
         return BAD_VALUE;
     }
@@ -864,21 +999,21 @@ status_t BufferQueueProducer::connect(const sp<IProducerListener>& listener,
                 status = IInterface::asBinder(listener)->linkToDeath(
                         static_cast<IBinder::DeathRecipient*>(this));
                 if (status != NO_ERROR) {
-                    BQ_LOGE("connect(P): linkToDeath failed: %s (%d)",
+                    BQ_LOGE("connect: linkToDeath failed: %s (%d)",
                             strerror(-status), status);
                 }
             }
             mCore->mConnectedProducerListener = listener;
             break;
         default:
-            BQ_LOGE("connect(P): unknown API %d", api);
+            BQ_LOGE("connect: unknown API %d", api);
             status = BAD_VALUE;
             break;
     }
 
     mCore->mBufferHasBeenQueued = false;
-    mCore->mDequeueBufferCannotBlock =
-            mCore->mConsumerControlledByApp && producerControlledByApp;
+    mCore->mDequeueBufferCannotBlock =  mCore->mConsumerControlledByApp &&
+            producerControlledByApp;
     mCore->mAllowAllocation = true;
 
     return status;
@@ -886,7 +1021,7 @@ status_t BufferQueueProducer::connect(const sp<IProducerListener>& listener,
 
 status_t BufferQueueProducer::disconnect(int api) {
     ATRACE_CALL();
-    BQ_LOGV("disconnect(P): api %d", api);
+    BQ_LOGV("disconnect: api %d", api);
 
     int status = NO_ERROR;
     sp<IConsumerListener> listener;
@@ -923,13 +1058,13 @@ status_t BufferQueueProducer::disconnect(int api) {
                     mCore->mDequeueCondition.broadcast();
                     listener = mCore->mConsumerListener;
                 } else if (mCore->mConnectedApi != BufferQueueCore::NO_CONNECTED_API) {
-                    BQ_LOGE("disconnect(P): still connected to another API "
+                    BQ_LOGE("disconnect: still connected to another API "
                             "(cur=%d req=%d)", mCore->mConnectedApi, api);
                     status = BAD_VALUE;
                 }
                 break;
             default:
-                BQ_LOGE("disconnect(P): unknown API %d", api);
+                BQ_LOGE("disconnect: unknown API %d", api);
                 status = BAD_VALUE;
                 break;
         }
@@ -957,8 +1092,8 @@ status_t BufferQueueProducer::setSidebandStream(const sp<NativeHandle>& stream)
     return NO_ERROR;
 }
 
-void BufferQueueProducer::allocateBuffers(bool async, uint32_t width,
-        uint32_t height, PixelFormat format, uint32_t usage) {
+void BufferQueueProducer::allocateBuffers(uint32_t width, uint32_t height,
+        PixelFormat format, uint32_t usage) {
     ATRACE_CALL();
     while (true) {
         Vector<int> freeSlots;
@@ -982,7 +1117,7 @@ void BufferQueueProducer::allocateBuffers(bool async, uint32_t width,
                 if (mSlots[slot].mGraphicBuffer != NULL) {
                     ++currentBufferCount;
                 } else {
-                    if (mSlots[slot].mBufferState != BufferSlot::FREE) {
+                    if (!mSlots[slot].mBufferState.isFree()) {
                         BQ_LOGE("allocateBuffers: slot %d without buffer is not FREE",
                                 slot);
                         continue;
@@ -992,7 +1127,7 @@ void BufferQueueProducer::allocateBuffers(bool async, uint32_t width,
                 }
             }
 
-            int maxBufferCount = mCore->getMaxBufferCountLocked(async);
+            int maxBufferCount = mCore->getMaxBufferCountLocked();
             BQ_LOGV("allocateBuffers: allocating from %d buffers up to %d buffers",
                     currentBufferCount, maxBufferCount);
             if (maxBufferCount <= currentBufferCount)
@@ -1045,7 +1180,7 @@ void BufferQueueProducer::allocateBuffers(bool async, uint32_t width,
 
             for (size_t i = 0; i < newBufferCount; ++i) {
                 int slot = freeSlots[i];
-                if (mSlots[slot].mBufferState != BufferSlot::FREE) {
+                if (!mSlots[slot].mBufferState.isFree()) {
                     // A consumer allocated the FREE slot with attachBuffer. Discard the buffer we
                     // allocated.
                     BQ_LOGV("allocateBuffers: slot %d was acquired while allocating. "
@@ -1095,6 +1230,27 @@ String8 BufferQueueProducer::getConsumerName() const {
     return mConsumerName;
 }
 
+uint64_t BufferQueueProducer::getNextFrameNumber() const {
+    ATRACE_CALL();
+
+    Mutex::Autolock lock(mCore->mMutex);
+    uint64_t nextFrameNumber = mCore->mFrameCounter + 1;
+    return nextFrameNumber;
+}
+
+status_t BufferQueueProducer::setSingleBufferMode(bool singleBufferMode) {
+    ATRACE_CALL();
+    BQ_LOGV("setSingleBufferMode: %d", singleBufferMode);
+
+    Mutex::Autolock lock(mCore->mMutex);
+    if (!singleBufferMode) {
+        mCore->mSingleBufferSlot = BufferQueueCore::INVALID_BUFFER_SLOT;
+    }
+    mCore->mSingleBufferMode = singleBufferMode;
+
+    return NO_ERROR;
+}
+
 void BufferQueueProducer::binderDied(const wp<android::IBinder>& /* who */) {
     // If we're here, it means that a producer we were connected to died.
     // We're guaranteed that we are still connected to it because we remove
index 01595de..b1cdc5d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 The Android Open Source Project
+ * Copyright 2015 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 namespace android {
 
-const char* BufferSlot::bufferStateName(BufferState state) {
-    switch (state) {
-        case BufferSlot::DEQUEUED: return "DEQUEUED";
-        case BufferSlot::QUEUED: return "QUEUED";
-        case BufferSlot::FREE: return "FREE";
-        case BufferSlot::ACQUIRED: return "ACQUIRED";
+
+const char* BufferState::string() const {
+
+    if (isShared()) {
+        return "SHARED";
+    }
+
+    if (isFree()) {
+        return "FREE";
+    }
+
+    if (isAcquired()) {
+        return "ACQUIRED";
+    }
+
+    if (isDequeued()) {
+        return "DEQUEUED";
+    }
+
+    if (isQueued()) {
+        return "QUEUED";
     }
-    return "Unknown";
+    return "UNKNOWN";
 }
 
 } // namespace android
index 04ab06b..d01187f 100644 (file)
@@ -239,14 +239,14 @@ status_t ConsumerBase::acquireBufferLocked(BufferItem *item,
     }
 
     if (item->mGraphicBuffer != NULL) {
-        mSlots[item->mBuf].mGraphicBuffer = item->mGraphicBuffer;
+        mSlots[item->mSlot].mGraphicBuffer = item->mGraphicBuffer;
     }
 
-    mSlots[item->mBuf].mFrameNumber = item->mFrameNumber;
-    mSlots[item->mBuf].mFence = item->mFence;
+    mSlots[item->mSlot].mFrameNumber = item->mFrameNumber;
+    mSlots[item->mSlot].mFence = item->mFence;
 
     CB_LOGV("acquireBufferLocked: -> slot=%d/%" PRIu64,
-            item->mBuf, item->mFrameNumber);
+            item->mSlot, item->mFrameNumber);
 
     return OK;
 }
index e29b740..7ed3d0f 100644 (file)
@@ -106,22 +106,22 @@ status_t CpuConsumer::lockNextBuffer(LockedBuffer *nativeBuffer) {
         }
     }
 
-    int buf = b.mBuf;
+    int slot = b.mSlot;
 
     void *bufferPointer = NULL;
     android_ycbcr ycbcr = android_ycbcr();
 
-    PixelFormat format = mSlots[buf].mGraphicBuffer->getPixelFormat();
+    PixelFormat format = mSlots[slot].mGraphicBuffer->getPixelFormat();
     PixelFormat flexFormat = format;
     if (isPossiblyYUV(format)) {
         if (b.mFence.get()) {
-            err = mSlots[buf].mGraphicBuffer->lockAsyncYCbCr(
+            err = mSlots[slot].mGraphicBuffer->lockAsyncYCbCr(
                 GraphicBuffer::USAGE_SW_READ_OFTEN,
                 b.mCrop,
                 &ycbcr,
                 b.mFence->dup());
         } else {
-            err = mSlots[buf].mGraphicBuffer->lockYCbCr(
+            err = mSlots[slot].mGraphicBuffer->lockYCbCr(
                 GraphicBuffer::USAGE_SW_READ_OFTEN,
                 b.mCrop,
                 &ycbcr);
@@ -141,13 +141,13 @@ status_t CpuConsumer::lockNextBuffer(LockedBuffer *nativeBuffer) {
 
     if (bufferPointer == NULL) { // not flexible YUV
         if (b.mFence.get()) {
-            err = mSlots[buf].mGraphicBuffer->lockAsync(
+            err = mSlots[slot].mGraphicBuffer->lockAsync(
                 GraphicBuffer::USAGE_SW_READ_OFTEN,
                 b.mCrop,
                 &bufferPointer,
                 b.mFence->dup());
         } else {
-            err = mSlots[buf].mGraphicBuffer->lock(
+            err = mSlots[slot].mGraphicBuffer->lock(
                 GraphicBuffer::USAGE_SW_READ_OFTEN,
                 b.mCrop,
                 &bufferPointer);
@@ -169,19 +169,19 @@ status_t CpuConsumer::lockNextBuffer(LockedBuffer *nativeBuffer) {
     assert(lockedIdx < mMaxLockedBuffers);
 
     AcquiredBuffer &ab = mAcquiredBuffers.editItemAt(lockedIdx);
-    ab.mSlot = buf;
+    ab.mSlot = slot;
     ab.mBufferPointer = bufferPointer;
-    ab.mGraphicBuffer = mSlots[buf].mGraphicBuffer;
+    ab.mGraphicBuffer = mSlots[slot].mGraphicBuffer;
 
     nativeBuffer->data   =
             reinterpret_cast<uint8_t*>(bufferPointer);
-    nativeBuffer->width  = mSlots[buf].mGraphicBuffer->getWidth();
-    nativeBuffer->height = mSlots[buf].mGraphicBuffer->getHeight();
+    nativeBuffer->width  = mSlots[slot].mGraphicBuffer->getWidth();
+    nativeBuffer->height = mSlots[slot].mGraphicBuffer->getHeight();
     nativeBuffer->format = format;
     nativeBuffer->flexFormat = flexFormat;
     nativeBuffer->stride = (ycbcr.y != NULL) ?
             static_cast<uint32_t>(ycbcr.ystride) :
-            mSlots[buf].mGraphicBuffer->getStride();
+            mSlots[slot].mGraphicBuffer->getStride();
 
     nativeBuffer->crop        = b.mCrop;
     nativeBuffer->transform   = b.mTransform;
index 757e08a..39a7ae3 100644 (file)
@@ -130,6 +130,7 @@ static bool isEglImageCroppable(const Rect& crop) {
 GLConsumer::GLConsumer(const sp<IGraphicBufferConsumer>& bq, uint32_t tex,
         uint32_t texTarget, bool useFenceSync, bool isControlledByApp) :
     ConsumerBase(bq, isControlledByApp),
+    mCurrentCrop(Rect::EMPTY_RECT),
     mCurrentTransform(0),
     mCurrentScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
     mCurrentFence(Fence::NO_FENCE),
@@ -157,6 +158,7 @@ GLConsumer::GLConsumer(const sp<IGraphicBufferConsumer>& bq, uint32_t tex,
 GLConsumer::GLConsumer(const sp<IGraphicBufferConsumer>& bq, uint32_t texTarget,
         bool useFenceSync, bool isControlledByApp) :
     ConsumerBase(bq, isControlledByApp),
+    mCurrentCrop(Rect::EMPTY_RECT),
     mCurrentTransform(0),
     mCurrentScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
     mCurrentFence(Fence::NO_FENCE),
@@ -181,12 +183,6 @@ GLConsumer::GLConsumer(const sp<IGraphicBufferConsumer>& bq, uint32_t texTarget,
     mConsumer->setConsumerUsageBits(DEFAULT_USAGE_FLAGS);
 }
 
-status_t GLConsumer::setDefaultMaxBufferCount(int bufferCount) {
-    Mutex::Autolock lock(mMutex);
-    return mConsumer->setDefaultMaxBufferCount(bufferCount);
-}
-
-
 status_t GLConsumer::setDefaultBufferSize(uint32_t w, uint32_t h)
 {
     Mutex::Autolock lock(mMutex);
@@ -355,7 +351,7 @@ status_t GLConsumer::acquireBufferLocked(BufferItem *item,
     // before, so any prior EglImage created is using a stale buffer. This
     // replaces any old EglImage with a new one (using the new buffer).
     if (item->mGraphicBuffer != NULL) {
-        int slot = item->mBuf;
+        int slot = item->mSlot;
         mEglSlots[slot].mEglImage = new EglImage(item->mGraphicBuffer);
     }
 
@@ -379,12 +375,12 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item)
 {
     status_t err = NO_ERROR;
 
-    int buf = item.mBuf;
+    int slot = item.mSlot;
 
     if (!mAttached) {
         GLC_LOGE("updateAndRelease: GLConsumer is not attached to an OpenGL "
                 "ES context");
-        releaseBufferLocked(buf, mSlots[buf].mGraphicBuffer,
+        releaseBufferLocked(slot, mSlots[slot].mGraphicBuffer,
                 mEglDisplay, EGL_NO_SYNC_KHR);
         return INVALID_OPERATION;
     }
@@ -392,7 +388,7 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item)
     // Confirm state.
     err = checkAndUpdateEglStateLocked();
     if (err != NO_ERROR) {
-        releaseBufferLocked(buf, mSlots[buf].mGraphicBuffer,
+        releaseBufferLocked(slot, mSlots[slot].mGraphicBuffer,
                 mEglDisplay, EGL_NO_SYNC_KHR);
         return err;
     }
@@ -402,31 +398,38 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item)
     // ConsumerBase.
     // We may have to do this even when item.mGraphicBuffer == NULL (which
     // means the buffer was previously acquired).
-    err = mEglSlots[buf].mEglImage->createIfNeeded(mEglDisplay, item.mCrop);
+    err = mEglSlots[slot].mEglImage->createIfNeeded(mEglDisplay, item.mCrop);
     if (err != NO_ERROR) {
         GLC_LOGW("updateAndRelease: unable to createImage on display=%p slot=%d",
-                mEglDisplay, buf);
-        releaseBufferLocked(buf, mSlots[buf].mGraphicBuffer,
+                mEglDisplay, slot);
+        releaseBufferLocked(slot, mSlots[slot].mGraphicBuffer,
                 mEglDisplay, EGL_NO_SYNC_KHR);
         return UNKNOWN_ERROR;
     }
 
     // Do whatever sync ops we need to do before releasing the old slot.
-    err = syncForReleaseLocked(mEglDisplay);
-    if (err != NO_ERROR) {
-        // Release the buffer we just acquired.  It's not safe to
-        // release the old buffer, so instead we just drop the new frame.
-        // As we are still under lock since acquireBuffer, it is safe to
-        // release by slot.
-        releaseBufferLocked(buf, mSlots[buf].mGraphicBuffer,
-                mEglDisplay, EGL_NO_SYNC_KHR);
-        return err;
+    if (!item.mSingleBufferMode || slot != mCurrentTexture) {
+        err = syncForReleaseLocked(mEglDisplay);
+        if (err != NO_ERROR) {
+            // Release the buffer we just acquired.  It's not safe to
+            // release the old buffer, so instead we just drop the new frame.
+            // As we are still under lock since acquireBuffer, it is safe to
+            // release by slot.
+            releaseBufferLocked(slot, mSlots[slot].mGraphicBuffer,
+                    mEglDisplay, EGL_NO_SYNC_KHR);
+            return err;
+        }
     }
 
     GLC_LOGV("updateAndRelease: (slot=%d buf=%p) -> (slot=%d buf=%p)",
             mCurrentTexture, mCurrentTextureImage != NULL ?
                     mCurrentTextureImage->graphicBufferHandle() : 0,
-            buf, mSlots[buf].mGraphicBuffer->handle);
+            slot, mSlots[slot].mGraphicBuffer->handle);
+
+    // Hang onto the pointer so that it isn't freed in the call to
+    // releaseBufferLocked() if we're in single buffer mode and both buffers are
+    // the same.
+    sp<EglImage> nextTextureImage = mEglSlots[slot].mEglImage;
 
     // release old buffer
     if (mCurrentTexture != BufferQueue::INVALID_BUFFER_SLOT) {
@@ -442,8 +445,8 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item)
     }
 
     // Update the GLConsumer state.
-    mCurrentTexture = buf;
-    mCurrentTextureImage = mEglSlots[buf].mEglImage;
+    mCurrentTexture = slot;
+    mCurrentTextureImage = nextTextureImage;
     mCurrentCrop = item.mCrop;
     mCurrentTransform = item.mTransform;
     mCurrentScalingMode = item.mScalingMode;
@@ -1046,6 +1049,11 @@ status_t GLConsumer::setTransformHint(uint32_t hint) {
     return mConsumer->setTransformHint(hint);
 }
 
+status_t GLConsumer::setMaxAcquiredBufferCount(int maxAcquiredBuffers) {
+    Mutex::Autolock lock(mMutex);
+    return mConsumer->setMaxAcquiredBufferCount(maxAcquiredBuffers);
+}
+
 void GLConsumer::dumpLocked(String8& result, const char* prefix) const
 {
     result.appendFormat(
@@ -1083,7 +1091,8 @@ static void mtxMul(float out[16], const float a[16], const float b[16]) {
 GLConsumer::EglImage::EglImage(sp<GraphicBuffer> graphicBuffer) :
     mGraphicBuffer(graphicBuffer),
     mEglImage(EGL_NO_IMAGE_KHR),
-    mEglDisplay(EGL_NO_DISPLAY) {
+    mEglDisplay(EGL_NO_DISPLAY),
+    mCropRect(Rect::EMPTY_RECT) {
 }
 
 GLConsumer::EglImage::~EglImage() {
index b86f4c5..d2f482e 100644 (file)
@@ -43,8 +43,7 @@ enum {
     CONSUMER_DISCONNECT,
     GET_RELEASED_BUFFERS,
     SET_DEFAULT_BUFFER_SIZE,
-    SET_DEFAULT_MAX_BUFFER_COUNT,
-    DISABLE_ASYNC_BUFFER,
+    SET_MAX_BUFFER_COUNT,
     SET_MAX_ACQUIRED_BUFFER_COUNT,
     SET_CONSUMER_NAME,
     SET_DEFAULT_BUFFER_FORMAT,
@@ -172,21 +171,11 @@ public:
         return reply.readInt32();
     }
 
-    virtual status_t setDefaultMaxBufferCount(int bufferCount) {
+    virtual status_t setMaxBufferCount(int bufferCount) {
         Parcel data, reply;
         data.writeInterfaceToken(IGraphicBufferConsumer::getInterfaceDescriptor());
         data.writeInt32(bufferCount);
-        status_t result = remote()->transact(SET_DEFAULT_MAX_BUFFER_COUNT, data, &reply);
-        if (result != NO_ERROR) {
-            return result;
-        }
-        return reply.readInt32();
-    }
-
-    virtual status_t disableAsyncBuffer() {
-        Parcel data, reply;
-        data.writeInterfaceToken(IGraphicBufferConsumer::getInterfaceDescriptor());
-        status_t result = remote()->transact(DISABLE_ASYNC_BUFFER, data, &reply);
+        status_t result = remote()->transact(SET_MAX_BUFFER_COUNT, data, &reply);
         if (result != NO_ERROR) {
             return result;
         }
@@ -363,16 +352,10 @@ status_t BnGraphicBufferConsumer::onTransact(
             reply->writeInt32(result);
             return NO_ERROR;
         }
-        case SET_DEFAULT_MAX_BUFFER_COUNT: {
+        case SET_MAX_BUFFER_COUNT: {
             CHECK_INTERFACE(IGraphicBufferConsumer, data, reply);
             int bufferCount = data.readInt32();
-            status_t result = setDefaultMaxBufferCount(bufferCount);
-            reply->writeInt32(result);
-            return NO_ERROR;
-        }
-        case DISABLE_ASYNC_BUFFER: {
-            CHECK_INTERFACE(IGraphicBufferConsumer, data, reply);
-            status_t result = disableAsyncBuffer();
+            status_t result = setMaxBufferCount(bufferCount);
             reply->writeInt32(result);
             return NO_ERROR;
         }
index 8bdbc22..d5310bd 100644 (file)
@@ -34,7 +34,6 @@ namespace android {
 
 enum {
     REQUEST_BUFFER = IBinder::FIRST_CALL_TRANSACTION,
-    SET_BUFFER_COUNT,
     DEQUEUE_BUFFER,
     DETACH_BUFFER,
     DETACH_NEXT_BUFFER,
@@ -49,6 +48,10 @@ enum {
     ALLOW_ALLOCATION,
     SET_GENERATION_NUMBER,
     GET_CONSUMER_NAME,
+    SET_MAX_DEQUEUED_BUFFER_COUNT,
+    SET_ASYNC_MODE,
+    GET_NEXT_FRAME_NUMBER,
+    SET_SINGLE_BUFFER_MODE
 };
 
 class BpGraphicBufferProducer : public BpInterface<IGraphicBufferProducer>
@@ -82,12 +85,27 @@ public:
         return result;
     }
 
-    virtual status_t setBufferCount(int bufferCount)
-    {
+    virtual status_t setMaxDequeuedBufferCount(int maxDequeuedBuffers) {
         Parcel data, reply;
-        data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
-        data.writeInt32(bufferCount);
-        status_t result =remote()->transact(SET_BUFFER_COUNT, data, &reply);
+        data.writeInterfaceToken(
+                IGraphicBufferProducer::getInterfaceDescriptor());
+        data.writeInt32(maxDequeuedBuffers);
+        status_t result = remote()->transact(SET_MAX_DEQUEUED_BUFFER_COUNT,
+                data, &reply);
+        if (result != NO_ERROR) {
+            return result;
+        }
+        result = reply.readInt32();
+        return result;
+    }
+
+    virtual status_t setAsyncMode(bool async) {
+        Parcel data, reply;
+        data.writeInterfaceToken(
+                IGraphicBufferProducer::getInterfaceDescriptor());
+        data.writeInt32(async);
+        status_t result = remote()->transact(SET_ASYNC_MODE,
+                data, &reply);
         if (result != NO_ERROR) {
             return result;
         }
@@ -95,12 +113,10 @@ public:
         return result;
     }
 
-    virtual status_t dequeueBuffer(int *buf, sp<Fence>* fence, bool async,
-            uint32_t width, uint32_t height, PixelFormat format,
-            uint32_t usage) {
+    virtual status_t dequeueBuffer(int *buf, sp<Fence>* fence, uint32_t width,
+            uint32_t height, PixelFormat format, uint32_t usage) {
         Parcel data, reply;
         data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
-        data.writeInt32(static_cast<int32_t>(async));
         data.writeUint32(width);
         data.writeUint32(height);
         data.writeInt32(static_cast<int32_t>(format));
@@ -190,12 +206,17 @@ public:
         return result;
     }
 
-    virtual void cancelBuffer(int buf, const sp<Fence>& fence) {
+    virtual status_t cancelBuffer(int buf, const sp<Fence>& fence) {
         Parcel data, reply;
         data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
         data.writeInt32(buf);
         data.write(*fence.get());
-        remote()->transact(CANCEL_BUFFER, data, &reply);
+        status_t result = remote()->transact(CANCEL_BUFFER, data, &reply);
+        if (result != NO_ERROR) {
+            return result;
+        }
+        result = reply.readInt32();
+        return result;
     }
 
     virtual int query(int what, int* value) {
@@ -260,11 +281,10 @@ public:
         return result;
     }
 
-    virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
+    virtual void allocateBuffers(uint32_t width, uint32_t height,
             PixelFormat format, uint32_t usage) {
         Parcel data, reply;
         data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
-        data.writeInt32(static_cast<int32_t>(async));
         data.writeUint32(width);
         data.writeUint32(height);
         data.writeInt32(static_cast<int32_t>(format));
@@ -308,6 +328,31 @@ public:
         }
         return reply.readString8();
     }
+
+    virtual uint64_t getNextFrameNumber() const {
+        Parcel data, reply;
+        data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
+        status_t result = remote()->transact(GET_NEXT_FRAME_NUMBER, data, &reply);
+        if (result != NO_ERROR) {
+            ALOGE("getNextFrameNumber failed to transact: %d", result);
+            return 0;
+        }
+        uint64_t frameNumber = reply.readUint64();
+        return frameNumber;
+    }
+
+    virtual status_t setSingleBufferMode(bool singleBufferMode) {
+        Parcel data, reply;
+        data.writeInterfaceToken(
+                IGraphicBufferProducer::getInterfaceDescriptor());
+        data.writeInt32(singleBufferMode);
+        status_t result = remote()->transact(SET_SINGLE_BUFFER_MODE, data,
+                &reply);
+        if (result == NO_ERROR) {
+            result = reply.readInt32();
+        }
+        return result;
+    }
 };
 
 // Out-of-line virtual method definition to trigger vtable emission in this
@@ -334,24 +379,30 @@ status_t BnGraphicBufferProducer::onTransact(
             reply->writeInt32(result);
             return NO_ERROR;
         }
-        case SET_BUFFER_COUNT: {
+        case SET_MAX_DEQUEUED_BUFFER_COUNT: {
+            CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
+            int maxDequeuedBuffers = data.readInt32();
+            int result = setMaxDequeuedBufferCount(maxDequeuedBuffers);
+            reply->writeInt32(result);
+            return NO_ERROR;
+        }
+        case SET_ASYNC_MODE: {
             CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
-            int bufferCount = data.readInt32();
-            int result = setBufferCount(bufferCount);
+            bool async = data.readInt32();
+            int result = setAsyncMode(async);
             reply->writeInt32(result);
             return NO_ERROR;
         }
         case DEQUEUE_BUFFER: {
             CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
-            bool async = static_cast<bool>(data.readInt32());
             uint32_t width = data.readUint32();
             uint32_t height = data.readUint32();
             PixelFormat format = static_cast<PixelFormat>(data.readInt32());
             uint32_t usage = data.readUint32();
             int buf = 0;
             sp<Fence> fence;
-            int result = dequeueBuffer(&buf, &fence, async, width, height,
-                    format, usage);
+            int result = dequeueBuffer(&buf, &fence, width, height, format,
+                    usage);
             reply->writeInt32(buf);
             reply->writeInt32(fence != NULL);
             if (fence != NULL) {
@@ -411,7 +462,8 @@ status_t BnGraphicBufferProducer::onTransact(
             int buf = data.readInt32();
             sp<Fence> fence = new Fence();
             data.read(*fence.get());
-            cancelBuffer(buf, fence);
+            status_t result = cancelBuffer(buf, fence);
+            reply->writeInt32(result);
             return NO_ERROR;
         }
         case QUERY: {
@@ -457,12 +509,11 @@ status_t BnGraphicBufferProducer::onTransact(
         }
         case ALLOCATE_BUFFERS: {
             CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
-            bool async = static_cast<bool>(data.readInt32());
             uint32_t width = data.readUint32();
             uint32_t height = data.readUint32();
             PixelFormat format = static_cast<PixelFormat>(data.readInt32());
             uint32_t usage = data.readUint32();
-            allocateBuffers(async, width, height, format, usage);
+            allocateBuffers(width, height, format, usage);
             return NO_ERROR;
         }
         case ALLOW_ALLOCATION: {
@@ -484,6 +535,19 @@ status_t BnGraphicBufferProducer::onTransact(
             reply->writeString8(getConsumerName());
             return NO_ERROR;
         }
+        case GET_NEXT_FRAME_NUMBER: {
+            CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
+            uint64_t frameNumber = getNextFrameNumber();
+            reply->writeUint64(frameNumber);
+            return NO_ERROR;
+        }
+        case SET_SINGLE_BUFFER_MODE: {
+            CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
+            bool singleBufferMode = data.readInt32();
+            status_t result = setSingleBufferMode(singleBufferMode);
+            reply->writeInt32(result);
+            return NO_ERROR;
+        }
     }
     return BBinder::onTransact(code, data, reply, flags);
 }
@@ -502,7 +566,6 @@ size_t IGraphicBufferProducer::QueueBufferInput::getFlattenedSize() const {
          + sizeof(scalingMode)
          + sizeof(transform)
          + sizeof(stickyTransform)
-         + sizeof(async)
          + fence->getFlattenedSize()
          + surfaceDamage.getFlattenedSize();
 }
@@ -524,7 +587,6 @@ status_t IGraphicBufferProducer::QueueBufferInput::flatten(
     FlattenableUtils::write(buffer, size, scalingMode);
     FlattenableUtils::write(buffer, size, transform);
     FlattenableUtils::write(buffer, size, stickyTransform);
-    FlattenableUtils::write(buffer, size, async);
     status_t result = fence->flatten(buffer, size, fds, count);
     if (result != NO_ERROR) {
         return result;
@@ -542,8 +604,7 @@ status_t IGraphicBufferProducer::QueueBufferInput::unflatten(
             + sizeof(crop)
             + sizeof(scalingMode)
             + sizeof(transform)
-            + sizeof(stickyTransform)
-            + sizeof(async);
+            + sizeof(stickyTransform);
 
     if (size < minNeeded) {
         return NO_MEMORY;
@@ -556,7 +617,6 @@ status_t IGraphicBufferProducer::QueueBufferInput::unflatten(
     FlattenableUtils::read(buffer, size, scalingMode);
     FlattenableUtils::read(buffer, size, transform);
     FlattenableUtils::read(buffer, size, stickyTransform);
-    FlattenableUtils::read(buffer, size, async);
 
     fence = new Fence();
     status_t result = fence->unflatten(buffer, size, fds, count);
index 78886d5..b4cbf84 100644 (file)
@@ -353,7 +353,7 @@ status_t BnSurfaceComposer::onTransact(
             sp<IBinder> display = data.readStrongBinder();
             sp<IGraphicBufferProducer> producer =
                     interface_cast<IGraphicBufferProducer>(data.readStrongBinder());
-            Rect sourceCrop;
+            Rect sourceCrop(Rect::EMPTY_RECT);
             data.read(sourceCrop);
             uint32_t reqWidth = data.readUint32();
             uint32_t reqHeight = data.readUint32();
index 00323dc..06f13e8 100644 (file)
@@ -38,6 +38,8 @@ status_t layer_state_t::write(Parcel& output) const
     *reinterpret_cast<layer_state_t::matrix22_t *>(
             output.writeInplace(sizeof(layer_state_t::matrix22_t))) = matrix;
     output.write(crop);
+    output.writeStrongBinder(handle);
+    output.writeUint64(frameNumber);
     output.write(transparentRegion);
     return NO_ERROR;
 }
@@ -62,6 +64,8 @@ status_t layer_state_t::read(const Parcel& input)
         return BAD_VALUE;
     }
     input.read(crop);
+    handle = input.readStrongBinder();
+    frameNumber = input.readUint64();
     input.read(transparentRegion);
     return NO_ERROR;
 }
@@ -77,6 +81,16 @@ status_t ComposerState::read(const Parcel& input) {
 }
 
 
+DisplayState::DisplayState() :
+    what(0),
+    layerStack(0),
+    orientation(eOrientationDefault),
+    viewport(Rect::EMPTY_RECT),
+    frame(Rect::EMPTY_RECT),
+    width(0),
+    height(0) {
+}
+
 status_t DisplayState::write(Parcel& output) const {
     output.writeStrongBinder(token);
     output.writeStrongBinder(IInterface::asBinder(surface));
index 235cbbd..0a0fc4b 100644 (file)
@@ -38,7 +38,8 @@ namespace android {
 Sensor::Sensor()
     : mHandle(0), mType(0),
       mMinValue(0), mMaxValue(0), mResolution(0),
-      mPower(0), mMinDelay(0), mFifoReservedEventCount(0), mFifoMaxEventCount(0),
+      mPower(0), mMinDelay(0), mVersion(0), mFifoReservedEventCount(0),
+      mFifoMaxEventCount(0), mRequiredAppOp(0),
       mMaxDelay(0), mFlags(0)
 {
 }
index 43f9214..bafe947 100644 (file)
@@ -132,7 +132,7 @@ void StreamSplitter::onFrameAvailable(const BufferItem& /* item */) {
     ALOGV("acquired buffer %#" PRIx64 " from input",
             bufferItem.mGraphicBuffer->getId());
 
-    status = mInput->detachBuffer(bufferItem.mBuf);
+    status = mInput->detachBuffer(bufferItem.mSlot);
     LOG_ALWAYS_FATAL_IF(status != NO_ERROR,
             "detaching buffer from input failed (%d)", status);
 
@@ -144,8 +144,7 @@ void StreamSplitter::onFrameAvailable(const BufferItem& /* item */) {
             bufferItem.mTimestamp, bufferItem.mIsAutoTimestamp,
             bufferItem.mDataSpace, bufferItem.mCrop,
             static_cast<int32_t>(bufferItem.mScalingMode),
-            bufferItem.mTransform, bufferItem.mIsDroppable,
-            bufferItem.mFence);
+            bufferItem.mTransform, bufferItem.mFence);
 
     // Attach and queue the buffer to each of the outputs
     Vector<sp<IGraphicBufferProducer> >::iterator output = mOutputs.begin();
index 4b76f98..7578a3d 100644 (file)
@@ -43,6 +43,7 @@ Surface::Surface(
         const sp<IGraphicBufferProducer>& bufferProducer,
         bool controlledByApp)
     : mGraphicBufferProducer(bufferProducer),
+      mCrop(Rect::EMPTY_RECT),
       mGenerationNumber(0)
 {
     // Initialize the ANativeWindow function pointers.
@@ -67,7 +68,6 @@ Surface::Surface(
     mReqUsage = 0;
     mTimestamp = NATIVE_WINDOW_TIMESTAMP_AUTO;
     mDataSpace = HAL_DATASPACE_UNKNOWN;
-    mCrop.clear();
     mScalingMode = NATIVE_WINDOW_SCALING_MODE_FREEZE;
     mTransform = 0;
     mStickyTransform = 0;
@@ -99,8 +99,8 @@ void Surface::setSidebandStream(const sp<NativeHandle>& stream) {
 void Surface::allocateBuffers() {
     uint32_t reqWidth = mReqWidth ? mReqWidth : mUserWidth;
     uint32_t reqHeight = mReqHeight ? mReqHeight : mUserHeight;
-    mGraphicBufferProducer->allocateBuffers(mSwapIntervalZero, reqWidth,
-            reqHeight, mReqFormat, mReqUsage);
+    mGraphicBufferProducer->allocateBuffers(reqWidth, reqHeight,
+            mReqFormat, mReqUsage);
 }
 
 status_t Surface::setGenerationNumber(uint32_t generation) {
@@ -111,6 +111,10 @@ status_t Surface::setGenerationNumber(uint32_t generation) {
     return result;
 }
 
+uint64_t Surface::getNextFrameNumber() const {
+    return mGraphicBufferProducer->getNextFrameNumber();
+}
+
 String8 Surface::getConsumerName() const {
     return mGraphicBufferProducer->getConsumerName();
 }
@@ -184,7 +188,9 @@ int Surface::hook_perform(ANativeWindow* window, int operation, ...) {
     va_list args;
     va_start(args, operation);
     Surface* c = getSelf(window);
-    return c->perform(operation, args);
+    int result = c->perform(operation, args);
+    va_end(args);
+    return result;
 }
 
 int Surface::setSwapInterval(int interval) {
@@ -200,6 +206,7 @@ int Surface::setSwapInterval(int interval) {
         interval = maxSwapInterval;
 
     mSwapIntervalZero = (interval == 0);
+    mGraphicBufferProducer->setAsyncMode(mSwapIntervalZero);
 
     return NO_ERROR;
 }
@@ -210,7 +217,6 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer, int* fenceFd) {
 
     uint32_t reqWidth;
     uint32_t reqHeight;
-    bool swapIntervalZero;
     PixelFormat reqFormat;
     uint32_t reqUsage;
 
@@ -220,20 +226,19 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer, int* fenceFd) {
         reqWidth = mReqWidth ? mReqWidth : mUserWidth;
         reqHeight = mReqHeight ? mReqHeight : mUserHeight;
 
-        swapIntervalZero = mSwapIntervalZero;
         reqFormat = mReqFormat;
         reqUsage = mReqUsage;
     } // Drop the lock so that we can still touch the Surface while blocking in IGBP::dequeueBuffer
 
     int buf = -1;
     sp<Fence> fence;
-    status_t result = mGraphicBufferProducer->dequeueBuffer(&buf, &fence, swapIntervalZero,
+    status_t result = mGraphicBufferProducer->dequeueBuffer(&buf, &fence,
             reqWidth, reqHeight, reqFormat, reqUsage);
 
     if (result < 0) {
-        ALOGV("dequeueBuffer: IGraphicBufferProducer::dequeueBuffer(%d, %d, %d, %d, %d)"
-             "failed: %d", swapIntervalZero, reqWidth, reqHeight, reqFormat,
-             reqUsage, result);
+        ALOGV("dequeueBuffer: IGraphicBufferProducer::dequeueBuffer"
+                "(%d, %d, %d, %d) failed: %d", reqWidth, reqHeight, reqFormat,
+                reqUsage, result);
         return result;
     }
 
@@ -332,14 +337,14 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) {
 
 
     // Make sure the crop rectangle is entirely inside the buffer.
-    Rect crop;
+    Rect crop(Rect::EMPTY_RECT);
     mCrop.intersect(Rect(buffer->width, buffer->height), &crop);
 
     sp<Fence> fence(fenceFd >= 0 ? new Fence(fenceFd) : Fence::NO_FENCE);
     IGraphicBufferProducer::QueueBufferOutput output;
     IGraphicBufferProducer::QueueBufferInput input(timestamp, isAutoTimestamp,
             mDataSpace, crop, mScalingMode, mTransform ^ mStickyTransform,
-            mSwapIntervalZero, fence, mStickyTransform);
+            fence, mStickyTransform);
 
     if (mConnectedToCpu || mDirtyRegion.bounds() == Rect::INVALID_RECT) {
         input.setSurfaceDamage(Region::INVALID_REGION);
@@ -545,6 +550,9 @@ int Surface::perform(int operation, va_list args)
     case NATIVE_WINDOW_SET_SURFACE_DAMAGE:
         res = dispatchSetSurfaceDamage(args);
         break;
+    case NATIVE_WINDOW_SET_SINGLE_BUFFER_MODE:
+        res = dispatchSetSingleBufferMode(args);
+        break;
     default:
         res = NAME_NOT_FOUND;
         break;
@@ -655,6 +663,12 @@ int Surface::dispatchSetSurfaceDamage(va_list args) {
     return NO_ERROR;
 }
 
+int Surface::dispatchSetSingleBufferMode(va_list args) {
+    bool singleBufferMode = va_arg(args, int);
+    setSingleBufferMode(singleBufferMode);
+    return NO_ERROR;
+}
+
 int Surface::connect(int api) {
     static sp<IProducerListener> listener = new DummyProducerListener();
     return connect(api, listener);
@@ -779,7 +793,7 @@ int Surface::setCrop(Rect const* rect)
 {
     ATRACE_CALL();
 
-    Rect realRect;
+    Rect realRect(Rect::EMPTY_RECT);
     if (rect == NULL || rect->isEmpty()) {
         realRect.clear();
     } else {
@@ -800,9 +814,54 @@ int Surface::setBufferCount(int bufferCount)
     ALOGV("Surface::setBufferCount");
     Mutex::Autolock lock(mMutex);
 
-    status_t err = mGraphicBufferProducer->setBufferCount(bufferCount);
+    status_t err = NO_ERROR;
+    if (bufferCount == 0) {
+        err = mGraphicBufferProducer->setMaxDequeuedBufferCount(1);
+    } else {
+        int minUndequeuedBuffers = 0;
+        err = mGraphicBufferProducer->query(
+                NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &minUndequeuedBuffers);
+        if (err == NO_ERROR) {
+            err = mGraphicBufferProducer->setMaxDequeuedBufferCount(
+                    bufferCount - minUndequeuedBuffers);
+        }
+    }
+
+    if (err == NO_ERROR) {
+        freeAllBuffers();
+    }
+
     ALOGE_IF(err, "IGraphicBufferProducer::setBufferCount(%d) returned %s",
-            bufferCount, strerror(-err));
+             bufferCount, strerror(-err));
+
+    return err;
+}
+
+int Surface::setMaxDequeuedBufferCount(int maxDequeuedBuffers) {
+    ATRACE_CALL();
+    ALOGV("Surface::setMaxDequeuedBufferCount");
+    Mutex::Autolock lock(mMutex);
+
+    status_t err = mGraphicBufferProducer->setMaxDequeuedBufferCount(
+            maxDequeuedBuffers);
+    ALOGE_IF(err, "IGraphicBufferProducer::setMaxDequeuedBufferCount(%d) "
+            "returned %s", maxDequeuedBuffers, strerror(-err));
+
+    if (err == NO_ERROR) {
+        freeAllBuffers();
+    }
+
+    return err;
+}
+
+int Surface::setAsyncMode(bool async) {
+    ATRACE_CALL();
+    ALOGV("Surface::setAsyncMode");
+    Mutex::Autolock lock(mMutex);
+
+    status_t err = mGraphicBufferProducer->setAsyncMode(async);
+    ALOGE_IF(err, "IGraphicBufferProducer::setAsyncMode(%d) returned %s",
+            async, strerror(-err));
 
     if (err == NO_ERROR) {
         freeAllBuffers();
@@ -811,6 +870,19 @@ int Surface::setBufferCount(int bufferCount)
     return err;
 }
 
+int Surface::setSingleBufferMode(bool singleBufferMode) {
+    ATRACE_CALL();
+    ALOGV("Surface::setSingleBufferMode (%d)", singleBufferMode);
+    Mutex::Autolock lock(mMutex);
+
+    status_t err = mGraphicBufferProducer->setSingleBufferMode(
+            singleBufferMode);
+    ALOGE_IF(err, "IGraphicsBufferProducer::setSingleBufferMode(%d) returned"
+            "%s", singleBufferMode, strerror(-err));
+
+    return err;
+}
+
 int Surface::setBuffersDimensions(uint32_t width, uint32_t height)
 {
     ATRACE_CALL();
index 6ad47d8..3242f55 100644 (file)
@@ -158,6 +158,9 @@ public:
             const Rect& crop);
     status_t setLayerStack(const sp<SurfaceComposerClient>& client,
             const sp<IBinder>& id, uint32_t layerStack);
+    status_t deferTransactionUntil(const sp<SurfaceComposerClient>& client,
+            const sp<IBinder>& id, const sp<IBinder>& handle,
+            uint64_t frameNumber);
 
     void setDisplaySurface(const sp<IBinder>& token,
             const sp<IGraphicBufferProducer>& bufferProducer);
@@ -310,9 +313,9 @@ status_t Composer::setFlags(const sp<SurfaceComposerClient>& client,
     layer_state_t* s = getLayerStateLocked(client, id);
     if (!s)
         return BAD_INDEX;
-    if (mask & layer_state_t::eLayerOpaque ||
-            mask & layer_state_t::eLayerHidden ||
-            mask & layer_state_t::eLayerSecure) {
+    if ((mask & layer_state_t::eLayerOpaque) ||
+            (mask & layer_state_t::eLayerHidden) ||
+            (mask & layer_state_t::eLayerSecure)) {
         s->what |= layer_state_t::eFlagsChanged;
     }
     s->flags &= ~mask;
@@ -383,6 +386,20 @@ status_t Composer::setCrop(const sp<SurfaceComposerClient>& client,
     return NO_ERROR;
 }
 
+status_t Composer::deferTransactionUntil(
+        const sp<SurfaceComposerClient>& client, const sp<IBinder>& id,
+        const sp<IBinder>& handle, uint64_t frameNumber) {
+    Mutex::Autolock lock(mLock);
+    layer_state_t* s = getLayerStateLocked(client, id);
+    if (!s) {
+        return BAD_INDEX;
+    }
+    s->what |= layer_state_t::eDeferTransaction;
+    s->handle = handle;
+    s->frameNumber = frameNumber;
+    return NO_ERROR;
+}
+
 // ---------------------------------------------------------------------------
 
 DisplayState& Composer::getDisplayStateLocked(const sp<IBinder>& token) {
@@ -609,6 +626,11 @@ status_t SurfaceComposerClient::setMatrix(const sp<IBinder>& id, float dsdx, flo
     return getComposer().setMatrix(this, id, dsdx, dtdx, dsdy, dtdy);
 }
 
+status_t SurfaceComposerClient::deferTransactionUntil(const sp<IBinder>& id,
+        const sp<IBinder>& handle, uint64_t frameNumber) {
+    return getComposer().deferTransactionUntil(this, id, handle, frameNumber);
+}
+
 // ----------------------------------------------------------------------------
 
 void SurfaceComposerClient::setDisplaySurface(const sp<IBinder>& token,
index 1983027..a945358 100644 (file)
@@ -145,6 +145,13 @@ status_t SurfaceControl::setCrop(const Rect& crop) {
     return mClient->setCrop(mHandle, crop);
 }
 
+status_t SurfaceControl::deferTransactionUntil(sp<IBinder> handle,
+        uint64_t frameNumber) {
+    status_t err = validate();
+    if (err < 0) return err;
+    return mClient->deferTransactionUntil(mHandle, handle, frameNumber);
+}
+
 status_t SurfaceControl::clearLayerFrameStats() const {
     status_t err = validate();
     if (err < 0) return err;
@@ -190,5 +197,11 @@ sp<Surface> SurfaceControl::getSurface() const
     return mSurfaceData;
 }
 
+sp<IBinder> SurfaceControl::getHandle() const
+{
+    Mutex::Autolock lock(mLock);
+    return mHandle;
+}
+
 // ----------------------------------------------------------------------------
 }; // namespace android
index 1a54875..a32a90c 100644 (file)
@@ -113,7 +113,7 @@ TEST_F(BufferQueueTest, BufferQueueInAnotherProcess) {
     sp<Fence> fence;
     sp<GraphicBuffer> buffer;
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            mProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0,
+            mProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
                     GRALLOC_USAGE_SW_WRITE_OFTEN));
     ASSERT_EQ(OK, mProducer->requestBuffer(slot, &buffer));
 
@@ -125,7 +125,7 @@ TEST_F(BufferQueueTest, BufferQueueInAnotherProcess) {
 
     IGraphicBufferProducer::QueueBufferInput input(0, false,
             HAL_DATASPACE_UNKNOWN, Rect(0, 0, 1, 1),
-            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, false, Fence::NO_FENCE);
+            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, Fence::NO_FENCE);
     ASSERT_EQ(OK, mProducer->queueBuffer(slot, input, &output));
 
     BufferItem item;
@@ -145,19 +145,19 @@ TEST_F(BufferQueueTest, AcquireBuffer_ExceedsMaxAcquireCount_Fails) {
     IGraphicBufferProducer::QueueBufferOutput qbo;
     mProducer->connect(new DummyProducerListener, NATIVE_WINDOW_API_CPU, false,
             &qbo);
-    mProducer->setBufferCount(4);
+    mProducer->setMaxDequeuedBufferCount(3);
 
     int slot;
     sp<Fence> fence;
     sp<GraphicBuffer> buf;
     IGraphicBufferProducer::QueueBufferInput qbi(0, false,
             HAL_DATASPACE_UNKNOWN, Rect(0, 0, 1, 1),
-            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, false, Fence::NO_FENCE);
+            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, Fence::NO_FENCE);
     BufferItem item;
 
     for (int i = 0; i < 2; i++) {
         ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-                mProducer->dequeueBuffer(&slot, &fence, false, 1, 1, 0,
+                mProducer->dequeueBuffer(&slot, &fence, 1, 1, 0,
                     GRALLOC_USAGE_SW_READ_OFTEN));
         ASSERT_EQ(OK, mProducer->requestBuffer(slot, &buf));
         ASSERT_EQ(OK, mProducer->queueBuffer(slot, qbi, &qbo));
@@ -165,7 +165,7 @@ TEST_F(BufferQueueTest, AcquireBuffer_ExceedsMaxAcquireCount_Fails) {
     }
 
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            mProducer->dequeueBuffer(&slot, &fence, false, 1, 1, 0,
+            mProducer->dequeueBuffer(&slot, &fence, 1, 1, 0,
                 GRALLOC_USAGE_SW_READ_OFTEN));
     ASSERT_EQ(OK, mProducer->requestBuffer(slot, &buf));
     ASSERT_EQ(OK, mProducer->queueBuffer(slot, qbi, &qbo));
@@ -189,6 +189,9 @@ TEST_F(BufferQueueTest, SetMaxAcquiredBufferCountWithIllegalValues_ReturnsError)
     EXPECT_EQ(BAD_VALUE, mConsumer->setMaxAcquiredBufferCount(
             BufferQueue::MAX_MAX_ACQUIRED_BUFFERS+1));
     EXPECT_EQ(BAD_VALUE, mConsumer->setMaxAcquiredBufferCount(100));
+
+    EXPECT_EQ(OK, mConsumer->setMaxBufferCount(5));
+    EXPECT_EQ(BAD_VALUE, mConsumer->setMaxAcquiredBufferCount(5));
 }
 
 TEST_F(BufferQueueTest, SetMaxAcquiredBufferCountWithLegalValues_Succeeds) {
@@ -206,6 +209,28 @@ TEST_F(BufferQueueTest, SetMaxAcquiredBufferCountWithLegalValues_Succeeds) {
             BufferQueue::MAX_MAX_ACQUIRED_BUFFERS));
 }
 
+TEST_F(BufferQueueTest, SetMaxBufferCountWithLegalValues_Succeeds) {
+    createBufferQueue();
+    sp<DummyConsumer> dc(new DummyConsumer);
+    mConsumer->consumerConnect(dc, false);
+
+    // Test single buffer mode
+    EXPECT_EQ(OK, mConsumer->setMaxAcquiredBufferCount(1));
+}
+
+TEST_F(BufferQueueTest, SetMaxBufferCountWithIllegalValues_ReturnsError) {
+    createBufferQueue();
+    sp<DummyConsumer> dc(new DummyConsumer);
+    mConsumer->consumerConnect(dc, false);
+
+    EXPECT_EQ(BAD_VALUE, mConsumer->setMaxBufferCount(0));
+    EXPECT_EQ(BAD_VALUE, mConsumer->setMaxBufferCount(
+            BufferQueue::NUM_BUFFER_SLOTS + 1));
+
+    EXPECT_EQ(OK, mConsumer->setMaxAcquiredBufferCount(5));
+    EXPECT_EQ(BAD_VALUE, mConsumer->setMaxBufferCount(3));
+}
+
 TEST_F(BufferQueueTest, DetachAndReattachOnProducerSide) {
     createBufferQueue();
     sp<DummyConsumer> dc(new DummyConsumer);
@@ -223,7 +248,7 @@ TEST_F(BufferQueueTest, DetachAndReattachOnProducerSide) {
     sp<Fence> fence;
     sp<GraphicBuffer> buffer;
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            mProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0,
+            mProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
                     GRALLOC_USAGE_SW_WRITE_OFTEN));
     ASSERT_EQ(BAD_VALUE, mProducer->detachBuffer(slot)); // Not requested
     ASSERT_EQ(OK, mProducer->requestBuffer(slot, &buffer));
@@ -247,7 +272,7 @@ TEST_F(BufferQueueTest, DetachAndReattachOnProducerSide) {
     ASSERT_EQ(OK, mProducer->attachBuffer(&newSlot, buffer));
     IGraphicBufferProducer::QueueBufferInput input(0, false,
             HAL_DATASPACE_UNKNOWN, Rect(0, 0, 1, 1),
-            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, false, Fence::NO_FENCE);
+            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, Fence::NO_FENCE);
     ASSERT_EQ(OK, mProducer->queueBuffer(newSlot, input, &output));
 
     BufferItem item;
@@ -272,12 +297,12 @@ TEST_F(BufferQueueTest, DetachAndReattachOnConsumerSide) {
     sp<Fence> fence;
     sp<GraphicBuffer> buffer;
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            mProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0,
+            mProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
                     GRALLOC_USAGE_SW_WRITE_OFTEN));
     ASSERT_EQ(OK, mProducer->requestBuffer(slot, &buffer));
     IGraphicBufferProducer::QueueBufferInput input(0, false,
             HAL_DATASPACE_UNKNOWN, Rect(0, 0, 1, 1),
-            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, false, Fence::NO_FENCE);
+            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, Fence::NO_FENCE);
     ASSERT_EQ(OK, mProducer->queueBuffer(slot, input, &output));
 
     ASSERT_EQ(BAD_VALUE, mConsumer->detachBuffer(-1)); // Index too low
@@ -288,8 +313,8 @@ TEST_F(BufferQueueTest, DetachAndReattachOnConsumerSide) {
     BufferItem item;
     ASSERT_EQ(OK, mConsumer->acquireBuffer(&item, static_cast<nsecs_t>(0)));
 
-    ASSERT_EQ(OK, mConsumer->detachBuffer(item.mBuf));
-    ASSERT_EQ(BAD_VALUE, mConsumer->detachBuffer(item.mBuf)); // Not acquired
+    ASSERT_EQ(OK, mConsumer->detachBuffer(item.mSlot));
+    ASSERT_EQ(BAD_VALUE, mConsumer->detachBuffer(item.mSlot)); // Not acquired
 
     uint32_t* dataIn;
     ASSERT_EQ(OK, item.mGraphicBuffer->lock(
@@ -308,7 +333,7 @@ TEST_F(BufferQueueTest, DetachAndReattachOnConsumerSide) {
             EGL_NO_SYNC_KHR, Fence::NO_FENCE));
 
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            mProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0,
+            mProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
                     GRALLOC_USAGE_SW_WRITE_OFTEN));
     ASSERT_EQ(OK, mProducer->requestBuffer(slot, &buffer));
 
@@ -331,7 +356,7 @@ TEST_F(BufferQueueTest, MoveFromConsumerToProducer) {
     sp<Fence> fence;
     sp<GraphicBuffer> buffer;
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            mProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0,
+            mProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
                     GRALLOC_USAGE_SW_WRITE_OFTEN));
     ASSERT_EQ(OK, mProducer->requestBuffer(slot, &buffer));
 
@@ -343,12 +368,12 @@ TEST_F(BufferQueueTest, MoveFromConsumerToProducer) {
 
     IGraphicBufferProducer::QueueBufferInput input(0, false,
             HAL_DATASPACE_UNKNOWN, Rect(0, 0, 1, 1),
-            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, false, Fence::NO_FENCE);
+            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, Fence::NO_FENCE);
     ASSERT_EQ(OK, mProducer->queueBuffer(slot, input, &output));
 
     BufferItem item;
     ASSERT_EQ(OK, mConsumer->acquireBuffer(&item, static_cast<nsecs_t>(0)));
-    ASSERT_EQ(OK, mConsumer->detachBuffer(item.mBuf));
+    ASSERT_EQ(OK, mConsumer->detachBuffer(item.mSlot));
 
     int newSlot;
     ASSERT_EQ(OK, mProducer->attachBuffer(&newSlot, item.mGraphicBuffer));
@@ -380,13 +405,13 @@ TEST_F(BufferQueueTest, TestDisallowingAllocation) {
     sp<GraphicBuffer> buffer;
     // This should return an error since it would require an allocation
     ASSERT_EQ(OK, mProducer->allowAllocation(false));
-    ASSERT_EQ(WOULD_BLOCK, mProducer->dequeueBuffer(&slot, &fence, false, 0, 0,
+    ASSERT_EQ(WOULD_BLOCK, mProducer->dequeueBuffer(&slot, &fence, 0, 0,
             0, GRALLOC_USAGE_SW_WRITE_OFTEN));
 
     // This should succeed, now that we've lifted the prohibition
     ASSERT_EQ(OK, mProducer->allowAllocation(true));
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            mProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0,
+            mProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
             GRALLOC_USAGE_SW_WRITE_OFTEN));
 
     // Release the previous buffer back to the BufferQueue
@@ -394,7 +419,7 @@ TEST_F(BufferQueueTest, TestDisallowingAllocation) {
 
     // This should fail since we're requesting a different size
     ASSERT_EQ(OK, mProducer->allowAllocation(false));
-    ASSERT_EQ(WOULD_BLOCK, mProducer->dequeueBuffer(&slot, &fence, false,
+    ASSERT_EQ(WOULD_BLOCK, mProducer->dequeueBuffer(&slot, &fence,
             WIDTH * 2, HEIGHT * 2, 0, GRALLOC_USAGE_SW_WRITE_OFTEN));
 }
 
@@ -412,7 +437,7 @@ TEST_F(BufferQueueTest, TestGenerationNumbers) {
     int slot;
     sp<Fence> fence;
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            mProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0, 0));
+            mProducer->dequeueBuffer(&slot, &fence, 0, 0, 0, 0));
 
     sp<GraphicBuffer> buffer;
     ASSERT_EQ(OK, mProducer->requestBuffer(slot, &buffer));
@@ -440,4 +465,74 @@ TEST_F(BufferQueueTest, TestGenerationNumbers) {
     ASSERT_EQ(OK, mConsumer->attachBuffer(&outSlot, buffer));
 }
 
+TEST_F(BufferQueueTest, TestSingleBufferMode) {
+    createBufferQueue();
+    sp<DummyConsumer> dc(new DummyConsumer);
+    ASSERT_EQ(OK, mConsumer->consumerConnect(dc, true));
+    IGraphicBufferProducer::QueueBufferOutput output;
+    ASSERT_EQ(OK, mProducer->connect(new DummyProducerListener,
+            NATIVE_WINDOW_API_CPU, true, &output));
+
+    ASSERT_EQ(OK, mProducer->setSingleBufferMode(true));
+
+    // Get a buffer
+    int singleSlot;
+    sp<Fence> fence;
+    sp<GraphicBuffer> buffer;
+    ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
+            mProducer->dequeueBuffer(&singleSlot, &fence, 0, 0, 0, 0));
+    ASSERT_EQ(OK, mProducer->requestBuffer(singleSlot, &buffer));
+
+    // Queue the buffer
+    IGraphicBufferProducer::QueueBufferInput input(0, false,
+            HAL_DATASPACE_UNKNOWN, Rect(0, 0, 1, 1),
+            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, Fence::NO_FENCE);
+    ASSERT_EQ(OK, mProducer->queueBuffer(singleSlot, input, &output));
+
+    // Repeatedly acquire and release a buffer from the consumer side, it should
+    // always return the same one.
+    BufferItem item;
+    for (int i = 0; i < 5; i++) {
+        ASSERT_EQ(OK, mConsumer->acquireBuffer(&item, 0));
+        ASSERT_EQ(singleSlot, item.mSlot);
+        ASSERT_EQ(0, item.mTimestamp);
+        ASSERT_EQ(false, item.mIsAutoTimestamp);
+        ASSERT_EQ(HAL_DATASPACE_UNKNOWN, item.mDataSpace);
+        ASSERT_EQ(Rect(0, 0, 1, 1), item.mCrop);
+        ASSERT_EQ(NATIVE_WINDOW_SCALING_MODE_FREEZE, item.mScalingMode);
+        ASSERT_EQ(0, item.mTransform);
+        ASSERT_EQ(Fence::NO_FENCE, item.mFence);
+
+        ASSERT_EQ(OK, mConsumer->releaseBuffer(item.mSlot, item.mFrameNumber,
+                EGL_NO_DISPLAY, EGL_NO_SYNC_KHR, Fence::NO_FENCE));
+    }
+
+    // Repeatedly queue and dequeue a buffer from the producer side, it should
+    // always return the same one.
+    int slot;
+    for (int i = 0; i < 5; i++) {
+        ASSERT_EQ(OK, mProducer->dequeueBuffer(&slot, &fence, 0, 0, 0, 0));
+        ASSERT_EQ(singleSlot, slot);
+        ASSERT_EQ(OK, mProducer->queueBuffer(singleSlot, input, &output));
+    }
+
+    // Repeatedly acquire and release a buffer from the consumer side, it should
+    // always return the same one. First grabbing them from the queue and then
+    // when the queue is empty, returning the single buffer.
+    for (int i = 0; i < 10; i++) {
+        ASSERT_EQ(OK, mConsumer->acquireBuffer(&item, 0));
+        ASSERT_EQ(singleSlot, item.mSlot);
+        ASSERT_EQ(0, item.mTimestamp);
+        ASSERT_EQ(false, item.mIsAutoTimestamp);
+        ASSERT_EQ(HAL_DATASPACE_UNKNOWN, item.mDataSpace);
+        ASSERT_EQ(Rect(0, 0, 1, 1), item.mCrop);
+        ASSERT_EQ(NATIVE_WINDOW_SCALING_MODE_FREEZE, item.mScalingMode);
+        ASSERT_EQ(0, item.mTransform);
+        ASSERT_EQ(Fence::NO_FENCE, item.mFence);
+
+        ASSERT_EQ(OK, mConsumer->releaseBuffer(item.mSlot, item.mFrameNumber,
+                EGL_NO_DISPLAY, EGL_NO_SYNC_KHR, Fence::NO_FENCE));
+    }
+}
+
 } // namespace android
index 2dc9ccc..289cc74 100644 (file)
@@ -444,19 +444,14 @@ void checkAnyBuffer(const CpuConsumer::LockedBuffer &buf, int format) {
     }
 }
 
-void fillYV12BufferRect(uint8_t* buf, int w, int h, int stride,
-        const android_native_rect_t& rect);
-
-void fillRGBA8Buffer(uint8_t* buf, int w, int h, int stride);
-
-void fillRGBA8BufferSolid(uint8_t* buf, int w, int h, int stride, uint8_t r,
-        uint8_t g, uint8_t b, uint8_t a);
-
 // Configures the ANativeWindow producer-side interface based on test parameters
 void configureANW(const sp<ANativeWindow>& anw,
         const CpuConsumerTestParams& params,
         int maxBufferSlack) {
     status_t err;
+    err = native_window_api_connect(anw.get(), NATIVE_WINDOW_API_CPU);
+    ASSERT_NO_ERROR(err, "connect error: ");
+
     err = native_window_set_buffers_dimensions(anw.get(),
             params.width, params.height);
     ASSERT_NO_ERROR(err, "set_buffers_dimensions error: ");
index d3c4a95..f0d27a8 100644 (file)
@@ -35,9 +35,11 @@ public:
 
 protected:
     GLTest() :
+            mDisplaySecs(0),
             mEglDisplay(EGL_NO_DISPLAY),
             mEglSurface(EGL_NO_SURFACE),
-            mEglContext(EGL_NO_CONTEXT) {
+            mEglContext(EGL_NO_CONTEXT),
+            mGlConfig(NULL) {
     }
 
     virtual void SetUp();
index 4ef9a69..882b14c 100644 (file)
@@ -61,7 +61,6 @@ namespace {
     const Rect QUEUE_BUFFER_INPUT_RECT = Rect(DEFAULT_WIDTH, DEFAULT_HEIGHT);
     const int QUEUE_BUFFER_INPUT_SCALING_MODE = 0;
     const int QUEUE_BUFFER_INPUT_TRANSFORM = 0;
-    const bool QUEUE_BUFFER_INPUT_ASYNC = false;
     const sp<Fence> QUEUE_BUFFER_INPUT_FENCE = Fence::NO_FENCE;
 }; // namespace anonymous
 
@@ -131,7 +130,6 @@ protected:
            crop = QUEUE_BUFFER_INPUT_RECT;
            scalingMode = QUEUE_BUFFER_INPUT_SCALING_MODE;
            transform = QUEUE_BUFFER_INPUT_TRANSFORM;
-           async = QUEUE_BUFFER_INPUT_ASYNC;
            fence = QUEUE_BUFFER_INPUT_FENCE;
         }
 
@@ -143,7 +141,6 @@ protected:
                     crop,
                     scalingMode,
                     transform,
-                    async,
                     fence);
         }
 
@@ -177,11 +174,6 @@ protected:
             return *this;
         }
 
-        QueueBufferInputBuilder& setAsync(bool async) {
-            this->async = async;
-            return *this;
-        }
-
         QueueBufferInputBuilder& setFence(sp<Fence> fence) {
             this->fence = fence;
             return *this;
@@ -194,7 +186,6 @@ protected:
         Rect crop;
         int scalingMode;
         uint32_t transform;
-        int async;
         sp<Fence> fence;
     }; // struct QueueBufferInputBuilder
 
@@ -204,8 +195,28 @@ protected:
         sp<Fence> fence;
     };
 
-    status_t dequeueBuffer(bool async, uint32_t w, uint32_t h, uint32_t format, uint32_t usage, DequeueBufferResult* result) {
-        return mProducer->dequeueBuffer(&result->slot, &result->fence, async, w, h, format, usage);
+    status_t dequeueBuffer(uint32_t w, uint32_t h, uint32_t format, uint32_t usage, DequeueBufferResult* result) {
+        return mProducer->dequeueBuffer(&result->slot, &result->fence, w, h, format, usage);
+    }
+
+    void setupDequeueRequestBuffer(int *slot, sp<Fence> *fence,
+            sp<GraphicBuffer> *buffer)
+    {
+        ASSERT_TRUE(slot != NULL);
+        ASSERT_TRUE(fence != NULL);
+        ASSERT_TRUE(buffer != NULL);
+
+        ASSERT_NO_FATAL_FAILURE(ConnectProducer());
+
+        ASSERT_EQ(OK, ~IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION &
+                (mProducer->dequeueBuffer(slot, fence, DEFAULT_WIDTH,
+                DEFAULT_HEIGHT, DEFAULT_FORMAT, TEST_PRODUCER_USAGE_BITS)));
+
+        EXPECT_LE(0, *slot);
+        EXPECT_GT(BufferQueue::NUM_BUFFER_SLOTS, *slot);
+
+        // Request the buffer (pre-requisite for queueing)
+        ASSERT_OK(mProducer->requestBuffer(*slot, buffer));
     }
 
 private: // hide from test body
@@ -334,12 +345,11 @@ TEST_F(IGraphicBufferProducerTest, Queue_Succeeds) {
     int dequeuedSlot = -1;
     sp<Fence> dequeuedFence;
 
-    // XX: OK to assume first call returns this flag or not? Not really documented.
-    ASSERT_EQ(OK | IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
-                                     QUEUE_BUFFER_INPUT_ASYNC,
+
+    ASSERT_EQ(OK, ~IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION &
+            (mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
                                      DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FORMAT,
-                                     TEST_PRODUCER_USAGE_BITS));
+                                     TEST_PRODUCER_USAGE_BITS)));
 
     EXPECT_LE(0, dequeuedSlot);
     EXPECT_GT(BufferQueue::NUM_BUFFER_SLOTS, dequeuedSlot);
@@ -400,11 +410,10 @@ TEST_F(IGraphicBufferProducerTest, Queue_ReturnsError) {
     int dequeuedSlot = -1;
     sp<Fence> dequeuedFence;
 
-    ASSERT_EQ(OK | IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
-                                     QUEUE_BUFFER_INPUT_ASYNC,
+    ASSERT_EQ(OK, ~IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION &
+            (mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
                                      DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FORMAT,
-                                     TEST_PRODUCER_USAGE_BITS));
+                                     TEST_PRODUCER_USAGE_BITS)));
 
     // Slot was enqueued without requesting a buffer
     {
@@ -470,30 +479,28 @@ TEST_F(IGraphicBufferProducerTest, CancelBuffer_DoesntCrash) {
     int dequeuedSlot = -1;
     sp<Fence> dequeuedFence;
 
-    ASSERT_EQ(OK | IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
-                                     QUEUE_BUFFER_INPUT_ASYNC,
+    ASSERT_EQ(OK, ~IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION &
+            (mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
                                      DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FORMAT,
-                                     TEST_PRODUCER_USAGE_BITS));
+                                     TEST_PRODUCER_USAGE_BITS)));
 
     // No return code, but at least test that it doesn't blow up...
     // TODO: add a return code
     mProducer->cancelBuffer(dequeuedSlot, dequeuedFence);
 }
 
-TEST_F(IGraphicBufferProducerTest, SetBufferCount_Succeeds) {
-
-    // The producer does not wish to set a buffer count
-    EXPECT_OK(mProducer->setBufferCount(0)) << "bufferCount: " << 0;
-    // TODO: how to test "0" buffer count?
-
-    int minBuffers;
-    ASSERT_OK(mProducer->query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &minBuffers));
+TEST_F(IGraphicBufferProducerTest, SetMaxDequeuedBufferCount_Succeeds) {
+    ASSERT_NO_FATAL_FAILURE(ConnectProducer());
+    int minUndequeuedBuffers;
+    ASSERT_OK(mProducer->query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS,
+            &minUndequeuedBuffers));
 
-    // The MIN_UNDEQUEUED_BUFFERS limit is exclusive, so need to increment by at least 1
-    minBuffers++;
+    const int minBuffers = 1;
+    const int maxBuffers = BufferQueue::NUM_BUFFER_SLOTS - minUndequeuedBuffers;
 
-    ASSERT_OK(mProducer->setBufferCount(minBuffers)) << "bufferCount: " << minBuffers;
+    ASSERT_OK(mProducer->setAsyncMode(false)) << "async mode: " << false;
+    ASSERT_OK(mProducer->setMaxDequeuedBufferCount(minBuffers))
+            << "bufferCount: " << minBuffers;
 
     std::vector<DequeueBufferResult> dequeueList;
 
@@ -501,72 +508,217 @@ TEST_F(IGraphicBufferProducerTest, SetBufferCount_Succeeds) {
     for (int i = 0; i < minBuffers; ++i) {
         DequeueBufferResult result;
 
-        EXPECT_LE(OK,
-                dequeueBuffer(QUEUE_BUFFER_INPUT_ASYNC,
-                              DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FORMAT,
-                              TEST_PRODUCER_USAGE_BITS, &result))
+        EXPECT_EQ(OK, ~IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION &
+                (dequeueBuffer(DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FORMAT,
+                              TEST_PRODUCER_USAGE_BITS, &result)))
                 << "iteration: " << i << ", slot: " << result.slot;
 
         dequeueList.push_back(result);
     }
 
     // Cancel every buffer, so we can set buffer count again
-    for (int i = 0; i < minBuffers; ++i) {
-        DequeueBufferResult& result = dequeueList[i];
+    for (auto& result : dequeueList) {
         mProducer->cancelBuffer(result.slot, result.fence);
     }
 
-    ASSERT_OK(mProducer->setBufferCount(BufferQueue::NUM_BUFFER_SLOTS));
+    ASSERT_OK(mProducer->setMaxDequeuedBufferCount(maxBuffers));
 
-    // Should now be able to dequeue up to NUM_BUFFER_SLOTS times
-    for (int i = 0; i < BufferQueue::NUM_BUFFER_SLOTS; ++i) {
+    // Should now be able to dequeue up to maxBuffers times
+    for (int i = 0; i < maxBuffers; ++i) {
         int dequeuedSlot = -1;
         sp<Fence> dequeuedFence;
 
-        EXPECT_LE(OK,
-                mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
-                                         QUEUE_BUFFER_INPUT_ASYNC,
-                                         DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FORMAT,
-                                         TEST_PRODUCER_USAGE_BITS))
+        EXPECT_EQ(OK, ~IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION &
+                (mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
+                                         DEFAULT_WIDTH, DEFAULT_HEIGHT,
+                                         DEFAULT_FORMAT,
+                                         TEST_PRODUCER_USAGE_BITS)))
                 << "iteration: " << i << ", slot: " << dequeuedSlot;
     }
 }
 
-TEST_F(IGraphicBufferProducerTest, SetBufferCount_Fails) {
-    int minBuffers;
-    ASSERT_OK(mProducer->query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &minBuffers));
+TEST_F(IGraphicBufferProducerTest, SetMaxDequeuedBufferCount_Fails) {
+    ASSERT_NO_FATAL_FAILURE(ConnectProducer());
+    int minUndequeuedBuffers;
+    ASSERT_OK(mProducer->query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS,
+                               &minUndequeuedBuffers));
 
-    // The MIN_UNDEQUEUED_BUFFERS limit is exclusive, so need to increment by at least 1
-    minBuffers++;
+    const int minBuffers = 1;
+    const int maxBuffers = BufferQueue::NUM_BUFFER_SLOTS - minUndequeuedBuffers;
 
+    ASSERT_OK(mProducer->setAsyncMode(false)) << "async mode: " << false;
     // Buffer count was out of range
-    EXPECT_EQ(BAD_VALUE, mProducer->setBufferCount(-1)) << "bufferCount: " << -1;
-    EXPECT_EQ(BAD_VALUE, mProducer->setBufferCount(minBuffers - 1)) << "bufferCount: " << minBuffers - 1;
-    EXPECT_EQ(BAD_VALUE, mProducer->setBufferCount(BufferQueue::NUM_BUFFER_SLOTS + 1))
-            << "bufferCount: " << BufferQueue::NUM_BUFFER_SLOTS + 1;
+    EXPECT_EQ(BAD_VALUE, mProducer->setMaxDequeuedBufferCount(0))
+            << "bufferCount: " << 0;
+    EXPECT_EQ(BAD_VALUE, mProducer->setMaxDequeuedBufferCount(maxBuffers + 1))
+            << "bufferCount: " << maxBuffers + 1;
 
-    // Pre-requisite to fail out a valid setBufferCount call
+    // Prerequisite to fail out a valid setBufferCount call
     {
         int dequeuedSlot = -1;
         sp<Fence> dequeuedFence;
 
-        ASSERT_LE(OK,
-                mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
-                                         QUEUE_BUFFER_INPUT_ASYNC,
-                                         DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FORMAT,
-                                         TEST_PRODUCER_USAGE_BITS))
+        ASSERT_EQ(OK, ~IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION &
+                (mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
+                                         DEFAULT_WIDTH, DEFAULT_HEIGHT,
+                                         DEFAULT_FORMAT,
+                                         TEST_PRODUCER_USAGE_BITS)))
                 << "slot: " << dequeuedSlot;
     }
 
     // Client has one or more buffers dequeued
-    EXPECT_EQ(BAD_VALUE, mProducer->setBufferCount(minBuffers)) << "bufferCount: " << minBuffers;
+    EXPECT_EQ(BAD_VALUE, mProducer->setMaxDequeuedBufferCount(minBuffers))
+            << "bufferCount: " << minBuffers;
 
     // Abandon buffer queue
     ASSERT_OK(mConsumer->consumerDisconnect());
 
     // Fail because the buffer queue was abandoned
-    EXPECT_EQ(NO_INIT, mProducer->setBufferCount(minBuffers)) << "bufferCount: " << minBuffers;
+    EXPECT_EQ(NO_INIT, mProducer->setMaxDequeuedBufferCount(minBuffers))
+            << "bufferCount: " << minBuffers;
+
+}
+
+TEST_F(IGraphicBufferProducerTest, SetAsyncMode_Succeeds) {
+    ASSERT_OK(mConsumer->setMaxAcquiredBufferCount(1)) << "maxAcquire: " << 1;
+    ASSERT_NO_FATAL_FAILURE(ConnectProducer());
+    ASSERT_OK(mProducer->setAsyncMode(true)) << "async mode: " << true;
+    ASSERT_OK(mProducer->setMaxDequeuedBufferCount(1)) << "maxDequeue: " << 1;
+
+    int dequeuedSlot = -1;
+    sp<Fence> dequeuedFence;
+    IGraphicBufferProducer::QueueBufferInput input = CreateBufferInput();
+    IGraphicBufferProducer::QueueBufferOutput output;
+    sp<GraphicBuffer> dequeuedBuffer;
+
+    // Should now be able to queue/dequeue as many buffers as we want without
+    // blocking
+    for (int i = 0; i < 5; ++i) {
+        ASSERT_EQ(OK, ~IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION &
+                (mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
+                DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FORMAT,
+                TEST_PRODUCER_USAGE_BITS))) << "slot : " << dequeuedSlot;
+        ASSERT_OK(mProducer->requestBuffer(dequeuedSlot, &dequeuedBuffer));
+        ASSERT_OK(mProducer->queueBuffer(dequeuedSlot, input, &output));
+    }
+}
+
+TEST_F(IGraphicBufferProducerTest, SetAsyncMode_Fails) {
+    ASSERT_NO_FATAL_FAILURE(ConnectProducer());
+    // Prerequisite to fail out a valid setBufferCount call
+    {
+        int dequeuedSlot = -1;
+        sp<Fence> dequeuedFence;
+
+        ASSERT_EQ(OK, ~IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION &
+                (mProducer->dequeueBuffer(&dequeuedSlot, &dequeuedFence,
+                DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FORMAT,
+                TEST_PRODUCER_USAGE_BITS))) << "slot: " << dequeuedSlot;
+    }
+
+    // Abandon buffer queue
+    ASSERT_OK(mConsumer->consumerDisconnect());
+
+    // Fail because the buffer queue was abandoned
+    EXPECT_EQ(NO_INIT, mProducer->setAsyncMode(false)) << "asyncMode: "
+            << false;
+}
+
+TEST_F(IGraphicBufferProducerTest,
+        DisconnectedProducerReturnsError_dequeueBuffer) {
+    int slot = -1;
+    sp<Fence> fence;
+
+    ASSERT_EQ(NO_INIT, mProducer->dequeueBuffer(&slot, &fence, DEFAULT_WIDTH,
+            DEFAULT_HEIGHT, DEFAULT_FORMAT, TEST_PRODUCER_USAGE_BITS));
+}
+
+TEST_F(IGraphicBufferProducerTest,
+        DisconnectedProducerReturnsError_detachNextBuffer) {
+    sp<Fence> fence;
+    sp<GraphicBuffer> buffer;
+
+    ASSERT_EQ(NO_INIT, mProducer->detachNextBuffer(&buffer, &fence));
+}
+
+TEST_F(IGraphicBufferProducerTest,
+        DisconnectedProducerReturnsError_requestBuffer) {
+    ASSERT_NO_FATAL_FAILURE(ConnectProducer());
+
+    int slot = -1;
+    sp<Fence> fence;
+
+    ASSERT_EQ(OK, ~IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION &
+            (mProducer->dequeueBuffer(&slot, &fence, DEFAULT_WIDTH,
+            DEFAULT_HEIGHT, DEFAULT_FORMAT, TEST_PRODUCER_USAGE_BITS)));
+
+    EXPECT_LE(0, slot);
+    EXPECT_GT(BufferQueue::NUM_BUFFER_SLOTS, slot);
+
+    ASSERT_OK(mProducer->disconnect(TEST_API));
+
+    sp<GraphicBuffer> buffer;
+
+    ASSERT_EQ(NO_INIT, mProducer->requestBuffer(slot, &buffer));
+}
+
+
+TEST_F(IGraphicBufferProducerTest,
+        DisconnectedProducerReturnsError_detachBuffer) {
+    int slot = -1;
+    sp<Fence> fence;
+    sp<GraphicBuffer> buffer;
+
+    setupDequeueRequestBuffer(&slot, &fence, &buffer);
+
+    ASSERT_OK(mProducer->disconnect(TEST_API));
+
+    ASSERT_EQ(NO_INIT, mProducer->detachBuffer(slot));
+}
+
+TEST_F(IGraphicBufferProducerTest,
+        DisconnectedProducerReturnsError_queueBuffer) {
+    int slot = -1;
+    sp<Fence> fence;
+    sp<GraphicBuffer> buffer;
+
+    setupDequeueRequestBuffer(&slot, &fence, &buffer);
+
+    ASSERT_OK(mProducer->disconnect(TEST_API));
+
+    // A generic "valid" input
+    IGraphicBufferProducer::QueueBufferInput input = CreateBufferInput();
+    IGraphicBufferProducer::QueueBufferOutput output;
+
+    ASSERT_EQ(NO_INIT, mProducer->queueBuffer(slot, input, &output));
+}
+
+TEST_F(IGraphicBufferProducerTest,
+        DisconnectedProducerReturnsError_cancelBuffer) {
+    int slot = -1;
+    sp<Fence> fence;
+    sp<GraphicBuffer> buffer;
+
+    setupDequeueRequestBuffer(&slot, &fence, &buffer);
+
+    ASSERT_OK(mProducer->disconnect(TEST_API));
+
+    ASSERT_EQ(NO_INIT, mProducer->cancelBuffer(slot, fence));
+}
+
+TEST_F(IGraphicBufferProducerTest,
+        DisconnectedProducerReturnsError_attachBuffer) {
+    int slot = -1;
+    sp<Fence> fence;
+    sp<GraphicBuffer> buffer;
+
+    setupDequeueRequestBuffer(&slot, &fence, &buffer);
+
+    ASSERT_OK(mProducer->detachBuffer(slot));
+
+    ASSERT_OK(mProducer->disconnect(TEST_API));
 
+    ASSERT_EQ(NO_INIT, mProducer->attachBuffer(&slot, buffer));
 }
 
 } // namespace android
index 00cc39d..c7ce263 100644 (file)
@@ -103,7 +103,7 @@ TEST_F(StreamSplitterTest, OneInputOneOutput) {
     sp<Fence> fence;
     sp<GraphicBuffer> buffer;
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            inputProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0,
+            inputProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
                     GRALLOC_USAGE_SW_WRITE_OFTEN));
     ASSERT_EQ(OK, inputProducer->requestBuffer(slot, &buffer));
 
@@ -114,9 +114,8 @@ TEST_F(StreamSplitterTest, OneInputOneOutput) {
     ASSERT_EQ(OK, buffer->unlock());
 
     IGraphicBufferProducer::QueueBufferInput qbInput(0, false,
-            HAL_DATASPACE_UNKNOWN,
-            Rect(0, 0, 1, 1), NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, false,
-            Fence::NO_FENCE);
+            HAL_DATASPACE_UNKNOWN, Rect(0, 0, 1, 1),
+            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, Fence::NO_FENCE);
     ASSERT_EQ(OK, inputProducer->queueBuffer(slot, qbInput, &qbOutput));
 
     BufferItem item;
@@ -128,11 +127,11 @@ TEST_F(StreamSplitterTest, OneInputOneOutput) {
     ASSERT_EQ(*dataOut, TEST_DATA);
     ASSERT_EQ(OK, item.mGraphicBuffer->unlock());
 
-    ASSERT_EQ(OK, outputConsumer->releaseBuffer(item.mBuf, item.mFrameNumber,
+    ASSERT_EQ(OK, outputConsumer->releaseBuffer(item.mSlot, item.mFrameNumber,
             EGL_NO_DISPLAY, EGL_NO_SYNC_KHR, Fence::NO_FENCE));
 
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            inputProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0,
+            inputProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
                     GRALLOC_USAGE_SW_WRITE_OFTEN));
 
     ASSERT_EQ(1, allocator->getAllocCount());
@@ -170,7 +169,7 @@ TEST_F(StreamSplitterTest, OneInputMultipleOutputs) {
     sp<Fence> fence;
     sp<GraphicBuffer> buffer;
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            inputProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0,
+            inputProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
                     GRALLOC_USAGE_SW_WRITE_OFTEN));
     ASSERT_EQ(OK, inputProducer->requestBuffer(slot, &buffer));
 
@@ -181,9 +180,8 @@ TEST_F(StreamSplitterTest, OneInputMultipleOutputs) {
     ASSERT_EQ(OK, buffer->unlock());
 
     IGraphicBufferProducer::QueueBufferInput qbInput(0, false,
-            HAL_DATASPACE_UNKNOWN,
-            Rect(0, 0, 1, 1), NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, false,
-            Fence::NO_FENCE);
+            HAL_DATASPACE_UNKNOWN, Rect(0, 0, 1, 1),
+            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, Fence::NO_FENCE);
     ASSERT_EQ(OK, inputProducer->queueBuffer(slot, qbInput, &qbOutput));
 
     for (int output = 0; output < NUM_OUTPUTS; ++output) {
@@ -196,13 +194,13 @@ TEST_F(StreamSplitterTest, OneInputMultipleOutputs) {
         ASSERT_EQ(*dataOut, TEST_DATA);
         ASSERT_EQ(OK, item.mGraphicBuffer->unlock());
 
-        ASSERT_EQ(OK, outputConsumers[output]->releaseBuffer(item.mBuf,
+        ASSERT_EQ(OK, outputConsumers[output]->releaseBuffer(item.mSlot,
                     item.mFrameNumber, EGL_NO_DISPLAY, EGL_NO_SYNC_KHR,
                     Fence::NO_FENCE));
     }
 
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            inputProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0,
+            inputProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
                     GRALLOC_USAGE_SW_WRITE_OFTEN));
 
     ASSERT_EQ(1, allocator->getAllocCount());
@@ -231,7 +229,7 @@ TEST_F(StreamSplitterTest, OutputAbandonment) {
     sp<Fence> fence;
     sp<GraphicBuffer> buffer;
     ASSERT_EQ(IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION,
-            inputProducer->dequeueBuffer(&slot, &fence, false, 0, 0, 0,
+            inputProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
                     GRALLOC_USAGE_SW_WRITE_OFTEN));
     ASSERT_EQ(OK, inputProducer->requestBuffer(slot, &buffer));
 
@@ -239,14 +237,13 @@ TEST_F(StreamSplitterTest, OutputAbandonment) {
     outputConsumer->consumerDisconnect();
 
     IGraphicBufferProducer::QueueBufferInput qbInput(0, false,
-            HAL_DATASPACE_UNKNOWN,
-            Rect(0, 0, 1, 1), NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, false,
-            Fence::NO_FENCE);
+            HAL_DATASPACE_UNKNOWN, Rect(0, 0, 1, 1),
+            NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, Fence::NO_FENCE);
     ASSERT_EQ(OK, inputProducer->queueBuffer(slot, qbInput, &qbOutput));
 
     // Input should be abandoned
-    ASSERT_EQ(NO_INIT, inputProducer->dequeueBuffer(&slot, &fence, false, 0, 0,
-            0, GRALLOC_USAGE_SW_WRITE_OFTEN));
+    ASSERT_EQ(NO_INIT, inputProducer->dequeueBuffer(&slot, &fence, 0, 0, 0,
+            GRALLOC_USAGE_SW_WRITE_OFTEN));
 }
 
 } // namespace android
index 1a50b24..2356f54 100644 (file)
@@ -37,7 +37,8 @@ protected:
     SurfaceTextureClientTest():
             mEglDisplay(EGL_NO_DISPLAY),
             mEglSurface(EGL_NO_SURFACE),
-            mEglContext(EGL_NO_CONTEXT) {
+            mEglContext(EGL_NO_CONTEXT),
+            mEglConfig(NULL) {
     }
 
     virtual void SetUp() {
@@ -215,6 +216,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometryInvalidSizesFail) {
 }
 
 TEST_F(SurfaceTextureClientTest, DefaultGeometryValues) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ANativeWindowBuffer* buf;
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf));
     EXPECT_EQ(1, buf->width);
@@ -224,6 +226,7 @@ TEST_F(SurfaceTextureClientTest, DefaultGeometryValues) {
 }
 
 TEST_F(SurfaceTextureClientTest, BufferGeometryCanBeSet) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ANativeWindowBuffer* buf;
     EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 16, 8));
     EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), PIXEL_FORMAT_RGB_565));
@@ -235,6 +238,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometryCanBeSet) {
 }
 
 TEST_F(SurfaceTextureClientTest, BufferGeometryDefaultSizeSetFormat) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ANativeWindowBuffer* buf;
     EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 0, 0));
     EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), PIXEL_FORMAT_RGB_565));
@@ -246,6 +250,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometryDefaultSizeSetFormat) {
 }
 
 TEST_F(SurfaceTextureClientTest, BufferGeometrySetSizeDefaultFormat) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ANativeWindowBuffer* buf;
     EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 16, 8));
     EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), 0));
@@ -257,6 +262,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometrySetSizeDefaultFormat) {
 }
 
 TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeUnset) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ANativeWindowBuffer* buf;
     EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 16, 8));
     EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), 0));
@@ -275,6 +281,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeUnset) {
 }
 
 TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeChangedWithoutFormat) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ANativeWindowBuffer* buf;
     EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 0, 0));
     EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), PIXEL_FORMAT_RGB_565));
@@ -292,6 +299,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeChangedWithoutFormat) {
 }
 
 TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSize) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     sp<GLConsumer> st(mST);
     ANativeWindowBuffer* buf;
     EXPECT_EQ(OK, st->setDefaultBufferSize(16, 8));
@@ -304,6 +312,7 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSize) {
 
 TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeAfterDequeue) {
     ANativeWindowBuffer* buf[2];
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0]));
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1]));
@@ -324,6 +333,7 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeAfterDequeue) {
 
 TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeVsGeometry) {
     ANativeWindowBuffer* buf[2];
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
     EXPECT_EQ(OK, mST->setDefaultBufferSize(16, 8));
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0]));
@@ -350,6 +360,7 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeVsGeometry) {
 
 TEST_F(SurfaceTextureClientTest, SurfaceTextureTooManyUpdateTexImage) {
     android_native_buffer_t* buf[3];
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, mANW->setSwapInterval(mANW.get(), 0));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
 
@@ -373,6 +384,7 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureTooManyUpdateTexImage) {
 
 TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeSlowRetire) {
     android_native_buffer_t* buf[3];
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0]));
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1]));
@@ -393,6 +405,7 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeSlowRetire) {
 
 TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeFastRetire) {
     android_native_buffer_t* buf[3];
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0]));
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1]));
@@ -413,8 +426,8 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeFastRetire) {
 
 TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeDQQR) {
     android_native_buffer_t* buf[3];
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3));
-
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0]));
     ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1));
     EXPECT_EQ(OK, mST->updateTexImage());
@@ -438,6 +451,7 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeDQQR) {
 TEST_F(SurfaceTextureClientTest, DISABLED_SurfaceTextureSyncModeDequeueCurrent) {
     android_native_buffer_t* buf[3];
     android_native_buffer_t* firstBuf;
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3));
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &firstBuf));
     ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), firstBuf, -1));
@@ -457,6 +471,7 @@ TEST_F(SurfaceTextureClientTest, DISABLED_SurfaceTextureSyncModeDequeueCurrent)
 
 TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeMinUndequeued) {
     android_native_buffer_t* buf[3];
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3));
 
     // We should be able to dequeue all the buffers before we've queued mANWy.
@@ -482,6 +497,7 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeMinUndequeued) {
 }
 
 TEST_F(SurfaceTextureClientTest, SetCropCropsCrop) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     android_native_rect_t rect = {-2, -13, 40, 18};
     native_window_set_crop(mANW.get(), &rect);
 
@@ -536,6 +552,7 @@ TEST_F(SurfaceTextureClientTest, DISABLED_SurfaceTextureSyncModeWaitRetire) {
     };
 
     android_native_buffer_t* buf[3];
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3));
     // dequeue/queue/update so we have a current buffer
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0]));
@@ -559,6 +576,7 @@ TEST_F(SurfaceTextureClientTest, DISABLED_SurfaceTextureSyncModeWaitRetire) {
 TEST_F(SurfaceTextureClientTest, GetTransformMatrixReturnsVerticalFlip) {
     android_native_buffer_t* buf[3];
     float mtx[16] = {};
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0]));
     ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1));
@@ -589,6 +607,7 @@ TEST_F(SurfaceTextureClientTest, GetTransformMatrixReturnsVerticalFlip) {
 TEST_F(SurfaceTextureClientTest, GetTransformMatrixSucceedsAfterFreeingBuffers) {
     android_native_buffer_t* buf[3];
     float mtx[16] = {};
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
     ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0]));
     ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1));
@@ -638,6 +657,7 @@ TEST_F(SurfaceTextureClientTest, GetTransformMatrixSucceedsAfterFreeingBuffersWi
     crop.right = 5;
     crop.bottom = 5;
 
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4));
     ASSERT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 8, 8));
     ASSERT_EQ(OK, native_window_set_buffers_format(mANW.get(), 0));
index c243fc0..0606839 100644 (file)
@@ -27,6 +27,8 @@ TEST_F(SurfaceTextureFBOTest, BlitFromCpuFilledBufferToFbo) {
     const int texWidth = 64;
     const int texHeight = 64;
 
+    ASSERT_EQ(NO_ERROR, native_window_api_connect(mANW.get(),
+            NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_dimensions(mANW.get(),
             texWidth, texHeight));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_format(mANW.get(),
index 9776733..c4d0aaa 100644 (file)
@@ -31,6 +31,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest,
         }
     };
 
+    SetUpWindowAndContext();
+
     runProducerThread(new PT());
 
     mFC->waitForFrame();
@@ -50,6 +52,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest,
         }
     };
 
+    SetUpWindowAndContext();
+
     runProducerThread(new PT());
 
     mFC->waitForFrame();
@@ -75,6 +79,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest,
         }
     };
 
+    SetUpWindowAndContext();
+
     runProducerThread(new PT());
 
     for (int i = 0; i < NUM_ITERATIONS; i++) {
@@ -104,6 +110,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest,
         }
     };
 
+    SetUpWindowAndContext();
+
     runProducerThread(new PT());
 
     for (int i = 0; i < NUM_ITERATIONS; i++) {
@@ -134,7 +142,7 @@ TEST_F(SurfaceTextureGLThreadToGLTest,
         }
     };
 
-    ASSERT_EQ(OK, mST->setDefaultMaxBufferCount(2));
+    SetUpWindowAndContext();
 
     runProducerThread(new PT());
 
index 5a2eff3..5d43a48 100644 (file)
@@ -34,7 +34,9 @@ protected:
 
     virtual void SetUp() {
         SurfaceTextureGLTest::SetUp();
+    }
 
+    void SetUpWindowAndContext() {
         mProducerEglSurface = eglCreateWindowSurface(mEglDisplay, mGlConfig,
                 mANW.get(), NULL);
         ASSERT_EQ(EGL_SUCCESS, eglGetError());
index 6edbfb8..c28b4d1 100644 (file)
@@ -29,8 +29,11 @@ TEST_F(SurfaceTextureGLToGLTest, TransformHintGetsRespected) {
     mST->setTransformHint(NATIVE_WINDOW_TRANSFORM_ROT_90);
 
     // This test requires 3 buffers to avoid deadlock because we're
-    // both producer and consumer, and only using one thread.
-    mST->setDefaultMaxBufferCount(3);
+    // both producer and consumer, and only using one thread. Set max dequeued
+    // to 2, and max acquired already defaults to 1.
+    ASSERT_EQ(OK, mSTC->setMaxDequeuedBufferCount(2));
+
+    SetUpWindowAndContext();
 
     // Do the producer side of things
     EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mProducerEglSurface,
@@ -81,7 +84,10 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromGLFilledRGBABufferPow2) {
     mST->setDefaultBufferSize(texWidth, texHeight);
 
     // This test requires 3 buffers to complete run on a single thread.
-    mST->setDefaultMaxBufferCount(3);
+    // Set max dequeued to 2, and max acquired already defaults to 1.
+    ASSERT_EQ(OK, mSTC->setMaxDequeuedBufferCount(2));
+
+    SetUpWindowAndContext();
 
     // Do the producer side of things
     EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mProducerEglSurface,
@@ -150,6 +156,7 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromGLFilledRGBABufferPow2) {
 }
 
 TEST_F(SurfaceTextureGLToGLTest, EglDestroySurfaceUnrefsBuffers) {
+    SetUpWindowAndContext();
     sp<GraphicBuffer> buffers[2];
 
     // This test requires async mode to run on a single thread.
@@ -195,6 +202,7 @@ TEST_F(SurfaceTextureGLToGLTest, EglDestroySurfaceUnrefsBuffers) {
 }
 
 TEST_F(SurfaceTextureGLToGLTest, EglDestroySurfaceAfterAbandonUnrefsBuffers) {
+    SetUpWindowAndContext();
     sp<GraphicBuffer> buffers[3];
 
     // This test requires async mode to run on a single thread.
@@ -252,6 +260,7 @@ TEST_F(SurfaceTextureGLToGLTest, EglDestroySurfaceAfterAbandonUnrefsBuffers) {
 }
 
 TEST_F(SurfaceTextureGLToGLTest, EglMakeCurrentBeforeConsumerDeathUnrefsBuffers) {
+    SetUpWindowAndContext();
     sp<GraphicBuffer> buffer;
 
     EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mProducerEglSurface,
@@ -289,6 +298,7 @@ TEST_F(SurfaceTextureGLToGLTest, EglMakeCurrentBeforeConsumerDeathUnrefsBuffers)
 }
 
 TEST_F(SurfaceTextureGLToGLTest, EglMakeCurrentAfterConsumerDeathUnrefsBuffers) {
+    SetUpWindowAndContext();
     sp<GraphicBuffer> buffer;
 
     EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mProducerEglSurface,
@@ -330,7 +340,10 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromUserSizedGLFilledBuffer) {
     enum { texHeight = 64 };
 
     // This test requires 3 buffers to complete run on a single thread.
-    mST->setDefaultMaxBufferCount(3);
+    // Set max dequeued to 2, and max acquired already defaults to 1.
+    ASSERT_EQ(OK, mSTC->setMaxDequeuedBufferCount(2));
+
+    SetUpWindowAndContext();
 
     // Set the user buffer size.
     native_window_set_buffers_user_dimensions(mANW.get(), texWidth, texHeight);
@@ -387,7 +400,10 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromPreRotatedUserSizedGLFilledBuffer)
     enum { texHeight = 16 };
 
     // This test requires 3 buffers to complete run on a single thread.
-    mST->setDefaultMaxBufferCount(3);
+    // Set max dequeued to 2, and max acquired already defaults to 1.
+    ASSERT_EQ(OK, mSTC->setMaxDequeuedBufferCount(2));
+
+    SetUpWindowAndContext();
 
     // Set the transform hint.
     mST->setTransformHint(NATIVE_WINDOW_TRANSFORM_ROT_90);
@@ -448,7 +464,10 @@ TEST_F(SurfaceTextureGLToGLTest, TexturingFromPreRotatedGLFilledBuffer) {
     enum { texHeight = 16 };
 
     // This test requires 3 buffers to complete run on a single thread.
-    mST->setDefaultMaxBufferCount(3);
+    // Set max dequeued to 2, and max acquired already defaults to 1.
+    ASSERT_EQ(OK, mSTC->setMaxDequeuedBufferCount(2));
+
+    SetUpWindowAndContext();
 
     // Set the transform hint.
     mST->setTransformHint(NATIVE_WINDOW_TRANSFORM_ROT_90);
index fad133f..1a904b5 100644 (file)
@@ -28,6 +28,8 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferNpot) {
     const int texWidth = 64;
     const int texHeight = 66;
 
+    ASSERT_EQ(NO_ERROR, native_window_api_connect(mANW.get(),
+            NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_dimensions(mANW.get(),
             texWidth, texHeight));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_format(mANW.get(),
@@ -76,6 +78,8 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferPow2) {
     const int texWidth = 64;
     const int texHeight = 64;
 
+    ASSERT_EQ(NO_ERROR, native_window_api_connect(mANW.get(),
+            NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_dimensions(mANW.get(),
             texWidth, texHeight));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_format(mANW.get(),
@@ -124,6 +128,8 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferWithCrop) {
     const int texWidth = 64;
     const int texHeight = 66;
 
+    ASSERT_EQ(NO_ERROR, native_window_api_connect(mANW.get(),
+            NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_dimensions(mANW.get(),
             texWidth, texHeight));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_format(mANW.get(),
@@ -190,7 +196,8 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BuffersRepeatedly) {
     enum { texHeight = 16 };
     enum { numFrames = 1024 };
 
-    ASSERT_EQ(NO_ERROR, mST->setDefaultMaxBufferCount(2));
+    ASSERT_EQ(NO_ERROR, native_window_api_connect(mANW.get(),
+            NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_dimensions(mANW.get(),
             texWidth, texHeight));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_format(mANW.get(),
@@ -334,6 +341,8 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledRGBABufferNpot) {
     const int texWidth = 64;
     const int texHeight = 66;
 
+    ASSERT_EQ(NO_ERROR, native_window_api_connect(mANW.get(),
+            NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_dimensions(mANW.get(),
             texWidth, texHeight));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_format(mANW.get(),
@@ -378,6 +387,8 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledRGBABufferPow2) {
     const int texWidth = 64;
     const int texHeight = 64;
 
+    ASSERT_EQ(NO_ERROR, native_window_api_connect(mANW.get(),
+            NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_dimensions(mANW.get(),
             texWidth, texHeight));
     ASSERT_EQ(NO_ERROR, native_window_set_buffers_format(mANW.get(),
@@ -436,7 +447,10 @@ TEST_F(SurfaceTextureGLTest, DisconnectStressTest) {
         virtual bool threadLoop() {
             ANativeWindowBuffer* anb;
 
-            native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_EGL);
+            if (native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU) !=
+                    NO_ERROR) {
+                return false;
+            }
 
             for (int numFrames =0 ; numFrames < 2; numFrames ++) {
 
@@ -453,7 +467,10 @@ TEST_F(SurfaceTextureGLTest, DisconnectStressTest) {
                 }
             }
 
-            native_window_api_disconnect(mANW.get(), NATIVE_WINDOW_API_EGL);
+            if (native_window_api_disconnect(mANW.get(), NATIVE_WINDOW_API_CPU)
+                    != NO_ERROR) {
+                return false;
+            }
 
             return false;
         }
@@ -487,7 +504,7 @@ TEST_F(SurfaceTextureGLTest, DisconnectStressTest) {
 // attempt to release a buffer that it does not owned
 TEST_F(SurfaceTextureGLTest, DisconnectClearsCurrentTexture) {
     ASSERT_EQ(OK, native_window_api_connect(mANW.get(),
-            NATIVE_WINDOW_API_EGL));
+            NATIVE_WINDOW_API_CPU));
 
     ANativeWindowBuffer *anb;
 
@@ -501,9 +518,9 @@ TEST_F(SurfaceTextureGLTest, DisconnectClearsCurrentTexture) {
     EXPECT_EQ(OK,mST->updateTexImage());
 
     ASSERT_EQ(OK, native_window_api_disconnect(mANW.get(),
-            NATIVE_WINDOW_API_EGL));
+            NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(OK, native_window_api_connect(mANW.get(),
-            NATIVE_WINDOW_API_EGL));
+            NATIVE_WINDOW_API_CPU));
 
     EXPECT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &anb));
     EXPECT_EQ(OK, mANW->queueBuffer(mANW.get(), anb, -1));
@@ -513,7 +530,7 @@ TEST_F(SurfaceTextureGLTest, DisconnectClearsCurrentTexture) {
     EXPECT_EQ(OK,mST->updateTexImage());
 
     ASSERT_EQ(OK, native_window_api_disconnect(mANW.get(),
-            NATIVE_WINDOW_API_EGL));
+            NATIVE_WINDOW_API_CPU));
 }
 
 TEST_F(SurfaceTextureGLTest, ScaleToWindowMode) {
@@ -615,6 +632,11 @@ TEST_F(SurfaceTextureGLTest, AbandonUnblocksDequeueBuffer) {
             Mutex::Autolock lock(mMutex);
             ANativeWindowBuffer* anb;
 
+            if (native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU) !=
+                    NO_ERROR) {
+                return false;
+            }
+
             // Frame 1
             if (native_window_dequeue_buffer_and_wait(mANW.get(),
                     &anb) != NO_ERROR) {
@@ -658,8 +680,6 @@ TEST_F(SurfaceTextureGLTest, AbandonUnblocksDequeueBuffer) {
         Mutex mMutex;
     };
 
-    ASSERT_EQ(OK, mST->setDefaultMaxBufferCount(2));
-
     sp<Thread> pt(new ProducerThread(mANW));
     pt->run();
 
@@ -681,6 +701,9 @@ TEST_F(SurfaceTextureGLTest, InvalidWidthOrHeightFails) {
     int texHeight = 16;
     ANativeWindowBuffer* anb;
 
+    ASSERT_EQ(NO_ERROR, native_window_api_connect(mANW.get(),
+            NATIVE_WINDOW_API_CPU));
+
     GLint maxTextureSize;
     glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
 
index 7934bbc..3cca035 100644 (file)
@@ -27,7 +27,8 @@ protected:
     enum { THIRD_TEX_ID = 456 };
 
     SurfaceTextureMultiContextGLTest():
-            mSecondEglContext(EGL_NO_CONTEXT) {
+            mSecondEglContext(EGL_NO_CONTEXT),
+            mThirdEglContext(EGL_NO_CONTEXT) {
     }
 
     virtual void SetUp() {
index 1cd101e..5b02dcf 100644 (file)
@@ -26,6 +26,7 @@
 namespace android {
 
 TEST_F(SurfaceTextureMultiContextGLTest, UpdateFromMultipleContextsFails) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -40,6 +41,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, UpdateFromMultipleContextsFails) {
 }
 
 TEST_F(SurfaceTextureMultiContextGLTest, DetachFromContextSucceeds) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -55,6 +57,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, DetachFromContextSucceeds) {
 
 TEST_F(SurfaceTextureMultiContextGLTest,
         DetachFromContextSucceedsAfterProducerDisconnect) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -70,6 +73,7 @@ TEST_F(SurfaceTextureMultiContextGLTest,
 }
 
 TEST_F(SurfaceTextureMultiContextGLTest, DetachFromContextFailsWhenAbandoned) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -82,6 +86,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, DetachFromContextFailsWhenAbandoned) {
 }
 
 TEST_F(SurfaceTextureMultiContextGLTest, DetachFromContextFailsWhenDetached) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -96,6 +101,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, DetachFromContextFailsWhenDetached) {
 }
 
 TEST_F(SurfaceTextureMultiContextGLTest, DetachFromContextFailsWithNoDisplay) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -112,6 +118,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, DetachFromContextFailsWithNoDisplay) {
 }
 
 TEST_F(SurfaceTextureMultiContextGLTest, DetachFromContextFailsWithNoContext) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -128,6 +135,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, DetachFromContextFailsWithNoContext) {
 }
 
 TEST_F(SurfaceTextureMultiContextGLTest, UpdateTexImageFailsWhenDetached) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Detach from the primary context.
@@ -139,6 +147,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, UpdateTexImageFailsWhenDetached) {
 }
 
 TEST_F(SurfaceTextureMultiContextGLTest, AttachToContextSucceeds) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -169,6 +178,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, AttachToContextSucceeds) {
 
 TEST_F(SurfaceTextureMultiContextGLTest,
         AttachToContextSucceedsAfterProducerDisconnect) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -200,6 +210,7 @@ TEST_F(SurfaceTextureMultiContextGLTest,
 
 TEST_F(SurfaceTextureMultiContextGLTest,
         AttachToContextSucceedsBeforeUpdateTexImage) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Detach from the primary context.
@@ -230,6 +241,7 @@ TEST_F(SurfaceTextureMultiContextGLTest,
 }
 
 TEST_F(SurfaceTextureMultiContextGLTest, AttachToContextFailsWhenAbandoned) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -247,6 +259,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, AttachToContextFailsWhenAbandoned) {
 }
 
 TEST_F(SurfaceTextureMultiContextGLTest, AttachToContextFailsWhenAttached) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -259,6 +272,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, AttachToContextFailsWhenAttached) {
 
 TEST_F(SurfaceTextureMultiContextGLTest,
         AttachToContextFailsWhenAttachedBeforeUpdateTexImage) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Attempt to attach to the primary context.
@@ -266,6 +280,7 @@ TEST_F(SurfaceTextureMultiContextGLTest,
 }
 
 TEST_F(SurfaceTextureMultiContextGLTest, AttachToContextFailsWithNoDisplay) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -285,6 +300,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, AttachToContextFailsWithNoDisplay) {
 }
 
 TEST_F(SurfaceTextureMultiContextGLTest, AttachToContextSucceedsTwice) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Latch the texture contents on the primary context.
@@ -323,6 +339,7 @@ TEST_F(SurfaceTextureMultiContextGLTest, AttachToContextSucceedsTwice) {
 
 TEST_F(SurfaceTextureMultiContextGLTest,
         AttachToContextSucceedsTwiceBeforeUpdateTexImage) {
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
 
     // Detach from the primary context.
@@ -361,7 +378,7 @@ TEST_F(SurfaceTextureMultiContextGLTest,
 
 TEST_F(SurfaceTextureMultiContextGLTest,
         UpdateTexImageSucceedsForBufferConsumedBeforeDetach) {
-    ASSERT_EQ(NO_ERROR, mST->setDefaultMaxBufferCount(2));
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
 
     // produce two frames and consume them both on the primary context
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
@@ -388,7 +405,7 @@ TEST_F(SurfaceTextureMultiContextGLTest,
 
 TEST_F(SurfaceTextureMultiContextGLTest,
        AttachAfterDisplayTerminatedSucceeds) {
-    ASSERT_EQ(NO_ERROR, mST->setDefaultMaxBufferCount(2));
+    ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU));
 
     // produce two frames and consume them both on the primary context
     ASSERT_NO_FATAL_FAILURE(produceOneRGBA8Frame(mANW));
index 3f495f8..6f0104a 100644 (file)
@@ -100,6 +100,8 @@ TEST_F(SurfaceTest, ScreenshotsOfProtectedBuffersSucceed) {
     ASSERT_EQ(NO_ERROR, sf->captureScreen(display, producer, Rect(),
             64, 64, 0, 0x7fffffff, false));
 
+    ASSERT_EQ(NO_ERROR, native_window_api_connect(anw.get(),
+            NATIVE_WINDOW_API_CPU));
     // Set the PROTECTED usage bit and verify that the screenshot fails.  Note
     // that we need to dequeue a buffer in order for it to actually get
     // allocated in SurfaceFlinger.
@@ -190,6 +192,8 @@ TEST_F(SurfaceTest, SettingGenerationNumber) {
     // Allocate a buffer with a generation number of 0
     ANativeWindowBuffer* buffer;
     int fenceFd;
+    ASSERT_EQ(NO_ERROR, native_window_api_connect(window.get(),
+            NATIVE_WINDOW_API_CPU));
     ASSERT_EQ(NO_ERROR, window->dequeueBuffer(window.get(), &buffer, &fenceFd));
     ASSERT_EQ(NO_ERROR, window->cancelBuffer(window.get(), buffer, fenceFd));
 
index 90951b3..e822e6e 100644 (file)
@@ -28,7 +28,8 @@
 namespace android {
 
 TextureRenderer::TextureRenderer(GLuint texName,
-        const sp<GLConsumer>& st) : mTexName(texName), mST(st) {
+        const sp<GLConsumer>& st) : mTexName(texName), mST(st), mPgm(0),
+        mPositionHandle(-1), mTexSamplerHandle(-1), mTexMatrixHandle(-1) {
 }
 
 void TextureRenderer::SetUp() {
index dd01a93..fe649fb 100644 (file)
@@ -607,6 +607,10 @@ sp<KeyCharacterMap> KeyCharacterMap::readFromParcel(Parcel* parcel) {
     if (parcel->errorCheck()) {
         return NULL;
     }
+    if (numKeys > MAX_KEYS) {
+        ALOGE("Too many keys in KeyCharacterMap (%d > %d)", numKeys, MAX_KEYS);
+        return NULL;
+    }
 
     for (size_t i = 0; i < numKeys; i++) {
         int32_t keyCode = parcel->readInt32();
index 3ead25c..59db157 100644 (file)
@@ -74,7 +74,7 @@ private:
  */
 
 FramebufferNativeWindow::FramebufferNativeWindow()
-    : BASE(), fbDev(0), grDev(0), mUpdateOnDemand(false)
+    : BASE(), fbDev(0), grDev(0), mCurrentBufferIndex(0), mUpdateOnDemand(false)
 {
     hw_module_t const* module;
     if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module) == 0) {
index e55db30..4fe0946 100644 (file)
@@ -43,7 +43,7 @@ static uint64_t getUniqueId() {
 
 GraphicBuffer::GraphicBuffer()
     : BASE(), mOwner(ownData), mBufferMapper(GraphicBufferMapper::get()),
-      mInitCheck(NO_ERROR), mId(getUniqueId())
+      mInitCheck(NO_ERROR), mId(getUniqueId()), mGenerationNumber(0)
 {
     width  =
     height =
@@ -56,7 +56,7 @@ GraphicBuffer::GraphicBuffer()
 GraphicBuffer::GraphicBuffer(uint32_t inWidth, uint32_t inHeight,
         PixelFormat inFormat, uint32_t inUsage)
     : BASE(), mOwner(ownData), mBufferMapper(GraphicBufferMapper::get()),
-      mInitCheck(NO_ERROR), mId(getUniqueId())
+      mInitCheck(NO_ERROR), mId(getUniqueId()), mGenerationNumber(0)
 {
     width  =
     height =
@@ -72,7 +72,7 @@ GraphicBuffer::GraphicBuffer(uint32_t inWidth, uint32_t inHeight,
         native_handle_t* inHandle, bool keepOwnership)
     : BASE(), mOwner(keepOwnership ? ownHandle : ownNone),
       mBufferMapper(GraphicBufferMapper::get()),
-      mInitCheck(NO_ERROR), mId(getUniqueId())
+      mInitCheck(NO_ERROR), mId(getUniqueId()), mGenerationNumber(0)
 {
     width  = static_cast<int>(inWidth);
     height = static_cast<int>(inHeight);
@@ -85,7 +85,8 @@ GraphicBuffer::GraphicBuffer(uint32_t inWidth, uint32_t inHeight,
 GraphicBuffer::GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership)
     : BASE(), mOwner(keepOwnership ? ownHandle : ownNone),
       mBufferMapper(GraphicBufferMapper::get()),
-      mInitCheck(NO_ERROR), mWrappedBuffer(buffer), mId(getUniqueId())
+      mInitCheck(NO_ERROR), mWrappedBuffer(buffer), mId(getUniqueId()),
+      mGenerationNumber(0)
 {
     width  = buffer->width;
     height = buffer->height;
@@ -112,6 +113,7 @@ void GraphicBuffer::free_handle()
         GraphicBufferAllocator& allocator(GraphicBufferAllocator::get());
         allocator.free(handle);
     }
+    handle = NULL;
     mWrappedBuffer = 0;
 }
 
index dcce21f..99cbedc 100644 (file)
@@ -20,6 +20,7 @@
 namespace android {
 
 const Rect Rect::INVALID_RECT{0, 0, -1, -1};
+const Rect Rect::EMPTY_RECT{0, 0, 0, 0};
 
 static inline int32_t min(int32_t a, int32_t b) {
     return (a < b) ? a : b;
@@ -110,7 +111,7 @@ Rect Rect::transform(uint32_t xform, int32_t width, int32_t height) const {
 }
 
 Rect Rect::reduce(const Rect& exclude) const {
-    Rect result;
+    Rect result(Rect::EMPTY_RECT);
 
     uint32_t mask = 0;
     mask |= (exclude.left   > left)   ? 1 : 0;
index a3558bd..ac37990 100644 (file)
@@ -798,7 +798,7 @@ status_t Region::unflatten(void const* buffer, size_t size) {
     Region result;
     result.mStorage.clear();
     for (size_t r = 0; r < numRects; ++r) {
-        Rect rect;
+        Rect rect(Rect::EMPTY_RECT);
         status_t status = rect.unflatten(buffer, size);
         if (status != NO_ERROR) {
             return status;
index f389c94..3f9e332 100644 (file)
@@ -27,12 +27,11 @@ LOCAL_SRC_FILES:=          \
        EGL/egl_object.cpp     \
        EGL/egl.cpp            \
        EGL/eglApi.cpp         \
-       EGL/trace.cpp              \
        EGL/getProcAddress.cpp.arm \
        EGL/Loader.cpp         \
 #
 
-LOCAL_SHARED_LIBRARIES += libcutils libutils liblog libGLES_trace
+LOCAL_SHARED_LIBRARIES += libcutils libutils liblog
 LOCAL_MODULE:= libEGL
 LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
 LOCAL_SHARED_LIBRARIES += libdl
@@ -42,7 +41,6 @@ LOCAL_C_INCLUDES += bionic/libc/private
 LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\"
 LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
 LOCAL_CFLAGS += -fvisibility=hidden
-LOCAL_CFLAGS += -DEGL_TRACE=1
 
 ifeq ($(BOARD_ALLOW_EGL_HIBERNATION),true)
   LOCAL_CFLAGS += -DBOARD_ALLOW_EGL_HIBERNATION
index 8df9af3..e593a72 100644 (file)
@@ -28,8 +28,6 @@
 
 #include <EGL/egl.h>
 
-#include "../glestrace.h"
-
 #include "egldefs.h"
 #include "Loader.h"
 
@@ -70,7 +68,9 @@ ANDROID_SINGLETON_STATIC_INSTANCE( Loader )
  *  -1   -> not running inside the emulator
  *   0   -> running inside the emulator, but GPU emulation not supported
  *   1   -> running inside the emulator, GPU emulation is supported
- *          through the "emulation" config.
+ *          through the "emulation" host-side OpenGL ES implementation.
+ *   2   -> running inside the emulator, GPU emulation is supported
+ *          through a guest-side vendor driver's OpenGL ES implementation.
  */
 static int
 checkGlesEmulationStatus(void)
@@ -158,7 +158,6 @@ Loader::Loader()
 }
 
 Loader::~Loader() {
-    GLTrace_stop();
 }
 
 static void* load_wrapper(const char* path) {
@@ -278,6 +277,30 @@ void *Loader::load_driver(const char* kind,
     public:
         static String8 find(const char* kind) {
             String8 result;
+            int emulationStatus = checkGlesEmulationStatus();
+            switch (emulationStatus) {
+                case 0:
+                    ALOGD("Emulator without GPU support detected. "
+                          "Fallback to legacy software renderer.");
+#if defined(__LP64__)
+                    result.setTo("/system/lib64/egl/libGLES_android.so");
+#else
+                    result.setTo("/system/lib/egl/libGLES_android.so");
+#endif
+                    return result;
+                case 1:
+                    // Use host-side OpenGL through the "emulation" library
+#if defined(__LP64__)
+                    result.appendFormat("/system/lib64/egl/lib%s_emulation.so", kind);
+#else
+                    result.appendFormat("/system/lib/egl/lib%s_emulation.so", kind);
+#endif
+                    return result;
+                default:
+                    // Not in emulator, or use other guest-side implementation
+                    break;
+            }
+
             String8 pattern;
             pattern.appendFormat("lib%s", kind);
             const char* const searchPaths[] = {
@@ -322,20 +345,6 @@ void *Loader::load_driver(const char* kind,
     private:
         static bool find(String8& result,
                 const String8& pattern, const char* const search, bool exact) {
-
-            // in the emulator case, we just return the hardcoded name
-            // of the software renderer.
-            if (checkGlesEmulationStatus() == 0) {
-                ALOGD("Emulator without GPU support detected. "
-                      "Fallback to software renderer.");
-#if defined(__LP64__)
-                result.setTo("/system/lib64/egl/libGLES_android.so");
-#else
-                result.setTo("/system/lib/egl/libGLES_android.so");
-#endif
-                return true;
-            }
-
             if (exact) {
                 String8 absolutePath;
                 absolutePath.appendFormat("%s/%s.so", search, pattern.string());
index 4e0e5bc..18cf261 100644 (file)
@@ -32,7 +32,6 @@
 #include <utils/String8.h>
 
 #include "../egl_impl.h"
-#include "../glestrace.h"
 
 #include "egl_tls.h"
 #include "egldefs.h"
@@ -54,161 +53,10 @@ pthread_key_t gGLWrapperKey = -1;
 
 // ----------------------------------------------------------------------------
 
-#if EGL_TRACE
-
-EGLAPI pthread_key_t gGLTraceKey = -1;
-
-// ----------------------------------------------------------------------------
-
-/**
- * There are three different tracing methods:
- * 1. libs/EGL/trace.cpp: Traces all functions to systrace.
- *    To enable:
- *      - set system property "debug.egl.trace" to "systrace" to trace all apps.
- * 2. libs/EGL/trace.cpp: Logs a stack trace for GL errors after each function call.
- *    To enable:
- *      - set system property "debug.egl.trace" to "error" to trace all apps.
- * 3. libs/EGL/trace.cpp: Traces all functions to logcat.
- *    To enable:
- *      - set system property "debug.egl.trace" to 1 to trace all apps.
- *      - or call setGLTraceLevel(1) from an app to enable tracing for that app.
- * 4. libs/GLES_trace: Traces all functions via protobuf to host.
- *    To enable:
- *        - set system property "debug.egl.debug_proc" to the application name.
- *      - or call setGLDebugLevel(1) from the app.
- */
-static int sEGLTraceLevel;
-static int sEGLApplicationTraceLevel;
-
-static bool sEGLSystraceEnabled;
-static bool sEGLGetErrorEnabled;
-
-static volatile int sEGLDebugLevel;
-
-extern gl_hooks_t gHooksTrace;
-extern gl_hooks_t gHooksSystrace;
-extern gl_hooks_t gHooksErrorTrace;
-
-int getEGLDebugLevel() {
-    return sEGLDebugLevel;
-}
-
-void setEGLDebugLevel(int level) {
-    sEGLDebugLevel = level;
-}
-
-static inline void setGlTraceThreadSpecific(gl_hooks_t const *value) {
-    pthread_setspecific(gGLTraceKey, value);
-}
-
-gl_hooks_t const* getGLTraceThreadSpecific() {
-    return static_cast<gl_hooks_t*>(pthread_getspecific(gGLTraceKey));
-}
-
-void initEglTraceLevel() {
-    char value[PROPERTY_VALUE_MAX];
-    property_get("debug.egl.trace", value, "0");
-
-    sEGLGetErrorEnabled = !strcasecmp(value, "error");
-    if (sEGLGetErrorEnabled) {
-        sEGLSystraceEnabled = false;
-        sEGLTraceLevel = 0;
-        return;
-    }
-
-    sEGLSystraceEnabled = !strcasecmp(value, "systrace");
-    if (sEGLSystraceEnabled) {
-        sEGLTraceLevel = 0;
-        return;
-    }
-
-    int propertyLevel = atoi(value);
-    int applicationLevel = sEGLApplicationTraceLevel;
-    sEGLTraceLevel = propertyLevel > applicationLevel ? propertyLevel : applicationLevel;
-}
-
-void initEglDebugLevel() {
-    if (getEGLDebugLevel() == 0) {
-        char value[PROPERTY_VALUE_MAX];
-
-        // check system property only on userdebug or eng builds
-        property_get("ro.debuggable", value, "0");
-        if (value[0] == '0')
-            return;
-
-        property_get("debug.egl.debug_proc", value, "");
-        if (strlen(value) > 0) {
-            FILE * file = fopen("/proc/self/cmdline", "r");
-            if (file) {
-                char cmdline[256];
-                if (fgets(cmdline, sizeof(cmdline), file)) {
-                    if (!strncmp(value, cmdline, strlen(value))) {
-                        // set EGL debug if the "debug.egl.debug_proc" property
-                        // matches the prefix of this application's command line
-                        setEGLDebugLevel(1);
-                    }
-                }
-                fclose(file);
-            }
-        }
-    }
-
-    if (getEGLDebugLevel() > 0) {
-        if (GLTrace_start() < 0) {
-            ALOGE("Error starting Tracer for OpenGL ES. Disabling..");
-            setEGLDebugLevel(0);
-        }
-    }
-}
-
-void setGLHooksThreadSpecific(gl_hooks_t const *value) {
-    if (sEGLGetErrorEnabled) {
-        setGlTraceThreadSpecific(value);
-        setGlThreadSpecific(&gHooksErrorTrace);
-    } else if (sEGLSystraceEnabled) {
-        setGlTraceThreadSpecific(value);
-        setGlThreadSpecific(&gHooksSystrace);
-    } else if (sEGLTraceLevel > 0) {
-        setGlTraceThreadSpecific(value);
-        setGlThreadSpecific(&gHooksTrace);
-    } else if (getEGLDebugLevel() > 0 && value != &gHooksNoContext) {
-        setGlTraceThreadSpecific(value);
-        setGlThreadSpecific(GLTrace_getGLHooks());
-    } else {
-        setGlTraceThreadSpecific(NULL);
-        setGlThreadSpecific(value);
-    }
-}
-
-/*
- * Global entry point to allow applications to modify their own trace level.
- * The effective trace level is the max of this level and the value of debug.egl.trace.
- */
-extern "C"
-void setGLTraceLevel(int level) {
-    sEGLApplicationTraceLevel = level;
-}
-
-/*
- * Global entry point to allow applications to modify their own debug level.
- * Debugging is enabled if either the application requested it, or if the system property
- * matches the application's name.
- * Note that this only sets the debug level. The value is read and used either in
- * initEglDebugLevel() if the application hasn't initialized its display yet, or when
- * eglSwapBuffers() is called next.
- */
-void EGLAPI setGLDebugLevel(int level) {
-    setEGLDebugLevel(level);
-}
-
-#else
-
 void setGLHooksThreadSpecific(gl_hooks_t const *value) {
     setGlThreadSpecific(value);
 }
 
-#endif
-
 /*****************************************************************************/
 
 static int gl_no_context() {
@@ -231,10 +79,6 @@ static int gl_no_context() {
 
 static void early_egl_init(void)
 {
-#if EGL_TRACE
-    pthread_key_create(&gGLTraceKey, NULL);
-    initEglTraceLevel();
-#endif
     int numHooks = sizeof(gHooksNoContext) / sizeof(EGLFuncPointer);
     EGLFuncPointer *iter = reinterpret_cast<EGLFuncPointer*>(&gHooksNoContext);
     for (int hook = 0; hook < numHooks; ++hook) {
index cdec565..5bd7464 100644 (file)
@@ -39,7 +39,6 @@
 #include <utils/Trace.h>
 
 #include "../egl_impl.h"
-#include "../glestrace.h"
 #include "../hooks.h"
 
 #include "egl_display.h"
@@ -231,8 +230,6 @@ static void(*findProcAddress(const char* name,
 extern void setGLHooksThreadSpecific(gl_hooks_t const *value);
 extern EGLBoolean egl_init_drivers();
 extern const __eglMustCastToProperFunctionPointerType gExtensionForwarders[MAX_NUMBER_OF_GL_EXTENSIONS];
-extern int getEGLDebugLevel();
-extern void setEGLDebugLevel(int level);
 extern gl_hooks_t gHooksTrace;
 
 } // namespace android;
@@ -674,10 +671,6 @@ EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config,
             }
             egl_context_t* c = new egl_context_t(dpy, context, config, cnx,
                     version);
-#if EGL_TRACE
-            if (getEGLDebugLevel() > 0)
-                GLTrace_eglCreateContext(version, c);
-#endif
             return c;
         }
     }
@@ -783,10 +776,6 @@ EGLBoolean eglMakeCurrent(  EGLDisplay dpy, EGLSurface draw,
         if (c) {
             setGLHooksThreadSpecific(c->cnx->hooks[c->version]);
             egl_tls_t::setContext(ctx);
-#if EGL_TRACE
-            if (getEGLDebugLevel() > 0)
-                GLTrace_eglMakeCurrent(c->version, c->cnx->hooks[c->version], ctx);
-#endif
             _c.acquire();
             _r.acquire();
             _d.acquire();
@@ -971,10 +960,6 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
                 "no more slots for eglGetProcAddress(\"%s\")",
                 procname);
 
-#if EGL_TRACE
-        gl_hooks_t *debugHooks = GLTrace_getGLHooks();
-#endif
-
         if (!addr && (slot < MAX_NUMBER_OF_GL_EXTENSIONS)) {
             bool found = false;
 
@@ -984,10 +969,6 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
                 addr =
                 cnx->hooks[egl_connection_t::GLESv1_INDEX]->ext.extensions[slot] =
                 cnx->hooks[egl_connection_t::GLESv2_INDEX]->ext.extensions[slot] =
-#if EGL_TRACE
-                debugHooks->ext.extensions[slot] =
-                gHooksTrace.ext.extensions[slot] =
-#endif
                         cnx->egl.eglGetProcAddress(procname);
                 if (addr) found = true;
             }
@@ -1079,34 +1060,6 @@ EGLBoolean eglSwapBuffersWithDamageKHR(EGLDisplay dpy, EGLSurface draw,
     if (!_s.get())
         return setError(EGL_BAD_SURFACE, EGL_FALSE);
 
-#if EGL_TRACE
-    gl_hooks_t const *trace_hooks = getGLTraceThreadSpecific();
-    if (getEGLDebugLevel() > 0) {
-        if (trace_hooks == NULL) {
-            if (GLTrace_start() < 0) {
-                ALOGE("Disabling Tracer for OpenGL ES");
-                setEGLDebugLevel(0);
-            } else {
-                // switch over to the trace version of hooks
-                EGLContext ctx = egl_tls_t::getContext();
-                egl_context_t * const c = get_context(ctx);
-                if (c) {
-                    setGLHooksThreadSpecific(c->cnx->hooks[c->version]);
-                    GLTrace_eglMakeCurrent(c->version, c->cnx->hooks[c->version], ctx);
-                }
-            }
-        }
-
-        GLTrace_eglSwapBuffers(dpy, draw);
-    } else if (trace_hooks != NULL) {
-        // tracing is now disabled, so switch back to the non trace version
-        EGLContext ctx = egl_tls_t::getContext();
-        egl_context_t * const c = get_context(ctx);
-        if (c) setGLHooksThreadSpecific(c->cnx->hooks[c->version]);
-        GLTrace_stop();
-    }
-#endif
-
     egl_surface_t const * const s = get_surface(draw);
 
     if (CC_UNLIKELY(dp->traceGpuCompletion)) {
@@ -1233,6 +1186,14 @@ EGLBoolean eglSurfaceAttrib(
         return setError(EGL_BAD_SURFACE, EGL_FALSE);
 
     egl_surface_t const * const s = get_surface(surface);
+
+    //XXX: temporary hack for the EGL hook-up for single buffer mode
+    if (attribute == EGL_RENDER_BUFFER && (value == EGL_BACK_BUFFER ||
+            value == EGL_SINGLE_BUFFER)) {
+        return (native_window_set_single_buffer_mode(s->win.get(),
+                value == EGL_SINGLE_BUFFER)) ? EGL_TRUE : EGL_FALSE;
+    }
+
     if (s->cnx->egl.eglSurfaceAttrib) {
         return s->cnx->egl.eglSurfaceAttrib(
                 dp->disp.dpy, s->surface, attribute, value);
@@ -1356,11 +1317,6 @@ EGLBoolean eglReleaseThread(void)
 {
     clearError();
 
-#if EGL_TRACE
-    if (getEGLDebugLevel() > 0)
-        GLTrace_eglReleaseThread();
-#endif
-
     // If there is context bound to the thread, release it
     egl_display_t::loseCurrent(get_context(getContext()));
 
index ec59235..ab21c8f 100644 (file)
@@ -38,8 +38,6 @@ static char const * const sClientApiString  = "OpenGL_ES";
 extern char const * const gBuiltinExtensionString;
 extern char const * const gExtensionString;
 
-extern void initEglTraceLevel();
-extern void initEglDebugLevel();
 extern void setGLHooksThreadSpecific(gl_hooks_t const *value);
 
 // ----------------------------------------------------------------------------
@@ -139,15 +137,6 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) {
     {
         Mutex::Autolock _l(lock);
 
-#if EGL_TRACE
-
-        // Called both at early_init time and at this time. (Early_init is pre-zygote, so
-        // the information from that call may be stale.)
-        initEglTraceLevel();
-        initEglDebugLevel();
-
-#endif
-
         setGLHooksThreadSpecific(&gHooksNoContext);
 
         // initialize each EGL and
@@ -189,25 +178,21 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) {
 
         mExtensionString.setTo(gBuiltinExtensionString);
         char const* start = gExtensionString;
-        char const* end;
         do {
-            // find the space separating this extension for the next one
-            end = strchr(start, ' ');
-            if (end) {
-                // length of the extension string
-                const size_t len = end - start;
-                if (len) {
-                    // NOTE: we could avoid the copy if we had strnstr.
-                    const String8 ext(start, len);
-                    if (findExtension(disp.queryString.extensions, ext.string(),
-                            len)) {
-                        mExtensionString.append(start, len+1);
-                    }
+            // length of the extension name
+            size_t len = strcspn(start, " ");
+            if (len) {
+                // NOTE: we could avoid the copy if we had strnstr.
+                const String8 ext(start, len);
+                if (findExtension(disp.queryString.extensions, ext.string(),
+                        len)) {
+                    mExtensionString.append(ext + " ");
                 }
-                // process the next extension string, and skip the space.
-                start = end + 1;
+                // advance to the next extension name, skipping the space.
+                start += len;
+                start += (*start == ' ') ? 1 : 0;
             }
-        } while (end);
+        } while (*start != '\0');
 
         egl_cache_t::get()->initialize(this);
 
index 5af4f5b..00eae0b 100644 (file)
@@ -68,14 +68,6 @@ public:
     egl_tls_t::setErrorEtc(__FUNCTION__, __LINE__, _e, _r, true)
 
 // ----------------------------------------------------------------------------
-
-#if EGL_TRACE
-
-extern gl_hooks_t const* getGLTraceThreadSpecific();
-
-#endif
-
-// ----------------------------------------------------------------------------
 }; // namespace android
 // ----------------------------------------------------------------------------
 
diff --git a/opengl/libs/EGL/trace.cpp b/opengl/libs/EGL/trace.cpp
deleted file mode 100644 (file)
index 4f07053..0000000
+++ /dev/null
@@ -1,463 +0,0 @@
-/*
- ** Copyright 2010, The Android Open Source Project
- **
- ** Licensed under the Apache License, Version 2.0 (the "License");
- ** you may not use this file except in compliance with the License.
- ** You may obtain a copy of the License at
- **
- **     http://www.apache.org/licenses/LICENSE-2.0
- **
- ** Unless required by applicable law or agreed to in writing, software
- ** distributed under the License is distributed on an "AS IS" BASIS,
- ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ** See the License for the specific language governing permissions and
- ** limitations under the License.
- */
-
-#if EGL_TRACE
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
-#include <cutils/log.h>
-
-#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-#include <utils/Trace.h>
-
-#include <utils/CallStack.h>
-
-#include "egl_tls.h"
-#include "hooks.h"
-
-// ----------------------------------------------------------------------------
-namespace android {
-// ----------------------------------------------------------------------------
-
-struct GLenumString {
-    // The GL_TIMEOUT_IGNORED "enum" doesn't fit in a GLenum, so use GLuint64
-    GLuint64 e;
-    const char* s;
-};
-
-#undef GL_ENUM
-#define GL_ENUM(VAL,NAME) {VAL, #NAME},
-
-static GLenumString g_enumnames[] = {
-#include "enums.in"
-};
-#undef GL_ENUM
-
-static int compareGLEnum(const void* a, const void* b) {
-    return ((const GLenumString*) a)->e - ((const GLenumString*) b)->e;
-}
-
-static const char* GLEnumToString(GLenum e) {
-    GLenumString key = {e, ""};
-    const GLenumString* result = (const GLenumString*) bsearch(
-        &key, g_enumnames,
-        sizeof(g_enumnames) / sizeof(g_enumnames[0]),
-        sizeof(g_enumnames[0]), compareGLEnum);
-    if (result) {
-        return result->s;
-    }
-    return NULL;
-}
-
-static const char* GLbooleanToString(GLboolean arg) {
-    return arg ? "GL_TRUE" : "GL_FALSE";
-}
-
-static GLenumString g_bitfieldNames[] = {
-    {0x00004000, "GL_COLOR_BUFFER_BIT"},
-    {0x00000400, "GL_STENCIL_BUFFER_BIT"},
-    {0x00000100, "GL_DEPTH_BUFFER_BIT"}
-};
-
-class StringBuilder {
-    static const int lineSize = 500;
-    char line[lineSize];
-    int line_index;
-public:
-    StringBuilder() {
-        line_index = 0;
-        line[0] = '\0';
-    }
-    void append(const char* fmt, ...) {
-        va_list argp;
-        va_start(argp, fmt);
-        line_index += vsnprintf(line + line_index, lineSize-line_index, fmt, argp);
-        va_end(argp);
-    }
-    const char* getString() {
-        line_index = 0;
-        line[lineSize-1] = '\0';
-        return line;
-    }
-};
-
-
-static void TraceGLShaderSource(GLuint shader, GLsizei count,
-    const GLchar** string, const GLint* length) {
-    ALOGD("const char* shaderSrc[] = {");
-    for (GLsizei i = 0; i < count; i++) {
-        const char* comma = i < count-1 ? "," : "";
-        const GLchar* s = string[i];
-        if (length) {
-            GLint len = length[i];
-            ALOGD("    \"%*s\"%s", len, s, comma);
-        } else {
-            ALOGD("    \"%s\"%s", s, comma);
-        }
-    }
-    ALOGD("};");
-    if (length) {
-        ALOGD("const GLint* shaderLength[] = {");
-        for (GLsizei i = 0; i < count; i++) {
-            const char* comma = i < count-1 ? "," : "";
-            GLint len = length[i];
-            ALOGD("    \"%d\"%s", len, comma);
-        }
-        ALOGD("};");
-        ALOGD("glShaderSource(%u, %u, shaderSrc, shaderLength);",
-            shader, count);
-    } else {
-        ALOGD("glShaderSource(%u, %u, shaderSrc, (const GLint*) 0);",
-            shader, count);
-    }
-}
-
-static void TraceValue(int elementCount, char type,
-        GLsizei chunkCount, GLsizei chunkSize, const void* value) {
-    StringBuilder stringBuilder;
-    GLsizei count = chunkCount * chunkSize;
-    bool isFloat = type == 'f';
-    const char* typeString = isFloat ? "GLfloat" : "GLint";
-    ALOGD("const %s value[] = {", typeString);
-    for (GLsizei i = 0; i < count; i++) {
-        StringBuilder builder;
-        builder.append("    ");
-        for (int e = 0; e < elementCount; e++) {
-            const char* comma = ", ";
-            if (e == elementCount-1) {
-                if (i == count - 1) {
-                    comma = "";
-                } else {
-                    comma = ",";
-                }
-            }
-            if (isFloat) {
-                builder.append("%g%s", * (GLfloat*) value, comma);
-                value = (void*) (((GLfloat*) value) + 1);
-            } else {
-                builder.append("%d%s", * (GLint*) value, comma);
-                value = (void*) (((GLint*) value) + 1);
-            }
-        }
-        ALOGD("%s", builder.getString());
-        if (chunkSize > 1 && i < count-1
-                && (i % chunkSize) == (chunkSize-1)) {
-            ALOGD("%s", ""); // Print a blank line.
-        }
-    }
-    ALOGD("};");
-}
-
-static void TraceUniformv(int elementCount, char type,
-        GLuint location, GLsizei count, const void* value) {
-    TraceValue(elementCount, type, count, 1, value);
-    ALOGD("glUniform%d%c(%u, %u, value);", elementCount, type, location, count);
-}
-
-static void TraceUniformMatrix(int matrixSideLength,
-        GLuint location, GLsizei count, GLboolean transpose, const void* value) {
-    TraceValue(matrixSideLength, 'f', count, matrixSideLength, value);
-    ALOGD("glUniformMatrix%dfv(%u, %u, %s, value);", matrixSideLength, location, count,
-            GLbooleanToString(transpose));
-}
-
-static void TraceGL(const char* name, int numArgs, ...) {
-    va_list argp;
-    va_start(argp, numArgs);
-    int nameLen = strlen(name);
-
-    // glShaderSource
-    if (nameLen == 14 && strcmp(name, "glShaderSource") == 0) {
-        va_arg(argp, const char*);
-        GLuint shader = va_arg(argp, GLuint);
-        va_arg(argp, const char*);
-        GLsizei count = va_arg(argp, GLsizei);
-        va_arg(argp, const char*);
-        const GLchar** string = (const GLchar**) va_arg(argp, void*);
-        va_arg(argp, const char*);
-        const GLint* length = (const GLint*) va_arg(argp, void*);
-        va_end(argp);
-        TraceGLShaderSource(shader, count, string, length);
-        return;
-    }
-
-    // glUniformXXv
-
-    if (nameLen == 12 && strncmp(name, "glUniform", 9) == 0 && name[11] == 'v') {
-        int elementCount = name[9] - '0'; // 1..4
-        char type = name[10]; // 'f' or 'i'
-        va_arg(argp, const char*);
-        GLuint location = va_arg(argp, GLuint);
-        va_arg(argp, const char*);
-        GLsizei count = va_arg(argp, GLsizei);
-        va_arg(argp, const char*);
-        const void* value = (const void*) va_arg(argp, void*);
-        va_end(argp);
-        TraceUniformv(elementCount, type, location, count, value);
-        return;
-    }
-
-    // glUniformMatrixXfv
-
-    if (nameLen == 18 && strncmp(name, "glUniformMatrix", 15) == 0
-            && name[16] == 'f' && name[17] == 'v') {
-        int matrixSideLength = name[15] - '0'; // 2..4
-        va_arg(argp, const char*);
-        GLuint location = va_arg(argp, GLuint);
-        va_arg(argp, const char*);
-        GLsizei count = va_arg(argp, GLsizei);
-        va_arg(argp, const char*);
-        GLboolean transpose = (GLboolean) va_arg(argp, int);
-        va_arg(argp, const char*);
-        const void* value = (const void*) va_arg(argp, void*);
-        va_end(argp);
-        TraceUniformMatrix(matrixSideLength, location, count, transpose, value);
-        return;
-    }
-
-    StringBuilder builder;
-    builder.append("%s(", name);
-    for (int i = 0; i < numArgs; i++) {
-        if (i > 0) {
-            builder.append(", ");
-        }
-        const char* type = va_arg(argp, const char*);
-        bool isPtr = type[strlen(type)-1] == '*'
-            || strcmp(type, "GLeglImageOES") == 0;
-        if (isPtr) {
-            const void* arg = va_arg(argp, const void*);
-            builder.append("(%s) 0x%08x", type, (size_t) arg);
-        } else if (strcmp(type, "GLbitfield") == 0) {
-            size_t arg = va_arg(argp, size_t);
-            bool first = true;
-            for (size_t i = 0; i < sizeof(g_bitfieldNames) / sizeof(g_bitfieldNames[0]); i++) {
-                const GLenumString* b = &g_bitfieldNames[i];
-                if (b->e & arg) {
-                    if (first) {
-                        first = false;
-                    } else {
-                        builder.append(" | ");
-                    }
-                    builder.append("%s", b->s);
-                    arg &= ~b->e;
-                }
-            }
-            if (first || arg != 0) {
-                if (!first) {
-                    builder.append(" | ");
-                }
-                builder.append("0x%08x", arg);
-            }
-        } else if (strcmp(type, "GLboolean") == 0) {
-            GLboolean arg = va_arg(argp, int);
-            builder.append("%s", GLbooleanToString(arg));
-        } else if (strcmp(type, "GLclampf") == 0) {
-            double arg = va_arg(argp, double);
-            builder.append("%g", arg);
-        } else if (strcmp(type, "GLenum") == 0) {
-            GLenum arg = va_arg(argp, int);
-            const char* s = GLEnumToString(arg);
-            if (s) {
-                builder.append("%s", s);
-            } else {
-                builder.append("0x%x", arg);
-            }
-        } else if (strcmp(type, "GLfixed") == 0) {
-            int arg = va_arg(argp, int);
-            builder.append("0x%08x", arg);
-        } else if (strcmp(type, "GLfloat") == 0) {
-            double arg = va_arg(argp, double);
-            builder.append("%g", arg);
-        } else if (strcmp(type, "GLint") == 0) {
-            int arg = va_arg(argp, int);
-            const char* s = NULL;
-            if (strcmp(name, "glTexParameteri") == 0) {
-                s = GLEnumToString(arg);
-            }
-            if (s) {
-                builder.append("%s", s);
-            } else {
-                builder.append("%d", arg);
-            }
-        } else if (strcmp(type, "GLintptr") == 0) {
-            int arg = va_arg(argp, unsigned int);
-            builder.append("%u", arg);
-        } else if (strcmp(type, "GLsizei") == 0) {
-            int arg = va_arg(argp, size_t);
-            builder.append("%u", arg);
-        } else if (strcmp(type, "GLsizeiptr") == 0) {
-            int arg = va_arg(argp, size_t);
-            builder.append("%u", arg);
-        } else if (strcmp(type, "GLuint") == 0) {
-            int arg = va_arg(argp, unsigned int);
-            builder.append("%u", arg);
-        } else {
-            builder.append("/* ??? %s */", type);
-            break;
-        }
-    }
-    builder.append(");");
-    ALOGD("%s", builder.getString());
-    va_end(argp);
-}
-
-///////////////////////////////////////////////////////////////////////////
-// Log trace
-///////////////////////////////////////////////////////////////////////////
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-#define TRACE_GL_VOID(_api, _args, _argList, ...)                         \
-static void Tracing_ ## _api _args {                                      \
-    TraceGL(#_api, __VA_ARGS__);                                          \
-    gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl;  \
-    _c->_api _argList;                                                    \
-}
-
-#define TRACE_GL(_type, _api, _args, _argList, ...)                       \
-static _type Tracing_ ## _api _args {                                     \
-    TraceGL(#_api, __VA_ARGS__);                                        \
-    gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl;  \
-    return _c->_api _argList;                                             \
-}
-
-extern "C" {
-#include "../trace.in"
-}
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-#define GL_ENTRY(_r, _api, ...) Tracing_ ## _api,
-EGLAPI gl_hooks_t gHooksTrace = {
-    {
-        #include "entries.in"
-    },
-    {
-        {0}
-    }
-};
-#undef GL_ENTRY
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-///////////////////////////////////////////////////////////////////////////
-// Systrace
-///////////////////////////////////////////////////////////////////////////
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-#define TRACE_GL_VOID(_api, _args, _argList, ...)                         \
-static void Systrace_ ## _api _args {                                     \
-    ATRACE_NAME(#_api);                                                   \
-    gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl;  \
-    _c->_api _argList;                                                    \
-}
-
-#define TRACE_GL(_type, _api, _args, _argList, ...)                       \
-static _type Systrace_ ## _api _args {                                    \
-    ATRACE_NAME(#_api);                                                   \
-    gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl;  \
-    return _c->_api _argList;                                             \
-}
-
-extern "C" {
-#include "../trace.in"
-}
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-#define GL_ENTRY(_r, _api, ...) Systrace_ ## _api,
-EGLAPI gl_hooks_t gHooksSystrace = {
-    {
-        #include "entries.in"
-    },
-    {
-        {0}
-    }
-};
-#undef GL_ENTRY
-
-///////////////////////////////////////////////////////////////////////////
-//
-///////////////////////////////////////////////////////////////////////////
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-#define CHECK_ERROR(_c, _api)                                             \
-    GLenum status = GL_NO_ERROR;                                          \
-    bool error = false;                                                   \
-    while ((status = _c->glGetError()) != GL_NO_ERROR) {                  \
-        ALOGD("[" #_api "] 0x%x", status);                                \
-        error = true;                                                     \
-    }                                                                     \
-    if (error) {                                                          \
-        CallStack s;                                                      \
-        s.update();                                                       \
-        s.log("glGetError:" #_api);                                       \
-    }                                                                     \
-
-#define TRACE_GL_VOID(_api, _args, _argList, ...)                         \
-static void ErrorTrace_ ## _api _args {                                   \
-    gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl;  \
-    _c->_api _argList;                                                    \
-    CHECK_ERROR(_c, _api);                                                \
-}
-
-#define TRACE_GL(_type, _api, _args, _argList, ...)                       \
-static _type ErrorTrace_ ## _api _args {                                  \
-    gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl;  \
-    _type _r = _c->_api _argList;                                         \
-    CHECK_ERROR(_c, _api);                                                \
-    return _r;                                                            \
-}
-
-extern "C" {
-#include "../trace.in"
-}
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-#define GL_ENTRY(_r, _api, ...) ErrorTrace_ ## _api,
-EGLAPI gl_hooks_t gHooksErrorTrace = {
-    {
-        #include "entries.in"
-    },
-    {
-        {0}
-    }
-};
-#undef GL_ENTRY
-#undef CHECK_ERROR
-
-#undef TRACE_GL_VOID
-#undef TRACE_GL
-
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
-
-#endif // EGL_TRACE
diff --git a/opengl/libs/GLES_trace/.gitignore b/opengl/libs/GLES_trace/.gitignore
deleted file mode 100644 (file)
index 8df825e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-java
-*.pyc
-*.swp
-pyratemp.py
diff --git a/opengl/libs/GLES_trace/Android.mk b/opengl/libs/GLES_trace/Android.mk
deleted file mode 100644 (file)
index 24c4be2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
-LOCAL_SRC_FILES := \
-    src/gltrace_api.cpp \
-    src/gltrace_context.cpp \
-    src/gltrace_egl.cpp \
-    src/gltrace_eglapi.cpp \
-    src/gltrace_fixup.cpp \
-    src/gltrace_hooks.cpp \
-    src/gltrace_transport.cpp \
-    $(call all-proto-files-under, proto)
-
-LOCAL_C_INCLUDES := \
-    $(LOCAL_PATH) \
-    $(LOCAL_PATH)/../ \
-    external
-
-LOCAL_STATIC_LIBRARIES := liblzf
-LOCAL_SHARED_LIBRARIES := libcutils libutils liblog
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := lite
-
-LOCAL_CFLAGS += -DLOG_TAG=\"libGLES_trace\"
-
-# we need to access the private Bionic header <bionic_tls.h>
-LOCAL_C_INCLUDES += bionic/libc/private
-
-LOCAL_MODULE:= libGLES_trace
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/opengl/libs/GLES_trace/DESIGN.txt b/opengl/libs/GLES_trace/DESIGN.txt
deleted file mode 100644 (file)
index 72a2e15..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-Design of the GLES Tracing Library
-
-Code Runtime Behavior:
-
-    Initialization:
-    
-    egl_display_t::initialize() calls initEglTraceLevel() to figure out whether tracing should be
-    enabled. Currently, the shell properties "debug.egl.trace" and "debug.egl.debug_proc" together
-    control whether tracing should be enabled for a certain process. If tracing is enabled, this
-    calls GLTrace_start() to start the trace server.
-    
-    egl_display_t::initialize() then calls setGLHooksThreadSpecific() where we set the thread
-    specific gl_hooks structure to point to the trace implementation. From this point on, every
-    GLES call is redirected to the trace implementation.
-    
-    Application runtime:
-
-    While the application is running, all its GLES calls are directly routed to their corresponding
-    trace implementation.
-
-    For EGL calls, the trace library provides a bunch of functions that must be explicitly called
-    from the EGL library. These functions are declared in glestrace.h
-
-    Application shutdown:
-
-    Currently, the application is killed when the user stops tracing from the frontend GUI. We need
-    to explore if a more graceful method of stopping the application, or detaching tracing from the
-    application is required.
-
-
-Enabling tracing while the application is running:
-
-    In order to allow tracing of an already running application, we allow DdmServer to enable
-    OpenGL tracing. In such a case, the application already has its GL hooks set up to point to the
-    real GL implementation, and we need to switch them to point to the trace implementation.
-
-    This is achieved by checking whether tracing should be enabled at every eglSwap call.
-    (Note: We were already checking for tracing at every eglSwap, the only change now is that
-    the tracing could actually be ON/OFF at runtime - earlier it was set once and never changed).
-
-    If eglSwap detects that tracing should be enabled now, then it performs the following steps:
-        - switch the gl hooks to point to the trace implementation.
-        - call trace eglMakeCurrent to indicate that there is now a new context that is current.
-        - continue on with tracing the eglSwap call.
-    This switches the hooks to point to the trace implementation only for the current context.
-    But the other contexts have their gl hooks updated when they perform eglMakeCurrent.
-
-    The GLTrace version of eglMakeCurrent now has to be updated to allow switching to a context
-    it may not know of. In such a case, it creates a context matching the version that it is now
-    switching to.
-
-Disabling tracing:
-
-    We disable tracing under two conditions:
-        - stop tracing request from DdmServer
-        - gltrace transport gets disconnected from the host.
-    In either case, both actions simply disable the tracing flag. The current context gets its
-    gl hooks restored in the next eglSwap, and the other traced contexts get their gl hooks
-    restored when they perform a eglMakeCurrent.
-
-Code Structure:
-
-    glestrace.h declares all the hooks exposed by libglestrace. These are used by EGL/egl.cpp and
-    EGL/eglApi.cpp to initialize the trace library, and to inform the library of EGL calls.
-
-    All GL calls are present in GLES_Trace/src/gltrace_api.cpp. This file is generated by the
-    GLES_Trace/src/genapi.py script. The structure of all the functions looks like this:
-
-            void GLTrace_glFunction(args) {
-                // declare a protobuf
-                // copy arguments into the protobuf
-                // call the original GLES function
-                // if there is a return value, save it into the protobuf
-                // fixup the protobuf if necessary
-                // transport the protobuf to the host
-            }
-
-    The fixupGLMessage() call does any custom processing of the protobuf based on the GLES call.
-    This typically amounts to copying the data corresponding to input or output pointers.
diff --git a/opengl/libs/GLES_trace/dev.make b/opengl/libs/GLES_trace/dev.make
deleted file mode 100644 (file)
index 3405d8e..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-## NOTE
-## This file is used for development purposes only. It is not used by the build system.
-
-sync:
-       adb root
-       adb remount
-       adb shell stop
-       adb sync
-       adb shell start
diff --git a/opengl/libs/GLES_trace/proto/gltrace.proto b/opengl/libs/GLES_trace/proto/gltrace.proto
deleted file mode 100644 (file)
index 0344787..0000000
+++ /dev/null
@@ -1,853 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.gltrace;
-
-option optimize_for = LITE_RUNTIME;
-
-option java_package = "com.android.ide.eclipse.gltrace";
-option java_outer_classname = "GLProtoBuf";
-
-message GLMessage {
-    enum Function {
-        option allow_alias = true;
-
-        glActiveTexture = 0;
-        glAlphaFunc = 1;
-        glAlphaFuncx = 2;
-        glAlphaFuncxOES = 3;
-        glAttachShader = 4;
-        glBeginPerfMonitorAMD = 5;
-        glBindAttribLocation = 6;
-        glBindBuffer = 7;
-        glBindFramebuffer = 8;
-        glBindFramebufferOES = 9;
-        glBindRenderbuffer = 10;
-        glBindRenderbufferOES = 11;
-        glBindTexture = 12;
-        glBindVertexArrayOES = 13;
-        glBlendColor = 14;
-        glBlendEquation = 15;
-        glBlendEquationOES = 16;
-        glBlendEquationSeparate = 17;
-        glBlendEquationSeparateOES = 18;
-        glBlendFunc = 19;
-        glBlendFuncSeparate = 20;
-        glBlendFuncSeparateOES = 21;
-        glBufferData = 22;
-        glBufferSubData = 23;
-        glCheckFramebufferStatus = 24;
-        glCheckFramebufferStatusOES = 25;
-        glClearColor = 26;
-        glClearColorx = 27;
-        glClearColorxOES = 28;
-        glClearDepthf = 29;
-        glClearDepthfOES = 30;
-        glClearDepthx = 31;
-        glClearDepthxOES = 32;
-        glClear = 33;
-        glClearStencil = 34;
-        glClientActiveTexture = 35;
-        glClipPlanef = 36;
-        glClipPlanefIMG = 37;
-        glClipPlanefOES = 38;
-        glClipPlanex = 39;
-        glClipPlanexIMG = 40;
-        glClipPlanexOES = 41;
-        glColor4f = 42;
-        glColor4ub = 43;
-        glColor4x = 44;
-        glColor4xOES = 45;
-        glColorMask = 46;
-        glColorPointer = 47;
-        glCompileShader = 48;
-        glCompressedTexImage2D = 49;
-        glCompressedTexImage3DOES = 50;
-        glCompressedTexSubImage2D = 51;
-        glCompressedTexSubImage3DOES = 52;
-        glCopyTexImage2D = 53;
-        glCopyTexSubImage2D = 54;
-        glCopyTexSubImage3DOES = 55;
-        glCoverageMaskNV = 56;
-        glCoverageOperationNV = 57;
-        glCreateProgram = 58;
-        glCreateShader = 59;
-        glCullFace = 60;
-        glCurrentPaletteMatrixOES = 61;
-        glDeleteBuffers = 62;
-        glDeleteFencesNV = 63;
-        glDeleteFramebuffers = 64;
-        glDeleteFramebuffersOES = 65;
-        glDeletePerfMonitorsAMD = 66;
-        glDeleteProgram = 67;
-        glDeleteRenderbuffers = 68;
-        glDeleteRenderbuffersOES = 69;
-        glDeleteShader = 70;
-        glDeleteTextures = 71;
-        glDeleteVertexArraysOES = 72;
-        glDepthFunc = 73;
-        glDepthMask = 74;
-        glDepthRangef = 75;
-        glDepthRangefOES = 76;
-        glDepthRangex = 77;
-        glDepthRangexOES = 78;
-        glDetachShader = 79;
-        glDisableClientState = 80;
-        glDisableDriverControlQCOM = 81;
-        glDisable = 82;
-        glDisableVertexAttribArray = 83;
-        glDiscardFramebufferEXT = 84;
-        glDrawArrays = 85;
-        glDrawElements = 86;
-        glDrawTexfOES = 87;
-        glDrawTexfvOES = 88;
-        glDrawTexiOES = 89;
-        glDrawTexivOES = 90;
-        glDrawTexsOES = 91;
-        glDrawTexsvOES = 92;
-        glDrawTexxOES = 93;
-        glDrawTexxvOES = 94;
-        glEGLImageTargetRenderbufferStorageOES = 95;
-        glEGLImageTargetTexture2DOES = 96;
-        glEnableClientState = 97;
-        glEnableDriverControlQCOM = 98;
-        glEnable = 99;
-        glEnableVertexAttribArray = 100;
-        glEndPerfMonitorAMD = 101;
-        glEndTilingQCOM = 102;
-        glExtGetBufferPointervQCOM = 103;
-        glExtGetBuffersQCOM = 104;
-        glExtGetFramebuffersQCOM = 105;
-        glExtGetProgramBinarySourceQCOM = 106;
-        glExtGetProgramsQCOM = 107;
-        glExtGetRenderbuffersQCOM = 108;
-        glExtGetShadersQCOM = 109;
-        glExtGetTexLevelParameterivQCOM = 110;
-        glExtGetTexSubImageQCOM = 111;
-        glExtGetTexturesQCOM = 112;
-        glExtIsProgramBinaryQCOM = 113;
-        glExtTexObjectStateOverrideiQCOM = 114;
-        glFinishFenceNV = 115;
-        glFinish = 116;
-        glFlush = 117;
-        glFogf = 118;
-        glFogfv = 119;
-        glFogx = 120;
-        glFogxOES = 121;
-        glFogxv = 122;
-        glFogxvOES = 123;
-        glFramebufferRenderbuffer = 124;
-        glFramebufferRenderbufferOES = 125;
-        glFramebufferTexture2D = 126;
-        glFramebufferTexture2DMultisampleIMG = 127;
-        glFramebufferTexture2DOES = 128;
-        glFramebufferTexture3DOES = 129;
-        glFrontFace = 130;
-        glFrustumf = 131;
-        glFrustumfOES = 132;
-        glFrustumx = 133;
-        glFrustumxOES = 134;
-        glGenBuffers = 135;
-        glGenerateMipmap = 136;
-        glGenerateMipmapOES = 137;
-        glGenFencesNV = 138;
-        glGenFramebuffers = 139;
-        glGenFramebuffersOES = 140;
-        glGenPerfMonitorsAMD = 141;
-        glGenRenderbuffers = 142;
-        glGenRenderbuffersOES = 143;
-        glGenTextures = 144;
-        glGenVertexArraysOES = 145;
-        glGetActiveAttrib = 146;
-        glGetActiveUniform = 147;
-        glGetAttachedShaders = 148;
-        glGetAttribLocation = 149;
-        glGetBooleanv = 150;
-        glGetBufferParameteriv = 151;
-        glGetBufferPointervOES = 152;
-        glGetClipPlanef = 153;
-        glGetClipPlanefOES = 154;
-        glGetClipPlanex = 155;
-        glGetClipPlanexOES = 156;
-        glGetDriverControlsQCOM = 157;
-        glGetDriverControlStringQCOM = 158;
-        glGetError = 159;
-        glGetFenceivNV = 160;
-        glGetFixedv = 161;
-        glGetFixedvOES = 162;
-        glGetFloatv = 163;
-        glGetFramebufferAttachmentParameteriv = 164;
-        glGetFramebufferAttachmentParameterivOES = 165;
-        glGetIntegerv = 166;
-        glGetLightfv = 167;
-        glGetLightxv = 168;
-        glGetLightxvOES = 169;
-        glGetMaterialfv = 170;
-        glGetMaterialxv = 171;
-        glGetMaterialxvOES = 172;
-        glGetPerfMonitorCounterDataAMD = 173;
-        glGetPerfMonitorCounterInfoAMD = 174;
-        glGetPerfMonitorCountersAMD = 175;
-        glGetPerfMonitorCounterStringAMD = 176;
-        glGetPerfMonitorGroupsAMD = 177;
-        glGetPerfMonitorGroupStringAMD = 178;
-        glGetPointerv = 179;
-        glGetProgramBinaryOES = 180;
-        glGetProgramInfoLog = 181;
-        glGetProgramiv = 182;
-        glGetRenderbufferParameteriv = 183;
-        glGetRenderbufferParameterivOES = 184;
-        glGetShaderInfoLog = 185;
-        glGetShaderiv = 186;
-        glGetShaderPrecisionFormat = 187;
-        glGetShaderSource = 188;
-        glGetString = 189;
-        glGetTexEnvfv = 190;
-        glGetTexEnviv = 191;
-        glGetTexEnvxv = 192;
-        glGetTexEnvxvOES = 193;
-        glGetTexGenfvOES = 194;
-        glGetTexGenivOES = 195;
-        glGetTexGenxvOES = 196;
-        glGetTexParameterfv = 197;
-        glGetTexParameteriv = 198;
-        glGetTexParameterxv = 199;
-        glGetTexParameterxvOES = 200;
-        glGetUniformfv = 201;
-        glGetUniformiv = 202;
-        glGetUniformLocation = 203;
-        glGetVertexAttribfv = 204;
-        glGetVertexAttribiv = 205;
-        glGetVertexAttribPointerv = 206;
-        glHint = 207;
-        glIsBuffer = 208;
-        glIsEnabled = 209;
-        glIsFenceNV = 210;
-        glIsFramebuffer = 211;
-        glIsFramebufferOES = 212;
-        glIsProgram = 213;
-        glIsRenderbuffer = 214;
-        glIsRenderbufferOES = 215;
-        glIsShader = 216;
-        glIsTexture = 217;
-        glIsVertexArrayOES = 218;
-        glLightf = 219;
-        glLightfv = 220;
-        glLightModelf = 221;
-        glLightModelfv = 222;
-        glLightModelx = 223;
-        glLightModelxOES = 224;
-        glLightModelxv = 225;
-        glLightModelxvOES = 226;
-        glLightx = 227;
-        glLightxOES = 228;
-        glLightxv = 229;
-        glLightxvOES = 230;
-        glLineWidth = 231;
-        glLineWidthx = 232;
-        glLineWidthxOES = 233;
-        glLinkProgram = 234;
-        glLoadIdentity = 235;
-        glLoadMatrixf = 236;
-        glLoadMatrixx = 237;
-        glLoadMatrixxOES = 238;
-        glLoadPaletteFromModelViewMatrixOES = 239;
-        glLogicOp = 240;
-        glMapBufferOES = 241;
-        glMaterialf = 242;
-        glMaterialfv = 243;
-        glMaterialx = 244;
-        glMaterialxOES = 245;
-        glMaterialxv = 246;
-        glMaterialxvOES = 247;
-        glMatrixIndexPointerOES = 248;
-        glMatrixMode = 249;
-        glMultiDrawArraysEXT = 250;
-        glMultiDrawElementsEXT = 251;
-        glMultiTexCoord4f = 252;
-        glMultiTexCoord4x = 253;
-        glMultiTexCoord4xOES = 254;
-        glMultMatrixf = 255;
-        glMultMatrixx = 256;
-        glMultMatrixxOES = 257;
-        glNormal3f = 258;
-        glNormal3x = 259;
-        glNormal3xOES = 260;
-        glNormalPointer = 261;
-        glOrthof = 262;
-        glOrthofOES = 263;
-        glOrthox = 264;
-        glOrthoxOES = 265;
-        glPixelStorei = 266;
-        glPointParameterf = 267;
-        glPointParameterfv = 268;
-        glPointParameterx = 269;
-        glPointParameterxOES = 270;
-        glPointParameterxv = 271;
-        glPointParameterxvOES = 272;
-        glPointSize = 273;
-        glPointSizePointerOES = 274;
-        glPointSizex = 275;
-        glPointSizexOES = 276;
-        glPolygonOffset = 277;
-        glPolygonOffsetx = 278;
-        glPolygonOffsetxOES = 279;
-        glPopMatrix = 280;
-        glProgramBinaryOES = 281;
-        glPushMatrix = 282;
-        glQueryMatrixxOES = 283;
-        glReadPixels = 284;
-        glReleaseShaderCompiler = 285;
-        glRenderbufferStorage = 286;
-        glRenderbufferStorageMultisampleIMG = 287;
-        glRenderbufferStorageOES = 288;
-        glRotatef = 289;
-        glRotatex = 290;
-        glRotatexOES = 291;
-        glSampleCoverage = 292;
-        glSampleCoveragex = 293;
-        glSampleCoveragexOES = 294;
-        glScalef = 295;
-        glScalex = 296;
-        glScalexOES = 297;
-        glScissor = 298;
-        glSelectPerfMonitorCountersAMD = 299;
-        glSetFenceNV = 300;
-        glShadeModel = 301;
-        glShaderBinary = 302;
-        glShaderSource = 303;
-        glStartTilingQCOM = 304;
-        glStencilFunc = 305;
-        glStencilFuncSeparate = 306;
-        glStencilMask = 307;
-        glStencilMaskSeparate = 308;
-        glStencilOp = 309;
-        glStencilOpSeparate = 310;
-        glTestFenceNV = 311;
-        glTexCoordPointer = 312;
-        glTexEnvf = 313;
-        glTexEnvfv = 314;
-        glTexEnvi = 315;
-        glTexEnviv = 316;
-        glTexEnvx = 317;
-        glTexEnvxOES = 318;
-        glTexEnvxv = 319;
-        glTexEnvxvOES = 320;
-        glTexGenfOES = 321;
-        glTexGenfvOES = 322;
-        glTexGeniOES = 323;
-        glTexGenivOES = 324;
-        glTexGenxOES = 325;
-        glTexGenxvOES = 326;
-        glTexImage2D = 327;
-        glTexImage3DOES = 328;
-        glTexParameterf = 329;
-        glTexParameterfv = 330;
-        glTexParameteri = 331;
-        glTexParameteriv = 332;
-        glTexParameterx = 333;
-        glTexParameterxOES = 334;
-        glTexParameterxv = 335;
-        glTexParameterxvOES = 336;
-        glTexSubImage2D = 337;
-        glTexSubImage3DOES = 338;
-        glTranslatef = 339;
-        glTranslatex = 340;
-        glTranslatexOES = 341;
-        glUniform1f = 342;
-        glUniform1fv = 343;
-        glUniform1i = 344;
-        glUniform1iv = 345;
-        glUniform2f = 346;
-        glUniform2fv = 347;
-        glUniform2i = 348;
-        glUniform2iv = 349;
-        glUniform3f = 350;
-        glUniform3fv = 351;
-        glUniform3i = 352;
-        glUniform3iv = 353;
-        glUniform4f = 354;
-        glUniform4fv = 355;
-        glUniform4i = 356;
-        glUniform4iv = 357;
-        glUniformMatrix2fv = 358;
-        glUniformMatrix3fv = 359;
-        glUniformMatrix4fv = 360;
-        glUnmapBufferOES = 361;
-        glUseProgram = 362;
-        glValidateProgram = 363;
-        glVertexAttrib1f = 364;
-        glVertexAttrib1fv = 365;
-        glVertexAttrib2f = 366;
-        glVertexAttrib2fv = 367;
-        glVertexAttrib3f = 368;
-        glVertexAttrib3fv = 369;
-        glVertexAttrib4f = 370;
-        glVertexAttrib4fv = 371;
-        glVertexAttribPointer = 372;
-        glVertexPointer = 373;
-        glViewport = 374;
-        glWeightPointerOES = 375;
-        glReadBuffer = 376;
-        glDrawRangeElements = 377;
-        glTexImage3D = 378;
-        glTexSubImage3D = 379;
-        glCopyTexSubImage3D = 380;
-        glCompressedTexImage3D = 381;
-        glCompressedTexSubImage3D = 382;
-        glGenQueries = 383;
-        glDeleteQueries = 384;
-        glIsQuery = 385;
-        glBeginQuery = 386;
-        glEndQuery = 387;
-        glGetQueryiv = 388;
-        glGetQueryObjectuiv = 389;
-        glUnmapBuffer = 390;
-        glGetBufferPointerv = 391;
-        glDrawBuffers = 392;
-        glUniformMatrix2x3fv = 393;
-        glUniformMatrix3x2fv = 394;
-        glUniformMatrix2x4fv = 395;
-        glUniformMatrix4x2fv = 396;
-        glUniformMatrix3x4fv = 397;
-        glUniformMatrix4x3fv = 398;
-        glBlitFramebuffer = 399;
-        glRenderbufferStorageMultisample = 400;
-        glFramebufferTextureLayer = 401;
-        glMapBufferRange = 402;
-        glFlushMappedBufferRange = 403;
-        glBindVertexArray = 404;
-        glDeleteVertexArrays = 405;
-        glGenVertexArrays = 406;
-        glIsVertexArray = 407;
-        glGetIntegeri_v = 408;
-        glBeginTransformFeedback = 409;
-        glEndTransformFeedback = 410;
-        glBindBufferRange = 411;
-        glBindBufferBase = 412;
-        glTransformFeedbackVaryings = 413;
-        glGetTransformFeedbackVarying = 414;
-        glVertexAttribIPointer = 415;
-        glGetVertexAttribIiv = 416;
-        glGetVertexAttribIuiv = 417;
-        glVertexAttribI4i = 418;
-        glVertexAttribI4ui = 419;
-        glVertexAttribI4iv = 420;
-        glVertexAttribI4uiv = 421;
-        glGetUniformuiv = 422;
-        glGetFragDataLocation = 423;
-        glUniform1ui = 424;
-        glUniform2ui = 425;
-        glUniform3ui = 426;
-        glUniform4ui = 427;
-        glUniform1uiv = 428;
-        glUniform2uiv = 429;
-        glUniform3uiv = 430;
-        glUniform4uiv = 431;
-        glClearBufferiv = 432;
-        glClearBufferuiv = 433;
-        glClearBufferfv = 434;
-        glClearBufferfi = 435;
-        glGetStringi = 436;
-        glCopyBufferSubData = 437;
-        glGetUniformIndices = 438;
-        glGetActiveUniformsiv = 439;
-        glGetUniformBlockIndex = 440;
-        glGetActiveUniformBlockiv = 441;
-        glGetActiveUniformBlockName = 442;
-        glUniformBlockBinding = 443;
-        glDrawArraysInstanced = 444;
-        glDrawElementsInstanced = 445;
-        glFenceSync = 446;
-        glIsSync = 447;
-        glDeleteSync = 448;
-        glClientWaitSync = 449;
-        glWaitSync = 450;
-        glGetInteger64v = 451;
-        glGetSynciv = 452;
-        glGetInteger64i_v = 453;
-        glGetBufferParameteri64v = 454;
-        glGenSamplers = 455;
-        glDeleteSamplers = 456;
-        glIsSampler = 457;
-        glBindSampler = 458;
-        glSamplerParameteri = 459;
-        glSamplerParameteriv = 460;
-        glSamplerParameterf = 461;
-        glSamplerParameterfv = 462;
-        glGetSamplerParameteriv = 463;
-        glGetSamplerParameterfv = 464;
-        glVertexAttribDivisor = 465;
-        glBindTransformFeedback = 466;
-        glDeleteTransformFeedbacks = 467;
-        glGenTransformFeedbacks = 468;
-        glIsTransformFeedback = 469;
-        glPauseTransformFeedback = 470;
-        glResumeTransformFeedback = 471;
-        glGetProgramBinary = 472;
-        glProgramBinary = 473;
-        glProgramParameteri = 474;
-        glInvalidateFramebuffer = 475;
-        glInvalidateSubFramebuffer = 476;
-        glTexStorage2D = 477;
-        glTexStorage3D = 478;
-        glGetInternalformativ = 479;
-        glBeginPerfQueryINTEL = 480;
-        glCreatePerfQueryINTEL = 481;
-        glDeletePerfQueryINTEL = 482;
-        glEndPerfQueryINTEL = 483;
-        glGetFirstPerfQueryIdINTEL = 484;
-        glGetNextPerfQueryIdINTEL = 485;
-        glGetPerfCounterInfoINTEL = 486;
-        glGetPerfQueryDataINTEL = 487;
-        glGetPerfQueryIdByNameINTEL = 488;
-        glGetPerfQueryInfoINTEL = 489;
-        glBlendBarrierKHR = 490;
-        glBlendBarrierNV = 491;
-        glBlendParameteriNV = 492;
-        glBlitFramebufferNV = 493;
-        glFenceSyncAPPLE = 494;
-        glIsSyncAPPLE = 495;
-        glDeleteSyncAPPLE = 496;
-        glClientWaitSyncAPPLE = 497;
-        glWaitSyncAPPLE = 498;
-        glGetInteger64vAPPLE = 499;
-        glGetSyncivAPPLE = 500;
-        glCopyBufferSubDataNV = 501;
-        glActiveShaderProgramEXT = 502;
-        glAlphaFuncQCOM = 503;
-        glBeginQueryEXT = 504;
-        glBindProgramPipelineEXT = 505;
-        glBlitFramebufferANGLE = 506;
-        glCreateShaderProgramvEXT = 507;
-        glDeleteProgramPipelinesEXT = 508;
-        glDeleteQueriesEXT = 509;
-        glDrawBuffersNV = 510;
-        glEndQueryEXT = 511;
-        glFramebufferTexture2DMultisampleEXT = 512;
-        glGenProgramPipelinesEXT = 513;
-        glGenQueriesEXT = 514;
-        glGetGraphicsResetStatusEXT = 515;
-        glGetObjectLabelEXT = 516;
-        glGetProgramPipelineInfoLogEXT = 517;
-        glGetProgramPipelineivEXT = 518;
-        glGetQueryObjectuivEXT = 519;
-        glGetQueryivEXT = 520;
-        glGetnUniformfvEXT = 521;
-        glGetnUniformivEXT = 521;
-        glInsertEventMarkerEXT = 522;
-        glIsProgramPipelineEXT = 523;
-        glIsQueryEXT = 524;
-        glLabelObjectEXT = 525;
-        glPopGroupMarkerEXT = 526;
-        glProgramParameteriEXT = 527;
-        glProgramUniform1fEXT = 528;
-        glProgramUniform1fvEXT = 529;
-        glProgramUniform1iEXT = 530;
-        glProgramUniform1ivEXT = 531;
-        glProgramUniform2fEXT = 532;
-        glProgramUniform2fvEXT = 533;
-        glProgramUniform2iEXT = 534;
-        glProgramUniform2ivEXT = 535;
-        glProgramUniform3fEXT = 536;
-        glProgramUniform3fvEXT = 537;
-        glProgramUniform3iEXT = 538;
-        glProgramUniform3ivEXT = 539;
-        glProgramUniform4fEXT = 540;
-        glProgramUniform4fvEXT = 541;
-        glProgramUniform4iEXT = 542;
-        glProgramUniform4ivEXT = 543;
-        glProgramUniformMatrix2fvEXT = 544;
-        glProgramUniformMatrix3fvEXT = 545;
-        glProgramUniformMatrix4fvEXT = 546;
-        glPushGroupMarkerEXT = 547;
-        glReadBufferNV = 548;
-        glReadnPixelsEXT = 549;
-        glRenderbufferStorageMultisampleANGLE = 550;
-        glRenderbufferStorageMultisampleAPPLE = 551;
-        glRenderbufferStorageMultisampleEXT = 552;
-        glResolveMultisampleFramebufferAPPLE = 553;
-        glTexStorage1DEXT = 554;
-        glTexStorage2DEXT = 555;
-        glTexStorage3DEXT = 556;
-        glTextureStorage1DEXT = 557;
-        glTextureStorage2DEXT = 558;
-        glTextureStorage3DEXT = 559;
-        glUseProgramStagesEXT = 560;
-        glValidateProgramPipelineEXT = 561;
-        glCopyTextureLevelsAPPLE = 562;
-        glDebugMessageControlKHR = 563;
-        glDebugMessageInsertKHR = 564;
-        glDebugMessageCallbackKHR = 565;
-        glGetDebugMessageLogKHR = 566;
-        glPushDebugGroupKHR = 567;
-        glPopDebugGroupKHR = 568;
-        glObjectLabelKHR = 569;
-        glGetObjectLabelKHR = 570;
-        glObjectPtrLabelKHR = 571;
-        glGetObjectPtrLabelKHR = 572;
-        glGetPointervKHR = 573;
-        glDrawArraysInstancedANGLE = 574;
-        glDrawElementsInstancedANGLE = 575;
-        glVertexAttribDivisorANGLE = 576;
-        glDrawArraysInstancedEXT = 577;
-        glDrawElementsInstancedEXT = 578;
-        glVertexAttribDivisorEXT = 579;
-        glDrawArraysInstancedNV = 580;
-        glDrawElementsInstancedNV = 581;
-        glVertexAttribDivisorNV = 582;
-        glDrawBuffersEXT = 583;
-        glReadBufferIndexedEXT = 584;
-        glDrawBuffersIndexedEXT = 585;
-        glGetIntegeri_vEXT = 586;
-        glMapBufferRangeEXT = 587;
-        glFlushMappedBufferRangeEXT = 588;
-        glQueryCounterEXT = 589;
-        glGetQueryObjecti64vEXT = 590;
-        glGetQueryObjectivEXT = 591;
-        glGetQueryObjectui64vEXT = 592;
-        glGetTranslatedShaderSourceANGLE = 593;
-        glMinSampleShadingOES = 594;
-        glMultiTexCoord1bOES = 595;
-        glMultiTexCoord1bvOES = 596;
-        glMultiTexCoord2bOES = 597;
-        glMultiTexCoord2bvOES = 598;
-        glMultiTexCoord3bOES = 599;
-        glMultiTexCoord3bvOES = 600;
-        glMultiTexCoord4bOES = 601;
-        glMultiTexCoord4bvOES = 602;
-        glTexCoord1bOES = 603;
-        glTexCoord1bvOES = 604;
-        glTexCoord2bOES = 605;
-        glTexCoord2bvOES = 606;
-        glTexCoord3bOES = 607;
-        glTexCoord3bvOES = 608;
-        glTexCoord4bOES = 609;
-        glTexCoord4bvOES = 610;
-        glVertex2bOES = 611;
-        glVertex2bvOES = 612;
-        glVertex3bOES = 613;
-        glVertex3bvOES = 614;
-        glVertex4bOES = 615;
-        glVertex4bvOES = 616;
-        glProgramUniform1uiEXT = 617;
-        glProgramUniform2uiEXT = 618;
-        glProgramUniform3uiEXT = 619;
-        glProgramUniform4uiEXT = 620;
-        glProgramUniform1uivEXT = 621;
-        glProgramUniform2uivEXT = 622;
-        glProgramUniform3uivEXT = 623;
-        glProgramUniform4uivEXT = 624;
-        glProgramUniformMatrix2x3fvEXT = 625;
-        glProgramUniformMatrix3x2fvEXT = 626;
-        glProgramUniformMatrix2x4fvEXT = 627;
-        glProgramUniformMatrix4x2fvEXT = 628;
-        glProgramUniformMatrix3x4fvEXT = 629;
-        glProgramUniformMatrix4x3fvEXT = 630;
-        glRenderbufferStorageMultisampleNV = 631;
-        glSampleCoverageOES = 632;
-        glTexStorage3DMultisampleOES = 633;
-        glUniformMatrix2x3fvNV = 634;
-        glUniformMatrix3x2fvNV = 635;
-        glUniformMatrix2x4fvNV = 636;
-        glUniformMatrix4x2fvNV = 637;
-        glUniformMatrix3x4fvNV = 638;
-        glUniformMatrix4x3fvNV = 639;
-        glActiveShaderProgram = 640;
-        glBindImageTexture = 641;
-        glBindProgramPipeline = 642;
-        glBindVertexBuffer = 643;
-        glCreateShaderProgramv = 644;
-        glDeleteProgramPipelines = 645;
-        glDispatchCompute = 646;
-        glDispatchComputeIndirect = 647;
-        glDrawArraysIndirect = 648;
-        glDrawElementsIndirect = 649;
-        glFramebufferParameteri = 650;
-        glGenProgramPipelines = 651;
-        glGetBooleani_v = 652;
-        glGetFramebufferParameteriv = 653;
-        glGetMultisamplefv = 654;
-        glGetProgramInterfaceiv = 655;
-        glGetProgramPipelineInfoLog = 656;
-        glGetProgramPipelineiv = 657;
-        glGetProgramResourceIndex = 658;
-        glGetProgramResourceLocation = 659;
-        glGetProgramResourceName = 660;
-        glGetProgramResourceiv = 661;
-        glGetTexLevelParameterfv = 662;
-        glGetTexLevelParameteriv = 663;
-        glIsProgramPipeline = 664;
-        glMemoryBarrier = 665;
-        glMemoryBarrierByRegion = 666;
-        glProgramUniform1f = 667;
-        glProgramUniform1fv = 668;
-        glProgramUniform1i = 669;
-        glProgramUniform1iv = 670;
-        glProgramUniform1ui = 671;
-        glProgramUniform1uiv = 672;
-        glProgramUniform2f = 673;
-        glProgramUniform2fv = 674;
-        glProgramUniform2i = 675;
-        glProgramUniform2iv = 676;
-        glProgramUniform2ui = 677;
-        glProgramUniform2uiv = 678;
-        glProgramUniform3f = 679;
-        glProgramUniform3fv = 680;
-        glProgramUniform3i = 681;
-        glProgramUniform3iv = 682;
-        glProgramUniform3ui = 683;
-        glProgramUniform3uiv = 684;
-        glProgramUniform4f = 685;
-        glProgramUniform4fv = 686;
-        glProgramUniform4i = 687;
-        glProgramUniform4iv = 688;
-        glProgramUniform4ui = 689;
-        glProgramUniform4uiv = 690;
-        glProgramUniformMatrix2fv = 691;
-        glProgramUniformMatrix2x3fv = 692;
-        glProgramUniformMatrix2x4fv = 693;
-        glProgramUniformMatrix3fv = 694;
-        glProgramUniformMatrix3x2fv = 695;
-        glProgramUniformMatrix3x4fv = 696;
-        glProgramUniformMatrix4fv = 697;
-        glProgramUniformMatrix4x2fv = 698;
-        glProgramUniformMatrix4x3fv = 699;
-        glSampleMaski = 700;
-        glTexStorage2DMultisample = 701;
-        glUseProgramStages = 702;
-        glValidateProgramPipeline = 703;
-        glVertexAttribBinding = 704;
-        glVertexAttribFormat = 705;
-        glVertexAttribIFormat = 706;
-        glVertexBindingDivisor = 707;
-        glBlendEquationSeparateiEXT = 708;
-        glBlendEquationiEXT = 709;
-        glBlendFuncSeparateiEXT = 710;
-        glBlendFunciEXT = 711;
-        glColorMaskiEXT = 712;
-        glCopyImageSubDataEXT = 713;
-        glDisableiEXT = 714;
-        glEnableiEXT = 715;
-        glFramebufferTextureEXT = 716;
-        glGetSamplerParameterIivEXT = 717;
-        glGetSamplerParameterIuivEXT = 718;
-        glGetTexParameterIivEXT = 719;
-        glGetTexParameterIuivEXT = 720;
-        glIsEnablediEXT = 721;
-        glPatchParameteriEXT = 722;
-        glPrimitiveBoundingBoxEXT = 723;
-        glSamplerParameterIivEXT = 724;
-        glSamplerParameterIuivEXT = 725;
-        glTexBufferEXT = 726;
-        glTexBufferRangeEXT = 727;
-        glTexParameterIivEXT = 728;
-        glTexParameterIuivEXT = 729;
-        glTextureViewEXT = 730;
-
-        eglGetDisplay = 2000;
-        eglInitialize = 2001;
-        eglTerminate = 2002;
-        eglGetConfigs = 2003;
-        eglChooseConfig = 2004;
-        eglGetConfigAttrib = 2005;
-        eglCreateWindowSurface = 2006;
-        eglCreatePixmapSurface = 2007;
-        eglCreatePbufferSurface = 2008;
-        eglDestroySurface = 2009;
-        eglQuerySurface = 2010;
-        eglCreateContext = 2011;
-        eglDestroyContext = 2012;
-        eglMakeCurrent = 2013;
-        eglGetCurrentContext = 2014;
-        eglGetCurrentSurface = 2015;
-        eglGetCurrentDisplay = 2016;
-        eglQueryContext = 2017;
-        eglWaitGL = 2018;
-        eglWaitNative = 2019;
-        eglSwapBuffers = 2020;
-        eglCopyBuffers = 2021;
-        eglGetError = 2022;
-        eglQueryString = 2023;
-        eglGetProcAddress = 2024;
-        eglSurfaceAttrib = 2025;
-        eglBindTexImage = 2026;
-        eglReleaseTexImage = 2027;
-        eglSwapInterval = 2028;
-        eglBindAPI = 2029;
-        eglQueryAPI = 2030;
-        eglWaitClient = 2031;
-        eglReleaseThread = 2032;
-        eglCreatePbufferFromClientBuffer = 2033;
-        eglLockSurfaceKHR = 2034;
-        eglUnlockSurfaceKHR = 2035;
-        eglCreateImageKHR = 2036;
-        eglDestroyImageKHR = 2037;
-        eglCreateSyncKHR = 2038;
-        eglDestroySyncKHR = 2039;
-        eglClientWaitSyncKHR = 2040;
-        eglGetSyncAttribKHR = 2041;
-        eglSetSwapRectangleANDROID = 2042;
-        eglGetRenderBufferANDROID = 2043;
-        eglGetSystemTimeFrequencyNV = 2044;
-        eglGetSystemTimeNV = 2045;
-
-        invalid = 3000;
-        glVertexAttribPointerData = 3001;
-    }
-
-    // A GL call's return data and arguments are formatted into this DataType
-    message DataType {
-        enum Type {
-            VOID = 1;       // GLvoid
-            CHAR = 2;       // GLchar
-            BYTE = 3;       // GLbyte, GLubyte
-            INT = 4;        // GLbitfield, GLshort, GLint, GLsizei, GLushort, GLuint, GLfixed
-            FLOAT = 5;      // GLfloat, GLclampf
-            BOOL = 6;       // GLboolean
-            ENUM = 7;       // GLenum
-            INT64 = 8;      // GLint64, GLuint64
-        };
-
-        required Type   type = 1 [default = VOID];
-        required bool   isArray = 2 [default = false];
-
-        repeated int32  intValue = 3;
-        repeated float  floatValue = 4;
-        repeated bytes  charValue = 5;
-        repeated bytes  rawBytes = 6;
-        repeated bool   boolValue = 7;
-        repeated int64  int64Value = 8;
-    }
-
-    message FrameBuffer {
-        required int32  width = 1;
-        required int32  height = 2;
-        repeated bytes  contents = 3;
-    }
-
-    required int32      context_id = 1;                     // GL context ID
-    required int64      start_time = 2;                     // time when call was invoked
-    required int32      duration = 3;                       // duration of the call (MONOTONIC TIME)
-
-    required Function   function = 4 [default = invalid];   // GL function called
-    repeated DataType   args = 5;                           // GL function's arguments
-    optional DataType   returnValue = 6;                    // GL function's return value
-
-    optional FrameBuffer fb = 7;                            // contents of the framebuffer
-
-    optional int32      threadtime = 8;                     // duration of the call (THREAD TIME)
-};
diff --git a/opengl/libs/GLES_trace/src/gltrace_api.cpp b/opengl/libs/GLES_trace/src/gltrace_api.cpp
deleted file mode 100644 (file)
index d83b9b4..0000000
+++ /dev/null
@@ -1,30963 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * THIS FILE WAS GENERATED BY A SCRIPT. DO NOT EDIT.
- */
-
-#include <cutils/log.h>
-#include <utils/Timers.h>
-
-#include "frameworks/native/opengl/libs/GLES_trace/proto/gltrace.pb.h"
-#include "gltrace_context.h"
-#include "gltrace_fixup.h"
-#include "gltrace_transport.h"
-
-namespace android {
-namespace gltrace {
-
-// Definitions for GL2 APIs
-
-void GLTrace_glActiveTexture(GLenum texture) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glActiveTexture);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glActiveTexture(texture);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glAttachShader(GLuint program, GLuint shader) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glAttachShader);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument shader
-    GLMessage_DataType *arg_shader = glmsg.add_args();
-    arg_shader->set_isarray(false);
-    arg_shader->set_type(GLMessage::DataType::INT);
-    arg_shader->add_intvalue(shader);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glAttachShader(program, shader);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindAttribLocation(GLuint program, GLuint index, const GLchar * name) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindAttribLocation);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT64);
-    arg_name->add_int64value((uintptr_t)name);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindAttribLocation(program, index, name);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) name,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindBuffer(GLenum target, GLuint buffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindBuffer);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument buffer
-    GLMessage_DataType *arg_buffer = glmsg.add_args();
-    arg_buffer->set_isarray(false);
-    arg_buffer->set_type(GLMessage::DataType::INT);
-    arg_buffer->add_intvalue(buffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindBuffer(target, buffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindFramebuffer(GLenum target, GLuint framebuffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindFramebuffer);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument framebuffer
-    GLMessage_DataType *arg_framebuffer = glmsg.add_args();
-    arg_framebuffer->set_isarray(false);
-    arg_framebuffer->set_type(GLMessage::DataType::INT);
-    arg_framebuffer->add_intvalue(framebuffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindFramebuffer(target, framebuffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindRenderbuffer);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument renderbuffer
-    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
-    arg_renderbuffer->set_isarray(false);
-    arg_renderbuffer->set_type(GLMessage::DataType::INT);
-    arg_renderbuffer->add_intvalue(renderbuffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindRenderbuffer(target, renderbuffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindTexture(GLenum target, GLuint texture) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindTexture);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindTexture(target, texture);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendColor);
-
-    // copy argument red
-    GLMessage_DataType *arg_red = glmsg.add_args();
-    arg_red->set_isarray(false);
-    arg_red->set_type(GLMessage::DataType::FLOAT);
-    arg_red->add_floatvalue(red);
-
-    // copy argument green
-    GLMessage_DataType *arg_green = glmsg.add_args();
-    arg_green->set_isarray(false);
-    arg_green->set_type(GLMessage::DataType::FLOAT);
-    arg_green->add_floatvalue(green);
-
-    // copy argument blue
-    GLMessage_DataType *arg_blue = glmsg.add_args();
-    arg_blue->set_isarray(false);
-    arg_blue->set_type(GLMessage::DataType::FLOAT);
-    arg_blue->add_floatvalue(blue);
-
-    // copy argument alpha
-    GLMessage_DataType *arg_alpha = glmsg.add_args();
-    arg_alpha->set_isarray(false);
-    arg_alpha->set_type(GLMessage::DataType::FLOAT);
-    arg_alpha->add_floatvalue(alpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendColor(red, green, blue, alpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendEquation(GLenum mode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendEquation);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendEquation(mode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendEquationSeparate);
-
-    // copy argument modeRGB
-    GLMessage_DataType *arg_modeRGB = glmsg.add_args();
-    arg_modeRGB->set_isarray(false);
-    arg_modeRGB->set_type(GLMessage::DataType::ENUM);
-    arg_modeRGB->add_intvalue((int)modeRGB);
-
-    // copy argument modeAlpha
-    GLMessage_DataType *arg_modeAlpha = glmsg.add_args();
-    arg_modeAlpha->set_isarray(false);
-    arg_modeAlpha->set_type(GLMessage::DataType::ENUM);
-    arg_modeAlpha->add_intvalue((int)modeAlpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendEquationSeparate(modeRGB, modeAlpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendFunc(GLenum sfactor, GLenum dfactor) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendFunc);
-
-    // copy argument sfactor
-    GLMessage_DataType *arg_sfactor = glmsg.add_args();
-    arg_sfactor->set_isarray(false);
-    arg_sfactor->set_type(GLMessage::DataType::ENUM);
-    arg_sfactor->add_intvalue((int)sfactor);
-
-    // copy argument dfactor
-    GLMessage_DataType *arg_dfactor = glmsg.add_args();
-    arg_dfactor->set_isarray(false);
-    arg_dfactor->set_type(GLMessage::DataType::ENUM);
-    arg_dfactor->add_intvalue((int)dfactor);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendFunc(sfactor, dfactor);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendFuncSeparate);
-
-    // copy argument sfactorRGB
-    GLMessage_DataType *arg_sfactorRGB = glmsg.add_args();
-    arg_sfactorRGB->set_isarray(false);
-    arg_sfactorRGB->set_type(GLMessage::DataType::ENUM);
-    arg_sfactorRGB->add_intvalue((int)sfactorRGB);
-
-    // copy argument dfactorRGB
-    GLMessage_DataType *arg_dfactorRGB = glmsg.add_args();
-    arg_dfactorRGB->set_isarray(false);
-    arg_dfactorRGB->set_type(GLMessage::DataType::ENUM);
-    arg_dfactorRGB->add_intvalue((int)dfactorRGB);
-
-    // copy argument sfactorAlpha
-    GLMessage_DataType *arg_sfactorAlpha = glmsg.add_args();
-    arg_sfactorAlpha->set_isarray(false);
-    arg_sfactorAlpha->set_type(GLMessage::DataType::ENUM);
-    arg_sfactorAlpha->add_intvalue((int)sfactorAlpha);
-
-    // copy argument dfactorAlpha
-    GLMessage_DataType *arg_dfactorAlpha = glmsg.add_args();
-    arg_dfactorAlpha->set_isarray(false);
-    arg_dfactorAlpha->set_type(GLMessage::DataType::ENUM);
-    arg_dfactorAlpha->add_intvalue((int)dfactorAlpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBufferData(GLenum target, GLsizeiptr size, const void * data, GLenum usage) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBufferData);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // copy argument usage
-    GLMessage_DataType *arg_usage = glmsg.add_args();
-    arg_usage->set_isarray(false);
-    arg_usage->set_type(GLMessage::DataType::ENUM);
-    arg_usage->add_intvalue((int)usage);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBufferData(target, size, data, usage);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBufferSubData);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument offset
-    GLMessage_DataType *arg_offset = glmsg.add_args();
-    arg_offset->set_isarray(false);
-    arg_offset->set_type(GLMessage::DataType::INT);
-    arg_offset->add_intvalue(offset);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBufferSubData(target, offset, size, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLenum GLTrace_glCheckFramebufferStatus(GLenum target) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCheckFramebufferStatus);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLenum retValue = glContext->hooks->gl.glCheckFramebufferStatus(target);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::ENUM);
-    rt->add_intvalue((int)retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glClear(GLbitfield mask) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClear);
-
-    // copy argument mask
-    GLMessage_DataType *arg_mask = glmsg.add_args();
-    arg_mask->set_isarray(false);
-    arg_mask->set_type(GLMessage::DataType::INT);
-    arg_mask->add_intvalue(mask);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClear(mask);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearColor);
-
-    // copy argument red
-    GLMessage_DataType *arg_red = glmsg.add_args();
-    arg_red->set_isarray(false);
-    arg_red->set_type(GLMessage::DataType::FLOAT);
-    arg_red->add_floatvalue(red);
-
-    // copy argument green
-    GLMessage_DataType *arg_green = glmsg.add_args();
-    arg_green->set_isarray(false);
-    arg_green->set_type(GLMessage::DataType::FLOAT);
-    arg_green->add_floatvalue(green);
-
-    // copy argument blue
-    GLMessage_DataType *arg_blue = glmsg.add_args();
-    arg_blue->set_isarray(false);
-    arg_blue->set_type(GLMessage::DataType::FLOAT);
-    arg_blue->add_floatvalue(blue);
-
-    // copy argument alpha
-    GLMessage_DataType *arg_alpha = glmsg.add_args();
-    arg_alpha->set_isarray(false);
-    arg_alpha->set_type(GLMessage::DataType::FLOAT);
-    arg_alpha->add_floatvalue(alpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearColor(red, green, blue, alpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearDepthf(GLfloat d) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearDepthf);
-
-    // copy argument d
-    GLMessage_DataType *arg_d = glmsg.add_args();
-    arg_d->set_isarray(false);
-    arg_d->set_type(GLMessage::DataType::FLOAT);
-    arg_d->add_floatvalue(d);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearDepthf(d);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearStencil(GLint s) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearStencil);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::INT);
-    arg_s->add_intvalue(s);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearStencil(s);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glColorMask);
-
-    // copy argument red
-    GLMessage_DataType *arg_red = glmsg.add_args();
-    arg_red->set_isarray(false);
-    arg_red->set_type(GLMessage::DataType::BOOL);
-    arg_red->add_boolvalue(red);
-
-    // copy argument green
-    GLMessage_DataType *arg_green = glmsg.add_args();
-    arg_green->set_isarray(false);
-    arg_green->set_type(GLMessage::DataType::BOOL);
-    arg_green->add_boolvalue(green);
-
-    // copy argument blue
-    GLMessage_DataType *arg_blue = glmsg.add_args();
-    arg_blue->set_isarray(false);
-    arg_blue->set_type(GLMessage::DataType::BOOL);
-    arg_blue->add_boolvalue(blue);
-
-    // copy argument alpha
-    GLMessage_DataType *arg_alpha = glmsg.add_args();
-    arg_alpha->set_isarray(false);
-    arg_alpha->set_type(GLMessage::DataType::BOOL);
-    arg_alpha->add_boolvalue(alpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glColorMask(red, green, blue, alpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompileShader(GLuint shader) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCompileShader);
-
-    // copy argument shader
-    GLMessage_DataType *arg_shader = glmsg.add_args();
-    arg_shader->set_isarray(false);
-    arg_shader->set_type(GLMessage::DataType::INT);
-    arg_shader->add_intvalue(shader);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCompileShader(shader);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCompressedTexImage2D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument border
-    GLMessage_DataType *arg_border = glmsg.add_args();
-    arg_border->set_isarray(false);
-    arg_border->set_type(GLMessage::DataType::INT);
-    arg_border->add_intvalue(border);
-
-    // copy argument imageSize
-    GLMessage_DataType *arg_imageSize = glmsg.add_args();
-    arg_imageSize->set_isarray(false);
-    arg_imageSize->set_type(GLMessage::DataType::INT);
-    arg_imageSize->add_intvalue(imageSize);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCompressedTexSubImage2D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument xoffset
-    GLMessage_DataType *arg_xoffset = glmsg.add_args();
-    arg_xoffset->set_isarray(false);
-    arg_xoffset->set_type(GLMessage::DataType::INT);
-    arg_xoffset->add_intvalue(xoffset);
-
-    // copy argument yoffset
-    GLMessage_DataType *arg_yoffset = glmsg.add_args();
-    arg_yoffset->set_isarray(false);
-    arg_yoffset->set_type(GLMessage::DataType::INT);
-    arg_yoffset->add_intvalue(yoffset);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument imageSize
-    GLMessage_DataType *arg_imageSize = glmsg.add_args();
-    arg_imageSize->set_isarray(false);
-    arg_imageSize->set_type(GLMessage::DataType::INT);
-    arg_imageSize->add_intvalue(imageSize);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCopyTexImage2D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument border
-    GLMessage_DataType *arg_border = glmsg.add_args();
-    arg_border->set_isarray(false);
-    arg_border->set_type(GLMessage::DataType::INT);
-    arg_border->add_intvalue(border);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCopyTexSubImage2D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument xoffset
-    GLMessage_DataType *arg_xoffset = glmsg.add_args();
-    arg_xoffset->set_isarray(false);
-    arg_xoffset->set_type(GLMessage::DataType::INT);
-    arg_xoffset->add_intvalue(xoffset);
-
-    // copy argument yoffset
-    GLMessage_DataType *arg_yoffset = glmsg.add_args();
-    arg_yoffset->set_isarray(false);
-    arg_yoffset->set_type(GLMessage::DataType::INT);
-    arg_yoffset->add_intvalue(yoffset);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLuint GLTrace_glCreateProgram(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCreateProgram);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLuint retValue = glContext->hooks->gl.glCreateProgram();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-GLuint GLTrace_glCreateShader(GLenum type) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCreateShader);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLuint retValue = glContext->hooks->gl.glCreateShader(type);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glCullFace(GLenum mode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCullFace);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCullFace(mode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteBuffers(GLsizei n, const GLuint * buffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteBuffers);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument buffers
-    GLMessage_DataType *arg_buffers = glmsg.add_args();
-    arg_buffers->set_isarray(false);
-    arg_buffers->set_type(GLMessage::DataType::INT64);
-    arg_buffers->add_int64value((uintptr_t)buffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteBuffers(n, buffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) buffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteFramebuffers(GLsizei n, const GLuint * framebuffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteFramebuffers);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument framebuffers
-    GLMessage_DataType *arg_framebuffers = glmsg.add_args();
-    arg_framebuffers->set_isarray(false);
-    arg_framebuffers->set_type(GLMessage::DataType::INT64);
-    arg_framebuffers->add_int64value((uintptr_t)framebuffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteFramebuffers(n, framebuffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) framebuffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteProgram(GLuint program) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteProgram);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteProgram(program);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteRenderbuffers(GLsizei n, const GLuint * renderbuffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteRenderbuffers);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument renderbuffers
-    GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
-    arg_renderbuffers->set_isarray(false);
-    arg_renderbuffers->set_type(GLMessage::DataType::INT64);
-    arg_renderbuffers->add_int64value((uintptr_t)renderbuffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteRenderbuffers(n, renderbuffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) renderbuffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteShader(GLuint shader) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteShader);
-
-    // copy argument shader
-    GLMessage_DataType *arg_shader = glmsg.add_args();
-    arg_shader->set_isarray(false);
-    arg_shader->set_type(GLMessage::DataType::INT);
-    arg_shader->add_intvalue(shader);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteShader(shader);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteTextures(GLsizei n, const GLuint * textures) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteTextures);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument textures
-    GLMessage_DataType *arg_textures = glmsg.add_args();
-    arg_textures->set_isarray(false);
-    arg_textures->set_type(GLMessage::DataType::INT64);
-    arg_textures->add_int64value((uintptr_t)textures);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteTextures(n, textures);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) textures,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDepthFunc(GLenum func) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDepthFunc);
-
-    // copy argument func
-    GLMessage_DataType *arg_func = glmsg.add_args();
-    arg_func->set_isarray(false);
-    arg_func->set_type(GLMessage::DataType::ENUM);
-    arg_func->add_intvalue((int)func);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDepthFunc(func);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDepthMask(GLboolean flag) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDepthMask);
-
-    // copy argument flag
-    GLMessage_DataType *arg_flag = glmsg.add_args();
-    arg_flag->set_isarray(false);
-    arg_flag->set_type(GLMessage::DataType::BOOL);
-    arg_flag->add_boolvalue(flag);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDepthMask(flag);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDepthRangef(GLfloat n, GLfloat f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDepthRangef);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::FLOAT);
-    arg_n->add_floatvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::FLOAT);
-    arg_f->add_floatvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDepthRangef(n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDetachShader(GLuint program, GLuint shader) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDetachShader);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument shader
-    GLMessage_DataType *arg_shader = glmsg.add_args();
-    arg_shader->set_isarray(false);
-    arg_shader->set_type(GLMessage::DataType::INT);
-    arg_shader->add_intvalue(shader);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDetachShader(program, shader);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDisable(GLenum cap) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDisable);
-
-    // copy argument cap
-    GLMessage_DataType *arg_cap = glmsg.add_args();
-    arg_cap->set_isarray(false);
-    arg_cap->set_type(GLMessage::DataType::ENUM);
-    arg_cap->add_intvalue((int)cap);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDisable(cap);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDisableVertexAttribArray(GLuint index) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDisableVertexAttribArray);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDisableVertexAttribArray(index);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawArrays(GLenum mode, GLint first, GLsizei count) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawArrays);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument first
-    GLMessage_DataType *arg_first = glmsg.add_args();
-    arg_first->set_isarray(false);
-    arg_first->set_type(GLMessage::DataType::INT);
-    arg_first->add_intvalue(first);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawArrays(mode, first, count);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawElements(GLenum mode, GLsizei count, GLenum type, const void * indices) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawElements);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument indices
-    GLMessage_DataType *arg_indices = glmsg.add_args();
-    arg_indices->set_isarray(false);
-    arg_indices->set_type(GLMessage::DataType::INT64);
-    arg_indices->add_int64value((uintptr_t)indices);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawElements(mode, count, type, indices);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) indices,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEnable(GLenum cap) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEnable);
-
-    // copy argument cap
-    GLMessage_DataType *arg_cap = glmsg.add_args();
-    arg_cap->set_isarray(false);
-    arg_cap->set_type(GLMessage::DataType::ENUM);
-    arg_cap->add_intvalue((int)cap);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEnable(cap);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEnableVertexAttribArray(GLuint index) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEnableVertexAttribArray);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEnableVertexAttribArray(index);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFinish(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFinish);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFinish();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFlush(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFlush);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFlush();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFramebufferRenderbuffer);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument attachment
-    GLMessage_DataType *arg_attachment = glmsg.add_args();
-    arg_attachment->set_isarray(false);
-    arg_attachment->set_type(GLMessage::DataType::ENUM);
-    arg_attachment->add_intvalue((int)attachment);
-
-    // copy argument renderbuffertarget
-    GLMessage_DataType *arg_renderbuffertarget = glmsg.add_args();
-    arg_renderbuffertarget->set_isarray(false);
-    arg_renderbuffertarget->set_type(GLMessage::DataType::ENUM);
-    arg_renderbuffertarget->add_intvalue((int)renderbuffertarget);
-
-    // copy argument renderbuffer
-    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
-    arg_renderbuffer->set_isarray(false);
-    arg_renderbuffer->set_type(GLMessage::DataType::INT);
-    arg_renderbuffer->add_intvalue(renderbuffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFramebufferTexture2D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument attachment
-    GLMessage_DataType *arg_attachment = glmsg.add_args();
-    arg_attachment->set_isarray(false);
-    arg_attachment->set_type(GLMessage::DataType::ENUM);
-    arg_attachment->add_intvalue((int)attachment);
-
-    // copy argument textarget
-    GLMessage_DataType *arg_textarget = glmsg.add_args();
-    arg_textarget->set_isarray(false);
-    arg_textarget->set_type(GLMessage::DataType::ENUM);
-    arg_textarget->add_intvalue((int)textarget);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFramebufferTexture2D(target, attachment, textarget, texture, level);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFrontFace(GLenum mode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFrontFace);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFrontFace(mode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenBuffers(GLsizei n, GLuint * buffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenBuffers);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument buffers
-    GLMessage_DataType *arg_buffers = glmsg.add_args();
-    arg_buffers->set_isarray(false);
-    arg_buffers->set_type(GLMessage::DataType::INT64);
-    arg_buffers->add_int64value((uintptr_t)buffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenBuffers(n, buffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) buffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenerateMipmap(GLenum target) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenerateMipmap);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenerateMipmap(target);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenFramebuffers(GLsizei n, GLuint * framebuffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenFramebuffers);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument framebuffers
-    GLMessage_DataType *arg_framebuffers = glmsg.add_args();
-    arg_framebuffers->set_isarray(false);
-    arg_framebuffers->set_type(GLMessage::DataType::INT64);
-    arg_framebuffers->add_int64value((uintptr_t)framebuffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenFramebuffers(n, framebuffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) framebuffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenRenderbuffers);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument renderbuffers
-    GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
-    arg_renderbuffers->set_isarray(false);
-    arg_renderbuffers->set_type(GLMessage::DataType::INT64);
-    arg_renderbuffers->add_int64value((uintptr_t)renderbuffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenRenderbuffers(n, renderbuffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) renderbuffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenTextures(GLsizei n, GLuint * textures) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenTextures);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument textures
-    GLMessage_DataType *arg_textures = glmsg.add_args();
-    arg_textures->set_isarray(false);
-    arg_textures->set_type(GLMessage::DataType::INT64);
-    arg_textures->add_int64value((uintptr_t)textures);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenTextures(n, textures);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) textures,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetActiveAttrib);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT64);
-    arg_size->add_int64value((uintptr_t)size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::INT64);
-    arg_type->add_int64value((uintptr_t)type);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT64);
-    arg_name->add_int64value((uintptr_t)name);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetActiveAttrib(program, index, bufSize, length, size, type, name);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) size,
-        (void *) type,
-        (void *) name,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetActiveUniform);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT64);
-    arg_size->add_int64value((uintptr_t)size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::INT64);
-    arg_type->add_int64value((uintptr_t)type);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT64);
-    arg_name->add_int64value((uintptr_t)name);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetActiveUniform(program, index, bufSize, length, size, type, name);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) size,
-        (void *) type,
-        (void *) name,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetAttachedShaders);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument maxCount
-    GLMessage_DataType *arg_maxCount = glmsg.add_args();
-    arg_maxCount->set_isarray(false);
-    arg_maxCount->set_type(GLMessage::DataType::INT);
-    arg_maxCount->add_intvalue(maxCount);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT64);
-    arg_count->add_int64value((uintptr_t)count);
-
-    // copy argument shaders
-    GLMessage_DataType *arg_shaders = glmsg.add_args();
-    arg_shaders->set_isarray(false);
-    arg_shaders->set_type(GLMessage::DataType::INT64);
-    arg_shaders->add_int64value((uintptr_t)shaders);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetAttachedShaders(program, maxCount, count, shaders);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) count,
-        (void *) shaders,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLint GLTrace_glGetAttribLocation(GLuint program, const GLchar * name) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetAttribLocation);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT64);
-    arg_name->add_int64value((uintptr_t)name);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLint retValue = glContext->hooks->gl.glGetAttribLocation(program, name);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) name,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetBooleanv(GLenum pname, GLboolean * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetBooleanv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetBooleanv(pname, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetBufferParameteriv(GLenum target, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetBufferParameteriv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetBufferParameteriv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLenum GLTrace_glGetError(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetError);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLenum retValue = glContext->hooks->gl.glGetError();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::ENUM);
-    rt->add_intvalue((int)retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetFloatv(GLenum pname, GLfloat * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetFloatv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetFloatv(pname, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetFramebufferAttachmentParameteriv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument attachment
-    GLMessage_DataType *arg_attachment = glmsg.add_args();
-    arg_attachment->set_isarray(false);
-    arg_attachment->set_type(GLMessage::DataType::ENUM);
-    arg_attachment->add_intvalue((int)attachment);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetIntegerv(GLenum pname, GLint * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetIntegerv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetIntegerv(pname, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramiv(GLuint program, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramiv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetProgramiv(program, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramInfoLog);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument infoLog
-    GLMessage_DataType *arg_infoLog = glmsg.add_args();
-    arg_infoLog->set_isarray(false);
-    arg_infoLog->set_type(GLMessage::DataType::INT64);
-    arg_infoLog->add_int64value((uintptr_t)infoLog);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetProgramInfoLog(program, bufSize, length, infoLog);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) infoLog,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetRenderbufferParameteriv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetRenderbufferParameteriv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetShaderiv(GLuint shader, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetShaderiv);
-
-    // copy argument shader
-    GLMessage_DataType *arg_shader = glmsg.add_args();
-    arg_shader->set_isarray(false);
-    arg_shader->set_type(GLMessage::DataType::INT);
-    arg_shader->add_intvalue(shader);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetShaderiv(shader, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetShaderInfoLog);
-
-    // copy argument shader
-    GLMessage_DataType *arg_shader = glmsg.add_args();
-    arg_shader->set_isarray(false);
-    arg_shader->set_type(GLMessage::DataType::INT);
-    arg_shader->add_intvalue(shader);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument infoLog
-    GLMessage_DataType *arg_infoLog = glmsg.add_args();
-    arg_infoLog->set_isarray(false);
-    arg_infoLog->set_type(GLMessage::DataType::INT64);
-    arg_infoLog->add_int64value((uintptr_t)infoLog);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetShaderInfoLog(shader, bufSize, length, infoLog);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) infoLog,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetShaderPrecisionFormat);
-
-    // copy argument shadertype
-    GLMessage_DataType *arg_shadertype = glmsg.add_args();
-    arg_shadertype->set_isarray(false);
-    arg_shadertype->set_type(GLMessage::DataType::ENUM);
-    arg_shadertype->add_intvalue((int)shadertype);
-
-    // copy argument precisiontype
-    GLMessage_DataType *arg_precisiontype = glmsg.add_args();
-    arg_precisiontype->set_isarray(false);
-    arg_precisiontype->set_type(GLMessage::DataType::ENUM);
-    arg_precisiontype->add_intvalue((int)precisiontype);
-
-    // copy argument range
-    GLMessage_DataType *arg_range = glmsg.add_args();
-    arg_range->set_isarray(false);
-    arg_range->set_type(GLMessage::DataType::INT64);
-    arg_range->add_int64value((uintptr_t)range);
-
-    // copy argument precision
-    GLMessage_DataType *arg_precision = glmsg.add_args();
-    arg_precision->set_isarray(false);
-    arg_precision->set_type(GLMessage::DataType::INT64);
-    arg_precision->add_int64value((uintptr_t)precision);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) range,
-        (void *) precision,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetShaderSource);
-
-    // copy argument shader
-    GLMessage_DataType *arg_shader = glmsg.add_args();
-    arg_shader->set_isarray(false);
-    arg_shader->set_type(GLMessage::DataType::INT);
-    arg_shader->add_intvalue(shader);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument source
-    GLMessage_DataType *arg_source = glmsg.add_args();
-    arg_source->set_isarray(false);
-    arg_source->set_type(GLMessage::DataType::INT64);
-    arg_source->add_int64value((uintptr_t)source);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetShaderSource(shader, bufSize, length, source);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) source,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-const GLubyte * GLTrace_glGetString(GLenum name) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetString);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::ENUM);
-    arg_name->add_intvalue((int)name);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    const GLubyte * retValue = glContext->hooks->gl.glGetString(name);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT64);
-    rt->add_int64value((uintptr_t)retValue);
-
-    void *pointerArgs[] = {
-        (void *) retValue,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexParameterfv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexParameterfv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexParameteriv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexParameteriv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetUniformfv(GLuint program, GLint location, GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetUniformfv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetUniformfv(program, location, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetUniformiv(GLuint program, GLint location, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetUniformiv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetUniformiv(program, location, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLint GLTrace_glGetUniformLocation(GLuint program, const GLchar * name) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetUniformLocation);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT64);
-    arg_name->add_int64value((uintptr_t)name);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLint retValue = glContext->hooks->gl.glGetUniformLocation(program, name);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) name,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetVertexAttribfv);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetVertexAttribfv(index, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetVertexAttribiv(GLuint index, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetVertexAttribiv);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetVertexAttribiv(index, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetVertexAttribPointerv(GLuint index, GLenum pname, void ** pointer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetVertexAttribPointerv);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument pointer
-    GLMessage_DataType *arg_pointer = glmsg.add_args();
-    arg_pointer->set_isarray(false);
-    arg_pointer->set_type(GLMessage::DataType::INT64);
-    arg_pointer->add_int64value((uintptr_t)pointer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetVertexAttribPointerv(index, pname, pointer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pointer,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glHint(GLenum target, GLenum mode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glHint);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glHint(target, mode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsBuffer(GLuint buffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsBuffer);
-
-    // copy argument buffer
-    GLMessage_DataType *arg_buffer = glmsg.add_args();
-    arg_buffer->set_isarray(false);
-    arg_buffer->set_type(GLMessage::DataType::INT);
-    arg_buffer->add_intvalue(buffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsBuffer(buffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-GLboolean GLTrace_glIsEnabled(GLenum cap) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsEnabled);
-
-    // copy argument cap
-    GLMessage_DataType *arg_cap = glmsg.add_args();
-    arg_cap->set_isarray(false);
-    arg_cap->set_type(GLMessage::DataType::ENUM);
-    arg_cap->add_intvalue((int)cap);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsEnabled(cap);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-GLboolean GLTrace_glIsFramebuffer(GLuint framebuffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsFramebuffer);
-
-    // copy argument framebuffer
-    GLMessage_DataType *arg_framebuffer = glmsg.add_args();
-    arg_framebuffer->set_isarray(false);
-    arg_framebuffer->set_type(GLMessage::DataType::INT);
-    arg_framebuffer->add_intvalue(framebuffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsFramebuffer(framebuffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-GLboolean GLTrace_glIsProgram(GLuint program) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsProgram);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsProgram(program);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-GLboolean GLTrace_glIsRenderbuffer(GLuint renderbuffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsRenderbuffer);
-
-    // copy argument renderbuffer
-    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
-    arg_renderbuffer->set_isarray(false);
-    arg_renderbuffer->set_type(GLMessage::DataType::INT);
-    arg_renderbuffer->add_intvalue(renderbuffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsRenderbuffer(renderbuffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-GLboolean GLTrace_glIsShader(GLuint shader) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsShader);
-
-    // copy argument shader
-    GLMessage_DataType *arg_shader = glmsg.add_args();
-    arg_shader->set_isarray(false);
-    arg_shader->set_type(GLMessage::DataType::INT);
-    arg_shader->add_intvalue(shader);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsShader(shader);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-GLboolean GLTrace_glIsTexture(GLuint texture) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsTexture);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsTexture(texture);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glLineWidth(GLfloat width) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLineWidth);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::FLOAT);
-    arg_width->add_floatvalue(width);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLineWidth(width);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLinkProgram(GLuint program) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLinkProgram);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLinkProgram(program);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPixelStorei(GLenum pname, GLint param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPixelStorei);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPixelStorei(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPolygonOffset(GLfloat factor, GLfloat units) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPolygonOffset);
-
-    // copy argument factor
-    GLMessage_DataType *arg_factor = glmsg.add_args();
-    arg_factor->set_isarray(false);
-    arg_factor->set_type(GLMessage::DataType::FLOAT);
-    arg_factor->add_floatvalue(factor);
-
-    // copy argument units
-    GLMessage_DataType *arg_units = glmsg.add_args();
-    arg_units->set_isarray(false);
-    arg_units->set_type(GLMessage::DataType::FLOAT);
-    arg_units->add_floatvalue(units);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPolygonOffset(factor, units);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glReadPixels);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument pixels
-    GLMessage_DataType *arg_pixels = glmsg.add_args();
-    arg_pixels->set_isarray(false);
-    arg_pixels->set_type(GLMessage::DataType::INT64);
-    arg_pixels->add_int64value((uintptr_t)pixels);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glReadPixels(x, y, width, height, format, type, pixels);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pixels,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glReleaseShaderCompiler(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glReleaseShaderCompiler);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glReleaseShaderCompiler();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glRenderbufferStorage);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glRenderbufferStorage(target, internalformat, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSampleCoverage(GLfloat value, GLboolean invert) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSampleCoverage);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::FLOAT);
-    arg_value->add_floatvalue(value);
-
-    // copy argument invert
-    GLMessage_DataType *arg_invert = glmsg.add_args();
-    arg_invert->set_isarray(false);
-    arg_invert->set_type(GLMessage::DataType::BOOL);
-    arg_invert->add_boolvalue(invert);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSampleCoverage(value, invert);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glScissor(GLint x, GLint y, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glScissor);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glScissor(x, y, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glShaderBinary(GLsizei count, const GLuint * shaders, GLenum binaryformat, const void * binary, GLsizei length) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glShaderBinary);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument shaders
-    GLMessage_DataType *arg_shaders = glmsg.add_args();
-    arg_shaders->set_isarray(false);
-    arg_shaders->set_type(GLMessage::DataType::INT64);
-    arg_shaders->add_int64value((uintptr_t)shaders);
-
-    // copy argument binaryformat
-    GLMessage_DataType *arg_binaryformat = glmsg.add_args();
-    arg_binaryformat->set_isarray(false);
-    arg_binaryformat->set_type(GLMessage::DataType::ENUM);
-    arg_binaryformat->add_intvalue((int)binaryformat);
-
-    // copy argument binary
-    GLMessage_DataType *arg_binary = glmsg.add_args();
-    arg_binary->set_isarray(false);
-    arg_binary->set_type(GLMessage::DataType::INT64);
-    arg_binary->add_int64value((uintptr_t)binary);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glShaderBinary(count, shaders, binaryformat, binary, length);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) shaders,
-        (void *) binary,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glShaderSource(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glShaderSource);
-
-    // copy argument shader
-    GLMessage_DataType *arg_shader = glmsg.add_args();
-    arg_shader->set_isarray(false);
-    arg_shader->set_type(GLMessage::DataType::INT);
-    arg_shader->add_intvalue(shader);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument string
-    GLMessage_DataType *arg_string = glmsg.add_args();
-    arg_string->set_isarray(false);
-    arg_string->set_type(GLMessage::DataType::INT64);
-    arg_string->add_int64value((uintptr_t)string);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glShaderSource(shader, count, string, length);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) string,
-        (void *) length,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilFunc(GLenum func, GLint ref, GLuint mask) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glStencilFunc);
-
-    // copy argument func
-    GLMessage_DataType *arg_func = glmsg.add_args();
-    arg_func->set_isarray(false);
-    arg_func->set_type(GLMessage::DataType::ENUM);
-    arg_func->add_intvalue((int)func);
-
-    // copy argument ref
-    GLMessage_DataType *arg_ref = glmsg.add_args();
-    arg_ref->set_isarray(false);
-    arg_ref->set_type(GLMessage::DataType::INT);
-    arg_ref->add_intvalue(ref);
-
-    // copy argument mask
-    GLMessage_DataType *arg_mask = glmsg.add_args();
-    arg_mask->set_isarray(false);
-    arg_mask->set_type(GLMessage::DataType::INT);
-    arg_mask->add_intvalue(mask);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glStencilFunc(func, ref, mask);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glStencilFuncSeparate);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument func
-    GLMessage_DataType *arg_func = glmsg.add_args();
-    arg_func->set_isarray(false);
-    arg_func->set_type(GLMessage::DataType::ENUM);
-    arg_func->add_intvalue((int)func);
-
-    // copy argument ref
-    GLMessage_DataType *arg_ref = glmsg.add_args();
-    arg_ref->set_isarray(false);
-    arg_ref->set_type(GLMessage::DataType::INT);
-    arg_ref->add_intvalue(ref);
-
-    // copy argument mask
-    GLMessage_DataType *arg_mask = glmsg.add_args();
-    arg_mask->set_isarray(false);
-    arg_mask->set_type(GLMessage::DataType::INT);
-    arg_mask->add_intvalue(mask);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glStencilFuncSeparate(face, func, ref, mask);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilMask(GLuint mask) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glStencilMask);
-
-    // copy argument mask
-    GLMessage_DataType *arg_mask = glmsg.add_args();
-    arg_mask->set_isarray(false);
-    arg_mask->set_type(GLMessage::DataType::INT);
-    arg_mask->add_intvalue(mask);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glStencilMask(mask);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilMaskSeparate(GLenum face, GLuint mask) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glStencilMaskSeparate);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument mask
-    GLMessage_DataType *arg_mask = glmsg.add_args();
-    arg_mask->set_isarray(false);
-    arg_mask->set_type(GLMessage::DataType::INT);
-    arg_mask->add_intvalue(mask);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glStencilMaskSeparate(face, mask);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glStencilOp);
-
-    // copy argument fail
-    GLMessage_DataType *arg_fail = glmsg.add_args();
-    arg_fail->set_isarray(false);
-    arg_fail->set_type(GLMessage::DataType::ENUM);
-    arg_fail->add_intvalue((int)fail);
-
-    // copy argument zfail
-    GLMessage_DataType *arg_zfail = glmsg.add_args();
-    arg_zfail->set_isarray(false);
-    arg_zfail->set_type(GLMessage::DataType::ENUM);
-    arg_zfail->add_intvalue((int)zfail);
-
-    // copy argument zpass
-    GLMessage_DataType *arg_zpass = glmsg.add_args();
-    arg_zpass->set_isarray(false);
-    arg_zpass->set_type(GLMessage::DataType::ENUM);
-    arg_zpass->add_intvalue((int)zpass);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glStencilOp(fail, zfail, zpass);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glStencilOpSeparate);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument sfail
-    GLMessage_DataType *arg_sfail = glmsg.add_args();
-    arg_sfail->set_isarray(false);
-    arg_sfail->set_type(GLMessage::DataType::ENUM);
-    arg_sfail->add_intvalue((int)sfail);
-
-    // copy argument dpfail
-    GLMessage_DataType *arg_dpfail = glmsg.add_args();
-    arg_dpfail->set_isarray(false);
-    arg_dpfail->set_type(GLMessage::DataType::ENUM);
-    arg_dpfail->add_intvalue((int)dpfail);
-
-    // copy argument dppass
-    GLMessage_DataType *arg_dppass = glmsg.add_args();
-    arg_dppass->set_isarray(false);
-    arg_dppass->set_type(GLMessage::DataType::ENUM);
-    arg_dppass->add_intvalue((int)dppass);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glStencilOpSeparate(face, sfail, dpfail, dppass);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexImage2D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::INT);
-    arg_internalformat->add_intvalue(internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument border
-    GLMessage_DataType *arg_border = glmsg.add_args();
-    arg_border->set_isarray(false);
-    arg_border->set_type(GLMessage::DataType::INT);
-    arg_border->add_intvalue(border);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument pixels
-    GLMessage_DataType *arg_pixels = glmsg.add_args();
-    arg_pixels->set_isarray(false);
-    arg_pixels->set_type(GLMessage::DataType::INT64);
-    arg_pixels->add_int64value((uintptr_t)pixels);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pixels,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterf(GLenum target, GLenum pname, GLfloat param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexParameterf);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::FLOAT);
-    arg_param->add_floatvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexParameterf(target, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexParameterfv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexParameterfv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameteri(GLenum target, GLenum pname, GLint param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexParameteri);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexParameteri(target, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameteriv(GLenum target, GLenum pname, const GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexParameteriv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexParameteriv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexSubImage2D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument xoffset
-    GLMessage_DataType *arg_xoffset = glmsg.add_args();
-    arg_xoffset->set_isarray(false);
-    arg_xoffset->set_type(GLMessage::DataType::INT);
-    arg_xoffset->add_intvalue(xoffset);
-
-    // copy argument yoffset
-    GLMessage_DataType *arg_yoffset = glmsg.add_args();
-    arg_yoffset->set_isarray(false);
-    arg_yoffset->set_type(GLMessage::DataType::INT);
-    arg_yoffset->add_intvalue(yoffset);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument pixels
-    GLMessage_DataType *arg_pixels = glmsg.add_args();
-    arg_pixels->set_isarray(false);
-    arg_pixels->set_type(GLMessage::DataType::INT64);
-    arg_pixels->add_int64value((uintptr_t)pixels);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pixels,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform1f(GLint location, GLfloat v0) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform1f);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform1f(location, v0);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform1fv(GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform1fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform1fv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform1i(GLint location, GLint v0) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform1i);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform1i(location, v0);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform1iv(GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform1iv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform1iv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform2f(GLint location, GLfloat v0, GLfloat v1) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform2f);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::FLOAT);
-    arg_v1->add_floatvalue(v1);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform2f(location, v0, v1);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform2fv(GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform2fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform2fv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform2i(GLint location, GLint v0, GLint v1) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform2i);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform2i(location, v0, v1);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform2iv(GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform2iv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform2iv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform3f);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::FLOAT);
-    arg_v1->add_floatvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::FLOAT);
-    arg_v2->add_floatvalue(v2);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform3f(location, v0, v1, v2);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform3fv(GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform3fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform3fv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform3i(GLint location, GLint v0, GLint v1, GLint v2) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform3i);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform3i(location, v0, v1, v2);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform3iv(GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform3iv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform3iv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform4f);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::FLOAT);
-    arg_v1->add_floatvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::FLOAT);
-    arg_v2->add_floatvalue(v2);
-
-    // copy argument v3
-    GLMessage_DataType *arg_v3 = glmsg.add_args();
-    arg_v3->set_isarray(false);
-    arg_v3->set_type(GLMessage::DataType::FLOAT);
-    arg_v3->add_floatvalue(v3);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform4f(location, v0, v1, v2, v3);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform4fv(GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform4fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform4fv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform4i);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // copy argument v3
-    GLMessage_DataType *arg_v3 = glmsg.add_args();
-    arg_v3->set_isarray(false);
-    arg_v3->set_type(GLMessage::DataType::INT);
-    arg_v3->add_intvalue(v3);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform4i(location, v0, v1, v2, v3);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform4iv(GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform4iv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform4iv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix2fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix2fv(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix3fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix3fv(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix4fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix4fv(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUseProgram(GLuint program) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUseProgram);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUseProgram(program);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glValidateProgram(GLuint program) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glValidateProgram);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glValidateProgram(program);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib1f(GLuint index, GLfloat x) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttrib1f);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::FLOAT);
-    arg_x->add_floatvalue(x);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttrib1f(index, x);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib1fv(GLuint index, const GLfloat * v) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttrib1fv);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument v
-    GLMessage_DataType *arg_v = glmsg.add_args();
-    arg_v->set_isarray(false);
-    arg_v->set_type(GLMessage::DataType::INT64);
-    arg_v->add_int64value((uintptr_t)v);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttrib1fv(index, v);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) v,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib2f(GLuint index, GLfloat x, GLfloat y) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttrib2f);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::FLOAT);
-    arg_x->add_floatvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::FLOAT);
-    arg_y->add_floatvalue(y);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttrib2f(index, x, y);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib2fv(GLuint index, const GLfloat * v) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttrib2fv);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument v
-    GLMessage_DataType *arg_v = glmsg.add_args();
-    arg_v->set_isarray(false);
-    arg_v->set_type(GLMessage::DataType::INT64);
-    arg_v->add_int64value((uintptr_t)v);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttrib2fv(index, v);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) v,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttrib3f);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::FLOAT);
-    arg_x->add_floatvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::FLOAT);
-    arg_y->add_floatvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::FLOAT);
-    arg_z->add_floatvalue(z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttrib3f(index, x, y, z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib3fv(GLuint index, const GLfloat * v) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttrib3fv);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument v
-    GLMessage_DataType *arg_v = glmsg.add_args();
-    arg_v->set_isarray(false);
-    arg_v->set_type(GLMessage::DataType::INT64);
-    arg_v->add_int64value((uintptr_t)v);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttrib3fv(index, v);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) v,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttrib4f);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::FLOAT);
-    arg_x->add_floatvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::FLOAT);
-    arg_y->add_floatvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::FLOAT);
-    arg_z->add_floatvalue(z);
-
-    // copy argument w
-    GLMessage_DataType *arg_w = glmsg.add_args();
-    arg_w->set_isarray(false);
-    arg_w->set_type(GLMessage::DataType::FLOAT);
-    arg_w->add_floatvalue(w);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttrib4f(index, x, y, z, w);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttrib4fv(GLuint index, const GLfloat * v) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttrib4fv);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument v
-    GLMessage_DataType *arg_v = glmsg.add_args();
-    arg_v->set_isarray(false);
-    arg_v->set_type(GLMessage::DataType::INT64);
-    arg_v->add_int64value((uintptr_t)v);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttrib4fv(index, v);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) v,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribPointer);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument normalized
-    GLMessage_DataType *arg_normalized = glmsg.add_args();
-    arg_normalized->set_isarray(false);
-    arg_normalized->set_type(GLMessage::DataType::BOOL);
-    arg_normalized->add_boolvalue(normalized);
-
-    // copy argument stride
-    GLMessage_DataType *arg_stride = glmsg.add_args();
-    arg_stride->set_isarray(false);
-    arg_stride->set_type(GLMessage::DataType::INT);
-    arg_stride->add_intvalue(stride);
-
-    // copy argument pointer
-    GLMessage_DataType *arg_pointer = glmsg.add_args();
-    arg_pointer->set_isarray(false);
-    arg_pointer->set_type(GLMessage::DataType::INT64);
-    arg_pointer->add_int64value((uintptr_t)pointer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribPointer(index, size, type, normalized, stride, pointer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pointer,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glViewport);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glViewport(x, y, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glReadBuffer(GLenum mode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glReadBuffer);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glReadBuffer(mode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawRangeElements);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument start
-    GLMessage_DataType *arg_start = glmsg.add_args();
-    arg_start->set_isarray(false);
-    arg_start->set_type(GLMessage::DataType::INT);
-    arg_start->add_intvalue(start);
-
-    // copy argument end
-    GLMessage_DataType *arg_end = glmsg.add_args();
-    arg_end->set_isarray(false);
-    arg_end->set_type(GLMessage::DataType::INT);
-    arg_end->add_intvalue(end);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument indices
-    GLMessage_DataType *arg_indices = glmsg.add_args();
-    arg_indices->set_isarray(false);
-    arg_indices->set_type(GLMessage::DataType::INT64);
-    arg_indices->add_int64value((uintptr_t)indices);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawRangeElements(mode, start, end, count, type, indices);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) indices,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexImage3D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::INT);
-    arg_internalformat->add_intvalue(internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // copy argument border
-    GLMessage_DataType *arg_border = glmsg.add_args();
-    arg_border->set_isarray(false);
-    arg_border->set_type(GLMessage::DataType::INT);
-    arg_border->add_intvalue(border);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument pixels
-    GLMessage_DataType *arg_pixels = glmsg.add_args();
-    arg_pixels->set_isarray(false);
-    arg_pixels->set_type(GLMessage::DataType::INT64);
-    arg_pixels->add_int64value((uintptr_t)pixels);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pixels,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexSubImage3D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument xoffset
-    GLMessage_DataType *arg_xoffset = glmsg.add_args();
-    arg_xoffset->set_isarray(false);
-    arg_xoffset->set_type(GLMessage::DataType::INT);
-    arg_xoffset->add_intvalue(xoffset);
-
-    // copy argument yoffset
-    GLMessage_DataType *arg_yoffset = glmsg.add_args();
-    arg_yoffset->set_isarray(false);
-    arg_yoffset->set_type(GLMessage::DataType::INT);
-    arg_yoffset->add_intvalue(yoffset);
-
-    // copy argument zoffset
-    GLMessage_DataType *arg_zoffset = glmsg.add_args();
-    arg_zoffset->set_isarray(false);
-    arg_zoffset->set_type(GLMessage::DataType::INT);
-    arg_zoffset->add_intvalue(zoffset);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument pixels
-    GLMessage_DataType *arg_pixels = glmsg.add_args();
-    arg_pixels->set_isarray(false);
-    arg_pixels->set_type(GLMessage::DataType::INT64);
-    arg_pixels->add_int64value((uintptr_t)pixels);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pixels,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCopyTexSubImage3D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument xoffset
-    GLMessage_DataType *arg_xoffset = glmsg.add_args();
-    arg_xoffset->set_isarray(false);
-    arg_xoffset->set_type(GLMessage::DataType::INT);
-    arg_xoffset->add_intvalue(xoffset);
-
-    // copy argument yoffset
-    GLMessage_DataType *arg_yoffset = glmsg.add_args();
-    arg_yoffset->set_isarray(false);
-    arg_yoffset->set_type(GLMessage::DataType::INT);
-    arg_yoffset->add_intvalue(yoffset);
-
-    // copy argument zoffset
-    GLMessage_DataType *arg_zoffset = glmsg.add_args();
-    arg_zoffset->set_isarray(false);
-    arg_zoffset->set_type(GLMessage::DataType::INT);
-    arg_zoffset->add_intvalue(zoffset);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCompressedTexImage3D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // copy argument border
-    GLMessage_DataType *arg_border = glmsg.add_args();
-    arg_border->set_isarray(false);
-    arg_border->set_type(GLMessage::DataType::INT);
-    arg_border->add_intvalue(border);
-
-    // copy argument imageSize
-    GLMessage_DataType *arg_imageSize = glmsg.add_args();
-    arg_imageSize->set_isarray(false);
-    arg_imageSize->set_type(GLMessage::DataType::INT);
-    arg_imageSize->add_intvalue(imageSize);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCompressedTexSubImage3D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument xoffset
-    GLMessage_DataType *arg_xoffset = glmsg.add_args();
-    arg_xoffset->set_isarray(false);
-    arg_xoffset->set_type(GLMessage::DataType::INT);
-    arg_xoffset->add_intvalue(xoffset);
-
-    // copy argument yoffset
-    GLMessage_DataType *arg_yoffset = glmsg.add_args();
-    arg_yoffset->set_isarray(false);
-    arg_yoffset->set_type(GLMessage::DataType::INT);
-    arg_yoffset->add_intvalue(yoffset);
-
-    // copy argument zoffset
-    GLMessage_DataType *arg_zoffset = glmsg.add_args();
-    arg_zoffset->set_isarray(false);
-    arg_zoffset->set_type(GLMessage::DataType::INT);
-    arg_zoffset->add_intvalue(zoffset);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument imageSize
-    GLMessage_DataType *arg_imageSize = glmsg.add_args();
-    arg_imageSize->set_isarray(false);
-    arg_imageSize->set_type(GLMessage::DataType::INT);
-    arg_imageSize->add_intvalue(imageSize);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenQueries(GLsizei n, GLuint * ids) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenQueries);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument ids
-    GLMessage_DataType *arg_ids = glmsg.add_args();
-    arg_ids->set_isarray(false);
-    arg_ids->set_type(GLMessage::DataType::INT64);
-    arg_ids->add_int64value((uintptr_t)ids);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenQueries(n, ids);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) ids,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteQueries(GLsizei n, const GLuint * ids) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteQueries);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument ids
-    GLMessage_DataType *arg_ids = glmsg.add_args();
-    arg_ids->set_isarray(false);
-    arg_ids->set_type(GLMessage::DataType::INT64);
-    arg_ids->add_int64value((uintptr_t)ids);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteQueries(n, ids);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) ids,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsQuery(GLuint id) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsQuery);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsQuery(id);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glBeginQuery(GLenum target, GLuint id) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBeginQuery);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBeginQuery(target, id);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEndQuery(GLenum target) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEndQuery);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEndQuery(target);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetQueryiv(GLenum target, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetQueryiv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetQueryiv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetQueryObjectuiv);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetQueryObjectuiv(id, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glUnmapBuffer(GLenum target) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUnmapBuffer);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glUnmapBuffer(target);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetBufferPointerv(GLenum target, GLenum pname, void ** params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetBufferPointerv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetBufferPointerv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawBuffers(GLsizei n, const GLenum * bufs) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawBuffers);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument bufs
-    GLMessage_DataType *arg_bufs = glmsg.add_args();
-    arg_bufs->set_isarray(false);
-    arg_bufs->set_type(GLMessage::DataType::INT64);
-    arg_bufs->add_int64value((uintptr_t)bufs);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawBuffers(n, bufs);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) bufs,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix2x3fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix2x3fv(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix3x2fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix3x2fv(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix2x4fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix2x4fv(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix4x2fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix4x2fv(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix3x4fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix3x4fv(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix4x3fv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix4x3fv(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlitFramebuffer);
-
-    // copy argument srcX0
-    GLMessage_DataType *arg_srcX0 = glmsg.add_args();
-    arg_srcX0->set_isarray(false);
-    arg_srcX0->set_type(GLMessage::DataType::INT);
-    arg_srcX0->add_intvalue(srcX0);
-
-    // copy argument srcY0
-    GLMessage_DataType *arg_srcY0 = glmsg.add_args();
-    arg_srcY0->set_isarray(false);
-    arg_srcY0->set_type(GLMessage::DataType::INT);
-    arg_srcY0->add_intvalue(srcY0);
-
-    // copy argument srcX1
-    GLMessage_DataType *arg_srcX1 = glmsg.add_args();
-    arg_srcX1->set_isarray(false);
-    arg_srcX1->set_type(GLMessage::DataType::INT);
-    arg_srcX1->add_intvalue(srcX1);
-
-    // copy argument srcY1
-    GLMessage_DataType *arg_srcY1 = glmsg.add_args();
-    arg_srcY1->set_isarray(false);
-    arg_srcY1->set_type(GLMessage::DataType::INT);
-    arg_srcY1->add_intvalue(srcY1);
-
-    // copy argument dstX0
-    GLMessage_DataType *arg_dstX0 = glmsg.add_args();
-    arg_dstX0->set_isarray(false);
-    arg_dstX0->set_type(GLMessage::DataType::INT);
-    arg_dstX0->add_intvalue(dstX0);
-
-    // copy argument dstY0
-    GLMessage_DataType *arg_dstY0 = glmsg.add_args();
-    arg_dstY0->set_isarray(false);
-    arg_dstY0->set_type(GLMessage::DataType::INT);
-    arg_dstY0->add_intvalue(dstY0);
-
-    // copy argument dstX1
-    GLMessage_DataType *arg_dstX1 = glmsg.add_args();
-    arg_dstX1->set_isarray(false);
-    arg_dstX1->set_type(GLMessage::DataType::INT);
-    arg_dstX1->add_intvalue(dstX1);
-
-    // copy argument dstY1
-    GLMessage_DataType *arg_dstY1 = glmsg.add_args();
-    arg_dstY1->set_isarray(false);
-    arg_dstY1->set_type(GLMessage::DataType::INT);
-    arg_dstY1->add_intvalue(dstY1);
-
-    // copy argument mask
-    GLMessage_DataType *arg_mask = glmsg.add_args();
-    arg_mask->set_isarray(false);
-    arg_mask->set_type(GLMessage::DataType::INT);
-    arg_mask->add_intvalue(mask);
-
-    // copy argument filter
-    GLMessage_DataType *arg_filter = glmsg.add_args();
-    arg_filter->set_isarray(false);
-    arg_filter->set_type(GLMessage::DataType::ENUM);
-    arg_filter->add_intvalue((int)filter);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glRenderbufferStorageMultisample);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument samples
-    GLMessage_DataType *arg_samples = glmsg.add_args();
-    arg_samples->set_isarray(false);
-    arg_samples->set_type(GLMessage::DataType::INT);
-    arg_samples->add_intvalue(samples);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFramebufferTextureLayer);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument attachment
-    GLMessage_DataType *arg_attachment = glmsg.add_args();
-    arg_attachment->set_isarray(false);
-    arg_attachment->set_type(GLMessage::DataType::ENUM);
-    arg_attachment->add_intvalue((int)attachment);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument layer
-    GLMessage_DataType *arg_layer = glmsg.add_args();
-    arg_layer->set_isarray(false);
-    arg_layer->set_type(GLMessage::DataType::INT);
-    arg_layer->add_intvalue(layer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFramebufferTextureLayer(target, attachment, texture, level, layer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void * GLTrace_glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMapBufferRange);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument offset
-    GLMessage_DataType *arg_offset = glmsg.add_args();
-    arg_offset->set_isarray(false);
-    arg_offset->set_type(GLMessage::DataType::INT);
-    arg_offset->add_intvalue(offset);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // copy argument access
-    GLMessage_DataType *arg_access = glmsg.add_args();
-    arg_access->set_isarray(false);
-    arg_access->set_type(GLMessage::DataType::INT);
-    arg_access->add_intvalue(access);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    void * retValue = glContext->hooks->gl.glMapBufferRange(target, offset, length, access);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT64);
-    rt->add_int64value((uintptr_t)retValue);
-
-    void *pointerArgs[] = {
-        (void *) retValue,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFlushMappedBufferRange);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument offset
-    GLMessage_DataType *arg_offset = glmsg.add_args();
-    arg_offset->set_isarray(false);
-    arg_offset->set_type(GLMessage::DataType::INT);
-    arg_offset->add_intvalue(offset);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFlushMappedBufferRange(target, offset, length);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindVertexArray(GLuint array) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindVertexArray);
-
-    // copy argument array
-    GLMessage_DataType *arg_array = glmsg.add_args();
-    arg_array->set_isarray(false);
-    arg_array->set_type(GLMessage::DataType::INT);
-    arg_array->add_intvalue(array);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindVertexArray(array);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteVertexArrays(GLsizei n, const GLuint * arrays) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteVertexArrays);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument arrays
-    GLMessage_DataType *arg_arrays = glmsg.add_args();
-    arg_arrays->set_isarray(false);
-    arg_arrays->set_type(GLMessage::DataType::INT64);
-    arg_arrays->add_int64value((uintptr_t)arrays);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteVertexArrays(n, arrays);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) arrays,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenVertexArrays(GLsizei n, GLuint * arrays) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenVertexArrays);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument arrays
-    GLMessage_DataType *arg_arrays = glmsg.add_args();
-    arg_arrays->set_isarray(false);
-    arg_arrays->set_type(GLMessage::DataType::INT64);
-    arg_arrays->add_int64value((uintptr_t)arrays);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenVertexArrays(n, arrays);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) arrays,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsVertexArray(GLuint array) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsVertexArray);
-
-    // copy argument array
-    GLMessage_DataType *arg_array = glmsg.add_args();
-    arg_array->set_isarray(false);
-    arg_array->set_type(GLMessage::DataType::INT);
-    arg_array->add_intvalue(array);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsVertexArray(array);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetIntegeri_v(GLenum target, GLuint index, GLint * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetIntegeri_v);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetIntegeri_v(target, index, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBeginTransformFeedback(GLenum primitiveMode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBeginTransformFeedback);
-
-    // copy argument primitiveMode
-    GLMessage_DataType *arg_primitiveMode = glmsg.add_args();
-    arg_primitiveMode->set_isarray(false);
-    arg_primitiveMode->set_type(GLMessage::DataType::ENUM);
-    arg_primitiveMode->add_intvalue((int)primitiveMode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBeginTransformFeedback(primitiveMode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEndTransformFeedback(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEndTransformFeedback);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEndTransformFeedback();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindBufferRange);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument buffer
-    GLMessage_DataType *arg_buffer = glmsg.add_args();
-    arg_buffer->set_isarray(false);
-    arg_buffer->set_type(GLMessage::DataType::INT);
-    arg_buffer->add_intvalue(buffer);
-
-    // copy argument offset
-    GLMessage_DataType *arg_offset = glmsg.add_args();
-    arg_offset->set_isarray(false);
-    arg_offset->set_type(GLMessage::DataType::INT);
-    arg_offset->add_intvalue(offset);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindBufferRange(target, index, buffer, offset, size);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindBufferBase(GLenum target, GLuint index, GLuint buffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindBufferBase);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument buffer
-    GLMessage_DataType *arg_buffer = glmsg.add_args();
-    arg_buffer->set_isarray(false);
-    arg_buffer->set_type(GLMessage::DataType::INT);
-    arg_buffer->add_intvalue(buffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindBufferBase(target, index, buffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTransformFeedbackVaryings);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument varyings
-    GLMessage_DataType *arg_varyings = glmsg.add_args();
-    arg_varyings->set_isarray(false);
-    arg_varyings->set_type(GLMessage::DataType::INT64);
-    arg_varyings->add_int64value((uintptr_t)varyings);
-
-    // copy argument bufferMode
-    GLMessage_DataType *arg_bufferMode = glmsg.add_args();
-    arg_bufferMode->set_isarray(false);
-    arg_bufferMode->set_type(GLMessage::DataType::ENUM);
-    arg_bufferMode->add_intvalue((int)bufferMode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTransformFeedbackVaryings(program, count, varyings, bufferMode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) varyings,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTransformFeedbackVarying);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT64);
-    arg_size->add_int64value((uintptr_t)size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::INT64);
-    arg_type->add_int64value((uintptr_t)type);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT64);
-    arg_name->add_int64value((uintptr_t)name);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) size,
-        (void *) type,
-        (void *) name,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribIPointer);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument stride
-    GLMessage_DataType *arg_stride = glmsg.add_args();
-    arg_stride->set_isarray(false);
-    arg_stride->set_type(GLMessage::DataType::INT);
-    arg_stride->add_intvalue(stride);
-
-    // copy argument pointer
-    GLMessage_DataType *arg_pointer = glmsg.add_args();
-    arg_pointer->set_isarray(false);
-    arg_pointer->set_type(GLMessage::DataType::INT64);
-    arg_pointer->add_int64value((uintptr_t)pointer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribIPointer(index, size, type, stride, pointer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pointer,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetVertexAttribIiv(GLuint index, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetVertexAttribIiv);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetVertexAttribIiv(index, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetVertexAttribIuiv);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetVertexAttribIuiv(index, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribI4i);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::INT);
-    arg_z->add_intvalue(z);
-
-    // copy argument w
-    GLMessage_DataType *arg_w = glmsg.add_args();
-    arg_w->set_isarray(false);
-    arg_w->set_type(GLMessage::DataType::INT);
-    arg_w->add_intvalue(w);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribI4i(index, x, y, z, w);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribI4ui);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::INT);
-    arg_z->add_intvalue(z);
-
-    // copy argument w
-    GLMessage_DataType *arg_w = glmsg.add_args();
-    arg_w->set_isarray(false);
-    arg_w->set_type(GLMessage::DataType::INT);
-    arg_w->add_intvalue(w);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribI4ui(index, x, y, z, w);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribI4iv(GLuint index, const GLint * v) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribI4iv);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument v
-    GLMessage_DataType *arg_v = glmsg.add_args();
-    arg_v->set_isarray(false);
-    arg_v->set_type(GLMessage::DataType::INT64);
-    arg_v->add_int64value((uintptr_t)v);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribI4iv(index, v);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) v,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribI4uiv(GLuint index, const GLuint * v) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribI4uiv);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument v
-    GLMessage_DataType *arg_v = glmsg.add_args();
-    arg_v->set_isarray(false);
-    arg_v->set_type(GLMessage::DataType::INT64);
-    arg_v->add_int64value((uintptr_t)v);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribI4uiv(index, v);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) v,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetUniformuiv(GLuint program, GLint location, GLuint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetUniformuiv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetUniformuiv(program, location, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLint GLTrace_glGetFragDataLocation(GLuint program, const GLchar * name) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetFragDataLocation);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT64);
-    arg_name->add_int64value((uintptr_t)name);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLint retValue = glContext->hooks->gl.glGetFragDataLocation(program, name);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) name,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glUniform1ui(GLint location, GLuint v0) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform1ui);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform1ui(location, v0);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform2ui(GLint location, GLuint v0, GLuint v1) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform2ui);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform2ui(location, v0, v1);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform3ui);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform3ui(location, v0, v1, v2);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform4ui);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // copy argument v3
-    GLMessage_DataType *arg_v3 = glmsg.add_args();
-    arg_v3->set_isarray(false);
-    arg_v3->set_type(GLMessage::DataType::INT);
-    arg_v3->add_intvalue(v3);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform4ui(location, v0, v1, v2, v3);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform1uiv(GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform1uiv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform1uiv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform2uiv(GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform2uiv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform2uiv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform3uiv(GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform3uiv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform3uiv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniform4uiv(GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniform4uiv);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniform4uiv(location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearBufferiv);
-
-    // copy argument buffer
-    GLMessage_DataType *arg_buffer = glmsg.add_args();
-    arg_buffer->set_isarray(false);
-    arg_buffer->set_type(GLMessage::DataType::ENUM);
-    arg_buffer->add_intvalue((int)buffer);
-
-    // copy argument drawbuffer
-    GLMessage_DataType *arg_drawbuffer = glmsg.add_args();
-    arg_drawbuffer->set_isarray(false);
-    arg_drawbuffer->set_type(GLMessage::DataType::INT);
-    arg_drawbuffer->add_intvalue(drawbuffer);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearBufferiv(buffer, drawbuffer, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearBufferuiv);
-
-    // copy argument buffer
-    GLMessage_DataType *arg_buffer = glmsg.add_args();
-    arg_buffer->set_isarray(false);
-    arg_buffer->set_type(GLMessage::DataType::ENUM);
-    arg_buffer->add_intvalue((int)buffer);
-
-    // copy argument drawbuffer
-    GLMessage_DataType *arg_drawbuffer = glmsg.add_args();
-    arg_drawbuffer->set_isarray(false);
-    arg_drawbuffer->set_type(GLMessage::DataType::INT);
-    arg_drawbuffer->add_intvalue(drawbuffer);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearBufferuiv(buffer, drawbuffer, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearBufferfv);
-
-    // copy argument buffer
-    GLMessage_DataType *arg_buffer = glmsg.add_args();
-    arg_buffer->set_isarray(false);
-    arg_buffer->set_type(GLMessage::DataType::ENUM);
-    arg_buffer->add_intvalue((int)buffer);
-
-    // copy argument drawbuffer
-    GLMessage_DataType *arg_drawbuffer = glmsg.add_args();
-    arg_drawbuffer->set_isarray(false);
-    arg_drawbuffer->set_type(GLMessage::DataType::INT);
-    arg_drawbuffer->add_intvalue(drawbuffer);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearBufferfv(buffer, drawbuffer, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearBufferfi);
-
-    // copy argument buffer
-    GLMessage_DataType *arg_buffer = glmsg.add_args();
-    arg_buffer->set_isarray(false);
-    arg_buffer->set_type(GLMessage::DataType::ENUM);
-    arg_buffer->add_intvalue((int)buffer);
-
-    // copy argument drawbuffer
-    GLMessage_DataType *arg_drawbuffer = glmsg.add_args();
-    arg_drawbuffer->set_isarray(false);
-    arg_drawbuffer->set_type(GLMessage::DataType::INT);
-    arg_drawbuffer->add_intvalue(drawbuffer);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::FLOAT);
-    arg_depth->add_floatvalue(depth);
-
-    // copy argument stencil
-    GLMessage_DataType *arg_stencil = glmsg.add_args();
-    arg_stencil->set_isarray(false);
-    arg_stencil->set_type(GLMessage::DataType::INT);
-    arg_stencil->add_intvalue(stencil);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearBufferfi(buffer, drawbuffer, depth, stencil);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-const GLubyte * GLTrace_glGetStringi(GLenum name, GLuint index) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetStringi);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::ENUM);
-    arg_name->add_intvalue((int)name);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    const GLubyte * retValue = glContext->hooks->gl.glGetStringi(name, index);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT64);
-    rt->add_int64value((uintptr_t)retValue);
-
-    void *pointerArgs[] = {
-        (void *) retValue,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCopyBufferSubData);
-
-    // copy argument readTarget
-    GLMessage_DataType *arg_readTarget = glmsg.add_args();
-    arg_readTarget->set_isarray(false);
-    arg_readTarget->set_type(GLMessage::DataType::ENUM);
-    arg_readTarget->add_intvalue((int)readTarget);
-
-    // copy argument writeTarget
-    GLMessage_DataType *arg_writeTarget = glmsg.add_args();
-    arg_writeTarget->set_isarray(false);
-    arg_writeTarget->set_type(GLMessage::DataType::ENUM);
-    arg_writeTarget->add_intvalue((int)writeTarget);
-
-    // copy argument readOffset
-    GLMessage_DataType *arg_readOffset = glmsg.add_args();
-    arg_readOffset->set_isarray(false);
-    arg_readOffset->set_type(GLMessage::DataType::INT);
-    arg_readOffset->add_intvalue(readOffset);
-
-    // copy argument writeOffset
-    GLMessage_DataType *arg_writeOffset = glmsg.add_args();
-    arg_writeOffset->set_isarray(false);
-    arg_writeOffset->set_type(GLMessage::DataType::INT);
-    arg_writeOffset->add_intvalue(writeOffset);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetUniformIndices);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument uniformCount
-    GLMessage_DataType *arg_uniformCount = glmsg.add_args();
-    arg_uniformCount->set_isarray(false);
-    arg_uniformCount->set_type(GLMessage::DataType::INT);
-    arg_uniformCount->add_intvalue(uniformCount);
-
-    // copy argument uniformNames
-    GLMessage_DataType *arg_uniformNames = glmsg.add_args();
-    arg_uniformNames->set_isarray(false);
-    arg_uniformNames->set_type(GLMessage::DataType::INT64);
-    arg_uniformNames->add_int64value((uintptr_t)uniformNames);
-
-    // copy argument uniformIndices
-    GLMessage_DataType *arg_uniformIndices = glmsg.add_args();
-    arg_uniformIndices->set_isarray(false);
-    arg_uniformIndices->set_type(GLMessage::DataType::INT64);
-    arg_uniformIndices->add_int64value((uintptr_t)uniformIndices);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetUniformIndices(program, uniformCount, uniformNames, uniformIndices);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) uniformNames,
-        (void *) uniformIndices,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetActiveUniformsiv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument uniformCount
-    GLMessage_DataType *arg_uniformCount = glmsg.add_args();
-    arg_uniformCount->set_isarray(false);
-    arg_uniformCount->set_type(GLMessage::DataType::INT);
-    arg_uniformCount->add_intvalue(uniformCount);
-
-    // copy argument uniformIndices
-    GLMessage_DataType *arg_uniformIndices = glmsg.add_args();
-    arg_uniformIndices->set_isarray(false);
-    arg_uniformIndices->set_type(GLMessage::DataType::INT64);
-    arg_uniformIndices->add_int64value((uintptr_t)uniformIndices);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) uniformIndices,
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLuint GLTrace_glGetUniformBlockIndex(GLuint program, const GLchar * uniformBlockName) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetUniformBlockIndex);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument uniformBlockName
-    GLMessage_DataType *arg_uniformBlockName = glmsg.add_args();
-    arg_uniformBlockName->set_isarray(false);
-    arg_uniformBlockName->set_type(GLMessage::DataType::INT64);
-    arg_uniformBlockName->add_int64value((uintptr_t)uniformBlockName);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLuint retValue = glContext->hooks->gl.glGetUniformBlockIndex(program, uniformBlockName);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) uniformBlockName,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetActiveUniformBlockiv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument uniformBlockIndex
-    GLMessage_DataType *arg_uniformBlockIndex = glmsg.add_args();
-    arg_uniformBlockIndex->set_isarray(false);
-    arg_uniformBlockIndex->set_type(GLMessage::DataType::INT);
-    arg_uniformBlockIndex->add_intvalue(uniformBlockIndex);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetActiveUniformBlockName);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument uniformBlockIndex
-    GLMessage_DataType *arg_uniformBlockIndex = glmsg.add_args();
-    arg_uniformBlockIndex->set_isarray(false);
-    arg_uniformBlockIndex->set_type(GLMessage::DataType::INT);
-    arg_uniformBlockIndex->add_intvalue(uniformBlockIndex);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument uniformBlockName
-    GLMessage_DataType *arg_uniformBlockName = glmsg.add_args();
-    arg_uniformBlockName->set_isarray(false);
-    arg_uniformBlockName->set_type(GLMessage::DataType::INT64);
-    arg_uniformBlockName->add_int64value((uintptr_t)uniformBlockName);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) uniformBlockName,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformBlockBinding);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument uniformBlockIndex
-    GLMessage_DataType *arg_uniformBlockIndex = glmsg.add_args();
-    arg_uniformBlockIndex->set_isarray(false);
-    arg_uniformBlockIndex->set_type(GLMessage::DataType::INT);
-    arg_uniformBlockIndex->add_intvalue(uniformBlockIndex);
-
-    // copy argument uniformBlockBinding
-    GLMessage_DataType *arg_uniformBlockBinding = glmsg.add_args();
-    arg_uniformBlockBinding->set_isarray(false);
-    arg_uniformBlockBinding->set_type(GLMessage::DataType::INT);
-    arg_uniformBlockBinding->add_intvalue(uniformBlockBinding);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawArraysInstanced);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument first
-    GLMessage_DataType *arg_first = glmsg.add_args();
-    arg_first->set_isarray(false);
-    arg_first->set_type(GLMessage::DataType::INT);
-    arg_first->add_intvalue(first);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument instancecount
-    GLMessage_DataType *arg_instancecount = glmsg.add_args();
-    arg_instancecount->set_isarray(false);
-    arg_instancecount->set_type(GLMessage::DataType::INT);
-    arg_instancecount->add_intvalue(instancecount);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawArraysInstanced(mode, first, count, instancecount);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawElementsInstanced);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument indices
-    GLMessage_DataType *arg_indices = glmsg.add_args();
-    arg_indices->set_isarray(false);
-    arg_indices->set_type(GLMessage::DataType::INT64);
-    arg_indices->add_int64value((uintptr_t)indices);
-
-    // copy argument instancecount
-    GLMessage_DataType *arg_instancecount = glmsg.add_args();
-    arg_instancecount->set_isarray(false);
-    arg_instancecount->set_type(GLMessage::DataType::INT);
-    arg_instancecount->add_intvalue(instancecount);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawElementsInstanced(mode, count, type, indices, instancecount);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) indices,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLsync GLTrace_glFenceSync(GLenum condition, GLbitfield flags) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFenceSync);
-
-    // copy argument condition
-    GLMessage_DataType *arg_condition = glmsg.add_args();
-    arg_condition->set_isarray(false);
-    arg_condition->set_type(GLMessage::DataType::ENUM);
-    arg_condition->add_intvalue((int)condition);
-
-    // copy argument flags
-    GLMessage_DataType *arg_flags = glmsg.add_args();
-    arg_flags->set_isarray(false);
-    arg_flags->set_type(GLMessage::DataType::INT);
-    arg_flags->add_intvalue(flags);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLsync retValue = glContext->hooks->gl.glFenceSync(condition, flags);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT64);
-    rt->add_int64value((uintptr_t)retValue);
-
-    void *pointerArgs[] = {
-        (void *) retValue,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-GLboolean GLTrace_glIsSync(GLsync sync) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsSync);
-
-    // copy argument sync
-    GLMessage_DataType *arg_sync = glmsg.add_args();
-    arg_sync->set_isarray(false);
-    arg_sync->set_type(GLMessage::DataType::INT64);
-    arg_sync->add_int64value((uintptr_t)sync);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsSync(sync);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) sync,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glDeleteSync(GLsync sync) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteSync);
-
-    // copy argument sync
-    GLMessage_DataType *arg_sync = glmsg.add_args();
-    arg_sync->set_isarray(false);
-    arg_sync->set_type(GLMessage::DataType::INT64);
-    arg_sync->add_int64value((uintptr_t)sync);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteSync(sync);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) sync,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLenum GLTrace_glClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClientWaitSync);
-
-    // copy argument sync
-    GLMessage_DataType *arg_sync = glmsg.add_args();
-    arg_sync->set_isarray(false);
-    arg_sync->set_type(GLMessage::DataType::INT64);
-    arg_sync->add_int64value((uintptr_t)sync);
-
-    // copy argument flags
-    GLMessage_DataType *arg_flags = glmsg.add_args();
-    arg_flags->set_isarray(false);
-    arg_flags->set_type(GLMessage::DataType::INT);
-    arg_flags->add_intvalue(flags);
-
-    // copy argument timeout
-    GLMessage_DataType *arg_timeout = glmsg.add_args();
-    arg_timeout->set_isarray(false);
-    arg_timeout->set_type(GLMessage::DataType::INT64);
-    arg_timeout->add_int64value(timeout);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLenum retValue = glContext->hooks->gl.glClientWaitSync(sync, flags, timeout);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::ENUM);
-    rt->add_intvalue((int)retValue);
-
-    void *pointerArgs[] = {
-        (void *) sync,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glWaitSync);
-
-    // copy argument sync
-    GLMessage_DataType *arg_sync = glmsg.add_args();
-    arg_sync->set_isarray(false);
-    arg_sync->set_type(GLMessage::DataType::INT64);
-    arg_sync->add_int64value((uintptr_t)sync);
-
-    // copy argument flags
-    GLMessage_DataType *arg_flags = glmsg.add_args();
-    arg_flags->set_isarray(false);
-    arg_flags->set_type(GLMessage::DataType::INT);
-    arg_flags->add_intvalue(flags);
-
-    // copy argument timeout
-    GLMessage_DataType *arg_timeout = glmsg.add_args();
-    arg_timeout->set_isarray(false);
-    arg_timeout->set_type(GLMessage::DataType::INT64);
-    arg_timeout->add_int64value(timeout);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glWaitSync(sync, flags, timeout);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) sync,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetInteger64v(GLenum pname, GLint64 * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetInteger64v);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetInteger64v(pname, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetSynciv);
-
-    // copy argument sync
-    GLMessage_DataType *arg_sync = glmsg.add_args();
-    arg_sync->set_isarray(false);
-    arg_sync->set_type(GLMessage::DataType::INT64);
-    arg_sync->add_int64value((uintptr_t)sync);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument values
-    GLMessage_DataType *arg_values = glmsg.add_args();
-    arg_values->set_isarray(false);
-    arg_values->set_type(GLMessage::DataType::INT64);
-    arg_values->add_int64value((uintptr_t)values);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetSynciv(sync, pname, bufSize, length, values);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) sync,
-        (void *) length,
-        (void *) values,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetInteger64i_v(GLenum target, GLuint index, GLint64 * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetInteger64i_v);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetInteger64i_v(target, index, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetBufferParameteri64v(GLenum target, GLenum pname, GLint64 * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetBufferParameteri64v);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetBufferParameteri64v(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenSamplers(GLsizei count, GLuint * samplers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenSamplers);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument samplers
-    GLMessage_DataType *arg_samplers = glmsg.add_args();
-    arg_samplers->set_isarray(false);
-    arg_samplers->set_type(GLMessage::DataType::INT64);
-    arg_samplers->add_int64value((uintptr_t)samplers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenSamplers(count, samplers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) samplers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteSamplers(GLsizei count, const GLuint * samplers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteSamplers);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument samplers
-    GLMessage_DataType *arg_samplers = glmsg.add_args();
-    arg_samplers->set_isarray(false);
-    arg_samplers->set_type(GLMessage::DataType::INT64);
-    arg_samplers->add_int64value((uintptr_t)samplers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteSamplers(count, samplers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) samplers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsSampler(GLuint sampler) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsSampler);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsSampler(sampler);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glBindSampler(GLuint unit, GLuint sampler) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindSampler);
-
-    // copy argument unit
-    GLMessage_DataType *arg_unit = glmsg.add_args();
-    arg_unit->set_isarray(false);
-    arg_unit->set_type(GLMessage::DataType::INT);
-    arg_unit->add_intvalue(unit);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindSampler(unit, sampler);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSamplerParameteri(GLuint sampler, GLenum pname, GLint param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSamplerParameteri);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSamplerParameteri(sampler, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint * param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSamplerParameteriv);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT64);
-    arg_param->add_int64value((uintptr_t)param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSamplerParameteriv(sampler, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) param,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSamplerParameterf);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::FLOAT);
-    arg_param->add_floatvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSamplerParameterf(sampler, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat * param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSamplerParameterfv);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT64);
-    arg_param->add_int64value((uintptr_t)param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSamplerParameterfv(sampler, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) param,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetSamplerParameteriv);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetSamplerParameteriv(sampler, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetSamplerParameterfv);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetSamplerParameterfv(sampler, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribDivisor(GLuint index, GLuint divisor) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribDivisor);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument divisor
-    GLMessage_DataType *arg_divisor = glmsg.add_args();
-    arg_divisor->set_isarray(false);
-    arg_divisor->set_type(GLMessage::DataType::INT);
-    arg_divisor->add_intvalue(divisor);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribDivisor(index, divisor);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindTransformFeedback(GLenum target, GLuint id) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindTransformFeedback);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindTransformFeedback(target, id);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteTransformFeedbacks(GLsizei n, const GLuint * ids) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteTransformFeedbacks);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument ids
-    GLMessage_DataType *arg_ids = glmsg.add_args();
-    arg_ids->set_isarray(false);
-    arg_ids->set_type(GLMessage::DataType::INT64);
-    arg_ids->add_int64value((uintptr_t)ids);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteTransformFeedbacks(n, ids);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) ids,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenTransformFeedbacks(GLsizei n, GLuint * ids) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenTransformFeedbacks);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument ids
-    GLMessage_DataType *arg_ids = glmsg.add_args();
-    arg_ids->set_isarray(false);
-    arg_ids->set_type(GLMessage::DataType::INT64);
-    arg_ids->add_int64value((uintptr_t)ids);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenTransformFeedbacks(n, ids);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) ids,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsTransformFeedback(GLuint id) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsTransformFeedback);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsTransformFeedback(id);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glPauseTransformFeedback(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPauseTransformFeedback);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPauseTransformFeedback();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glResumeTransformFeedback(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glResumeTransformFeedback);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glResumeTransformFeedback();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramBinary);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument binaryFormat
-    GLMessage_DataType *arg_binaryFormat = glmsg.add_args();
-    arg_binaryFormat->set_isarray(false);
-    arg_binaryFormat->set_type(GLMessage::DataType::INT64);
-    arg_binaryFormat->add_int64value((uintptr_t)binaryFormat);
-
-    // copy argument binary
-    GLMessage_DataType *arg_binary = glmsg.add_args();
-    arg_binary->set_isarray(false);
-    arg_binary->set_type(GLMessage::DataType::INT64);
-    arg_binary->add_int64value((uintptr_t)binary);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetProgramBinary(program, bufSize, length, binaryFormat, binary);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) binaryFormat,
-        (void *) binary,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramBinary(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramBinary);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument binaryFormat
-    GLMessage_DataType *arg_binaryFormat = glmsg.add_args();
-    arg_binaryFormat->set_isarray(false);
-    arg_binaryFormat->set_type(GLMessage::DataType::ENUM);
-    arg_binaryFormat->add_intvalue((int)binaryFormat);
-
-    // copy argument binary
-    GLMessage_DataType *arg_binary = glmsg.add_args();
-    arg_binary->set_isarray(false);
-    arg_binary->set_type(GLMessage::DataType::INT64);
-    arg_binary->add_int64value((uintptr_t)binary);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramBinary(program, binaryFormat, binary, length);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) binary,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramParameteri(GLuint program, GLenum pname, GLint value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramParameteri);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT);
-    arg_value->add_intvalue(value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramParameteri(program, pname, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glInvalidateFramebuffer);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument numAttachments
-    GLMessage_DataType *arg_numAttachments = glmsg.add_args();
-    arg_numAttachments->set_isarray(false);
-    arg_numAttachments->set_type(GLMessage::DataType::INT);
-    arg_numAttachments->add_intvalue(numAttachments);
-
-    // copy argument attachments
-    GLMessage_DataType *arg_attachments = glmsg.add_args();
-    arg_attachments->set_isarray(false);
-    arg_attachments->set_type(GLMessage::DataType::INT64);
-    arg_attachments->add_int64value((uintptr_t)attachments);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glInvalidateFramebuffer(target, numAttachments, attachments);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) attachments,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glInvalidateSubFramebuffer);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument numAttachments
-    GLMessage_DataType *arg_numAttachments = glmsg.add_args();
-    arg_numAttachments->set_isarray(false);
-    arg_numAttachments->set_type(GLMessage::DataType::INT);
-    arg_numAttachments->add_intvalue(numAttachments);
-
-    // copy argument attachments
-    GLMessage_DataType *arg_attachments = glmsg.add_args();
-    arg_attachments->set_isarray(false);
-    arg_attachments->set_type(GLMessage::DataType::INT64);
-    arg_attachments->add_int64value((uintptr_t)attachments);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glInvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) attachments,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexStorage2D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument levels
-    GLMessage_DataType *arg_levels = glmsg.add_args();
-    arg_levels->set_isarray(false);
-    arg_levels->set_type(GLMessage::DataType::INT);
-    arg_levels->add_intvalue(levels);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexStorage2D(target, levels, internalformat, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexStorage3D);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument levels
-    GLMessage_DataType *arg_levels = glmsg.add_args();
-    arg_levels->set_isarray(false);
-    arg_levels->set_type(GLMessage::DataType::INT);
-    arg_levels->add_intvalue(levels);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexStorage3D(target, levels, internalformat, width, height, depth);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetInternalformativ);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetInternalformativ(target, internalformat, pname, bufSize, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDispatchCompute);
-
-    // copy argument num_groups_x
-    GLMessage_DataType *arg_num_groups_x = glmsg.add_args();
-    arg_num_groups_x->set_isarray(false);
-    arg_num_groups_x->set_type(GLMessage::DataType::INT);
-    arg_num_groups_x->add_intvalue(num_groups_x);
-
-    // copy argument num_groups_y
-    GLMessage_DataType *arg_num_groups_y = glmsg.add_args();
-    arg_num_groups_y->set_isarray(false);
-    arg_num_groups_y->set_type(GLMessage::DataType::INT);
-    arg_num_groups_y->add_intvalue(num_groups_y);
-
-    // copy argument num_groups_z
-    GLMessage_DataType *arg_num_groups_z = glmsg.add_args();
-    arg_num_groups_z->set_isarray(false);
-    arg_num_groups_z->set_type(GLMessage::DataType::INT);
-    arg_num_groups_z->add_intvalue(num_groups_z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDispatchCompute(num_groups_x, num_groups_y, num_groups_z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDispatchComputeIndirect(GLintptr indirect) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDispatchComputeIndirect);
-
-    // copy argument indirect
-    GLMessage_DataType *arg_indirect = glmsg.add_args();
-    arg_indirect->set_isarray(false);
-    arg_indirect->set_type(GLMessage::DataType::INT);
-    arg_indirect->add_intvalue(indirect);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDispatchComputeIndirect(indirect);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawArraysIndirect(GLenum mode, const void * indirect) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawArraysIndirect);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument indirect
-    GLMessage_DataType *arg_indirect = glmsg.add_args();
-    arg_indirect->set_isarray(false);
-    arg_indirect->set_type(GLMessage::DataType::INT64);
-    arg_indirect->add_int64value((uintptr_t)indirect);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawArraysIndirect(mode, indirect);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) indirect,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawElementsIndirect(GLenum mode, GLenum type, const void * indirect) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawElementsIndirect);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument indirect
-    GLMessage_DataType *arg_indirect = glmsg.add_args();
-    arg_indirect->set_isarray(false);
-    arg_indirect->set_type(GLMessage::DataType::INT64);
-    arg_indirect->add_int64value((uintptr_t)indirect);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawElementsIndirect(mode, type, indirect);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) indirect,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferParameteri(GLenum target, GLenum pname, GLint param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFramebufferParameteri);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFramebufferParameteri(target, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetFramebufferParameteriv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetFramebufferParameteriv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramInterfaceiv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument programInterface
-    GLMessage_DataType *arg_programInterface = glmsg.add_args();
-    arg_programInterface->set_isarray(false);
-    arg_programInterface->set_type(GLMessage::DataType::ENUM);
-    arg_programInterface->add_intvalue((int)programInterface);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetProgramInterfaceiv(program, programInterface, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLuint GLTrace_glGetProgramResourceIndex(GLuint program, GLenum programInterface, const GLchar * name) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramResourceIndex);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument programInterface
-    GLMessage_DataType *arg_programInterface = glmsg.add_args();
-    arg_programInterface->set_isarray(false);
-    arg_programInterface->set_type(GLMessage::DataType::ENUM);
-    arg_programInterface->add_intvalue((int)programInterface);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT64);
-    arg_name->add_int64value((uintptr_t)name);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLuint retValue = glContext->hooks->gl.glGetProgramResourceIndex(program, programInterface, name);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) name,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei * length, GLchar * name) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramResourceName);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument programInterface
-    GLMessage_DataType *arg_programInterface = glmsg.add_args();
-    arg_programInterface->set_isarray(false);
-    arg_programInterface->set_type(GLMessage::DataType::ENUM);
-    arg_programInterface->add_intvalue((int)programInterface);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT64);
-    arg_name->add_int64value((uintptr_t)name);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetProgramResourceName(program, programInterface, index, bufSize, length, name);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) name,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramResourceiv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument programInterface
-    GLMessage_DataType *arg_programInterface = glmsg.add_args();
-    arg_programInterface->set_isarray(false);
-    arg_programInterface->set_type(GLMessage::DataType::ENUM);
-    arg_programInterface->add_intvalue((int)programInterface);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument propCount
-    GLMessage_DataType *arg_propCount = glmsg.add_args();
-    arg_propCount->set_isarray(false);
-    arg_propCount->set_type(GLMessage::DataType::INT);
-    arg_propCount->add_intvalue(propCount);
-
-    // copy argument props
-    GLMessage_DataType *arg_props = glmsg.add_args();
-    arg_props->set_isarray(false);
-    arg_props->set_type(GLMessage::DataType::INT64);
-    arg_props->add_int64value((uintptr_t)props);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetProgramResourceiv(program, programInterface, index, propCount, props, bufSize, length, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) props,
-        (void *) length,
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLint GLTrace_glGetProgramResourceLocation(GLuint program, GLenum programInterface, const GLchar * name) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramResourceLocation);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument programInterface
-    GLMessage_DataType *arg_programInterface = glmsg.add_args();
-    arg_programInterface->set_isarray(false);
-    arg_programInterface->set_type(GLMessage::DataType::ENUM);
-    arg_programInterface->add_intvalue((int)programInterface);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT64);
-    arg_name->add_int64value((uintptr_t)name);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLint retValue = glContext->hooks->gl.glGetProgramResourceLocation(program, programInterface, name);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) name,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUseProgramStages);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // copy argument stages
-    GLMessage_DataType *arg_stages = glmsg.add_args();
-    arg_stages->set_isarray(false);
-    arg_stages->set_type(GLMessage::DataType::INT);
-    arg_stages->add_intvalue(stages);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUseProgramStages(pipeline, stages, program);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glActiveShaderProgram(GLuint pipeline, GLuint program) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glActiveShaderProgram);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glActiveShaderProgram(pipeline, program);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLuint GLTrace_glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const* strings) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCreateShaderProgramv);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument strings
-    GLMessage_DataType *arg_strings = glmsg.add_args();
-    arg_strings->set_isarray(false);
-    arg_strings->set_type(GLMessage::DataType::INT64);
-    arg_strings->add_int64value((uintptr_t)strings);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLuint retValue = glContext->hooks->gl.glCreateShaderProgramv(type, count, strings);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) strings,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glBindProgramPipeline(GLuint pipeline) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindProgramPipeline);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindProgramPipeline(pipeline);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteProgramPipelines(GLsizei n, const GLuint * pipelines) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteProgramPipelines);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument pipelines
-    GLMessage_DataType *arg_pipelines = glmsg.add_args();
-    arg_pipelines->set_isarray(false);
-    arg_pipelines->set_type(GLMessage::DataType::INT64);
-    arg_pipelines->add_int64value((uintptr_t)pipelines);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteProgramPipelines(n, pipelines);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pipelines,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenProgramPipelines(GLsizei n, GLuint * pipelines) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenProgramPipelines);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument pipelines
-    GLMessage_DataType *arg_pipelines = glmsg.add_args();
-    arg_pipelines->set_isarray(false);
-    arg_pipelines->set_type(GLMessage::DataType::INT64);
-    arg_pipelines->add_int64value((uintptr_t)pipelines);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenProgramPipelines(n, pipelines);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pipelines,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsProgramPipeline(GLuint pipeline) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsProgramPipeline);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsProgramPipeline(pipeline);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramPipelineiv);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetProgramPipelineiv(pipeline, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1i(GLuint program, GLint location, GLint v0) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1i);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1i(program, location, v0);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2i);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2i(program, location, v0, v1);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3i);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3i(program, location, v0, v1, v2);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4i);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // copy argument v3
-    GLMessage_DataType *arg_v3 = glmsg.add_args();
-    arg_v3->set_isarray(false);
-    arg_v3->set_type(GLMessage::DataType::INT);
-    arg_v3->add_intvalue(v3);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4i(program, location, v0, v1, v2, v3);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1ui(GLuint program, GLint location, GLuint v0) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1ui);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1ui(program, location, v0);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2ui);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2ui(program, location, v0, v1);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3ui);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3ui(program, location, v0, v1, v2);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4ui);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // copy argument v3
-    GLMessage_DataType *arg_v3 = glmsg.add_args();
-    arg_v3->set_isarray(false);
-    arg_v3->set_type(GLMessage::DataType::INT);
-    arg_v3->add_intvalue(v3);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4ui(program, location, v0, v1, v2, v3);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1f(GLuint program, GLint location, GLfloat v0) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1f);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1f(program, location, v0);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2f);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::FLOAT);
-    arg_v1->add_floatvalue(v1);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2f(program, location, v0, v1);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3f);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::FLOAT);
-    arg_v1->add_floatvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::FLOAT);
-    arg_v2->add_floatvalue(v2);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3f(program, location, v0, v1, v2);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4f);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::FLOAT);
-    arg_v1->add_floatvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::FLOAT);
-    arg_v2->add_floatvalue(v2);
-
-    // copy argument v3
-    GLMessage_DataType *arg_v3 = glmsg.add_args();
-    arg_v3->set_isarray(false);
-    arg_v3->set_type(GLMessage::DataType::FLOAT);
-    arg_v3->add_floatvalue(v3);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4f(program, location, v0, v1, v2, v3);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1iv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1iv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2iv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2iv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3iv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3iv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4iv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4iv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1uiv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1uiv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2uiv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2uiv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3uiv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3uiv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4uiv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4uiv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1fv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2fv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3fv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4fv(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix2fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix2fv(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix3fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix3fv(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix4fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix4fv(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix2x3fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix2x3fv(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix3x2fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix3x2fv(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix2x4fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix2x4fv(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix4x2fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix4x2fv(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix3x4fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix3x4fv(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix4x3fv);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix4x3fv(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glValidateProgramPipeline(GLuint pipeline) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glValidateProgramPipeline);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glValidateProgramPipeline(pipeline);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramPipelineInfoLog);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument infoLog
-    GLMessage_DataType *arg_infoLog = glmsg.add_args();
-    arg_infoLog->set_isarray(false);
-    arg_infoLog->set_type(GLMessage::DataType::INT64);
-    arg_infoLog->add_int64value((uintptr_t)infoLog);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) infoLog,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindImageTexture);
-
-    // copy argument unit
-    GLMessage_DataType *arg_unit = glmsg.add_args();
-    arg_unit->set_isarray(false);
-    arg_unit->set_type(GLMessage::DataType::INT);
-    arg_unit->add_intvalue(unit);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument layered
-    GLMessage_DataType *arg_layered = glmsg.add_args();
-    arg_layered->set_isarray(false);
-    arg_layered->set_type(GLMessage::DataType::BOOL);
-    arg_layered->add_boolvalue(layered);
-
-    // copy argument layer
-    GLMessage_DataType *arg_layer = glmsg.add_args();
-    arg_layer->set_isarray(false);
-    arg_layer->set_type(GLMessage::DataType::INT);
-    arg_layer->add_intvalue(layer);
-
-    // copy argument access
-    GLMessage_DataType *arg_access = glmsg.add_args();
-    arg_access->set_isarray(false);
-    arg_access->set_type(GLMessage::DataType::ENUM);
-    arg_access->add_intvalue((int)access);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindImageTexture(unit, texture, level, layered, layer, access, format);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetBooleani_v(GLenum target, GLuint index, GLboolean * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetBooleani_v);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetBooleani_v(target, index, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMemoryBarrier(GLbitfield barriers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMemoryBarrier);
-
-    // copy argument barriers
-    GLMessage_DataType *arg_barriers = glmsg.add_args();
-    arg_barriers->set_isarray(false);
-    arg_barriers->set_type(GLMessage::DataType::INT);
-    arg_barriers->add_intvalue(barriers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMemoryBarrier(barriers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMemoryBarrierByRegion(GLbitfield barriers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMemoryBarrierByRegion);
-
-    // copy argument barriers
-    GLMessage_DataType *arg_barriers = glmsg.add_args();
-    arg_barriers->set_isarray(false);
-    arg_barriers->set_type(GLMessage::DataType::INT);
-    arg_barriers->add_intvalue(barriers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMemoryBarrierByRegion(barriers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexStorage2DMultisample);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument samples
-    GLMessage_DataType *arg_samples = glmsg.add_args();
-    arg_samples->set_isarray(false);
-    arg_samples->set_type(GLMessage::DataType::INT);
-    arg_samples->add_intvalue(samples);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument fixedsamplelocations
-    GLMessage_DataType *arg_fixedsamplelocations = glmsg.add_args();
-    arg_fixedsamplelocations->set_isarray(false);
-    arg_fixedsamplelocations->set_type(GLMessage::DataType::BOOL);
-    arg_fixedsamplelocations->add_boolvalue(fixedsamplelocations);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetMultisamplefv(GLenum pname, GLuint index, GLfloat * val) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetMultisamplefv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument val
-    GLMessage_DataType *arg_val = glmsg.add_args();
-    arg_val->set_isarray(false);
-    arg_val->set_type(GLMessage::DataType::INT64);
-    arg_val->add_int64value((uintptr_t)val);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetMultisamplefv(pname, index, val);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) val,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSampleMaski(GLuint maskNumber, GLbitfield mask) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSampleMaski);
-
-    // copy argument maskNumber
-    GLMessage_DataType *arg_maskNumber = glmsg.add_args();
-    arg_maskNumber->set_isarray(false);
-    arg_maskNumber->set_type(GLMessage::DataType::INT);
-    arg_maskNumber->add_intvalue(maskNumber);
-
-    // copy argument mask
-    GLMessage_DataType *arg_mask = glmsg.add_args();
-    arg_mask->set_isarray(false);
-    arg_mask->set_type(GLMessage::DataType::INT);
-    arg_mask->add_intvalue(mask);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSampleMaski(maskNumber, mask);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexLevelParameteriv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexLevelParameteriv(target, level, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexLevelParameterfv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexLevelParameterfv(target, level, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindVertexBuffer);
-
-    // copy argument bindingindex
-    GLMessage_DataType *arg_bindingindex = glmsg.add_args();
-    arg_bindingindex->set_isarray(false);
-    arg_bindingindex->set_type(GLMessage::DataType::INT);
-    arg_bindingindex->add_intvalue(bindingindex);
-
-    // copy argument buffer
-    GLMessage_DataType *arg_buffer = glmsg.add_args();
-    arg_buffer->set_isarray(false);
-    arg_buffer->set_type(GLMessage::DataType::INT);
-    arg_buffer->add_intvalue(buffer);
-
-    // copy argument offset
-    GLMessage_DataType *arg_offset = glmsg.add_args();
-    arg_offset->set_isarray(false);
-    arg_offset->set_type(GLMessage::DataType::INT);
-    arg_offset->add_intvalue(offset);
-
-    // copy argument stride
-    GLMessage_DataType *arg_stride = glmsg.add_args();
-    arg_stride->set_isarray(false);
-    arg_stride->set_type(GLMessage::DataType::INT);
-    arg_stride->add_intvalue(stride);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindVertexBuffer(bindingindex, buffer, offset, stride);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribFormat);
-
-    // copy argument attribindex
-    GLMessage_DataType *arg_attribindex = glmsg.add_args();
-    arg_attribindex->set_isarray(false);
-    arg_attribindex->set_type(GLMessage::DataType::INT);
-    arg_attribindex->add_intvalue(attribindex);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument normalized
-    GLMessage_DataType *arg_normalized = glmsg.add_args();
-    arg_normalized->set_isarray(false);
-    arg_normalized->set_type(GLMessage::DataType::BOOL);
-    arg_normalized->add_boolvalue(normalized);
-
-    // copy argument relativeoffset
-    GLMessage_DataType *arg_relativeoffset = glmsg.add_args();
-    arg_relativeoffset->set_isarray(false);
-    arg_relativeoffset->set_type(GLMessage::DataType::INT);
-    arg_relativeoffset->add_intvalue(relativeoffset);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribFormat(attribindex, size, type, normalized, relativeoffset);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribIFormat);
-
-    // copy argument attribindex
-    GLMessage_DataType *arg_attribindex = glmsg.add_args();
-    arg_attribindex->set_isarray(false);
-    arg_attribindex->set_type(GLMessage::DataType::INT);
-    arg_attribindex->add_intvalue(attribindex);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument relativeoffset
-    GLMessage_DataType *arg_relativeoffset = glmsg.add_args();
-    arg_relativeoffset->set_isarray(false);
-    arg_relativeoffset->set_type(GLMessage::DataType::INT);
-    arg_relativeoffset->add_intvalue(relativeoffset);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribIFormat(attribindex, size, type, relativeoffset);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribBinding(GLuint attribindex, GLuint bindingindex) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribBinding);
-
-    // copy argument attribindex
-    GLMessage_DataType *arg_attribindex = glmsg.add_args();
-    arg_attribindex->set_isarray(false);
-    arg_attribindex->set_type(GLMessage::DataType::INT);
-    arg_attribindex->add_intvalue(attribindex);
-
-    // copy argument bindingindex
-    GLMessage_DataType *arg_bindingindex = glmsg.add_args();
-    arg_bindingindex->set_isarray(false);
-    arg_bindingindex->set_type(GLMessage::DataType::INT);
-    arg_bindingindex->add_intvalue(bindingindex);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribBinding(attribindex, bindingindex);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexBindingDivisor(GLuint bindingindex, GLuint divisor) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexBindingDivisor);
-
-    // copy argument bindingindex
-    GLMessage_DataType *arg_bindingindex = glmsg.add_args();
-    arg_bindingindex->set_isarray(false);
-    arg_bindingindex->set_type(GLMessage::DataType::INT);
-    arg_bindingindex->add_intvalue(bindingindex);
-
-    // copy argument divisor
-    GLMessage_DataType *arg_divisor = glmsg.add_args();
-    arg_divisor->set_isarray(false);
-    arg_divisor->set_type(GLMessage::DataType::INT);
-    arg_divisor->add_intvalue(divisor);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexBindingDivisor(bindingindex, divisor);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-
-// Definitions for GL2Ext APIs
-
-void GLTrace_glBlendBarrierKHR(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendBarrierKHR);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendBarrierKHR();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDebugMessageControlKHR(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDebugMessageControlKHR);
-
-    // copy argument source
-    GLMessage_DataType *arg_source = glmsg.add_args();
-    arg_source->set_isarray(false);
-    arg_source->set_type(GLMessage::DataType::ENUM);
-    arg_source->add_intvalue((int)source);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument severity
-    GLMessage_DataType *arg_severity = glmsg.add_args();
-    arg_severity->set_isarray(false);
-    arg_severity->set_type(GLMessage::DataType::ENUM);
-    arg_severity->add_intvalue((int)severity);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument ids
-    GLMessage_DataType *arg_ids = glmsg.add_args();
-    arg_ids->set_isarray(false);
-    arg_ids->set_type(GLMessage::DataType::INT64);
-    arg_ids->add_int64value((uintptr_t)ids);
-
-    // copy argument enabled
-    GLMessage_DataType *arg_enabled = glmsg.add_args();
-    arg_enabled->set_isarray(false);
-    arg_enabled->set_type(GLMessage::DataType::BOOL);
-    arg_enabled->add_boolvalue(enabled);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDebugMessageControlKHR(source, type, severity, count, ids, enabled);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) ids,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDebugMessageInsertKHR(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDebugMessageInsertKHR);
-
-    // copy argument source
-    GLMessage_DataType *arg_source = glmsg.add_args();
-    arg_source->set_isarray(false);
-    arg_source->set_type(GLMessage::DataType::ENUM);
-    arg_source->add_intvalue((int)source);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // copy argument severity
-    GLMessage_DataType *arg_severity = glmsg.add_args();
-    arg_severity->set_isarray(false);
-    arg_severity->set_type(GLMessage::DataType::ENUM);
-    arg_severity->add_intvalue((int)severity);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // copy argument buf
-    GLMessage_DataType *arg_buf = glmsg.add_args();
-    arg_buf->set_isarray(false);
-    arg_buf->set_type(GLMessage::DataType::INT64);
-    arg_buf->add_int64value((uintptr_t)buf);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDebugMessageInsertKHR(source, type, id, severity, length, buf);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) buf,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDebugMessageCallbackKHR(GLDEBUGPROCKHR callback, const void * userParam) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDebugMessageCallbackKHR);
-
-    // copy argument callback
-    GLMessage_DataType *arg_callback = glmsg.add_args();
-    arg_callback->set_isarray(false);
-    arg_callback->set_type(GLMessage::DataType::INT64);
-    arg_callback->add_int64value((uintptr_t)callback);
-
-    // copy argument userParam
-    GLMessage_DataType *arg_userParam = glmsg.add_args();
-    arg_userParam->set_isarray(false);
-    arg_userParam->set_type(GLMessage::DataType::INT64);
-    arg_userParam->add_int64value((uintptr_t)userParam);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDebugMessageCallbackKHR(callback, userParam);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) callback,
-        (void *) userParam,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLuint GLTrace_glGetDebugMessageLogKHR(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetDebugMessageLogKHR);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument sources
-    GLMessage_DataType *arg_sources = glmsg.add_args();
-    arg_sources->set_isarray(false);
-    arg_sources->set_type(GLMessage::DataType::INT64);
-    arg_sources->add_int64value((uintptr_t)sources);
-
-    // copy argument types
-    GLMessage_DataType *arg_types = glmsg.add_args();
-    arg_types->set_isarray(false);
-    arg_types->set_type(GLMessage::DataType::INT64);
-    arg_types->add_int64value((uintptr_t)types);
-
-    // copy argument ids
-    GLMessage_DataType *arg_ids = glmsg.add_args();
-    arg_ids->set_isarray(false);
-    arg_ids->set_type(GLMessage::DataType::INT64);
-    arg_ids->add_int64value((uintptr_t)ids);
-
-    // copy argument severities
-    GLMessage_DataType *arg_severities = glmsg.add_args();
-    arg_severities->set_isarray(false);
-    arg_severities->set_type(GLMessage::DataType::INT64);
-    arg_severities->add_int64value((uintptr_t)severities);
-
-    // copy argument lengths
-    GLMessage_DataType *arg_lengths = glmsg.add_args();
-    arg_lengths->set_isarray(false);
-    arg_lengths->set_type(GLMessage::DataType::INT64);
-    arg_lengths->add_int64value((uintptr_t)lengths);
-
-    // copy argument messageLog
-    GLMessage_DataType *arg_messageLog = glmsg.add_args();
-    arg_messageLog->set_isarray(false);
-    arg_messageLog->set_type(GLMessage::DataType::INT64);
-    arg_messageLog->add_int64value((uintptr_t)messageLog);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLuint retValue = glContext->hooks->gl.glGetDebugMessageLogKHR(count, bufSize, sources, types, ids, severities, lengths, messageLog);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) sources,
-        (void *) types,
-        (void *) ids,
-        (void *) severities,
-        (void *) lengths,
-        (void *) messageLog,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glPushDebugGroupKHR(GLenum source, GLuint id, GLsizei length, const GLchar * message) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPushDebugGroupKHR);
-
-    // copy argument source
-    GLMessage_DataType *arg_source = glmsg.add_args();
-    arg_source->set_isarray(false);
-    arg_source->set_type(GLMessage::DataType::ENUM);
-    arg_source->add_intvalue((int)source);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // copy argument message
-    GLMessage_DataType *arg_message = glmsg.add_args();
-    arg_message->set_isarray(false);
-    arg_message->set_type(GLMessage::DataType::INT64);
-    arg_message->add_int64value((uintptr_t)message);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPushDebugGroupKHR(source, id, length, message);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) message,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPopDebugGroupKHR(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPopDebugGroupKHR);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPopDebugGroupKHR();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glObjectLabelKHR(GLenum identifier, GLuint name, GLsizei length, const GLchar * label) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glObjectLabelKHR);
-
-    // copy argument identifier
-    GLMessage_DataType *arg_identifier = glmsg.add_args();
-    arg_identifier->set_isarray(false);
-    arg_identifier->set_type(GLMessage::DataType::ENUM);
-    arg_identifier->add_intvalue((int)identifier);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT);
-    arg_name->add_intvalue(name);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // copy argument label
-    GLMessage_DataType *arg_label = glmsg.add_args();
-    arg_label->set_isarray(false);
-    arg_label->set_type(GLMessage::DataType::INT64);
-    arg_label->add_int64value((uintptr_t)label);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glObjectLabelKHR(identifier, name, length, label);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) label,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetObjectLabelKHR(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetObjectLabelKHR);
-
-    // copy argument identifier
-    GLMessage_DataType *arg_identifier = glmsg.add_args();
-    arg_identifier->set_isarray(false);
-    arg_identifier->set_type(GLMessage::DataType::ENUM);
-    arg_identifier->add_intvalue((int)identifier);
-
-    // copy argument name
-    GLMessage_DataType *arg_name = glmsg.add_args();
-    arg_name->set_isarray(false);
-    arg_name->set_type(GLMessage::DataType::INT);
-    arg_name->add_intvalue(name);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument label
-    GLMessage_DataType *arg_label = glmsg.add_args();
-    arg_label->set_isarray(false);
-    arg_label->set_type(GLMessage::DataType::INT64);
-    arg_label->add_int64value((uintptr_t)label);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetObjectLabelKHR(identifier, name, bufSize, length, label);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) label,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glObjectPtrLabelKHR(const void * ptr, GLsizei length, const GLchar * label) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glObjectPtrLabelKHR);
-
-    // copy argument ptr
-    GLMessage_DataType *arg_ptr = glmsg.add_args();
-    arg_ptr->set_isarray(false);
-    arg_ptr->set_type(GLMessage::DataType::INT64);
-    arg_ptr->add_int64value((uintptr_t)ptr);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // copy argument label
-    GLMessage_DataType *arg_label = glmsg.add_args();
-    arg_label->set_isarray(false);
-    arg_label->set_type(GLMessage::DataType::INT64);
-    arg_label->add_int64value((uintptr_t)label);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glObjectPtrLabelKHR(ptr, length, label);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) ptr,
-        (void *) label,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetObjectPtrLabelKHR(const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetObjectPtrLabelKHR);
-
-    // copy argument ptr
-    GLMessage_DataType *arg_ptr = glmsg.add_args();
-    arg_ptr->set_isarray(false);
-    arg_ptr->set_type(GLMessage::DataType::INT64);
-    arg_ptr->add_int64value((uintptr_t)ptr);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument label
-    GLMessage_DataType *arg_label = glmsg.add_args();
-    arg_label->set_isarray(false);
-    arg_label->set_type(GLMessage::DataType::INT64);
-    arg_label->add_int64value((uintptr_t)label);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetObjectPtrLabelKHR(ptr, bufSize, length, label);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) ptr,
-        (void *) length,
-        (void *) label,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPointervKHR(GLenum pname, void ** params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPointervKHR);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPointervKHR(pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEGLImageTargetTexture2DOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument image
-    GLMessage_DataType *arg_image = glmsg.add_args();
-    arg_image->set_isarray(false);
-    arg_image->set_type(GLMessage::DataType::INT64);
-    arg_image->add_int64value((uintptr_t)image);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEGLImageTargetTexture2DOES(target, image);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) image,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEGLImageTargetRenderbufferStorageOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument image
-    GLMessage_DataType *arg_image = glmsg.add_args();
-    arg_image->set_isarray(false);
-    arg_image->set_type(GLMessage::DataType::INT64);
-    arg_image->add_int64value((uintptr_t)image);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEGLImageTargetRenderbufferStorageOES(target, image);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) image,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramBinaryOES);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument binaryFormat
-    GLMessage_DataType *arg_binaryFormat = glmsg.add_args();
-    arg_binaryFormat->set_isarray(false);
-    arg_binaryFormat->set_type(GLMessage::DataType::INT64);
-    arg_binaryFormat->add_int64value((uintptr_t)binaryFormat);
-
-    // copy argument binary
-    GLMessage_DataType *arg_binary = glmsg.add_args();
-    arg_binary->set_isarray(false);
-    arg_binary->set_type(GLMessage::DataType::INT64);
-    arg_binary->add_int64value((uintptr_t)binary);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetProgramBinaryOES(program, bufSize, length, binaryFormat, binary);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) binaryFormat,
-        (void *) binary,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramBinaryOES(GLuint program, GLenum binaryFormat, const void * binary, GLint length) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramBinaryOES);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument binaryFormat
-    GLMessage_DataType *arg_binaryFormat = glmsg.add_args();
-    arg_binaryFormat->set_isarray(false);
-    arg_binaryFormat->set_type(GLMessage::DataType::ENUM);
-    arg_binaryFormat->add_intvalue((int)binaryFormat);
-
-    // copy argument binary
-    GLMessage_DataType *arg_binary = glmsg.add_args();
-    arg_binary->set_isarray(false);
-    arg_binary->set_type(GLMessage::DataType::INT64);
-    arg_binary->add_int64value((uintptr_t)binary);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramBinaryOES(program, binaryFormat, binary, length);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) binary,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void * GLTrace_glMapBufferOES(GLenum target, GLenum access) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMapBufferOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument access
-    GLMessage_DataType *arg_access = glmsg.add_args();
-    arg_access->set_isarray(false);
-    arg_access->set_type(GLMessage::DataType::ENUM);
-    arg_access->add_intvalue((int)access);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    void * retValue = glContext->hooks->gl.glMapBufferOES(target, access);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT64);
-    rt->add_int64value((uintptr_t)retValue);
-
-    void *pointerArgs[] = {
-        (void *) retValue,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-GLboolean GLTrace_glUnmapBufferOES(GLenum target) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUnmapBufferOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glUnmapBufferOES(target);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetBufferPointervOES(GLenum target, GLenum pname, void ** params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetBufferPointervOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetBufferPointervOES(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMinSampleShadingOES(GLfloat value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMinSampleShadingOES);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::FLOAT);
-    arg_value->add_floatvalue(value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMinSampleShadingOES(value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexImage3DOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // copy argument border
-    GLMessage_DataType *arg_border = glmsg.add_args();
-    arg_border->set_isarray(false);
-    arg_border->set_type(GLMessage::DataType::INT);
-    arg_border->add_intvalue(border);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument pixels
-    GLMessage_DataType *arg_pixels = glmsg.add_args();
-    arg_pixels->set_isarray(false);
-    arg_pixels->set_type(GLMessage::DataType::INT64);
-    arg_pixels->add_int64value((uintptr_t)pixels);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexImage3DOES(target, level, internalformat, width, height, depth, border, format, type, pixels);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pixels,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexSubImage3DOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument xoffset
-    GLMessage_DataType *arg_xoffset = glmsg.add_args();
-    arg_xoffset->set_isarray(false);
-    arg_xoffset->set_type(GLMessage::DataType::INT);
-    arg_xoffset->add_intvalue(xoffset);
-
-    // copy argument yoffset
-    GLMessage_DataType *arg_yoffset = glmsg.add_args();
-    arg_yoffset->set_isarray(false);
-    arg_yoffset->set_type(GLMessage::DataType::INT);
-    arg_yoffset->add_intvalue(yoffset);
-
-    // copy argument zoffset
-    GLMessage_DataType *arg_zoffset = glmsg.add_args();
-    arg_zoffset->set_isarray(false);
-    arg_zoffset->set_type(GLMessage::DataType::INT);
-    arg_zoffset->add_intvalue(zoffset);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument pixels
-    GLMessage_DataType *arg_pixels = glmsg.add_args();
-    arg_pixels->set_isarray(false);
-    arg_pixels->set_type(GLMessage::DataType::INT64);
-    arg_pixels->add_int64value((uintptr_t)pixels);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pixels,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCopyTexSubImage3DOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument xoffset
-    GLMessage_DataType *arg_xoffset = glmsg.add_args();
-    arg_xoffset->set_isarray(false);
-    arg_xoffset->set_type(GLMessage::DataType::INT);
-    arg_xoffset->add_intvalue(xoffset);
-
-    // copy argument yoffset
-    GLMessage_DataType *arg_yoffset = glmsg.add_args();
-    arg_yoffset->set_isarray(false);
-    arg_yoffset->set_type(GLMessage::DataType::INT);
-    arg_yoffset->add_intvalue(yoffset);
-
-    // copy argument zoffset
-    GLMessage_DataType *arg_zoffset = glmsg.add_args();
-    arg_zoffset->set_isarray(false);
-    arg_zoffset->set_type(GLMessage::DataType::INT);
-    arg_zoffset->add_intvalue(zoffset);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCopyTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, x, y, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCompressedTexImage3DOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // copy argument border
-    GLMessage_DataType *arg_border = glmsg.add_args();
-    arg_border->set_isarray(false);
-    arg_border->set_type(GLMessage::DataType::INT);
-    arg_border->add_intvalue(border);
-
-    // copy argument imageSize
-    GLMessage_DataType *arg_imageSize = glmsg.add_args();
-    arg_imageSize->set_isarray(false);
-    arg_imageSize->set_type(GLMessage::DataType::INT);
-    arg_imageSize->add_intvalue(imageSize);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCompressedTexImage3DOES(target, level, internalformat, width, height, depth, border, imageSize, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCompressedTexSubImage3DOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument xoffset
-    GLMessage_DataType *arg_xoffset = glmsg.add_args();
-    arg_xoffset->set_isarray(false);
-    arg_xoffset->set_type(GLMessage::DataType::INT);
-    arg_xoffset->add_intvalue(xoffset);
-
-    // copy argument yoffset
-    GLMessage_DataType *arg_yoffset = glmsg.add_args();
-    arg_yoffset->set_isarray(false);
-    arg_yoffset->set_type(GLMessage::DataType::INT);
-    arg_yoffset->add_intvalue(yoffset);
-
-    // copy argument zoffset
-    GLMessage_DataType *arg_zoffset = glmsg.add_args();
-    arg_zoffset->set_isarray(false);
-    arg_zoffset->set_type(GLMessage::DataType::INT);
-    arg_zoffset->add_intvalue(zoffset);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument imageSize
-    GLMessage_DataType *arg_imageSize = glmsg.add_args();
-    arg_imageSize->set_isarray(false);
-    arg_imageSize->set_type(GLMessage::DataType::INT);
-    arg_imageSize->add_intvalue(imageSize);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCompressedTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFramebufferTexture3DOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument attachment
-    GLMessage_DataType *arg_attachment = glmsg.add_args();
-    arg_attachment->set_isarray(false);
-    arg_attachment->set_type(GLMessage::DataType::ENUM);
-    arg_attachment->add_intvalue((int)attachment);
-
-    // copy argument textarget
-    GLMessage_DataType *arg_textarget = glmsg.add_args();
-    arg_textarget->set_isarray(false);
-    arg_textarget->set_type(GLMessage::DataType::ENUM);
-    arg_textarget->add_intvalue((int)textarget);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument zoffset
-    GLMessage_DataType *arg_zoffset = glmsg.add_args();
-    arg_zoffset->set_isarray(false);
-    arg_zoffset->set_type(GLMessage::DataType::INT);
-    arg_zoffset->add_intvalue(zoffset);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFramebufferTexture3DOES(target, attachment, textarget, texture, level, zoffset);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexStorage3DMultisampleOES(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexStorage3DMultisampleOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument samples
-    GLMessage_DataType *arg_samples = glmsg.add_args();
-    arg_samples->set_isarray(false);
-    arg_samples->set_type(GLMessage::DataType::INT);
-    arg_samples->add_intvalue(samples);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // copy argument fixedsamplelocations
-    GLMessage_DataType *arg_fixedsamplelocations = glmsg.add_args();
-    arg_fixedsamplelocations->set_isarray(false);
-    arg_fixedsamplelocations->set_type(GLMessage::DataType::BOOL);
-    arg_fixedsamplelocations->add_boolvalue(fixedsamplelocations);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexStorage3DMultisampleOES(target, samples, internalformat, width, height, depth, fixedsamplelocations);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindVertexArrayOES(GLuint array) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindVertexArrayOES);
-
-    // copy argument array
-    GLMessage_DataType *arg_array = glmsg.add_args();
-    arg_array->set_isarray(false);
-    arg_array->set_type(GLMessage::DataType::INT);
-    arg_array->add_intvalue(array);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindVertexArrayOES(array);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteVertexArraysOES(GLsizei n, const GLuint * arrays) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteVertexArraysOES);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument arrays
-    GLMessage_DataType *arg_arrays = glmsg.add_args();
-    arg_arrays->set_isarray(false);
-    arg_arrays->set_type(GLMessage::DataType::INT64);
-    arg_arrays->add_int64value((uintptr_t)arrays);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteVertexArraysOES(n, arrays);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) arrays,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenVertexArraysOES(GLsizei n, GLuint * arrays) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenVertexArraysOES);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument arrays
-    GLMessage_DataType *arg_arrays = glmsg.add_args();
-    arg_arrays->set_isarray(false);
-    arg_arrays->set_type(GLMessage::DataType::INT64);
-    arg_arrays->add_int64value((uintptr_t)arrays);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenVertexArraysOES(n, arrays);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) arrays,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsVertexArrayOES(GLuint array) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsVertexArrayOES);
-
-    // copy argument array
-    GLMessage_DataType *arg_array = glmsg.add_args();
-    arg_array->set_isarray(false);
-    arg_array->set_type(GLMessage::DataType::INT);
-    arg_array->add_intvalue(array);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsVertexArrayOES(array);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetPerfMonitorGroupsAMD(GLint * numGroups, GLsizei groupsSize, GLuint * groups) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPerfMonitorGroupsAMD);
-
-    // copy argument numGroups
-    GLMessage_DataType *arg_numGroups = glmsg.add_args();
-    arg_numGroups->set_isarray(false);
-    arg_numGroups->set_type(GLMessage::DataType::INT64);
-    arg_numGroups->add_int64value((uintptr_t)numGroups);
-
-    // copy argument groupsSize
-    GLMessage_DataType *arg_groupsSize = glmsg.add_args();
-    arg_groupsSize->set_isarray(false);
-    arg_groupsSize->set_type(GLMessage::DataType::INT);
-    arg_groupsSize->add_intvalue(groupsSize);
-
-    // copy argument groups
-    GLMessage_DataType *arg_groups = glmsg.add_args();
-    arg_groups->set_isarray(false);
-    arg_groups->set_type(GLMessage::DataType::INT64);
-    arg_groups->add_int64value((uintptr_t)groups);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPerfMonitorGroupsAMD(numGroups, groupsSize, groups);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) numGroups,
-        (void *) groups,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfMonitorCountersAMD(GLuint group, GLint * numCounters, GLint * maxActiveCounters, GLsizei counterSize, GLuint * counters) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPerfMonitorCountersAMD);
-
-    // copy argument group
-    GLMessage_DataType *arg_group = glmsg.add_args();
-    arg_group->set_isarray(false);
-    arg_group->set_type(GLMessage::DataType::INT);
-    arg_group->add_intvalue(group);
-
-    // copy argument numCounters
-    GLMessage_DataType *arg_numCounters = glmsg.add_args();
-    arg_numCounters->set_isarray(false);
-    arg_numCounters->set_type(GLMessage::DataType::INT64);
-    arg_numCounters->add_int64value((uintptr_t)numCounters);
-
-    // copy argument maxActiveCounters
-    GLMessage_DataType *arg_maxActiveCounters = glmsg.add_args();
-    arg_maxActiveCounters->set_isarray(false);
-    arg_maxActiveCounters->set_type(GLMessage::DataType::INT64);
-    arg_maxActiveCounters->add_int64value((uintptr_t)maxActiveCounters);
-
-    // copy argument counterSize
-    GLMessage_DataType *arg_counterSize = glmsg.add_args();
-    arg_counterSize->set_isarray(false);
-    arg_counterSize->set_type(GLMessage::DataType::INT);
-    arg_counterSize->add_intvalue(counterSize);
-
-    // copy argument counters
-    GLMessage_DataType *arg_counters = glmsg.add_args();
-    arg_counters->set_isarray(false);
-    arg_counters->set_type(GLMessage::DataType::INT64);
-    arg_counters->add_int64value((uintptr_t)counters);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPerfMonitorCountersAMD(group, numCounters, maxActiveCounters, counterSize, counters);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) numCounters,
-        (void *) maxActiveCounters,
-        (void *) counters,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei * length, GLchar * groupString) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPerfMonitorGroupStringAMD);
-
-    // copy argument group
-    GLMessage_DataType *arg_group = glmsg.add_args();
-    arg_group->set_isarray(false);
-    arg_group->set_type(GLMessage::DataType::INT);
-    arg_group->add_intvalue(group);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument groupString
-    GLMessage_DataType *arg_groupString = glmsg.add_args();
-    arg_groupString->set_isarray(false);
-    arg_groupString->set_type(GLMessage::DataType::INT64);
-    arg_groupString->add_int64value((uintptr_t)groupString);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPerfMonitorGroupStringAMD(group, bufSize, length, groupString);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) groupString,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei * length, GLchar * counterString) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPerfMonitorCounterStringAMD);
-
-    // copy argument group
-    GLMessage_DataType *arg_group = glmsg.add_args();
-    arg_group->set_isarray(false);
-    arg_group->set_type(GLMessage::DataType::INT);
-    arg_group->add_intvalue(group);
-
-    // copy argument counter
-    GLMessage_DataType *arg_counter = glmsg.add_args();
-    arg_counter->set_isarray(false);
-    arg_counter->set_type(GLMessage::DataType::INT);
-    arg_counter->add_intvalue(counter);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument counterString
-    GLMessage_DataType *arg_counterString = glmsg.add_args();
-    arg_counterString->set_isarray(false);
-    arg_counterString->set_type(GLMessage::DataType::INT64);
-    arg_counterString->add_int64value((uintptr_t)counterString);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPerfMonitorCounterStringAMD(group, counter, bufSize, length, counterString);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) counterString,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, void * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPerfMonitorCounterInfoAMD);
-
-    // copy argument group
-    GLMessage_DataType *arg_group = glmsg.add_args();
-    arg_group->set_isarray(false);
-    arg_group->set_type(GLMessage::DataType::INT);
-    arg_group->add_intvalue(group);
-
-    // copy argument counter
-    GLMessage_DataType *arg_counter = glmsg.add_args();
-    arg_counter->set_isarray(false);
-    arg_counter->set_type(GLMessage::DataType::INT);
-    arg_counter->add_intvalue(counter);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPerfMonitorCounterInfoAMD(group, counter, pname, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenPerfMonitorsAMD(GLsizei n, GLuint * monitors) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenPerfMonitorsAMD);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument monitors
-    GLMessage_DataType *arg_monitors = glmsg.add_args();
-    arg_monitors->set_isarray(false);
-    arg_monitors->set_type(GLMessage::DataType::INT64);
-    arg_monitors->add_int64value((uintptr_t)monitors);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenPerfMonitorsAMD(n, monitors);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) monitors,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeletePerfMonitorsAMD(GLsizei n, GLuint * monitors) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeletePerfMonitorsAMD);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument monitors
-    GLMessage_DataType *arg_monitors = glmsg.add_args();
-    arg_monitors->set_isarray(false);
-    arg_monitors->set_type(GLMessage::DataType::INT64);
-    arg_monitors->add_int64value((uintptr_t)monitors);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeletePerfMonitorsAMD(n, monitors);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) monitors,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint * counterList) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSelectPerfMonitorCountersAMD);
-
-    // copy argument monitor
-    GLMessage_DataType *arg_monitor = glmsg.add_args();
-    arg_monitor->set_isarray(false);
-    arg_monitor->set_type(GLMessage::DataType::INT);
-    arg_monitor->add_intvalue(monitor);
-
-    // copy argument enable
-    GLMessage_DataType *arg_enable = glmsg.add_args();
-    arg_enable->set_isarray(false);
-    arg_enable->set_type(GLMessage::DataType::BOOL);
-    arg_enable->add_boolvalue(enable);
-
-    // copy argument group
-    GLMessage_DataType *arg_group = glmsg.add_args();
-    arg_group->set_isarray(false);
-    arg_group->set_type(GLMessage::DataType::INT);
-    arg_group->add_intvalue(group);
-
-    // copy argument numCounters
-    GLMessage_DataType *arg_numCounters = glmsg.add_args();
-    arg_numCounters->set_isarray(false);
-    arg_numCounters->set_type(GLMessage::DataType::INT);
-    arg_numCounters->add_intvalue(numCounters);
-
-    // copy argument counterList
-    GLMessage_DataType *arg_counterList = glmsg.add_args();
-    arg_counterList->set_isarray(false);
-    arg_counterList->set_type(GLMessage::DataType::INT64);
-    arg_counterList->add_int64value((uintptr_t)counterList);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSelectPerfMonitorCountersAMD(monitor, enable, group, numCounters, counterList);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) counterList,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBeginPerfMonitorAMD(GLuint monitor) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBeginPerfMonitorAMD);
-
-    // copy argument monitor
-    GLMessage_DataType *arg_monitor = glmsg.add_args();
-    arg_monitor->set_isarray(false);
-    arg_monitor->set_type(GLMessage::DataType::INT);
-    arg_monitor->add_intvalue(monitor);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBeginPerfMonitorAMD(monitor);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEndPerfMonitorAMD(GLuint monitor) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEndPerfMonitorAMD);
-
-    // copy argument monitor
-    GLMessage_DataType *arg_monitor = glmsg.add_args();
-    arg_monitor->set_isarray(false);
-    arg_monitor->set_type(GLMessage::DataType::INT);
-    arg_monitor->add_intvalue(monitor);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEndPerfMonitorAMD(monitor);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint * data, GLint * bytesWritten) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPerfMonitorCounterDataAMD);
-
-    // copy argument monitor
-    GLMessage_DataType *arg_monitor = glmsg.add_args();
-    arg_monitor->set_isarray(false);
-    arg_monitor->set_type(GLMessage::DataType::INT);
-    arg_monitor->add_intvalue(monitor);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument dataSize
-    GLMessage_DataType *arg_dataSize = glmsg.add_args();
-    arg_dataSize->set_isarray(false);
-    arg_dataSize->set_type(GLMessage::DataType::INT);
-    arg_dataSize->add_intvalue(dataSize);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // copy argument bytesWritten
-    GLMessage_DataType *arg_bytesWritten = glmsg.add_args();
-    arg_bytesWritten->set_isarray(false);
-    arg_bytesWritten->set_type(GLMessage::DataType::INT64);
-    arg_bytesWritten->add_int64value((uintptr_t)bytesWritten);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPerfMonitorCounterDataAMD(monitor, pname, dataSize, data, bytesWritten);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-        (void *) bytesWritten,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlitFramebufferANGLE);
-
-    // copy argument srcX0
-    GLMessage_DataType *arg_srcX0 = glmsg.add_args();
-    arg_srcX0->set_isarray(false);
-    arg_srcX0->set_type(GLMessage::DataType::INT);
-    arg_srcX0->add_intvalue(srcX0);
-
-    // copy argument srcY0
-    GLMessage_DataType *arg_srcY0 = glmsg.add_args();
-    arg_srcY0->set_isarray(false);
-    arg_srcY0->set_type(GLMessage::DataType::INT);
-    arg_srcY0->add_intvalue(srcY0);
-
-    // copy argument srcX1
-    GLMessage_DataType *arg_srcX1 = glmsg.add_args();
-    arg_srcX1->set_isarray(false);
-    arg_srcX1->set_type(GLMessage::DataType::INT);
-    arg_srcX1->add_intvalue(srcX1);
-
-    // copy argument srcY1
-    GLMessage_DataType *arg_srcY1 = glmsg.add_args();
-    arg_srcY1->set_isarray(false);
-    arg_srcY1->set_type(GLMessage::DataType::INT);
-    arg_srcY1->add_intvalue(srcY1);
-
-    // copy argument dstX0
-    GLMessage_DataType *arg_dstX0 = glmsg.add_args();
-    arg_dstX0->set_isarray(false);
-    arg_dstX0->set_type(GLMessage::DataType::INT);
-    arg_dstX0->add_intvalue(dstX0);
-
-    // copy argument dstY0
-    GLMessage_DataType *arg_dstY0 = glmsg.add_args();
-    arg_dstY0->set_isarray(false);
-    arg_dstY0->set_type(GLMessage::DataType::INT);
-    arg_dstY0->add_intvalue(dstY0);
-
-    // copy argument dstX1
-    GLMessage_DataType *arg_dstX1 = glmsg.add_args();
-    arg_dstX1->set_isarray(false);
-    arg_dstX1->set_type(GLMessage::DataType::INT);
-    arg_dstX1->add_intvalue(dstX1);
-
-    // copy argument dstY1
-    GLMessage_DataType *arg_dstY1 = glmsg.add_args();
-    arg_dstY1->set_isarray(false);
-    arg_dstY1->set_type(GLMessage::DataType::INT);
-    arg_dstY1->add_intvalue(dstY1);
-
-    // copy argument mask
-    GLMessage_DataType *arg_mask = glmsg.add_args();
-    arg_mask->set_isarray(false);
-    arg_mask->set_type(GLMessage::DataType::INT);
-    arg_mask->add_intvalue(mask);
-
-    // copy argument filter
-    GLMessage_DataType *arg_filter = glmsg.add_args();
-    arg_filter->set_isarray(false);
-    arg_filter->set_type(GLMessage::DataType::ENUM);
-    arg_filter->add_intvalue((int)filter);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleANGLE);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument samples
-    GLMessage_DataType *arg_samples = glmsg.add_args();
-    arg_samples->set_isarray(false);
-    arg_samples->set_type(GLMessage::DataType::INT);
-    arg_samples->add_intvalue(samples);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glRenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawArraysInstancedANGLE);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument first
-    GLMessage_DataType *arg_first = glmsg.add_args();
-    arg_first->set_isarray(false);
-    arg_first->set_type(GLMessage::DataType::INT);
-    arg_first->add_intvalue(first);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument primcount
-    GLMessage_DataType *arg_primcount = glmsg.add_args();
-    arg_primcount->set_isarray(false);
-    arg_primcount->set_type(GLMessage::DataType::INT);
-    arg_primcount->add_intvalue(primcount);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawArraysInstancedANGLE(mode, first, count, primcount);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawElementsInstancedANGLE);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument indices
-    GLMessage_DataType *arg_indices = glmsg.add_args();
-    arg_indices->set_isarray(false);
-    arg_indices->set_type(GLMessage::DataType::INT64);
-    arg_indices->add_int64value((uintptr_t)indices);
-
-    // copy argument primcount
-    GLMessage_DataType *arg_primcount = glmsg.add_args();
-    arg_primcount->set_isarray(false);
-    arg_primcount->set_type(GLMessage::DataType::INT);
-    arg_primcount->add_intvalue(primcount);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawElementsInstancedANGLE(mode, count, type, indices, primcount);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) indices,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribDivisorANGLE(GLuint index, GLuint divisor) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribDivisorANGLE);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument divisor
-    GLMessage_DataType *arg_divisor = glmsg.add_args();
-    arg_divisor->set_isarray(false);
-    arg_divisor->set_type(GLMessage::DataType::INT);
-    arg_divisor->add_intvalue(divisor);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribDivisorANGLE(index, divisor);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTranslatedShaderSourceANGLE(GLuint shader, GLsizei bufsize, GLsizei * length, GLchar * source) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTranslatedShaderSourceANGLE);
-
-    // copy argument shader
-    GLMessage_DataType *arg_shader = glmsg.add_args();
-    arg_shader->set_isarray(false);
-    arg_shader->set_type(GLMessage::DataType::INT);
-    arg_shader->add_intvalue(shader);
-
-    // copy argument bufsize
-    GLMessage_DataType *arg_bufsize = glmsg.add_args();
-    arg_bufsize->set_isarray(false);
-    arg_bufsize->set_type(GLMessage::DataType::INT);
-    arg_bufsize->add_intvalue(bufsize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument source
-    GLMessage_DataType *arg_source = glmsg.add_args();
-    arg_source->set_isarray(false);
-    arg_source->set_type(GLMessage::DataType::INT64);
-    arg_source->add_int64value((uintptr_t)source);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTranslatedShaderSourceANGLE(shader, bufsize, length, source);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) source,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCopyTextureLevelsAPPLE(GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCopyTextureLevelsAPPLE);
-
-    // copy argument destinationTexture
-    GLMessage_DataType *arg_destinationTexture = glmsg.add_args();
-    arg_destinationTexture->set_isarray(false);
-    arg_destinationTexture->set_type(GLMessage::DataType::INT);
-    arg_destinationTexture->add_intvalue(destinationTexture);
-
-    // copy argument sourceTexture
-    GLMessage_DataType *arg_sourceTexture = glmsg.add_args();
-    arg_sourceTexture->set_isarray(false);
-    arg_sourceTexture->set_type(GLMessage::DataType::INT);
-    arg_sourceTexture->add_intvalue(sourceTexture);
-
-    // copy argument sourceBaseLevel
-    GLMessage_DataType *arg_sourceBaseLevel = glmsg.add_args();
-    arg_sourceBaseLevel->set_isarray(false);
-    arg_sourceBaseLevel->set_type(GLMessage::DataType::INT);
-    arg_sourceBaseLevel->add_intvalue(sourceBaseLevel);
-
-    // copy argument sourceLevelCount
-    GLMessage_DataType *arg_sourceLevelCount = glmsg.add_args();
-    arg_sourceLevelCount->set_isarray(false);
-    arg_sourceLevelCount->set_type(GLMessage::DataType::INT);
-    arg_sourceLevelCount->add_intvalue(sourceLevelCount);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCopyTextureLevelsAPPLE(destinationTexture, sourceTexture, sourceBaseLevel, sourceLevelCount);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleAPPLE);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument samples
-    GLMessage_DataType *arg_samples = glmsg.add_args();
-    arg_samples->set_isarray(false);
-    arg_samples->set_type(GLMessage::DataType::INT);
-    arg_samples->add_intvalue(samples);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glRenderbufferStorageMultisampleAPPLE(target, samples, internalformat, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glResolveMultisampleFramebufferAPPLE(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glResolveMultisampleFramebufferAPPLE);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glResolveMultisampleFramebufferAPPLE();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLsync GLTrace_glFenceSyncAPPLE(GLenum condition, GLbitfield flags) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFenceSyncAPPLE);
-
-    // copy argument condition
-    GLMessage_DataType *arg_condition = glmsg.add_args();
-    arg_condition->set_isarray(false);
-    arg_condition->set_type(GLMessage::DataType::ENUM);
-    arg_condition->add_intvalue((int)condition);
-
-    // copy argument flags
-    GLMessage_DataType *arg_flags = glmsg.add_args();
-    arg_flags->set_isarray(false);
-    arg_flags->set_type(GLMessage::DataType::INT);
-    arg_flags->add_intvalue(flags);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLsync retValue = glContext->hooks->gl.glFenceSyncAPPLE(condition, flags);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT64);
-    rt->add_int64value((uintptr_t)retValue);
-
-    void *pointerArgs[] = {
-        (void *) retValue,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-GLboolean GLTrace_glIsSyncAPPLE(GLsync sync) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsSyncAPPLE);
-
-    // copy argument sync
-    GLMessage_DataType *arg_sync = glmsg.add_args();
-    arg_sync->set_isarray(false);
-    arg_sync->set_type(GLMessage::DataType::INT64);
-    arg_sync->add_int64value((uintptr_t)sync);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsSyncAPPLE(sync);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) sync,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glDeleteSyncAPPLE(GLsync sync) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteSyncAPPLE);
-
-    // copy argument sync
-    GLMessage_DataType *arg_sync = glmsg.add_args();
-    arg_sync->set_isarray(false);
-    arg_sync->set_type(GLMessage::DataType::INT64);
-    arg_sync->add_int64value((uintptr_t)sync);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteSyncAPPLE(sync);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) sync,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLenum GLTrace_glClientWaitSyncAPPLE(GLsync sync, GLbitfield flags, GLuint64 timeout) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClientWaitSyncAPPLE);
-
-    // copy argument sync
-    GLMessage_DataType *arg_sync = glmsg.add_args();
-    arg_sync->set_isarray(false);
-    arg_sync->set_type(GLMessage::DataType::INT64);
-    arg_sync->add_int64value((uintptr_t)sync);
-
-    // copy argument flags
-    GLMessage_DataType *arg_flags = glmsg.add_args();
-    arg_flags->set_isarray(false);
-    arg_flags->set_type(GLMessage::DataType::INT);
-    arg_flags->add_intvalue(flags);
-
-    // copy argument timeout
-    GLMessage_DataType *arg_timeout = glmsg.add_args();
-    arg_timeout->set_isarray(false);
-    arg_timeout->set_type(GLMessage::DataType::INT64);
-    arg_timeout->add_int64value(timeout);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLenum retValue = glContext->hooks->gl.glClientWaitSyncAPPLE(sync, flags, timeout);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::ENUM);
-    rt->add_intvalue((int)retValue);
-
-    void *pointerArgs[] = {
-        (void *) sync,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glWaitSyncAPPLE(GLsync sync, GLbitfield flags, GLuint64 timeout) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glWaitSyncAPPLE);
-
-    // copy argument sync
-    GLMessage_DataType *arg_sync = glmsg.add_args();
-    arg_sync->set_isarray(false);
-    arg_sync->set_type(GLMessage::DataType::INT64);
-    arg_sync->add_int64value((uintptr_t)sync);
-
-    // copy argument flags
-    GLMessage_DataType *arg_flags = glmsg.add_args();
-    arg_flags->set_isarray(false);
-    arg_flags->set_type(GLMessage::DataType::INT);
-    arg_flags->add_intvalue(flags);
-
-    // copy argument timeout
-    GLMessage_DataType *arg_timeout = glmsg.add_args();
-    arg_timeout->set_isarray(false);
-    arg_timeout->set_type(GLMessage::DataType::INT64);
-    arg_timeout->add_int64value(timeout);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glWaitSyncAPPLE(sync, flags, timeout);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) sync,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetInteger64vAPPLE(GLenum pname, GLint64 * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetInteger64vAPPLE);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetInteger64vAPPLE(pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetSyncivAPPLE(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetSyncivAPPLE);
-
-    // copy argument sync
-    GLMessage_DataType *arg_sync = glmsg.add_args();
-    arg_sync->set_isarray(false);
-    arg_sync->set_type(GLMessage::DataType::INT64);
-    arg_sync->add_int64value((uintptr_t)sync);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument values
-    GLMessage_DataType *arg_values = glmsg.add_args();
-    arg_values->set_isarray(false);
-    arg_values->set_type(GLMessage::DataType::INT64);
-    arg_values->add_int64value((uintptr_t)values);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetSyncivAPPLE(sync, pname, bufSize, length, values);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) sync,
-        (void *) length,
-        (void *) values,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCopyImageSubDataEXT(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCopyImageSubDataEXT);
-
-    // copy argument srcName
-    GLMessage_DataType *arg_srcName = glmsg.add_args();
-    arg_srcName->set_isarray(false);
-    arg_srcName->set_type(GLMessage::DataType::INT);
-    arg_srcName->add_intvalue(srcName);
-
-    // copy argument srcTarget
-    GLMessage_DataType *arg_srcTarget = glmsg.add_args();
-    arg_srcTarget->set_isarray(false);
-    arg_srcTarget->set_type(GLMessage::DataType::ENUM);
-    arg_srcTarget->add_intvalue((int)srcTarget);
-
-    // copy argument srcLevel
-    GLMessage_DataType *arg_srcLevel = glmsg.add_args();
-    arg_srcLevel->set_isarray(false);
-    arg_srcLevel->set_type(GLMessage::DataType::INT);
-    arg_srcLevel->add_intvalue(srcLevel);
-
-    // copy argument srcX
-    GLMessage_DataType *arg_srcX = glmsg.add_args();
-    arg_srcX->set_isarray(false);
-    arg_srcX->set_type(GLMessage::DataType::INT);
-    arg_srcX->add_intvalue(srcX);
-
-    // copy argument srcY
-    GLMessage_DataType *arg_srcY = glmsg.add_args();
-    arg_srcY->set_isarray(false);
-    arg_srcY->set_type(GLMessage::DataType::INT);
-    arg_srcY->add_intvalue(srcY);
-
-    // copy argument srcZ
-    GLMessage_DataType *arg_srcZ = glmsg.add_args();
-    arg_srcZ->set_isarray(false);
-    arg_srcZ->set_type(GLMessage::DataType::INT);
-    arg_srcZ->add_intvalue(srcZ);
-
-    // copy argument dstName
-    GLMessage_DataType *arg_dstName = glmsg.add_args();
-    arg_dstName->set_isarray(false);
-    arg_dstName->set_type(GLMessage::DataType::INT);
-    arg_dstName->add_intvalue(dstName);
-
-    // copy argument dstTarget
-    GLMessage_DataType *arg_dstTarget = glmsg.add_args();
-    arg_dstTarget->set_isarray(false);
-    arg_dstTarget->set_type(GLMessage::DataType::ENUM);
-    arg_dstTarget->add_intvalue((int)dstTarget);
-
-    // copy argument dstLevel
-    GLMessage_DataType *arg_dstLevel = glmsg.add_args();
-    arg_dstLevel->set_isarray(false);
-    arg_dstLevel->set_type(GLMessage::DataType::INT);
-    arg_dstLevel->add_intvalue(dstLevel);
-
-    // copy argument dstX
-    GLMessage_DataType *arg_dstX = glmsg.add_args();
-    arg_dstX->set_isarray(false);
-    arg_dstX->set_type(GLMessage::DataType::INT);
-    arg_dstX->add_intvalue(dstX);
-
-    // copy argument dstY
-    GLMessage_DataType *arg_dstY = glmsg.add_args();
-    arg_dstY->set_isarray(false);
-    arg_dstY->set_type(GLMessage::DataType::INT);
-    arg_dstY->add_intvalue(dstY);
-
-    // copy argument dstZ
-    GLMessage_DataType *arg_dstZ = glmsg.add_args();
-    arg_dstZ->set_isarray(false);
-    arg_dstZ->set_type(GLMessage::DataType::INT);
-    arg_dstZ->add_intvalue(dstZ);
-
-    // copy argument srcWidth
-    GLMessage_DataType *arg_srcWidth = glmsg.add_args();
-    arg_srcWidth->set_isarray(false);
-    arg_srcWidth->set_type(GLMessage::DataType::INT);
-    arg_srcWidth->add_intvalue(srcWidth);
-
-    // copy argument srcHeight
-    GLMessage_DataType *arg_srcHeight = glmsg.add_args();
-    arg_srcHeight->set_isarray(false);
-    arg_srcHeight->set_type(GLMessage::DataType::INT);
-    arg_srcHeight->add_intvalue(srcHeight);
-
-    // copy argument srcDepth
-    GLMessage_DataType *arg_srcDepth = glmsg.add_args();
-    arg_srcDepth->set_isarray(false);
-    arg_srcDepth->set_type(GLMessage::DataType::INT);
-    arg_srcDepth->add_intvalue(srcDepth);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCopyImageSubDataEXT(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar * label) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLabelObjectEXT);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument object
-    GLMessage_DataType *arg_object = glmsg.add_args();
-    arg_object->set_isarray(false);
-    arg_object->set_type(GLMessage::DataType::INT);
-    arg_object->add_intvalue(object);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // copy argument label
-    GLMessage_DataType *arg_label = glmsg.add_args();
-    arg_label->set_isarray(false);
-    arg_label->set_type(GLMessage::DataType::INT64);
-    arg_label->add_int64value((uintptr_t)label);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLabelObjectEXT(type, object, length, label);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) label,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei * length, GLchar * label) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetObjectLabelEXT);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument object
-    GLMessage_DataType *arg_object = glmsg.add_args();
-    arg_object->set_isarray(false);
-    arg_object->set_type(GLMessage::DataType::INT);
-    arg_object->add_intvalue(object);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument label
-    GLMessage_DataType *arg_label = glmsg.add_args();
-    arg_label->set_isarray(false);
-    arg_label->set_type(GLMessage::DataType::INT64);
-    arg_label->add_int64value((uintptr_t)label);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetObjectLabelEXT(type, object, bufSize, length, label);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) label,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glInsertEventMarkerEXT(GLsizei length, const GLchar * marker) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glInsertEventMarkerEXT);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // copy argument marker
-    GLMessage_DataType *arg_marker = glmsg.add_args();
-    arg_marker->set_isarray(false);
-    arg_marker->set_type(GLMessage::DataType::INT64);
-    arg_marker->add_int64value((uintptr_t)marker);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glInsertEventMarkerEXT(length, marker);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) marker,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPushGroupMarkerEXT(GLsizei length, const GLchar * marker) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPushGroupMarkerEXT);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // copy argument marker
-    GLMessage_DataType *arg_marker = glmsg.add_args();
-    arg_marker->set_isarray(false);
-    arg_marker->set_type(GLMessage::DataType::INT64);
-    arg_marker->add_int64value((uintptr_t)marker);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPushGroupMarkerEXT(length, marker);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) marker,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPopGroupMarkerEXT(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPopGroupMarkerEXT);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPopGroupMarkerEXT();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum * attachments) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDiscardFramebufferEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument numAttachments
-    GLMessage_DataType *arg_numAttachments = glmsg.add_args();
-    arg_numAttachments->set_isarray(false);
-    arg_numAttachments->set_type(GLMessage::DataType::INT);
-    arg_numAttachments->add_intvalue(numAttachments);
-
-    // copy argument attachments
-    GLMessage_DataType *arg_attachments = glmsg.add_args();
-    arg_attachments->set_isarray(false);
-    arg_attachments->set_type(GLMessage::DataType::INT64);
-    arg_attachments->add_int64value((uintptr_t)attachments);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDiscardFramebufferEXT(target, numAttachments, attachments);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) attachments,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenQueriesEXT(GLsizei n, GLuint * ids) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenQueriesEXT);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument ids
-    GLMessage_DataType *arg_ids = glmsg.add_args();
-    arg_ids->set_isarray(false);
-    arg_ids->set_type(GLMessage::DataType::INT64);
-    arg_ids->add_int64value((uintptr_t)ids);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenQueriesEXT(n, ids);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) ids,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteQueriesEXT(GLsizei n, const GLuint * ids) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteQueriesEXT);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument ids
-    GLMessage_DataType *arg_ids = glmsg.add_args();
-    arg_ids->set_isarray(false);
-    arg_ids->set_type(GLMessage::DataType::INT64);
-    arg_ids->add_int64value((uintptr_t)ids);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteQueriesEXT(n, ids);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) ids,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsQueryEXT(GLuint id) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsQueryEXT);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsQueryEXT(id);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glBeginQueryEXT(GLenum target, GLuint id) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBeginQueryEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBeginQueryEXT(target, id);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEndQueryEXT(GLenum target) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEndQueryEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEndQueryEXT(target);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glQueryCounterEXT(GLuint id, GLenum target) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glQueryCounterEXT);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glQueryCounterEXT(id, target);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetQueryivEXT(GLenum target, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetQueryivEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetQueryivEXT(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetQueryObjectivEXT(GLuint id, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetQueryObjectivEXT);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetQueryObjectivEXT(id, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetQueryObjectuivEXT);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetQueryObjectuivEXT(id, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64 * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetQueryObjecti64vEXT);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetQueryObjecti64vEXT(id, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64 * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetQueryObjectui64vEXT);
-
-    // copy argument id
-    GLMessage_DataType *arg_id = glmsg.add_args();
-    arg_id->set_isarray(false);
-    arg_id->set_type(GLMessage::DataType::INT);
-    arg_id->add_intvalue(id);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetQueryObjectui64vEXT(id, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawBuffersEXT(GLsizei n, const GLenum * bufs) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawBuffersEXT);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument bufs
-    GLMessage_DataType *arg_bufs = glmsg.add_args();
-    arg_bufs->set_isarray(false);
-    arg_bufs->set_type(GLMessage::DataType::INT64);
-    arg_bufs->add_int64value((uintptr_t)bufs);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawBuffersEXT(n, bufs);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) bufs,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEnableiEXT(GLenum target, GLuint index) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEnableiEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEnableiEXT(target, index);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDisableiEXT(GLenum target, GLuint index) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDisableiEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDisableiEXT(target, index);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendEquationiEXT(GLuint buf, GLenum mode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendEquationiEXT);
-
-    // copy argument buf
-    GLMessage_DataType *arg_buf = glmsg.add_args();
-    arg_buf->set_isarray(false);
-    arg_buf->set_type(GLMessage::DataType::INT);
-    arg_buf->add_intvalue(buf);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendEquationiEXT(buf, mode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendEquationSeparateiEXT(GLuint buf, GLenum modeRGB, GLenum modeAlpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendEquationSeparateiEXT);
-
-    // copy argument buf
-    GLMessage_DataType *arg_buf = glmsg.add_args();
-    arg_buf->set_isarray(false);
-    arg_buf->set_type(GLMessage::DataType::INT);
-    arg_buf->add_intvalue(buf);
-
-    // copy argument modeRGB
-    GLMessage_DataType *arg_modeRGB = glmsg.add_args();
-    arg_modeRGB->set_isarray(false);
-    arg_modeRGB->set_type(GLMessage::DataType::ENUM);
-    arg_modeRGB->add_intvalue((int)modeRGB);
-
-    // copy argument modeAlpha
-    GLMessage_DataType *arg_modeAlpha = glmsg.add_args();
-    arg_modeAlpha->set_isarray(false);
-    arg_modeAlpha->set_type(GLMessage::DataType::ENUM);
-    arg_modeAlpha->add_intvalue((int)modeAlpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendEquationSeparateiEXT(buf, modeRGB, modeAlpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendFunciEXT(GLuint buf, GLenum src, GLenum dst) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendFunciEXT);
-
-    // copy argument buf
-    GLMessage_DataType *arg_buf = glmsg.add_args();
-    arg_buf->set_isarray(false);
-    arg_buf->set_type(GLMessage::DataType::INT);
-    arg_buf->add_intvalue(buf);
-
-    // copy argument src
-    GLMessage_DataType *arg_src = glmsg.add_args();
-    arg_src->set_isarray(false);
-    arg_src->set_type(GLMessage::DataType::ENUM);
-    arg_src->add_intvalue((int)src);
-
-    // copy argument dst
-    GLMessage_DataType *arg_dst = glmsg.add_args();
-    arg_dst->set_isarray(false);
-    arg_dst->set_type(GLMessage::DataType::ENUM);
-    arg_dst->add_intvalue((int)dst);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendFunciEXT(buf, src, dst);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendFuncSeparateiEXT(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendFuncSeparateiEXT);
-
-    // copy argument buf
-    GLMessage_DataType *arg_buf = glmsg.add_args();
-    arg_buf->set_isarray(false);
-    arg_buf->set_type(GLMessage::DataType::INT);
-    arg_buf->add_intvalue(buf);
-
-    // copy argument srcRGB
-    GLMessage_DataType *arg_srcRGB = glmsg.add_args();
-    arg_srcRGB->set_isarray(false);
-    arg_srcRGB->set_type(GLMessage::DataType::ENUM);
-    arg_srcRGB->add_intvalue((int)srcRGB);
-
-    // copy argument dstRGB
-    GLMessage_DataType *arg_dstRGB = glmsg.add_args();
-    arg_dstRGB->set_isarray(false);
-    arg_dstRGB->set_type(GLMessage::DataType::ENUM);
-    arg_dstRGB->add_intvalue((int)dstRGB);
-
-    // copy argument srcAlpha
-    GLMessage_DataType *arg_srcAlpha = glmsg.add_args();
-    arg_srcAlpha->set_isarray(false);
-    arg_srcAlpha->set_type(GLMessage::DataType::ENUM);
-    arg_srcAlpha->add_intvalue((int)srcAlpha);
-
-    // copy argument dstAlpha
-    GLMessage_DataType *arg_dstAlpha = glmsg.add_args();
-    arg_dstAlpha->set_isarray(false);
-    arg_dstAlpha->set_type(GLMessage::DataType::ENUM);
-    arg_dstAlpha->add_intvalue((int)dstAlpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendFuncSeparateiEXT(buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColorMaskiEXT(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glColorMaskiEXT);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::BOOL);
-    arg_r->add_boolvalue(r);
-
-    // copy argument g
-    GLMessage_DataType *arg_g = glmsg.add_args();
-    arg_g->set_isarray(false);
-    arg_g->set_type(GLMessage::DataType::BOOL);
-    arg_g->add_boolvalue(g);
-
-    // copy argument b
-    GLMessage_DataType *arg_b = glmsg.add_args();
-    arg_b->set_isarray(false);
-    arg_b->set_type(GLMessage::DataType::BOOL);
-    arg_b->add_boolvalue(b);
-
-    // copy argument a
-    GLMessage_DataType *arg_a = glmsg.add_args();
-    arg_a->set_isarray(false);
-    arg_a->set_type(GLMessage::DataType::BOOL);
-    arg_a->add_boolvalue(a);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glColorMaskiEXT(index, r, g, b, a);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsEnablediEXT(GLenum target, GLuint index) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsEnablediEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsEnablediEXT(target, index);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glDrawArraysInstancedEXT(GLenum mode, GLint start, GLsizei count, GLsizei primcount) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawArraysInstancedEXT);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument start
-    GLMessage_DataType *arg_start = glmsg.add_args();
-    arg_start->set_isarray(false);
-    arg_start->set_type(GLMessage::DataType::INT);
-    arg_start->add_intvalue(start);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument primcount
-    GLMessage_DataType *arg_primcount = glmsg.add_args();
-    arg_primcount->set_isarray(false);
-    arg_primcount->set_type(GLMessage::DataType::INT);
-    arg_primcount->add_intvalue(primcount);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawArraysInstancedEXT(mode, start, count, primcount);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawElementsInstancedEXT(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawElementsInstancedEXT);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument indices
-    GLMessage_DataType *arg_indices = glmsg.add_args();
-    arg_indices->set_isarray(false);
-    arg_indices->set_type(GLMessage::DataType::INT64);
-    arg_indices->add_int64value((uintptr_t)indices);
-
-    // copy argument primcount
-    GLMessage_DataType *arg_primcount = glmsg.add_args();
-    arg_primcount->set_isarray(false);
-    arg_primcount->set_type(GLMessage::DataType::INT);
-    arg_primcount->add_intvalue(primcount);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawElementsInstancedEXT(mode, count, type, indices, primcount);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) indices,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTextureEXT(GLenum target, GLenum attachment, GLuint texture, GLint level) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFramebufferTextureEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument attachment
-    GLMessage_DataType *arg_attachment = glmsg.add_args();
-    arg_attachment->set_isarray(false);
-    arg_attachment->set_type(GLMessage::DataType::ENUM);
-    arg_attachment->add_intvalue((int)attachment);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFramebufferTextureEXT(target, attachment, texture, level);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribDivisorEXT(GLuint index, GLuint divisor) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribDivisorEXT);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument divisor
-    GLMessage_DataType *arg_divisor = glmsg.add_args();
-    arg_divisor->set_isarray(false);
-    arg_divisor->set_type(GLMessage::DataType::INT);
-    arg_divisor->add_intvalue(divisor);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribDivisorEXT(index, divisor);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void * GLTrace_glMapBufferRangeEXT(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMapBufferRangeEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument offset
-    GLMessage_DataType *arg_offset = glmsg.add_args();
-    arg_offset->set_isarray(false);
-    arg_offset->set_type(GLMessage::DataType::INT);
-    arg_offset->add_intvalue(offset);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // copy argument access
-    GLMessage_DataType *arg_access = glmsg.add_args();
-    arg_access->set_isarray(false);
-    arg_access->set_type(GLMessage::DataType::INT);
-    arg_access->add_intvalue(access);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    void * retValue = glContext->hooks->gl.glMapBufferRangeEXT(target, offset, length, access);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT64);
-    rt->add_int64value((uintptr_t)retValue);
-
-    void *pointerArgs[] = {
-        (void *) retValue,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glFlushMappedBufferRangeEXT(GLenum target, GLintptr offset, GLsizeiptr length) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFlushMappedBufferRangeEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument offset
-    GLMessage_DataType *arg_offset = glmsg.add_args();
-    arg_offset->set_isarray(false);
-    arg_offset->set_type(GLMessage::DataType::INT);
-    arg_offset->add_intvalue(offset);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT);
-    arg_length->add_intvalue(length);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFlushMappedBufferRangeEXT(target, offset, length);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiDrawArraysEXT(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiDrawArraysEXT);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument first
-    GLMessage_DataType *arg_first = glmsg.add_args();
-    arg_first->set_isarray(false);
-    arg_first->set_type(GLMessage::DataType::INT64);
-    arg_first->add_int64value((uintptr_t)first);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT64);
-    arg_count->add_int64value((uintptr_t)count);
-
-    // copy argument primcount
-    GLMessage_DataType *arg_primcount = glmsg.add_args();
-    arg_primcount->set_isarray(false);
-    arg_primcount->set_type(GLMessage::DataType::INT);
-    arg_primcount->add_intvalue(primcount);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiDrawArraysEXT(mode, first, count, primcount);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) first,
-        (void *) count,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei primcount) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiDrawElementsEXT);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT64);
-    arg_count->add_int64value((uintptr_t)count);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument indices
-    GLMessage_DataType *arg_indices = glmsg.add_args();
-    arg_indices->set_isarray(false);
-    arg_indices->set_type(GLMessage::DataType::INT64);
-    arg_indices->add_int64value((uintptr_t)indices);
-
-    // copy argument primcount
-    GLMessage_DataType *arg_primcount = glmsg.add_args();
-    arg_primcount->set_isarray(false);
-    arg_primcount->set_type(GLMessage::DataType::INT);
-    arg_primcount->add_intvalue(primcount);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiDrawElementsEXT(mode, count, type, indices, primcount);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) count,
-        (void *) indices,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument samples
-    GLMessage_DataType *arg_samples = glmsg.add_args();
-    arg_samples->set_isarray(false);
-    arg_samples->set_type(GLMessage::DataType::INT);
-    arg_samples->add_intvalue(samples);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFramebufferTexture2DMultisampleEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument attachment
-    GLMessage_DataType *arg_attachment = glmsg.add_args();
-    arg_attachment->set_isarray(false);
-    arg_attachment->set_type(GLMessage::DataType::ENUM);
-    arg_attachment->add_intvalue((int)attachment);
-
-    // copy argument textarget
-    GLMessage_DataType *arg_textarget = glmsg.add_args();
-    arg_textarget->set_isarray(false);
-    arg_textarget->set_type(GLMessage::DataType::ENUM);
-    arg_textarget->add_intvalue((int)textarget);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument samples
-    GLMessage_DataType *arg_samples = glmsg.add_args();
-    arg_samples->set_isarray(false);
-    arg_samples->set_type(GLMessage::DataType::INT);
-    arg_samples->add_intvalue(samples);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFramebufferTexture2DMultisampleEXT(target, attachment, textarget, texture, level, samples);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glReadBufferIndexedEXT(GLenum src, GLint index) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glReadBufferIndexedEXT);
-
-    // copy argument src
-    GLMessage_DataType *arg_src = glmsg.add_args();
-    arg_src->set_isarray(false);
-    arg_src->set_type(GLMessage::DataType::ENUM);
-    arg_src->add_intvalue((int)src);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glReadBufferIndexedEXT(src, index);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawBuffersIndexedEXT(GLint n, const GLenum * location, const GLint * indices) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawBuffersIndexedEXT);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT64);
-    arg_location->add_int64value((uintptr_t)location);
-
-    // copy argument indices
-    GLMessage_DataType *arg_indices = glmsg.add_args();
-    arg_indices->set_isarray(false);
-    arg_indices->set_type(GLMessage::DataType::INT64);
-    arg_indices->add_int64value((uintptr_t)indices);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawBuffersIndexedEXT(n, location, indices);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) location,
-        (void *) indices,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetIntegeri_vEXT(GLenum target, GLuint index, GLint * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetIntegeri_vEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetIntegeri_vEXT(target, index, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPrimitiveBoundingBoxEXT(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPrimitiveBoundingBoxEXT);
-
-    // copy argument minX
-    GLMessage_DataType *arg_minX = glmsg.add_args();
-    arg_minX->set_isarray(false);
-    arg_minX->set_type(GLMessage::DataType::FLOAT);
-    arg_minX->add_floatvalue(minX);
-
-    // copy argument minY
-    GLMessage_DataType *arg_minY = glmsg.add_args();
-    arg_minY->set_isarray(false);
-    arg_minY->set_type(GLMessage::DataType::FLOAT);
-    arg_minY->add_floatvalue(minY);
-
-    // copy argument minZ
-    GLMessage_DataType *arg_minZ = glmsg.add_args();
-    arg_minZ->set_isarray(false);
-    arg_minZ->set_type(GLMessage::DataType::FLOAT);
-    arg_minZ->add_floatvalue(minZ);
-
-    // copy argument minW
-    GLMessage_DataType *arg_minW = glmsg.add_args();
-    arg_minW->set_isarray(false);
-    arg_minW->set_type(GLMessage::DataType::FLOAT);
-    arg_minW->add_floatvalue(minW);
-
-    // copy argument maxX
-    GLMessage_DataType *arg_maxX = glmsg.add_args();
-    arg_maxX->set_isarray(false);
-    arg_maxX->set_type(GLMessage::DataType::FLOAT);
-    arg_maxX->add_floatvalue(maxX);
-
-    // copy argument maxY
-    GLMessage_DataType *arg_maxY = glmsg.add_args();
-    arg_maxY->set_isarray(false);
-    arg_maxY->set_type(GLMessage::DataType::FLOAT);
-    arg_maxY->add_floatvalue(maxY);
-
-    // copy argument maxZ
-    GLMessage_DataType *arg_maxZ = glmsg.add_args();
-    arg_maxZ->set_isarray(false);
-    arg_maxZ->set_type(GLMessage::DataType::FLOAT);
-    arg_maxZ->add_floatvalue(maxZ);
-
-    // copy argument maxW
-    GLMessage_DataType *arg_maxW = glmsg.add_args();
-    arg_maxW->set_isarray(false);
-    arg_maxW->set_type(GLMessage::DataType::FLOAT);
-    arg_maxW->add_floatvalue(maxW);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPrimitiveBoundingBoxEXT(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLenum GLTrace_glGetGraphicsResetStatusEXT(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetGraphicsResetStatusEXT);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLenum retValue = glContext->hooks->gl.glGetGraphicsResetStatusEXT();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::ENUM);
-    rt->add_intvalue((int)retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glReadnPixelsEXT);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glReadnPixelsEXT(x, y, width, height, format, type, bufSize, data);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetnUniformfvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetnUniformfvEXT(program, location, bufSize, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetnUniformivEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetnUniformivEXT(program, location, bufSize, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glActiveShaderProgramEXT(GLuint pipeline, GLuint program) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glActiveShaderProgramEXT);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glActiveShaderProgramEXT(pipeline, program);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBindProgramPipelineEXT(GLuint pipeline) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindProgramPipelineEXT);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindProgramPipelineEXT(pipeline);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLuint GLTrace_glCreateShaderProgramvEXT(GLenum type, GLsizei count, const GLchar ** strings) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCreateShaderProgramvEXT);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument strings
-    GLMessage_DataType *arg_strings = glmsg.add_args();
-    arg_strings->set_isarray(false);
-    arg_strings->set_type(GLMessage::DataType::INT64);
-    arg_strings->add_int64value((uintptr_t)strings);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLuint retValue = glContext->hooks->gl.glCreateShaderProgramvEXT(type, count, strings);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) strings,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glDeleteProgramPipelinesEXT(GLsizei n, const GLuint * pipelines) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteProgramPipelinesEXT);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument pipelines
-    GLMessage_DataType *arg_pipelines = glmsg.add_args();
-    arg_pipelines->set_isarray(false);
-    arg_pipelines->set_type(GLMessage::DataType::INT64);
-    arg_pipelines->add_int64value((uintptr_t)pipelines);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteProgramPipelinesEXT(n, pipelines);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pipelines,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenProgramPipelinesEXT(GLsizei n, GLuint * pipelines) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenProgramPipelinesEXT);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument pipelines
-    GLMessage_DataType *arg_pipelines = glmsg.add_args();
-    arg_pipelines->set_isarray(false);
-    arg_pipelines->set_type(GLMessage::DataType::INT64);
-    arg_pipelines->add_int64value((uintptr_t)pipelines);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenProgramPipelinesEXT(n, pipelines);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pipelines,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramPipelineInfoLogEXT(GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramPipelineInfoLogEXT);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument infoLog
-    GLMessage_DataType *arg_infoLog = glmsg.add_args();
-    arg_infoLog->set_isarray(false);
-    arg_infoLog->set_type(GLMessage::DataType::INT64);
-    arg_infoLog->add_int64value((uintptr_t)infoLog);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetProgramPipelineInfoLogEXT(pipeline, bufSize, length, infoLog);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) infoLog,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetProgramPipelineivEXT(GLuint pipeline, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetProgramPipelineivEXT);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetProgramPipelineivEXT(pipeline, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsProgramPipelineEXT(GLuint pipeline) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsProgramPipelineEXT);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsProgramPipelineEXT(pipeline);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glProgramParameteriEXT(GLuint program, GLenum pname, GLint value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramParameteriEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT);
-    arg_value->add_intvalue(value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramParameteriEXT(program, pname, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1fEXT(GLuint program, GLint location, GLfloat v0) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1fEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1fEXT(program, location, v0);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1fvEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1iEXT(GLuint program, GLint location, GLint v0) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1iEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1iEXT(program, location, v0);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1ivEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1ivEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2fEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::FLOAT);
-    arg_v1->add_floatvalue(v1);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2fEXT(program, location, v0, v1);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2fvEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2iEXT(GLuint program, GLint location, GLint v0, GLint v1) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2iEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2iEXT(program, location, v0, v1);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2ivEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2ivEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3fEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::FLOAT);
-    arg_v1->add_floatvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::FLOAT);
-    arg_v2->add_floatvalue(v2);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3fEXT(program, location, v0, v1, v2);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3fvEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3iEXT(GLuint program, GLint location, GLint v0, GLint v1, GLint v2) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3iEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3iEXT(program, location, v0, v1, v2);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3ivEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3ivEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4fEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::FLOAT);
-    arg_v0->add_floatvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::FLOAT);
-    arg_v1->add_floatvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::FLOAT);
-    arg_v2->add_floatvalue(v2);
-
-    // copy argument v3
-    GLMessage_DataType *arg_v3 = glmsg.add_args();
-    arg_v3->set_isarray(false);
-    arg_v3->set_type(GLMessage::DataType::FLOAT);
-    arg_v3->add_floatvalue(v3);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4fEXT(program, location, v0, v1, v2, v3);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4fvEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4iEXT(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4iEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // copy argument v3
-    GLMessage_DataType *arg_v3 = glmsg.add_args();
-    arg_v3->set_isarray(false);
-    arg_v3->set_type(GLMessage::DataType::INT);
-    arg_v3->add_intvalue(v3);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4iEXT(program, location, v0, v1, v2, v3);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4ivEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4ivEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix2fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix2fvEXT(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix3fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix3fvEXT(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix4fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix4fvEXT(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUseProgramStagesEXT);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // copy argument stages
-    GLMessage_DataType *arg_stages = glmsg.add_args();
-    arg_stages->set_isarray(false);
-    arg_stages->set_type(GLMessage::DataType::INT);
-    arg_stages->add_intvalue(stages);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUseProgramStagesEXT(pipeline, stages, program);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glValidateProgramPipelineEXT(GLuint pipeline) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glValidateProgramPipelineEXT);
-
-    // copy argument pipeline
-    GLMessage_DataType *arg_pipeline = glmsg.add_args();
-    arg_pipeline->set_isarray(false);
-    arg_pipeline->set_type(GLMessage::DataType::INT);
-    arg_pipeline->add_intvalue(pipeline);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glValidateProgramPipelineEXT(pipeline);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1uiEXT(GLuint program, GLint location, GLuint v0) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1uiEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1uiEXT(program, location, v0);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2uiEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2uiEXT(program, location, v0, v1);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3uiEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3uiEXT(program, location, v0, v1, v2);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4uiEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument v0
-    GLMessage_DataType *arg_v0 = glmsg.add_args();
-    arg_v0->set_isarray(false);
-    arg_v0->set_type(GLMessage::DataType::INT);
-    arg_v0->add_intvalue(v0);
-
-    // copy argument v1
-    GLMessage_DataType *arg_v1 = glmsg.add_args();
-    arg_v1->set_isarray(false);
-    arg_v1->set_type(GLMessage::DataType::INT);
-    arg_v1->add_intvalue(v1);
-
-    // copy argument v2
-    GLMessage_DataType *arg_v2 = glmsg.add_args();
-    arg_v2->set_isarray(false);
-    arg_v2->set_type(GLMessage::DataType::INT);
-    arg_v2->add_intvalue(v2);
-
-    // copy argument v3
-    GLMessage_DataType *arg_v3 = glmsg.add_args();
-    arg_v3->set_isarray(false);
-    arg_v3->set_type(GLMessage::DataType::INT);
-    arg_v3->add_intvalue(v3);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4uiEXT(program, location, v0, v1, v2, v3);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform1uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform1uivEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform1uivEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform2uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform2uivEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform2uivEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform3uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform3uivEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform3uivEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniform4uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniform4uivEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniform4uivEXT(program, location, count, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix2x3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix2x3fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix2x3fvEXT(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix3x2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix3x2fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix3x2fvEXT(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix2x4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix2x4fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix2x4fvEXT(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix4x2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix4x2fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix4x2fvEXT(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix3x4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix3x4fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix3x4fvEXT(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glProgramUniformMatrix4x3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glProgramUniformMatrix4x3fvEXT);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glProgramUniformMatrix4x3fvEXT(program, location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPatchParameteriEXT(GLenum pname, GLint value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPatchParameteriEXT);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT);
-    arg_value->add_intvalue(value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPatchParameteriEXT(pname, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterIivEXT(GLenum target, GLenum pname, const GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexParameterIivEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexParameterIivEXT(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterIuivEXT(GLenum target, GLenum pname, const GLuint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexParameterIuivEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexParameterIuivEXT(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexParameterIivEXT(GLenum target, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexParameterIivEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexParameterIivEXT(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexParameterIuivEXT(GLenum target, GLenum pname, GLuint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexParameterIuivEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexParameterIuivEXT(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSamplerParameterIivEXT(GLuint sampler, GLenum pname, const GLint * param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSamplerParameterIivEXT);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT64);
-    arg_param->add_int64value((uintptr_t)param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSamplerParameterIivEXT(sampler, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) param,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSamplerParameterIuivEXT(GLuint sampler, GLenum pname, const GLuint * param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSamplerParameterIuivEXT);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT64);
-    arg_param->add_int64value((uintptr_t)param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSamplerParameterIuivEXT(sampler, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) param,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetSamplerParameterIivEXT(GLuint sampler, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetSamplerParameterIivEXT);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetSamplerParameterIivEXT(sampler, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetSamplerParameterIuivEXT(GLuint sampler, GLenum pname, GLuint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetSamplerParameterIuivEXT);
-
-    // copy argument sampler
-    GLMessage_DataType *arg_sampler = glmsg.add_args();
-    arg_sampler->set_isarray(false);
-    arg_sampler->set_type(GLMessage::DataType::INT);
-    arg_sampler->add_intvalue(sampler);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetSamplerParameterIuivEXT(sampler, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexBufferEXT(GLenum target, GLenum internalformat, GLuint buffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexBufferEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument buffer
-    GLMessage_DataType *arg_buffer = glmsg.add_args();
-    arg_buffer->set_isarray(false);
-    arg_buffer->set_type(GLMessage::DataType::INT);
-    arg_buffer->add_intvalue(buffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexBufferEXT(target, internalformat, buffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexBufferRangeEXT(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexBufferRangeEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument buffer
-    GLMessage_DataType *arg_buffer = glmsg.add_args();
-    arg_buffer->set_isarray(false);
-    arg_buffer->set_type(GLMessage::DataType::INT);
-    arg_buffer->add_intvalue(buffer);
-
-    // copy argument offset
-    GLMessage_DataType *arg_offset = glmsg.add_args();
-    arg_offset->set_isarray(false);
-    arg_offset->set_type(GLMessage::DataType::INT);
-    arg_offset->add_intvalue(offset);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexBufferRangeEXT(target, internalformat, buffer, offset, size);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexStorage1DEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument levels
-    GLMessage_DataType *arg_levels = glmsg.add_args();
-    arg_levels->set_isarray(false);
-    arg_levels->set_type(GLMessage::DataType::INT);
-    arg_levels->add_intvalue(levels);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexStorage1DEXT(target, levels, internalformat, width);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexStorage2DEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument levels
-    GLMessage_DataType *arg_levels = glmsg.add_args();
-    arg_levels->set_isarray(false);
-    arg_levels->set_type(GLMessage::DataType::INT);
-    arg_levels->add_intvalue(levels);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexStorage2DEXT(target, levels, internalformat, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexStorage3DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexStorage3DEXT);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument levels
-    GLMessage_DataType *arg_levels = glmsg.add_args();
-    arg_levels->set_isarray(false);
-    arg_levels->set_type(GLMessage::DataType::INT);
-    arg_levels->add_intvalue(levels);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexStorage3DEXT(target, levels, internalformat, width, height, depth);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTextureStorage1DEXT);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument levels
-    GLMessage_DataType *arg_levels = glmsg.add_args();
-    arg_levels->set_isarray(false);
-    arg_levels->set_type(GLMessage::DataType::INT);
-    arg_levels->add_intvalue(levels);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTextureStorage1DEXT(texture, target, levels, internalformat, width);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTextureStorage2DEXT);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument levels
-    GLMessage_DataType *arg_levels = glmsg.add_args();
-    arg_levels->set_isarray(false);
-    arg_levels->set_type(GLMessage::DataType::INT);
-    arg_levels->add_intvalue(levels);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTextureStorage2DEXT(texture, target, levels, internalformat, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTextureStorage3DEXT);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument levels
-    GLMessage_DataType *arg_levels = glmsg.add_args();
-    arg_levels->set_isarray(false);
-    arg_levels->set_type(GLMessage::DataType::INT);
-    arg_levels->add_intvalue(levels);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTextureStorage3DEXT(texture, target, levels, internalformat, width, height, depth);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTextureViewEXT(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTextureViewEXT);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument origtexture
-    GLMessage_DataType *arg_origtexture = glmsg.add_args();
-    arg_origtexture->set_isarray(false);
-    arg_origtexture->set_type(GLMessage::DataType::INT);
-    arg_origtexture->add_intvalue(origtexture);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument minlevel
-    GLMessage_DataType *arg_minlevel = glmsg.add_args();
-    arg_minlevel->set_isarray(false);
-    arg_minlevel->set_type(GLMessage::DataType::INT);
-    arg_minlevel->add_intvalue(minlevel);
-
-    // copy argument numlevels
-    GLMessage_DataType *arg_numlevels = glmsg.add_args();
-    arg_numlevels->set_isarray(false);
-    arg_numlevels->set_type(GLMessage::DataType::INT);
-    arg_numlevels->add_intvalue(numlevels);
-
-    // copy argument minlayer
-    GLMessage_DataType *arg_minlayer = glmsg.add_args();
-    arg_minlayer->set_isarray(false);
-    arg_minlayer->set_type(GLMessage::DataType::INT);
-    arg_minlayer->add_intvalue(minlayer);
-
-    // copy argument numlayers
-    GLMessage_DataType *arg_numlayers = glmsg.add_args();
-    arg_numlayers->set_isarray(false);
-    arg_numlayers->set_type(GLMessage::DataType::INT);
-    arg_numlayers->add_intvalue(numlayers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTextureViewEXT(texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleIMG);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument samples
-    GLMessage_DataType *arg_samples = glmsg.add_args();
-    arg_samples->set_isarray(false);
-    arg_samples->set_type(GLMessage::DataType::INT);
-    arg_samples->add_intvalue(samples);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glRenderbufferStorageMultisampleIMG(target, samples, internalformat, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFramebufferTexture2DMultisampleIMG);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument attachment
-    GLMessage_DataType *arg_attachment = glmsg.add_args();
-    arg_attachment->set_isarray(false);
-    arg_attachment->set_type(GLMessage::DataType::ENUM);
-    arg_attachment->add_intvalue((int)attachment);
-
-    // copy argument textarget
-    GLMessage_DataType *arg_textarget = glmsg.add_args();
-    arg_textarget->set_isarray(false);
-    arg_textarget->set_type(GLMessage::DataType::ENUM);
-    arg_textarget->add_intvalue((int)textarget);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument samples
-    GLMessage_DataType *arg_samples = glmsg.add_args();
-    arg_samples->set_isarray(false);
-    arg_samples->set_type(GLMessage::DataType::INT);
-    arg_samples->add_intvalue(samples);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFramebufferTexture2DMultisampleIMG(target, attachment, textarget, texture, level, samples);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBeginPerfQueryINTEL(GLuint queryHandle) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBeginPerfQueryINTEL);
-
-    // copy argument queryHandle
-    GLMessage_DataType *arg_queryHandle = glmsg.add_args();
-    arg_queryHandle->set_isarray(false);
-    arg_queryHandle->set_type(GLMessage::DataType::INT);
-    arg_queryHandle->add_intvalue(queryHandle);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBeginPerfQueryINTEL(queryHandle);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCreatePerfQueryINTEL(GLuint queryId, GLuint * queryHandle) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCreatePerfQueryINTEL);
-
-    // copy argument queryId
-    GLMessage_DataType *arg_queryId = glmsg.add_args();
-    arg_queryId->set_isarray(false);
-    arg_queryId->set_type(GLMessage::DataType::INT);
-    arg_queryId->add_intvalue(queryId);
-
-    // copy argument queryHandle
-    GLMessage_DataType *arg_queryHandle = glmsg.add_args();
-    arg_queryHandle->set_isarray(false);
-    arg_queryHandle->set_type(GLMessage::DataType::INT64);
-    arg_queryHandle->add_int64value((uintptr_t)queryHandle);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCreatePerfQueryINTEL(queryId, queryHandle);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) queryHandle,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeletePerfQueryINTEL(GLuint queryHandle) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeletePerfQueryINTEL);
-
-    // copy argument queryHandle
-    GLMessage_DataType *arg_queryHandle = glmsg.add_args();
-    arg_queryHandle->set_isarray(false);
-    arg_queryHandle->set_type(GLMessage::DataType::INT);
-    arg_queryHandle->add_intvalue(queryHandle);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeletePerfQueryINTEL(queryHandle);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEndPerfQueryINTEL(GLuint queryHandle) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEndPerfQueryINTEL);
-
-    // copy argument queryHandle
-    GLMessage_DataType *arg_queryHandle = glmsg.add_args();
-    arg_queryHandle->set_isarray(false);
-    arg_queryHandle->set_type(GLMessage::DataType::INT);
-    arg_queryHandle->add_intvalue(queryHandle);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEndPerfQueryINTEL(queryHandle);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetFirstPerfQueryIdINTEL(GLuint * queryId) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetFirstPerfQueryIdINTEL);
-
-    // copy argument queryId
-    GLMessage_DataType *arg_queryId = glmsg.add_args();
-    arg_queryId->set_isarray(false);
-    arg_queryId->set_type(GLMessage::DataType::INT64);
-    arg_queryId->add_int64value((uintptr_t)queryId);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetFirstPerfQueryIdINTEL(queryId);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) queryId,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetNextPerfQueryIdINTEL(GLuint queryId, GLuint * nextQueryId) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetNextPerfQueryIdINTEL);
-
-    // copy argument queryId
-    GLMessage_DataType *arg_queryId = glmsg.add_args();
-    arg_queryId->set_isarray(false);
-    arg_queryId->set_type(GLMessage::DataType::INT);
-    arg_queryId->add_intvalue(queryId);
-
-    // copy argument nextQueryId
-    GLMessage_DataType *arg_nextQueryId = glmsg.add_args();
-    arg_nextQueryId->set_isarray(false);
-    arg_nextQueryId->set_type(GLMessage::DataType::INT64);
-    arg_nextQueryId->add_int64value((uintptr_t)nextQueryId);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetNextPerfQueryIdINTEL(queryId, nextQueryId);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) nextQueryId,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfCounterInfoINTEL(GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar * counterName, GLuint counterDescLength, GLchar * counterDesc, GLuint * counterOffset, GLuint * counterDataSize, GLuint * counterTypeEnum, GLuint * counterDataTypeEnum, GLuint64 * rawCounterMaxValue) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPerfCounterInfoINTEL);
-
-    // copy argument queryId
-    GLMessage_DataType *arg_queryId = glmsg.add_args();
-    arg_queryId->set_isarray(false);
-    arg_queryId->set_type(GLMessage::DataType::INT);
-    arg_queryId->add_intvalue(queryId);
-
-    // copy argument counterId
-    GLMessage_DataType *arg_counterId = glmsg.add_args();
-    arg_counterId->set_isarray(false);
-    arg_counterId->set_type(GLMessage::DataType::INT);
-    arg_counterId->add_intvalue(counterId);
-
-    // copy argument counterNameLength
-    GLMessage_DataType *arg_counterNameLength = glmsg.add_args();
-    arg_counterNameLength->set_isarray(false);
-    arg_counterNameLength->set_type(GLMessage::DataType::INT);
-    arg_counterNameLength->add_intvalue(counterNameLength);
-
-    // copy argument counterName
-    GLMessage_DataType *arg_counterName = glmsg.add_args();
-    arg_counterName->set_isarray(false);
-    arg_counterName->set_type(GLMessage::DataType::INT64);
-    arg_counterName->add_int64value((uintptr_t)counterName);
-
-    // copy argument counterDescLength
-    GLMessage_DataType *arg_counterDescLength = glmsg.add_args();
-    arg_counterDescLength->set_isarray(false);
-    arg_counterDescLength->set_type(GLMessage::DataType::INT);
-    arg_counterDescLength->add_intvalue(counterDescLength);
-
-    // copy argument counterDesc
-    GLMessage_DataType *arg_counterDesc = glmsg.add_args();
-    arg_counterDesc->set_isarray(false);
-    arg_counterDesc->set_type(GLMessage::DataType::INT64);
-    arg_counterDesc->add_int64value((uintptr_t)counterDesc);
-
-    // copy argument counterOffset
-    GLMessage_DataType *arg_counterOffset = glmsg.add_args();
-    arg_counterOffset->set_isarray(false);
-    arg_counterOffset->set_type(GLMessage::DataType::INT64);
-    arg_counterOffset->add_int64value((uintptr_t)counterOffset);
-
-    // copy argument counterDataSize
-    GLMessage_DataType *arg_counterDataSize = glmsg.add_args();
-    arg_counterDataSize->set_isarray(false);
-    arg_counterDataSize->set_type(GLMessage::DataType::INT64);
-    arg_counterDataSize->add_int64value((uintptr_t)counterDataSize);
-
-    // copy argument counterTypeEnum
-    GLMessage_DataType *arg_counterTypeEnum = glmsg.add_args();
-    arg_counterTypeEnum->set_isarray(false);
-    arg_counterTypeEnum->set_type(GLMessage::DataType::INT64);
-    arg_counterTypeEnum->add_int64value((uintptr_t)counterTypeEnum);
-
-    // copy argument counterDataTypeEnum
-    GLMessage_DataType *arg_counterDataTypeEnum = glmsg.add_args();
-    arg_counterDataTypeEnum->set_isarray(false);
-    arg_counterDataTypeEnum->set_type(GLMessage::DataType::INT64);
-    arg_counterDataTypeEnum->add_int64value((uintptr_t)counterDataTypeEnum);
-
-    // copy argument rawCounterMaxValue
-    GLMessage_DataType *arg_rawCounterMaxValue = glmsg.add_args();
-    arg_rawCounterMaxValue->set_isarray(false);
-    arg_rawCounterMaxValue->set_type(GLMessage::DataType::INT64);
-    arg_rawCounterMaxValue->add_int64value((uintptr_t)rawCounterMaxValue);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPerfCounterInfoINTEL(queryId, counterId, counterNameLength, counterName, counterDescLength, counterDesc, counterOffset, counterDataSize, counterTypeEnum, counterDataTypeEnum, rawCounterMaxValue);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) counterName,
-        (void *) counterDesc,
-        (void *) counterOffset,
-        (void *) counterDataSize,
-        (void *) counterTypeEnum,
-        (void *) counterDataTypeEnum,
-        (void *) rawCounterMaxValue,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfQueryDataINTEL(GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid * data, GLuint * bytesWritten) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPerfQueryDataINTEL);
-
-    // copy argument queryHandle
-    GLMessage_DataType *arg_queryHandle = glmsg.add_args();
-    arg_queryHandle->set_isarray(false);
-    arg_queryHandle->set_type(GLMessage::DataType::INT);
-    arg_queryHandle->add_intvalue(queryHandle);
-
-    // copy argument flags
-    GLMessage_DataType *arg_flags = glmsg.add_args();
-    arg_flags->set_isarray(false);
-    arg_flags->set_type(GLMessage::DataType::INT);
-    arg_flags->add_intvalue(flags);
-
-    // copy argument dataSize
-    GLMessage_DataType *arg_dataSize = glmsg.add_args();
-    arg_dataSize->set_isarray(false);
-    arg_dataSize->set_type(GLMessage::DataType::INT);
-    arg_dataSize->add_intvalue(dataSize);
-
-    // copy argument data
-    GLMessage_DataType *arg_data = glmsg.add_args();
-    arg_data->set_isarray(false);
-    arg_data->set_type(GLMessage::DataType::INT64);
-    arg_data->add_int64value((uintptr_t)data);
-
-    // copy argument bytesWritten
-    GLMessage_DataType *arg_bytesWritten = glmsg.add_args();
-    arg_bytesWritten->set_isarray(false);
-    arg_bytesWritten->set_type(GLMessage::DataType::INT64);
-    arg_bytesWritten->add_int64value((uintptr_t)bytesWritten);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPerfQueryDataINTEL(queryHandle, flags, dataSize, data, bytesWritten);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) data,
-        (void *) bytesWritten,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfQueryIdByNameINTEL(GLchar * queryName, GLuint * queryId) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPerfQueryIdByNameINTEL);
-
-    // copy argument queryName
-    GLMessage_DataType *arg_queryName = glmsg.add_args();
-    arg_queryName->set_isarray(false);
-    arg_queryName->set_type(GLMessage::DataType::INT64);
-    arg_queryName->add_int64value((uintptr_t)queryName);
-
-    // copy argument queryId
-    GLMessage_DataType *arg_queryId = glmsg.add_args();
-    arg_queryId->set_isarray(false);
-    arg_queryId->set_type(GLMessage::DataType::INT64);
-    arg_queryId->add_int64value((uintptr_t)queryId);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPerfQueryIdByNameINTEL(queryName, queryId);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) queryName,
-        (void *) queryId,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPerfQueryInfoINTEL(GLuint queryId, GLuint queryNameLength, GLchar * queryName, GLuint * dataSize, GLuint * noCounters, GLuint * noInstances, GLuint * capsMask) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPerfQueryInfoINTEL);
-
-    // copy argument queryId
-    GLMessage_DataType *arg_queryId = glmsg.add_args();
-    arg_queryId->set_isarray(false);
-    arg_queryId->set_type(GLMessage::DataType::INT);
-    arg_queryId->add_intvalue(queryId);
-
-    // copy argument queryNameLength
-    GLMessage_DataType *arg_queryNameLength = glmsg.add_args();
-    arg_queryNameLength->set_isarray(false);
-    arg_queryNameLength->set_type(GLMessage::DataType::INT);
-    arg_queryNameLength->add_intvalue(queryNameLength);
-
-    // copy argument queryName
-    GLMessage_DataType *arg_queryName = glmsg.add_args();
-    arg_queryName->set_isarray(false);
-    arg_queryName->set_type(GLMessage::DataType::INT64);
-    arg_queryName->add_int64value((uintptr_t)queryName);
-
-    // copy argument dataSize
-    GLMessage_DataType *arg_dataSize = glmsg.add_args();
-    arg_dataSize->set_isarray(false);
-    arg_dataSize->set_type(GLMessage::DataType::INT64);
-    arg_dataSize->add_int64value((uintptr_t)dataSize);
-
-    // copy argument noCounters
-    GLMessage_DataType *arg_noCounters = glmsg.add_args();
-    arg_noCounters->set_isarray(false);
-    arg_noCounters->set_type(GLMessage::DataType::INT64);
-    arg_noCounters->add_int64value((uintptr_t)noCounters);
-
-    // copy argument noInstances
-    GLMessage_DataType *arg_noInstances = glmsg.add_args();
-    arg_noInstances->set_isarray(false);
-    arg_noInstances->set_type(GLMessage::DataType::INT64);
-    arg_noInstances->add_int64value((uintptr_t)noInstances);
-
-    // copy argument capsMask
-    GLMessage_DataType *arg_capsMask = glmsg.add_args();
-    arg_capsMask->set_isarray(false);
-    arg_capsMask->set_type(GLMessage::DataType::INT64);
-    arg_capsMask->add_int64value((uintptr_t)capsMask);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPerfQueryInfoINTEL(queryId, queryNameLength, queryName, dataSize, noCounters, noInstances, capsMask);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) queryName,
-        (void *) dataSize,
-        (void *) noCounters,
-        (void *) noInstances,
-        (void *) capsMask,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendParameteriNV(GLenum pname, GLint value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendParameteriNV);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT);
-    arg_value->add_intvalue(value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendParameteriNV(pname, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendBarrierNV(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendBarrierNV);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendBarrierNV();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCopyBufferSubDataNV(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCopyBufferSubDataNV);
-
-    // copy argument readTarget
-    GLMessage_DataType *arg_readTarget = glmsg.add_args();
-    arg_readTarget->set_isarray(false);
-    arg_readTarget->set_type(GLMessage::DataType::ENUM);
-    arg_readTarget->add_intvalue((int)readTarget);
-
-    // copy argument writeTarget
-    GLMessage_DataType *arg_writeTarget = glmsg.add_args();
-    arg_writeTarget->set_isarray(false);
-    arg_writeTarget->set_type(GLMessage::DataType::ENUM);
-    arg_writeTarget->add_intvalue((int)writeTarget);
-
-    // copy argument readOffset
-    GLMessage_DataType *arg_readOffset = glmsg.add_args();
-    arg_readOffset->set_isarray(false);
-    arg_readOffset->set_type(GLMessage::DataType::INT);
-    arg_readOffset->add_intvalue(readOffset);
-
-    // copy argument writeOffset
-    GLMessage_DataType *arg_writeOffset = glmsg.add_args();
-    arg_writeOffset->set_isarray(false);
-    arg_writeOffset->set_type(GLMessage::DataType::INT);
-    arg_writeOffset->add_intvalue(writeOffset);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCopyBufferSubDataNV(readTarget, writeTarget, readOffset, writeOffset, size);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCoverageMaskNV(GLboolean mask) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCoverageMaskNV);
-
-    // copy argument mask
-    GLMessage_DataType *arg_mask = glmsg.add_args();
-    arg_mask->set_isarray(false);
-    arg_mask->set_type(GLMessage::DataType::BOOL);
-    arg_mask->add_boolvalue(mask);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCoverageMaskNV(mask);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCoverageOperationNV(GLenum operation) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCoverageOperationNV);
-
-    // copy argument operation
-    GLMessage_DataType *arg_operation = glmsg.add_args();
-    arg_operation->set_isarray(false);
-    arg_operation->set_type(GLMessage::DataType::ENUM);
-    arg_operation->add_intvalue((int)operation);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCoverageOperationNV(operation);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawBuffersNV(GLsizei n, const GLenum * bufs) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawBuffersNV);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument bufs
-    GLMessage_DataType *arg_bufs = glmsg.add_args();
-    arg_bufs->set_isarray(false);
-    arg_bufs->set_type(GLMessage::DataType::INT64);
-    arg_bufs->add_int64value((uintptr_t)bufs);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawBuffersNV(n, bufs);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) bufs,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawArraysInstancedNV(GLenum mode, GLint first, GLsizei count, GLsizei primcount) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawArraysInstancedNV);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument first
-    GLMessage_DataType *arg_first = glmsg.add_args();
-    arg_first->set_isarray(false);
-    arg_first->set_type(GLMessage::DataType::INT);
-    arg_first->add_intvalue(first);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument primcount
-    GLMessage_DataType *arg_primcount = glmsg.add_args();
-    arg_primcount->set_isarray(false);
-    arg_primcount->set_type(GLMessage::DataType::INT);
-    arg_primcount->add_intvalue(primcount);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawArraysInstancedNV(mode, first, count, primcount);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawElementsInstancedNV(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawElementsInstancedNV);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument indices
-    GLMessage_DataType *arg_indices = glmsg.add_args();
-    arg_indices->set_isarray(false);
-    arg_indices->set_type(GLMessage::DataType::INT64);
-    arg_indices->add_int64value((uintptr_t)indices);
-
-    // copy argument primcount
-    GLMessage_DataType *arg_primcount = glmsg.add_args();
-    arg_primcount->set_isarray(false);
-    arg_primcount->set_type(GLMessage::DataType::INT);
-    arg_primcount->add_intvalue(primcount);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawElementsInstancedNV(mode, count, type, indices, primcount);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) indices,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteFencesNV(GLsizei n, const GLuint * fences) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteFencesNV);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument fences
-    GLMessage_DataType *arg_fences = glmsg.add_args();
-    arg_fences->set_isarray(false);
-    arg_fences->set_type(GLMessage::DataType::INT64);
-    arg_fences->add_int64value((uintptr_t)fences);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteFencesNV(n, fences);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) fences,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenFencesNV(GLsizei n, GLuint * fences) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenFencesNV);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument fences
-    GLMessage_DataType *arg_fences = glmsg.add_args();
-    arg_fences->set_isarray(false);
-    arg_fences->set_type(GLMessage::DataType::INT64);
-    arg_fences->add_int64value((uintptr_t)fences);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenFencesNV(n, fences);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) fences,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsFenceNV(GLuint fence) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsFenceNV);
-
-    // copy argument fence
-    GLMessage_DataType *arg_fence = glmsg.add_args();
-    arg_fence->set_isarray(false);
-    arg_fence->set_type(GLMessage::DataType::INT);
-    arg_fence->add_intvalue(fence);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsFenceNV(fence);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-GLboolean GLTrace_glTestFenceNV(GLuint fence) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTestFenceNV);
-
-    // copy argument fence
-    GLMessage_DataType *arg_fence = glmsg.add_args();
-    arg_fence->set_isarray(false);
-    arg_fence->set_type(GLMessage::DataType::INT);
-    arg_fence->add_intvalue(fence);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glTestFenceNV(fence);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glGetFenceivNV(GLuint fence, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetFenceivNV);
-
-    // copy argument fence
-    GLMessage_DataType *arg_fence = glmsg.add_args();
-    arg_fence->set_isarray(false);
-    arg_fence->set_type(GLMessage::DataType::INT);
-    arg_fence->add_intvalue(fence);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetFenceivNV(fence, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFinishFenceNV(GLuint fence) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFinishFenceNV);
-
-    // copy argument fence
-    GLMessage_DataType *arg_fence = glmsg.add_args();
-    arg_fence->set_isarray(false);
-    arg_fence->set_type(GLMessage::DataType::INT);
-    arg_fence->add_intvalue(fence);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFinishFenceNV(fence);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSetFenceNV(GLuint fence, GLenum condition) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSetFenceNV);
-
-    // copy argument fence
-    GLMessage_DataType *arg_fence = glmsg.add_args();
-    arg_fence->set_isarray(false);
-    arg_fence->set_type(GLMessage::DataType::INT);
-    arg_fence->add_intvalue(fence);
-
-    // copy argument condition
-    GLMessage_DataType *arg_condition = glmsg.add_args();
-    arg_condition->set_isarray(false);
-    arg_condition->set_type(GLMessage::DataType::ENUM);
-    arg_condition->add_intvalue((int)condition);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSetFenceNV(fence, condition);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlitFramebufferNV(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlitFramebufferNV);
-
-    // copy argument srcX0
-    GLMessage_DataType *arg_srcX0 = glmsg.add_args();
-    arg_srcX0->set_isarray(false);
-    arg_srcX0->set_type(GLMessage::DataType::INT);
-    arg_srcX0->add_intvalue(srcX0);
-
-    // copy argument srcY0
-    GLMessage_DataType *arg_srcY0 = glmsg.add_args();
-    arg_srcY0->set_isarray(false);
-    arg_srcY0->set_type(GLMessage::DataType::INT);
-    arg_srcY0->add_intvalue(srcY0);
-
-    // copy argument srcX1
-    GLMessage_DataType *arg_srcX1 = glmsg.add_args();
-    arg_srcX1->set_isarray(false);
-    arg_srcX1->set_type(GLMessage::DataType::INT);
-    arg_srcX1->add_intvalue(srcX1);
-
-    // copy argument srcY1
-    GLMessage_DataType *arg_srcY1 = glmsg.add_args();
-    arg_srcY1->set_isarray(false);
-    arg_srcY1->set_type(GLMessage::DataType::INT);
-    arg_srcY1->add_intvalue(srcY1);
-
-    // copy argument dstX0
-    GLMessage_DataType *arg_dstX0 = glmsg.add_args();
-    arg_dstX0->set_isarray(false);
-    arg_dstX0->set_type(GLMessage::DataType::INT);
-    arg_dstX0->add_intvalue(dstX0);
-
-    // copy argument dstY0
-    GLMessage_DataType *arg_dstY0 = glmsg.add_args();
-    arg_dstY0->set_isarray(false);
-    arg_dstY0->set_type(GLMessage::DataType::INT);
-    arg_dstY0->add_intvalue(dstY0);
-
-    // copy argument dstX1
-    GLMessage_DataType *arg_dstX1 = glmsg.add_args();
-    arg_dstX1->set_isarray(false);
-    arg_dstX1->set_type(GLMessage::DataType::INT);
-    arg_dstX1->add_intvalue(dstX1);
-
-    // copy argument dstY1
-    GLMessage_DataType *arg_dstY1 = glmsg.add_args();
-    arg_dstY1->set_isarray(false);
-    arg_dstY1->set_type(GLMessage::DataType::INT);
-    arg_dstY1->add_intvalue(dstY1);
-
-    // copy argument mask
-    GLMessage_DataType *arg_mask = glmsg.add_args();
-    arg_mask->set_isarray(false);
-    arg_mask->set_type(GLMessage::DataType::INT);
-    arg_mask->add_intvalue(mask);
-
-    // copy argument filter
-    GLMessage_DataType *arg_filter = glmsg.add_args();
-    arg_filter->set_isarray(false);
-    arg_filter->set_type(GLMessage::DataType::ENUM);
-    arg_filter->add_intvalue((int)filter);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlitFramebufferNV(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageMultisampleNV(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleNV);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument samples
-    GLMessage_DataType *arg_samples = glmsg.add_args();
-    arg_samples->set_isarray(false);
-    arg_samples->set_type(GLMessage::DataType::INT);
-    arg_samples->add_intvalue(samples);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glRenderbufferStorageMultisampleNV(target, samples, internalformat, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexAttribDivisorNV(GLuint index, GLuint divisor) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexAttribDivisorNV);
-
-    // copy argument index
-    GLMessage_DataType *arg_index = glmsg.add_args();
-    arg_index->set_isarray(false);
-    arg_index->set_type(GLMessage::DataType::INT);
-    arg_index->add_intvalue(index);
-
-    // copy argument divisor
-    GLMessage_DataType *arg_divisor = glmsg.add_args();
-    arg_divisor->set_isarray(false);
-    arg_divisor->set_type(GLMessage::DataType::INT);
-    arg_divisor->add_intvalue(divisor);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexAttribDivisorNV(index, divisor);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix2x3fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix2x3fvNV);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix2x3fvNV(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix3x2fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix3x2fvNV);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix3x2fvNV(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix2x4fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix2x4fvNV);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix2x4fvNV(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix4x2fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix4x2fvNV);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix4x2fvNV(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix3x4fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix3x4fvNV);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix3x4fvNV(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glUniformMatrix4x3fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glUniformMatrix4x3fvNV);
-
-    // copy argument location
-    GLMessage_DataType *arg_location = glmsg.add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-
-    // copy argument count
-    GLMessage_DataType *arg_count = glmsg.add_args();
-    arg_count->set_isarray(false);
-    arg_count->set_type(GLMessage::DataType::INT);
-    arg_count->add_intvalue(count);
-
-    // copy argument transpose
-    GLMessage_DataType *arg_transpose = glmsg.add_args();
-    arg_transpose->set_isarray(false);
-    arg_transpose->set_type(GLMessage::DataType::BOOL);
-    arg_transpose->add_boolvalue(transpose);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT64);
-    arg_value->add_int64value((uintptr_t)value);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glUniformMatrix4x3fvNV(location, count, transpose, value);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) value,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glReadBufferNV(GLenum mode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glReadBufferNV);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glReadBufferNV(mode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glAlphaFuncQCOM(GLenum func, GLclampf ref) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glAlphaFuncQCOM);
-
-    // copy argument func
-    GLMessage_DataType *arg_func = glmsg.add_args();
-    arg_func->set_isarray(false);
-    arg_func->set_type(GLMessage::DataType::ENUM);
-    arg_func->add_intvalue((int)func);
-
-    // copy argument ref
-    GLMessage_DataType *arg_ref = glmsg.add_args();
-    arg_ref->set_isarray(false);
-    arg_ref->set_type(GLMessage::DataType::FLOAT);
-    arg_ref->add_floatvalue(ref);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glAlphaFuncQCOM(func, ref);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetDriverControlsQCOM(GLint * num, GLsizei size, GLuint * driverControls) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetDriverControlsQCOM);
-
-    // copy argument num
-    GLMessage_DataType *arg_num = glmsg.add_args();
-    arg_num->set_isarray(false);
-    arg_num->set_type(GLMessage::DataType::INT64);
-    arg_num->add_int64value((uintptr_t)num);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument driverControls
-    GLMessage_DataType *arg_driverControls = glmsg.add_args();
-    arg_driverControls->set_isarray(false);
-    arg_driverControls->set_type(GLMessage::DataType::INT64);
-    arg_driverControls->add_int64value((uintptr_t)driverControls);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetDriverControlsQCOM(num, size, driverControls);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) num,
-        (void *) driverControls,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei * length, GLchar * driverControlString) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetDriverControlStringQCOM);
-
-    // copy argument driverControl
-    GLMessage_DataType *arg_driverControl = glmsg.add_args();
-    arg_driverControl->set_isarray(false);
-    arg_driverControl->set_type(GLMessage::DataType::INT);
-    arg_driverControl->add_intvalue(driverControl);
-
-    // copy argument bufSize
-    GLMessage_DataType *arg_bufSize = glmsg.add_args();
-    arg_bufSize->set_isarray(false);
-    arg_bufSize->set_type(GLMessage::DataType::INT);
-    arg_bufSize->add_intvalue(bufSize);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // copy argument driverControlString
-    GLMessage_DataType *arg_driverControlString = glmsg.add_args();
-    arg_driverControlString->set_isarray(false);
-    arg_driverControlString->set_type(GLMessage::DataType::INT64);
-    arg_driverControlString->add_int64value((uintptr_t)driverControlString);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetDriverControlStringQCOM(driverControl, bufSize, length, driverControlString);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) length,
-        (void *) driverControlString,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEnableDriverControlQCOM(GLuint driverControl) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEnableDriverControlQCOM);
-
-    // copy argument driverControl
-    GLMessage_DataType *arg_driverControl = glmsg.add_args();
-    arg_driverControl->set_isarray(false);
-    arg_driverControl->set_type(GLMessage::DataType::INT);
-    arg_driverControl->add_intvalue(driverControl);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEnableDriverControlQCOM(driverControl);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDisableDriverControlQCOM(GLuint driverControl) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDisableDriverControlQCOM);
-
-    // copy argument driverControl
-    GLMessage_DataType *arg_driverControl = glmsg.add_args();
-    arg_driverControl->set_isarray(false);
-    arg_driverControl->set_type(GLMessage::DataType::INT);
-    arg_driverControl->add_intvalue(driverControl);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDisableDriverControlQCOM(driverControl);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetTexturesQCOM(GLuint * textures, GLint maxTextures, GLint * numTextures) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtGetTexturesQCOM);
-
-    // copy argument textures
-    GLMessage_DataType *arg_textures = glmsg.add_args();
-    arg_textures->set_isarray(false);
-    arg_textures->set_type(GLMessage::DataType::INT64);
-    arg_textures->add_int64value((uintptr_t)textures);
-
-    // copy argument maxTextures
-    GLMessage_DataType *arg_maxTextures = glmsg.add_args();
-    arg_maxTextures->set_isarray(false);
-    arg_maxTextures->set_type(GLMessage::DataType::INT);
-    arg_maxTextures->add_intvalue(maxTextures);
-
-    // copy argument numTextures
-    GLMessage_DataType *arg_numTextures = glmsg.add_args();
-    arg_numTextures->set_isarray(false);
-    arg_numTextures->set_type(GLMessage::DataType::INT64);
-    arg_numTextures->add_int64value((uintptr_t)numTextures);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glExtGetTexturesQCOM(textures, maxTextures, numTextures);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) textures,
-        (void *) numTextures,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetBuffersQCOM(GLuint * buffers, GLint maxBuffers, GLint * numBuffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtGetBuffersQCOM);
-
-    // copy argument buffers
-    GLMessage_DataType *arg_buffers = glmsg.add_args();
-    arg_buffers->set_isarray(false);
-    arg_buffers->set_type(GLMessage::DataType::INT64);
-    arg_buffers->add_int64value((uintptr_t)buffers);
-
-    // copy argument maxBuffers
-    GLMessage_DataType *arg_maxBuffers = glmsg.add_args();
-    arg_maxBuffers->set_isarray(false);
-    arg_maxBuffers->set_type(GLMessage::DataType::INT);
-    arg_maxBuffers->add_intvalue(maxBuffers);
-
-    // copy argument numBuffers
-    GLMessage_DataType *arg_numBuffers = glmsg.add_args();
-    arg_numBuffers->set_isarray(false);
-    arg_numBuffers->set_type(GLMessage::DataType::INT64);
-    arg_numBuffers->add_int64value((uintptr_t)numBuffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glExtGetBuffersQCOM(buffers, maxBuffers, numBuffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) buffers,
-        (void *) numBuffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetRenderbuffersQCOM(GLuint * renderbuffers, GLint maxRenderbuffers, GLint * numRenderbuffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtGetRenderbuffersQCOM);
-
-    // copy argument renderbuffers
-    GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
-    arg_renderbuffers->set_isarray(false);
-    arg_renderbuffers->set_type(GLMessage::DataType::INT64);
-    arg_renderbuffers->add_int64value((uintptr_t)renderbuffers);
-
-    // copy argument maxRenderbuffers
-    GLMessage_DataType *arg_maxRenderbuffers = glmsg.add_args();
-    arg_maxRenderbuffers->set_isarray(false);
-    arg_maxRenderbuffers->set_type(GLMessage::DataType::INT);
-    arg_maxRenderbuffers->add_intvalue(maxRenderbuffers);
-
-    // copy argument numRenderbuffers
-    GLMessage_DataType *arg_numRenderbuffers = glmsg.add_args();
-    arg_numRenderbuffers->set_isarray(false);
-    arg_numRenderbuffers->set_type(GLMessage::DataType::INT64);
-    arg_numRenderbuffers->add_int64value((uintptr_t)numRenderbuffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glExtGetRenderbuffersQCOM(renderbuffers, maxRenderbuffers, numRenderbuffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) renderbuffers,
-        (void *) numRenderbuffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetFramebuffersQCOM(GLuint * framebuffers, GLint maxFramebuffers, GLint * numFramebuffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtGetFramebuffersQCOM);
-
-    // copy argument framebuffers
-    GLMessage_DataType *arg_framebuffers = glmsg.add_args();
-    arg_framebuffers->set_isarray(false);
-    arg_framebuffers->set_type(GLMessage::DataType::INT64);
-    arg_framebuffers->add_int64value((uintptr_t)framebuffers);
-
-    // copy argument maxFramebuffers
-    GLMessage_DataType *arg_maxFramebuffers = glmsg.add_args();
-    arg_maxFramebuffers->set_isarray(false);
-    arg_maxFramebuffers->set_type(GLMessage::DataType::INT);
-    arg_maxFramebuffers->add_intvalue(maxFramebuffers);
-
-    // copy argument numFramebuffers
-    GLMessage_DataType *arg_numFramebuffers = glmsg.add_args();
-    arg_numFramebuffers->set_isarray(false);
-    arg_numFramebuffers->set_type(GLMessage::DataType::INT64);
-    arg_numFramebuffers->add_int64value((uintptr_t)numFramebuffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glExtGetFramebuffersQCOM(framebuffers, maxFramebuffers, numFramebuffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) framebuffers,
-        (void *) numFramebuffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtGetTexLevelParameterivQCOM);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glExtGetTexLevelParameterivQCOM(texture, face, level, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtTexObjectStateOverrideiQCOM);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glExtTexObjectStateOverrideiQCOM(target, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void * texels) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtGetTexSubImageQCOM);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // copy argument xoffset
-    GLMessage_DataType *arg_xoffset = glmsg.add_args();
-    arg_xoffset->set_isarray(false);
-    arg_xoffset->set_type(GLMessage::DataType::INT);
-    arg_xoffset->add_intvalue(xoffset);
-
-    // copy argument yoffset
-    GLMessage_DataType *arg_yoffset = glmsg.add_args();
-    arg_yoffset->set_isarray(false);
-    arg_yoffset->set_type(GLMessage::DataType::INT);
-    arg_yoffset->add_intvalue(yoffset);
-
-    // copy argument zoffset
-    GLMessage_DataType *arg_zoffset = glmsg.add_args();
-    arg_zoffset->set_isarray(false);
-    arg_zoffset->set_type(GLMessage::DataType::INT);
-    arg_zoffset->add_intvalue(zoffset);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // copy argument format
-    GLMessage_DataType *arg_format = glmsg.add_args();
-    arg_format->set_isarray(false);
-    arg_format->set_type(GLMessage::DataType::ENUM);
-    arg_format->add_intvalue((int)format);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument texels
-    GLMessage_DataType *arg_texels = glmsg.add_args();
-    arg_texels->set_isarray(false);
-    arg_texels->set_type(GLMessage::DataType::INT64);
-    arg_texels->add_int64value((uintptr_t)texels);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glExtGetTexSubImageQCOM(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) texels,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetBufferPointervQCOM(GLenum target, void ** params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtGetBufferPointervQCOM);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glExtGetBufferPointervQCOM(target, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetShadersQCOM(GLuint * shaders, GLint maxShaders, GLint * numShaders) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtGetShadersQCOM);
-
-    // copy argument shaders
-    GLMessage_DataType *arg_shaders = glmsg.add_args();
-    arg_shaders->set_isarray(false);
-    arg_shaders->set_type(GLMessage::DataType::INT64);
-    arg_shaders->add_int64value((uintptr_t)shaders);
-
-    // copy argument maxShaders
-    GLMessage_DataType *arg_maxShaders = glmsg.add_args();
-    arg_maxShaders->set_isarray(false);
-    arg_maxShaders->set_type(GLMessage::DataType::INT);
-    arg_maxShaders->add_intvalue(maxShaders);
-
-    // copy argument numShaders
-    GLMessage_DataType *arg_numShaders = glmsg.add_args();
-    arg_numShaders->set_isarray(false);
-    arg_numShaders->set_type(GLMessage::DataType::INT64);
-    arg_numShaders->add_int64value((uintptr_t)numShaders);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glExtGetShadersQCOM(shaders, maxShaders, numShaders);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) shaders,
-        (void *) numShaders,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glExtGetProgramsQCOM(GLuint * programs, GLint maxPrograms, GLint * numPrograms) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtGetProgramsQCOM);
-
-    // copy argument programs
-    GLMessage_DataType *arg_programs = glmsg.add_args();
-    arg_programs->set_isarray(false);
-    arg_programs->set_type(GLMessage::DataType::INT64);
-    arg_programs->add_int64value((uintptr_t)programs);
-
-    // copy argument maxPrograms
-    GLMessage_DataType *arg_maxPrograms = glmsg.add_args();
-    arg_maxPrograms->set_isarray(false);
-    arg_maxPrograms->set_type(GLMessage::DataType::INT);
-    arg_maxPrograms->add_intvalue(maxPrograms);
-
-    // copy argument numPrograms
-    GLMessage_DataType *arg_numPrograms = glmsg.add_args();
-    arg_numPrograms->set_isarray(false);
-    arg_numPrograms->set_type(GLMessage::DataType::INT64);
-    arg_numPrograms->add_int64value((uintptr_t)numPrograms);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glExtGetProgramsQCOM(programs, maxPrograms, numPrograms);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) programs,
-        (void *) numPrograms,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glExtIsProgramBinaryQCOM(GLuint program) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtIsProgramBinaryQCOM);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glExtIsProgramBinaryQCOM(program);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar * source, GLint * length) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glExtGetProgramBinarySourceQCOM);
-
-    // copy argument program
-    GLMessage_DataType *arg_program = glmsg.add_args();
-    arg_program->set_isarray(false);
-    arg_program->set_type(GLMessage::DataType::INT);
-    arg_program->add_intvalue(program);
-
-    // copy argument shadertype
-    GLMessage_DataType *arg_shadertype = glmsg.add_args();
-    arg_shadertype->set_isarray(false);
-    arg_shadertype->set_type(GLMessage::DataType::ENUM);
-    arg_shadertype->add_intvalue((int)shadertype);
-
-    // copy argument source
-    GLMessage_DataType *arg_source = glmsg.add_args();
-    arg_source->set_isarray(false);
-    arg_source->set_type(GLMessage::DataType::INT64);
-    arg_source->add_int64value((uintptr_t)source);
-
-    // copy argument length
-    GLMessage_DataType *arg_length = glmsg.add_args();
-    arg_length->set_isarray(false);
-    arg_length->set_type(GLMessage::DataType::INT64);
-    arg_length->add_int64value((uintptr_t)length);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glExtGetProgramBinarySourceQCOM(program, shadertype, source, length);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) source,
-        (void *) length,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glStartTilingQCOM);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // copy argument preserveMask
-    GLMessage_DataType *arg_preserveMask = glmsg.add_args();
-    arg_preserveMask->set_isarray(false);
-    arg_preserveMask->set_type(GLMessage::DataType::INT);
-    arg_preserveMask->add_intvalue(preserveMask);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glStartTilingQCOM(x, y, width, height, preserveMask);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEndTilingQCOM(GLbitfield preserveMask) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEndTilingQCOM);
-
-    // copy argument preserveMask
-    GLMessage_DataType *arg_preserveMask = glmsg.add_args();
-    arg_preserveMask->set_isarray(false);
-    arg_preserveMask->set_type(GLMessage::DataType::INT);
-    arg_preserveMask->add_intvalue(preserveMask);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEndTilingQCOM(preserveMask);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-
-// Definitions for GL1 APIs
-
-void GLTrace_glAlphaFunc(GLenum func, GLfloat ref) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glAlphaFunc);
-
-    // copy argument func
-    GLMessage_DataType *arg_func = glmsg.add_args();
-    arg_func->set_isarray(false);
-    arg_func->set_type(GLMessage::DataType::ENUM);
-    arg_func->add_intvalue((int)func);
-
-    // copy argument ref
-    GLMessage_DataType *arg_ref = glmsg.add_args();
-    arg_ref->set_isarray(false);
-    arg_ref->set_type(GLMessage::DataType::FLOAT);
-    arg_ref->add_floatvalue(ref);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glAlphaFunc(func, ref);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanef(GLenum p, const GLfloat * eqn) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClipPlanef);
-
-    // copy argument p
-    GLMessage_DataType *arg_p = glmsg.add_args();
-    arg_p->set_isarray(false);
-    arg_p->set_type(GLMessage::DataType::ENUM);
-    arg_p->add_intvalue((int)p);
-
-    // copy argument eqn
-    GLMessage_DataType *arg_eqn = glmsg.add_args();
-    arg_eqn->set_isarray(false);
-    arg_eqn->set_type(GLMessage::DataType::INT64);
-    arg_eqn->add_int64value((uintptr_t)eqn);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClipPlanef(p, eqn);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) eqn,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glColor4f);
-
-    // copy argument red
-    GLMessage_DataType *arg_red = glmsg.add_args();
-    arg_red->set_isarray(false);
-    arg_red->set_type(GLMessage::DataType::FLOAT);
-    arg_red->add_floatvalue(red);
-
-    // copy argument green
-    GLMessage_DataType *arg_green = glmsg.add_args();
-    arg_green->set_isarray(false);
-    arg_green->set_type(GLMessage::DataType::FLOAT);
-    arg_green->add_floatvalue(green);
-
-    // copy argument blue
-    GLMessage_DataType *arg_blue = glmsg.add_args();
-    arg_blue->set_isarray(false);
-    arg_blue->set_type(GLMessage::DataType::FLOAT);
-    arg_blue->add_floatvalue(blue);
-
-    // copy argument alpha
-    GLMessage_DataType *arg_alpha = glmsg.add_args();
-    arg_alpha->set_isarray(false);
-    arg_alpha->set_type(GLMessage::DataType::FLOAT);
-    arg_alpha->add_floatvalue(alpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glColor4f(red, green, blue, alpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogf(GLenum pname, GLfloat param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFogf);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::FLOAT);
-    arg_param->add_floatvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFogf(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogfv(GLenum pname, const GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFogfv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFogfv(pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFrustumf(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFrustumf);
-
-    // copy argument l
-    GLMessage_DataType *arg_l = glmsg.add_args();
-    arg_l->set_isarray(false);
-    arg_l->set_type(GLMessage::DataType::FLOAT);
-    arg_l->add_floatvalue(l);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::FLOAT);
-    arg_r->add_floatvalue(r);
-
-    // copy argument b
-    GLMessage_DataType *arg_b = glmsg.add_args();
-    arg_b->set_isarray(false);
-    arg_b->set_type(GLMessage::DataType::FLOAT);
-    arg_b->add_floatvalue(b);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::FLOAT);
-    arg_t->add_floatvalue(t);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::FLOAT);
-    arg_n->add_floatvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::FLOAT);
-    arg_f->add_floatvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFrustumf(l, r, b, t, n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetClipPlanef(GLenum plane, GLfloat * equation) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetClipPlanef);
-
-    // copy argument plane
-    GLMessage_DataType *arg_plane = glmsg.add_args();
-    arg_plane->set_isarray(false);
-    arg_plane->set_type(GLMessage::DataType::ENUM);
-    arg_plane->add_intvalue((int)plane);
-
-    // copy argument equation
-    GLMessage_DataType *arg_equation = glmsg.add_args();
-    arg_equation->set_isarray(false);
-    arg_equation->set_type(GLMessage::DataType::INT64);
-    arg_equation->add_int64value((uintptr_t)equation);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetClipPlanef(plane, equation);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) equation,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetLightfv(GLenum light, GLenum pname, GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetLightfv);
-
-    // copy argument light
-    GLMessage_DataType *arg_light = glmsg.add_args();
-    arg_light->set_isarray(false);
-    arg_light->set_type(GLMessage::DataType::ENUM);
-    arg_light->add_intvalue((int)light);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetLightfv(light, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetMaterialfv);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetMaterialfv(face, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexEnvfv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexEnvfv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelf(GLenum pname, GLfloat param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightModelf);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::FLOAT);
-    arg_param->add_floatvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightModelf(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelfv(GLenum pname, const GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightModelfv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightModelfv(pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightf(GLenum light, GLenum pname, GLfloat param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightf);
-
-    // copy argument light
-    GLMessage_DataType *arg_light = glmsg.add_args();
-    arg_light->set_isarray(false);
-    arg_light->set_type(GLMessage::DataType::ENUM);
-    arg_light->add_intvalue((int)light);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::FLOAT);
-    arg_param->add_floatvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightf(light, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightfv(GLenum light, GLenum pname, const GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightfv);
-
-    // copy argument light
-    GLMessage_DataType *arg_light = glmsg.add_args();
-    arg_light->set_isarray(false);
-    arg_light->set_type(GLMessage::DataType::ENUM);
-    arg_light->add_intvalue((int)light);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightfv(light, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLoadMatrixf(const GLfloat * m) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLoadMatrixf);
-
-    // copy argument m
-    GLMessage_DataType *arg_m = glmsg.add_args();
-    arg_m->set_isarray(false);
-    arg_m->set_type(GLMessage::DataType::INT64);
-    arg_m->add_int64value((uintptr_t)m);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLoadMatrixf(m);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) m,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialf(GLenum face, GLenum pname, GLfloat param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMaterialf);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::FLOAT);
-    arg_param->add_floatvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMaterialf(face, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialfv(GLenum face, GLenum pname, const GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMaterialfv);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMaterialfv(face, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultMatrixf(const GLfloat * m) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultMatrixf);
-
-    // copy argument m
-    GLMessage_DataType *arg_m = glmsg.add_args();
-    arg_m->set_isarray(false);
-    arg_m->set_type(GLMessage::DataType::INT64);
-    arg_m->add_int64value((uintptr_t)m);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultMatrixf(m);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) m,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiTexCoord4f);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::FLOAT);
-    arg_s->add_floatvalue(s);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::FLOAT);
-    arg_t->add_floatvalue(t);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::FLOAT);
-    arg_r->add_floatvalue(r);
-
-    // copy argument q
-    GLMessage_DataType *arg_q = glmsg.add_args();
-    arg_q->set_isarray(false);
-    arg_q->set_type(GLMessage::DataType::FLOAT);
-    arg_q->add_floatvalue(q);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiTexCoord4f(target, s, t, r, q);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glNormal3f);
-
-    // copy argument nx
-    GLMessage_DataType *arg_nx = glmsg.add_args();
-    arg_nx->set_isarray(false);
-    arg_nx->set_type(GLMessage::DataType::FLOAT);
-    arg_nx->add_floatvalue(nx);
-
-    // copy argument ny
-    GLMessage_DataType *arg_ny = glmsg.add_args();
-    arg_ny->set_isarray(false);
-    arg_ny->set_type(GLMessage::DataType::FLOAT);
-    arg_ny->add_floatvalue(ny);
-
-    // copy argument nz
-    GLMessage_DataType *arg_nz = glmsg.add_args();
-    arg_nz->set_isarray(false);
-    arg_nz->set_type(GLMessage::DataType::FLOAT);
-    arg_nz->add_floatvalue(nz);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glNormal3f(nx, ny, nz);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glOrthof(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glOrthof);
-
-    // copy argument l
-    GLMessage_DataType *arg_l = glmsg.add_args();
-    arg_l->set_isarray(false);
-    arg_l->set_type(GLMessage::DataType::FLOAT);
-    arg_l->add_floatvalue(l);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::FLOAT);
-    arg_r->add_floatvalue(r);
-
-    // copy argument b
-    GLMessage_DataType *arg_b = glmsg.add_args();
-    arg_b->set_isarray(false);
-    arg_b->set_type(GLMessage::DataType::FLOAT);
-    arg_b->add_floatvalue(b);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::FLOAT);
-    arg_t->add_floatvalue(t);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::FLOAT);
-    arg_n->add_floatvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::FLOAT);
-    arg_f->add_floatvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glOrthof(l, r, b, t, n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterf(GLenum pname, GLfloat param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPointParameterf);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::FLOAT);
-    arg_param->add_floatvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPointParameterf(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterfv(GLenum pname, const GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPointParameterfv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPointParameterfv(pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointSize(GLfloat size) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPointSize);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::FLOAT);
-    arg_size->add_floatvalue(size);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPointSize(size);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glRotatef);
-
-    // copy argument angle
-    GLMessage_DataType *arg_angle = glmsg.add_args();
-    arg_angle->set_isarray(false);
-    arg_angle->set_type(GLMessage::DataType::FLOAT);
-    arg_angle->add_floatvalue(angle);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::FLOAT);
-    arg_x->add_floatvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::FLOAT);
-    arg_y->add_floatvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::FLOAT);
-    arg_z->add_floatvalue(z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glRotatef(angle, x, y, z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glScalef(GLfloat x, GLfloat y, GLfloat z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glScalef);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::FLOAT);
-    arg_x->add_floatvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::FLOAT);
-    arg_y->add_floatvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::FLOAT);
-    arg_z->add_floatvalue(z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glScalef(x, y, z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvf(GLenum target, GLenum pname, GLfloat param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexEnvf);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::FLOAT);
-    arg_param->add_floatvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexEnvf(target, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexEnvfv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexEnvfv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTranslatef(GLfloat x, GLfloat y, GLfloat z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTranslatef);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::FLOAT);
-    arg_x->add_floatvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::FLOAT);
-    arg_y->add_floatvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::FLOAT);
-    arg_z->add_floatvalue(z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTranslatef(x, y, z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glAlphaFuncx(GLenum func, GLfixed ref) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glAlphaFuncx);
-
-    // copy argument func
-    GLMessage_DataType *arg_func = glmsg.add_args();
-    arg_func->set_isarray(false);
-    arg_func->set_type(GLMessage::DataType::ENUM);
-    arg_func->add_intvalue((int)func);
-
-    // copy argument ref
-    GLMessage_DataType *arg_ref = glmsg.add_args();
-    arg_ref->set_isarray(false);
-    arg_ref->set_type(GLMessage::DataType::INT);
-    arg_ref->add_intvalue(ref);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glAlphaFuncx(func, ref);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearColorx(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearColorx);
-
-    // copy argument red
-    GLMessage_DataType *arg_red = glmsg.add_args();
-    arg_red->set_isarray(false);
-    arg_red->set_type(GLMessage::DataType::INT);
-    arg_red->add_intvalue(red);
-
-    // copy argument green
-    GLMessage_DataType *arg_green = glmsg.add_args();
-    arg_green->set_isarray(false);
-    arg_green->set_type(GLMessage::DataType::INT);
-    arg_green->add_intvalue(green);
-
-    // copy argument blue
-    GLMessage_DataType *arg_blue = glmsg.add_args();
-    arg_blue->set_isarray(false);
-    arg_blue->set_type(GLMessage::DataType::INT);
-    arg_blue->add_intvalue(blue);
-
-    // copy argument alpha
-    GLMessage_DataType *arg_alpha = glmsg.add_args();
-    arg_alpha->set_isarray(false);
-    arg_alpha->set_type(GLMessage::DataType::INT);
-    arg_alpha->add_intvalue(alpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearColorx(red, green, blue, alpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearDepthx(GLfixed depth) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearDepthx);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearDepthx(depth);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClientActiveTexture(GLenum texture) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClientActiveTexture);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClientActiveTexture(texture);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanex(GLenum plane, const GLfixed * equation) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClipPlanex);
-
-    // copy argument plane
-    GLMessage_DataType *arg_plane = glmsg.add_args();
-    arg_plane->set_isarray(false);
-    arg_plane->set_type(GLMessage::DataType::ENUM);
-    arg_plane->add_intvalue((int)plane);
-
-    // copy argument equation
-    GLMessage_DataType *arg_equation = glmsg.add_args();
-    arg_equation->set_isarray(false);
-    arg_equation->set_type(GLMessage::DataType::INT64);
-    arg_equation->add_int64value((uintptr_t)equation);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClipPlanex(plane, equation);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) equation,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glColor4ub);
-
-    // copy argument red
-    GLMessage_DataType *arg_red = glmsg.add_args();
-    arg_red->set_isarray(false);
-    arg_red->set_type(GLMessage::DataType::BYTE);
-    arg_red->add_intvalue((int)red);
-
-    // copy argument green
-    GLMessage_DataType *arg_green = glmsg.add_args();
-    arg_green->set_isarray(false);
-    arg_green->set_type(GLMessage::DataType::BYTE);
-    arg_green->add_intvalue((int)green);
-
-    // copy argument blue
-    GLMessage_DataType *arg_blue = glmsg.add_args();
-    arg_blue->set_isarray(false);
-    arg_blue->set_type(GLMessage::DataType::BYTE);
-    arg_blue->add_intvalue((int)blue);
-
-    // copy argument alpha
-    GLMessage_DataType *arg_alpha = glmsg.add_args();
-    arg_alpha->set_isarray(false);
-    arg_alpha->set_type(GLMessage::DataType::BYTE);
-    arg_alpha->add_intvalue((int)alpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glColor4ub(red, green, blue, alpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glColor4x);
-
-    // copy argument red
-    GLMessage_DataType *arg_red = glmsg.add_args();
-    arg_red->set_isarray(false);
-    arg_red->set_type(GLMessage::DataType::INT);
-    arg_red->add_intvalue(red);
-
-    // copy argument green
-    GLMessage_DataType *arg_green = glmsg.add_args();
-    arg_green->set_isarray(false);
-    arg_green->set_type(GLMessage::DataType::INT);
-    arg_green->add_intvalue(green);
-
-    // copy argument blue
-    GLMessage_DataType *arg_blue = glmsg.add_args();
-    arg_blue->set_isarray(false);
-    arg_blue->set_type(GLMessage::DataType::INT);
-    arg_blue->add_intvalue(blue);
-
-    // copy argument alpha
-    GLMessage_DataType *arg_alpha = glmsg.add_args();
-    arg_alpha->set_isarray(false);
-    arg_alpha->set_type(GLMessage::DataType::INT);
-    arg_alpha->add_intvalue(alpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glColor4x(red, green, blue, alpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColorPointer(GLint size, GLenum type, GLsizei stride, const void * pointer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glColorPointer);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument stride
-    GLMessage_DataType *arg_stride = glmsg.add_args();
-    arg_stride->set_isarray(false);
-    arg_stride->set_type(GLMessage::DataType::INT);
-    arg_stride->add_intvalue(stride);
-
-    // copy argument pointer
-    GLMessage_DataType *arg_pointer = glmsg.add_args();
-    arg_pointer->set_isarray(false);
-    arg_pointer->set_type(GLMessage::DataType::INT64);
-    arg_pointer->add_int64value((uintptr_t)pointer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glColorPointer(size, type, stride, pointer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pointer,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDepthRangex(GLfixed n, GLfixed f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDepthRangex);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::INT);
-    arg_f->add_intvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDepthRangex(n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDisableClientState(GLenum array) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDisableClientState);
-
-    // copy argument array
-    GLMessage_DataType *arg_array = glmsg.add_args();
-    arg_array->set_isarray(false);
-    arg_array->set_type(GLMessage::DataType::ENUM);
-    arg_array->add_intvalue((int)array);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDisableClientState(array);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glEnableClientState(GLenum array) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glEnableClientState);
-
-    // copy argument array
-    GLMessage_DataType *arg_array = glmsg.add_args();
-    arg_array->set_isarray(false);
-    arg_array->set_type(GLMessage::DataType::ENUM);
-    arg_array->add_intvalue((int)array);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glEnableClientState(array);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogx(GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFogx);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFogx(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogxv(GLenum pname, const GLfixed * param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFogxv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT64);
-    arg_param->add_int64value((uintptr_t)param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFogxv(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) param,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFrustumx(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFrustumx);
-
-    // copy argument l
-    GLMessage_DataType *arg_l = glmsg.add_args();
-    arg_l->set_isarray(false);
-    arg_l->set_type(GLMessage::DataType::INT);
-    arg_l->add_intvalue(l);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::INT);
-    arg_r->add_intvalue(r);
-
-    // copy argument b
-    GLMessage_DataType *arg_b = glmsg.add_args();
-    arg_b->set_isarray(false);
-    arg_b->set_type(GLMessage::DataType::INT);
-    arg_b->add_intvalue(b);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::INT);
-    arg_t->add_intvalue(t);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::INT);
-    arg_f->add_intvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFrustumx(l, r, b, t, n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetClipPlanex(GLenum plane, GLfixed * equation) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetClipPlanex);
-
-    // copy argument plane
-    GLMessage_DataType *arg_plane = glmsg.add_args();
-    arg_plane->set_isarray(false);
-    arg_plane->set_type(GLMessage::DataType::ENUM);
-    arg_plane->add_intvalue((int)plane);
-
-    // copy argument equation
-    GLMessage_DataType *arg_equation = glmsg.add_args();
-    arg_equation->set_isarray(false);
-    arg_equation->set_type(GLMessage::DataType::INT64);
-    arg_equation->add_int64value((uintptr_t)equation);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetClipPlanex(plane, equation);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) equation,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetFixedv(GLenum pname, GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetFixedv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetFixedv(pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetLightxv(GLenum light, GLenum pname, GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetLightxv);
-
-    // copy argument light
-    GLMessage_DataType *arg_light = glmsg.add_args();
-    arg_light->set_isarray(false);
-    arg_light->set_type(GLMessage::DataType::ENUM);
-    arg_light->add_intvalue((int)light);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetLightxv(light, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetMaterialxv(GLenum face, GLenum pname, GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetMaterialxv);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetMaterialxv(face, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetPointerv(GLenum pname, void ** params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetPointerv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetPointerv(pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexEnviv(GLenum target, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexEnviv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexEnviv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexEnvxv(GLenum target, GLenum pname, GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexEnvxv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexEnvxv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexParameterxv(GLenum target, GLenum pname, GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexParameterxv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexParameterxv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelx(GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightModelx);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightModelx(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelxv(GLenum pname, const GLfixed * param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightModelxv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT64);
-    arg_param->add_int64value((uintptr_t)param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightModelxv(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) param,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightx(GLenum light, GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightx);
-
-    // copy argument light
-    GLMessage_DataType *arg_light = glmsg.add_args();
-    arg_light->set_isarray(false);
-    arg_light->set_type(GLMessage::DataType::ENUM);
-    arg_light->add_intvalue((int)light);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightx(light, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightxv(GLenum light, GLenum pname, const GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightxv);
-
-    // copy argument light
-    GLMessage_DataType *arg_light = glmsg.add_args();
-    arg_light->set_isarray(false);
-    arg_light->set_type(GLMessage::DataType::ENUM);
-    arg_light->add_intvalue((int)light);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightxv(light, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLineWidthx(GLfixed width) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLineWidthx);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLineWidthx(width);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLoadIdentity(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLoadIdentity);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLoadIdentity();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLoadMatrixx(const GLfixed * m) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLoadMatrixx);
-
-    // copy argument m
-    GLMessage_DataType *arg_m = glmsg.add_args();
-    arg_m->set_isarray(false);
-    arg_m->set_type(GLMessage::DataType::INT64);
-    arg_m->add_int64value((uintptr_t)m);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLoadMatrixx(m);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) m,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLogicOp(GLenum opcode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLogicOp);
-
-    // copy argument opcode
-    GLMessage_DataType *arg_opcode = glmsg.add_args();
-    arg_opcode->set_isarray(false);
-    arg_opcode->set_type(GLMessage::DataType::ENUM);
-    arg_opcode->add_intvalue((int)opcode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLogicOp(opcode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialx(GLenum face, GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMaterialx);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMaterialx(face, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialxv(GLenum face, GLenum pname, const GLfixed * param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMaterialxv);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT64);
-    arg_param->add_int64value((uintptr_t)param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMaterialxv(face, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) param,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMatrixMode(GLenum mode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMatrixMode);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMatrixMode(mode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultMatrixx(const GLfixed * m) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultMatrixx);
-
-    // copy argument m
-    GLMessage_DataType *arg_m = glmsg.add_args();
-    arg_m->set_isarray(false);
-    arg_m->set_type(GLMessage::DataType::INT64);
-    arg_m->add_int64value((uintptr_t)m);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultMatrixx(m);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) m,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiTexCoord4x);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::INT);
-    arg_s->add_intvalue(s);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::INT);
-    arg_t->add_intvalue(t);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::INT);
-    arg_r->add_intvalue(r);
-
-    // copy argument q
-    GLMessage_DataType *arg_q = glmsg.add_args();
-    arg_q->set_isarray(false);
-    arg_q->set_type(GLMessage::DataType::INT);
-    arg_q->add_intvalue(q);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiTexCoord4x(texture, s, t, r, q);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glNormal3x);
-
-    // copy argument nx
-    GLMessage_DataType *arg_nx = glmsg.add_args();
-    arg_nx->set_isarray(false);
-    arg_nx->set_type(GLMessage::DataType::INT);
-    arg_nx->add_intvalue(nx);
-
-    // copy argument ny
-    GLMessage_DataType *arg_ny = glmsg.add_args();
-    arg_ny->set_isarray(false);
-    arg_ny->set_type(GLMessage::DataType::INT);
-    arg_ny->add_intvalue(ny);
-
-    // copy argument nz
-    GLMessage_DataType *arg_nz = glmsg.add_args();
-    arg_nz->set_isarray(false);
-    arg_nz->set_type(GLMessage::DataType::INT);
-    arg_nz->add_intvalue(nz);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glNormal3x(nx, ny, nz);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glNormalPointer(GLenum type, GLsizei stride, const void * pointer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glNormalPointer);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument stride
-    GLMessage_DataType *arg_stride = glmsg.add_args();
-    arg_stride->set_isarray(false);
-    arg_stride->set_type(GLMessage::DataType::INT);
-    arg_stride->add_intvalue(stride);
-
-    // copy argument pointer
-    GLMessage_DataType *arg_pointer = glmsg.add_args();
-    arg_pointer->set_isarray(false);
-    arg_pointer->set_type(GLMessage::DataType::INT64);
-    arg_pointer->add_int64value((uintptr_t)pointer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glNormalPointer(type, stride, pointer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pointer,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glOrthox(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glOrthox);
-
-    // copy argument l
-    GLMessage_DataType *arg_l = glmsg.add_args();
-    arg_l->set_isarray(false);
-    arg_l->set_type(GLMessage::DataType::INT);
-    arg_l->add_intvalue(l);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::INT);
-    arg_r->add_intvalue(r);
-
-    // copy argument b
-    GLMessage_DataType *arg_b = glmsg.add_args();
-    arg_b->set_isarray(false);
-    arg_b->set_type(GLMessage::DataType::INT);
-    arg_b->add_intvalue(b);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::INT);
-    arg_t->add_intvalue(t);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::INT);
-    arg_f->add_intvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glOrthox(l, r, b, t, n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterx(GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPointParameterx);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPointParameterx(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterxv(GLenum pname, const GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPointParameterxv);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPointParameterxv(pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointSizex(GLfixed size) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPointSizex);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPointSizex(size);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPolygonOffsetx(GLfixed factor, GLfixed units) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPolygonOffsetx);
-
-    // copy argument factor
-    GLMessage_DataType *arg_factor = glmsg.add_args();
-    arg_factor->set_isarray(false);
-    arg_factor->set_type(GLMessage::DataType::INT);
-    arg_factor->add_intvalue(factor);
-
-    // copy argument units
-    GLMessage_DataType *arg_units = glmsg.add_args();
-    arg_units->set_isarray(false);
-    arg_units->set_type(GLMessage::DataType::INT);
-    arg_units->add_intvalue(units);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPolygonOffsetx(factor, units);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPopMatrix(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPopMatrix);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPopMatrix();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPushMatrix(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPushMatrix);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPushMatrix();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glRotatex);
-
-    // copy argument angle
-    GLMessage_DataType *arg_angle = glmsg.add_args();
-    arg_angle->set_isarray(false);
-    arg_angle->set_type(GLMessage::DataType::INT);
-    arg_angle->add_intvalue(angle);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::INT);
-    arg_z->add_intvalue(z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glRotatex(angle, x, y, z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSampleCoveragex(GLclampx value, GLboolean invert) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSampleCoveragex);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT);
-    arg_value->add_intvalue(value);
-
-    // copy argument invert
-    GLMessage_DataType *arg_invert = glmsg.add_args();
-    arg_invert->set_isarray(false);
-    arg_invert->set_type(GLMessage::DataType::BOOL);
-    arg_invert->add_boolvalue(invert);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSampleCoveragex(value, invert);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glScalex(GLfixed x, GLfixed y, GLfixed z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glScalex);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::INT);
-    arg_z->add_intvalue(z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glScalex(x, y, z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glShadeModel(GLenum mode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glShadeModel);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glShadeModel(mode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const void * pointer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexCoordPointer);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument stride
-    GLMessage_DataType *arg_stride = glmsg.add_args();
-    arg_stride->set_isarray(false);
-    arg_stride->set_type(GLMessage::DataType::INT);
-    arg_stride->add_intvalue(stride);
-
-    // copy argument pointer
-    GLMessage_DataType *arg_pointer = glmsg.add_args();
-    arg_pointer->set_isarray(false);
-    arg_pointer->set_type(GLMessage::DataType::INT64);
-    arg_pointer->add_int64value((uintptr_t)pointer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexCoordPointer(size, type, stride, pointer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pointer,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvi(GLenum target, GLenum pname, GLint param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexEnvi);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexEnvi(target, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvx(GLenum target, GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexEnvx);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexEnvx(target, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnviv(GLenum target, GLenum pname, const GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexEnviv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexEnviv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvxv(GLenum target, GLenum pname, const GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexEnvxv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexEnvxv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterx(GLenum target, GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexParameterx);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexParameterx(target, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterxv(GLenum target, GLenum pname, const GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexParameterxv);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexParameterxv(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTranslatex(GLfixed x, GLfixed y, GLfixed z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTranslatex);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::INT);
-    arg_z->add_intvalue(z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTranslatex(x, y, z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertexPointer(GLint size, GLenum type, GLsizei stride, const void * pointer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertexPointer);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument stride
-    GLMessage_DataType *arg_stride = glmsg.add_args();
-    arg_stride->set_isarray(false);
-    arg_stride->set_type(GLMessage::DataType::INT);
-    arg_stride->add_intvalue(stride);
-
-    // copy argument pointer
-    GLMessage_DataType *arg_pointer = glmsg.add_args();
-    arg_pointer->set_isarray(false);
-    arg_pointer->set_type(GLMessage::DataType::INT64);
-    arg_pointer->add_int64value((uintptr_t)pointer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertexPointer(size, type, stride, pointer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pointer,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-
-// Definitions for GL1Ext APIs
-
-void GLTrace_glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendEquationSeparateOES);
-
-    // copy argument modeRGB
-    GLMessage_DataType *arg_modeRGB = glmsg.add_args();
-    arg_modeRGB->set_isarray(false);
-    arg_modeRGB->set_type(GLMessage::DataType::ENUM);
-    arg_modeRGB->add_intvalue((int)modeRGB);
-
-    // copy argument modeAlpha
-    GLMessage_DataType *arg_modeAlpha = glmsg.add_args();
-    arg_modeAlpha->set_isarray(false);
-    arg_modeAlpha->set_type(GLMessage::DataType::ENUM);
-    arg_modeAlpha->add_intvalue((int)modeAlpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendEquationSeparateOES(modeRGB, modeAlpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendFuncSeparateOES);
-
-    // copy argument srcRGB
-    GLMessage_DataType *arg_srcRGB = glmsg.add_args();
-    arg_srcRGB->set_isarray(false);
-    arg_srcRGB->set_type(GLMessage::DataType::ENUM);
-    arg_srcRGB->add_intvalue((int)srcRGB);
-
-    // copy argument dstRGB
-    GLMessage_DataType *arg_dstRGB = glmsg.add_args();
-    arg_dstRGB->set_isarray(false);
-    arg_dstRGB->set_type(GLMessage::DataType::ENUM);
-    arg_dstRGB->add_intvalue((int)dstRGB);
-
-    // copy argument srcAlpha
-    GLMessage_DataType *arg_srcAlpha = glmsg.add_args();
-    arg_srcAlpha->set_isarray(false);
-    arg_srcAlpha->set_type(GLMessage::DataType::ENUM);
-    arg_srcAlpha->add_intvalue((int)srcAlpha);
-
-    // copy argument dstAlpha
-    GLMessage_DataType *arg_dstAlpha = glmsg.add_args();
-    arg_dstAlpha->set_isarray(false);
-    arg_dstAlpha->set_type(GLMessage::DataType::ENUM);
-    arg_dstAlpha->add_intvalue((int)dstAlpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glBlendEquationOES(GLenum mode) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBlendEquationOES);
-
-    // copy argument mode
-    GLMessage_DataType *arg_mode = glmsg.add_args();
-    arg_mode->set_isarray(false);
-    arg_mode->set_type(GLMessage::DataType::ENUM);
-    arg_mode->add_intvalue((int)mode);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBlendEquationOES(mode);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord1bOES(GLenum texture, GLbyte s) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiTexCoord1bOES);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::BYTE);
-    arg_s->add_intvalue((int)s);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiTexCoord1bOES(texture, s);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord1bvOES(GLenum texture, const GLbyte * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiTexCoord1bvOES);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiTexCoord1bvOES(texture, coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord2bOES(GLenum texture, GLbyte s, GLbyte t) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiTexCoord2bOES);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::BYTE);
-    arg_s->add_intvalue((int)s);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::BYTE);
-    arg_t->add_intvalue((int)t);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiTexCoord2bOES(texture, s, t);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord2bvOES(GLenum texture, const GLbyte * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiTexCoord2bvOES);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiTexCoord2bvOES(texture, coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord3bOES(GLenum texture, GLbyte s, GLbyte t, GLbyte r) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiTexCoord3bOES);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::BYTE);
-    arg_s->add_intvalue((int)s);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::BYTE);
-    arg_t->add_intvalue((int)t);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::BYTE);
-    arg_r->add_intvalue((int)r);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiTexCoord3bOES(texture, s, t, r);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord3bvOES(GLenum texture, const GLbyte * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiTexCoord3bvOES);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiTexCoord3bvOES(texture, coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord4bOES(GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiTexCoord4bOES);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::BYTE);
-    arg_s->add_intvalue((int)s);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::BYTE);
-    arg_t->add_intvalue((int)t);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::BYTE);
-    arg_r->add_intvalue((int)r);
-
-    // copy argument q
-    GLMessage_DataType *arg_q = glmsg.add_args();
-    arg_q->set_isarray(false);
-    arg_q->set_type(GLMessage::DataType::BYTE);
-    arg_q->add_intvalue((int)q);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiTexCoord4bOES(texture, s, t, r, q);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord4bvOES(GLenum texture, const GLbyte * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiTexCoord4bvOES);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiTexCoord4bvOES(texture, coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexCoord1bOES(GLbyte s) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexCoord1bOES);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::BYTE);
-    arg_s->add_intvalue((int)s);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexCoord1bOES(s);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexCoord1bvOES(const GLbyte * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexCoord1bvOES);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexCoord1bvOES(coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexCoord2bOES(GLbyte s, GLbyte t) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexCoord2bOES);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::BYTE);
-    arg_s->add_intvalue((int)s);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::BYTE);
-    arg_t->add_intvalue((int)t);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexCoord2bOES(s, t);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexCoord2bvOES(const GLbyte * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexCoord2bvOES);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexCoord2bvOES(coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexCoord3bOES(GLbyte s, GLbyte t, GLbyte r) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexCoord3bOES);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::BYTE);
-    arg_s->add_intvalue((int)s);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::BYTE);
-    arg_t->add_intvalue((int)t);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::BYTE);
-    arg_r->add_intvalue((int)r);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexCoord3bOES(s, t, r);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexCoord3bvOES(const GLbyte * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexCoord3bvOES);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexCoord3bvOES(coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexCoord4bOES(GLbyte s, GLbyte t, GLbyte r, GLbyte q) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexCoord4bOES);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::BYTE);
-    arg_s->add_intvalue((int)s);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::BYTE);
-    arg_t->add_intvalue((int)t);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::BYTE);
-    arg_r->add_intvalue((int)r);
-
-    // copy argument q
-    GLMessage_DataType *arg_q = glmsg.add_args();
-    arg_q->set_isarray(false);
-    arg_q->set_type(GLMessage::DataType::BYTE);
-    arg_q->add_intvalue((int)q);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexCoord4bOES(s, t, r, q);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexCoord4bvOES(const GLbyte * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexCoord4bvOES);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexCoord4bvOES(coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertex2bOES(GLbyte x) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertex2bOES);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::BYTE);
-    arg_x->add_intvalue((int)x);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertex2bOES(x);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertex2bvOES(const GLbyte * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertex2bvOES);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertex2bvOES(coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertex3bOES(GLbyte x, GLbyte y) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertex3bOES);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::BYTE);
-    arg_x->add_intvalue((int)x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::BYTE);
-    arg_y->add_intvalue((int)y);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertex3bOES(x, y);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertex3bvOES(const GLbyte * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertex3bvOES);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertex3bvOES(coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertex4bOES(GLbyte x, GLbyte y, GLbyte z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertex4bOES);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::BYTE);
-    arg_x->add_intvalue((int)x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::BYTE);
-    arg_y->add_intvalue((int)y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::BYTE);
-    arg_z->add_intvalue((int)z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertex4bOES(x, y, z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glVertex4bvOES(const GLbyte * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glVertex4bvOES);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glVertex4bvOES(coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawTexsOES);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::INT);
-    arg_z->add_intvalue(z);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawTexsOES(x, y, z, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawTexiOES);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::INT);
-    arg_z->add_intvalue(z);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawTexiOES(x, y, z, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawTexxOES);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::INT);
-    arg_z->add_intvalue(z);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawTexxOES(x, y, z, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexsvOES(const GLshort * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawTexsvOES);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawTexsvOES(coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexivOES(const GLint * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawTexivOES);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawTexivOES(coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexxvOES(const GLfixed * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawTexxvOES);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawTexxvOES(coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawTexfOES);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::FLOAT);
-    arg_x->add_floatvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::FLOAT);
-    arg_y->add_floatvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::FLOAT);
-    arg_z->add_floatvalue(z);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::FLOAT);
-    arg_width->add_floatvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::FLOAT);
-    arg_height->add_floatvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawTexfOES(x, y, z, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDrawTexfvOES(const GLfloat * coords) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDrawTexfvOES);
-
-    // copy argument coords
-    GLMessage_DataType *arg_coords = glmsg.add_args();
-    arg_coords->set_isarray(false);
-    arg_coords->set_type(GLMessage::DataType::INT64);
-    arg_coords->add_int64value((uintptr_t)coords);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDrawTexfvOES(coords);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) coords,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glAlphaFuncxOES(GLenum func, GLfixed ref) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glAlphaFuncxOES);
-
-    // copy argument func
-    GLMessage_DataType *arg_func = glmsg.add_args();
-    arg_func->set_isarray(false);
-    arg_func->set_type(GLMessage::DataType::ENUM);
-    arg_func->add_intvalue((int)func);
-
-    // copy argument ref
-    GLMessage_DataType *arg_ref = glmsg.add_args();
-    arg_ref->set_isarray(false);
-    arg_ref->set_type(GLMessage::DataType::INT);
-    arg_ref->add_intvalue(ref);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glAlphaFuncxOES(func, ref);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearColorxOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearColorxOES);
-
-    // copy argument red
-    GLMessage_DataType *arg_red = glmsg.add_args();
-    arg_red->set_isarray(false);
-    arg_red->set_type(GLMessage::DataType::INT);
-    arg_red->add_intvalue(red);
-
-    // copy argument green
-    GLMessage_DataType *arg_green = glmsg.add_args();
-    arg_green->set_isarray(false);
-    arg_green->set_type(GLMessage::DataType::INT);
-    arg_green->add_intvalue(green);
-
-    // copy argument blue
-    GLMessage_DataType *arg_blue = glmsg.add_args();
-    arg_blue->set_isarray(false);
-    arg_blue->set_type(GLMessage::DataType::INT);
-    arg_blue->add_intvalue(blue);
-
-    // copy argument alpha
-    GLMessage_DataType *arg_alpha = glmsg.add_args();
-    arg_alpha->set_isarray(false);
-    arg_alpha->set_type(GLMessage::DataType::INT);
-    arg_alpha->add_intvalue(alpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearColorxOES(red, green, blue, alpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClearDepthxOES(GLfixed depth) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearDepthxOES);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::INT);
-    arg_depth->add_intvalue(depth);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearDepthxOES(depth);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanexOES(GLenum plane, const GLfixed * equation) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClipPlanexOES);
-
-    // copy argument plane
-    GLMessage_DataType *arg_plane = glmsg.add_args();
-    arg_plane->set_isarray(false);
-    arg_plane->set_type(GLMessage::DataType::ENUM);
-    arg_plane->add_intvalue((int)plane);
-
-    // copy argument equation
-    GLMessage_DataType *arg_equation = glmsg.add_args();
-    arg_equation->set_isarray(false);
-    arg_equation->set_type(GLMessage::DataType::INT64);
-    arg_equation->add_int64value((uintptr_t)equation);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClipPlanexOES(plane, equation);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) equation,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glColor4xOES);
-
-    // copy argument red
-    GLMessage_DataType *arg_red = glmsg.add_args();
-    arg_red->set_isarray(false);
-    arg_red->set_type(GLMessage::DataType::INT);
-    arg_red->add_intvalue(red);
-
-    // copy argument green
-    GLMessage_DataType *arg_green = glmsg.add_args();
-    arg_green->set_isarray(false);
-    arg_green->set_type(GLMessage::DataType::INT);
-    arg_green->add_intvalue(green);
-
-    // copy argument blue
-    GLMessage_DataType *arg_blue = glmsg.add_args();
-    arg_blue->set_isarray(false);
-    arg_blue->set_type(GLMessage::DataType::INT);
-    arg_blue->add_intvalue(blue);
-
-    // copy argument alpha
-    GLMessage_DataType *arg_alpha = glmsg.add_args();
-    arg_alpha->set_isarray(false);
-    arg_alpha->set_type(GLMessage::DataType::INT);
-    arg_alpha->add_intvalue(alpha);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glColor4xOES(red, green, blue, alpha);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDepthRangexOES(GLfixed n, GLfixed f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDepthRangexOES);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::INT);
-    arg_f->add_intvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDepthRangexOES(n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogxOES(GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFogxOES);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFogxOES(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFogxvOES(GLenum pname, const GLfixed * param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFogxvOES);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT64);
-    arg_param->add_int64value((uintptr_t)param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFogxvOES(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) param,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFrustumxOES(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFrustumxOES);
-
-    // copy argument l
-    GLMessage_DataType *arg_l = glmsg.add_args();
-    arg_l->set_isarray(false);
-    arg_l->set_type(GLMessage::DataType::INT);
-    arg_l->add_intvalue(l);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::INT);
-    arg_r->add_intvalue(r);
-
-    // copy argument b
-    GLMessage_DataType *arg_b = glmsg.add_args();
-    arg_b->set_isarray(false);
-    arg_b->set_type(GLMessage::DataType::INT);
-    arg_b->add_intvalue(b);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::INT);
-    arg_t->add_intvalue(t);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::INT);
-    arg_f->add_intvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFrustumxOES(l, r, b, t, n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetClipPlanexOES(GLenum plane, GLfixed * equation) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetClipPlanexOES);
-
-    // copy argument plane
-    GLMessage_DataType *arg_plane = glmsg.add_args();
-    arg_plane->set_isarray(false);
-    arg_plane->set_type(GLMessage::DataType::ENUM);
-    arg_plane->add_intvalue((int)plane);
-
-    // copy argument equation
-    GLMessage_DataType *arg_equation = glmsg.add_args();
-    arg_equation->set_isarray(false);
-    arg_equation->set_type(GLMessage::DataType::INT64);
-    arg_equation->add_int64value((uintptr_t)equation);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetClipPlanexOES(plane, equation);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) equation,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetFixedvOES(GLenum pname, GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetFixedvOES);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetFixedvOES(pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexEnvxvOES(GLenum target, GLenum pname, GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexEnvxvOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexEnvxvOES(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexParameterxvOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexParameterxvOES(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelxOES(GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightModelxOES);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightModelxOES(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightModelxvOES(GLenum pname, const GLfixed * param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightModelxvOES);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT64);
-    arg_param->add_int64value((uintptr_t)param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightModelxvOES(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) param,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightxOES(GLenum light, GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightxOES);
-
-    // copy argument light
-    GLMessage_DataType *arg_light = glmsg.add_args();
-    arg_light->set_isarray(false);
-    arg_light->set_type(GLMessage::DataType::ENUM);
-    arg_light->add_intvalue((int)light);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightxOES(light, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLightxvOES(GLenum light, GLenum pname, const GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLightxvOES);
-
-    // copy argument light
-    GLMessage_DataType *arg_light = glmsg.add_args();
-    arg_light->set_isarray(false);
-    arg_light->set_type(GLMessage::DataType::ENUM);
-    arg_light->add_intvalue((int)light);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLightxvOES(light, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLineWidthxOES(GLfixed width) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLineWidthxOES);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLineWidthxOES(width);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLoadMatrixxOES(const GLfixed * m) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLoadMatrixxOES);
-
-    // copy argument m
-    GLMessage_DataType *arg_m = glmsg.add_args();
-    arg_m->set_isarray(false);
-    arg_m->set_type(GLMessage::DataType::INT64);
-    arg_m->add_int64value((uintptr_t)m);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLoadMatrixxOES(m);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) m,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialxOES(GLenum face, GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMaterialxOES);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMaterialxOES(face, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMaterialxvOES(GLenum face, GLenum pname, const GLfixed * param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMaterialxvOES);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT64);
-    arg_param->add_int64value((uintptr_t)param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMaterialxvOES(face, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) param,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultMatrixxOES(const GLfixed * m) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultMatrixxOES);
-
-    // copy argument m
-    GLMessage_DataType *arg_m = glmsg.add_args();
-    arg_m->set_isarray(false);
-    arg_m->set_type(GLMessage::DataType::INT64);
-    arg_m->add_int64value((uintptr_t)m);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultMatrixxOES(m);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) m,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMultiTexCoord4xOES(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMultiTexCoord4xOES);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::ENUM);
-    arg_texture->add_intvalue((int)texture);
-
-    // copy argument s
-    GLMessage_DataType *arg_s = glmsg.add_args();
-    arg_s->set_isarray(false);
-    arg_s->set_type(GLMessage::DataType::INT);
-    arg_s->add_intvalue(s);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::INT);
-    arg_t->add_intvalue(t);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::INT);
-    arg_r->add_intvalue(r);
-
-    // copy argument q
-    GLMessage_DataType *arg_q = glmsg.add_args();
-    arg_q->set_isarray(false);
-    arg_q->set_type(GLMessage::DataType::INT);
-    arg_q->add_intvalue(q);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMultiTexCoord4xOES(texture, s, t, r, q);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glNormal3xOES);
-
-    // copy argument nx
-    GLMessage_DataType *arg_nx = glmsg.add_args();
-    arg_nx->set_isarray(false);
-    arg_nx->set_type(GLMessage::DataType::INT);
-    arg_nx->add_intvalue(nx);
-
-    // copy argument ny
-    GLMessage_DataType *arg_ny = glmsg.add_args();
-    arg_ny->set_isarray(false);
-    arg_ny->set_type(GLMessage::DataType::INT);
-    arg_ny->add_intvalue(ny);
-
-    // copy argument nz
-    GLMessage_DataType *arg_nz = glmsg.add_args();
-    arg_nz->set_isarray(false);
-    arg_nz->set_type(GLMessage::DataType::INT);
-    arg_nz->add_intvalue(nz);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glNormal3xOES(nx, ny, nz);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glOrthoxOES(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glOrthoxOES);
-
-    // copy argument l
-    GLMessage_DataType *arg_l = glmsg.add_args();
-    arg_l->set_isarray(false);
-    arg_l->set_type(GLMessage::DataType::INT);
-    arg_l->add_intvalue(l);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::INT);
-    arg_r->add_intvalue(r);
-
-    // copy argument b
-    GLMessage_DataType *arg_b = glmsg.add_args();
-    arg_b->set_isarray(false);
-    arg_b->set_type(GLMessage::DataType::INT);
-    arg_b->add_intvalue(b);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::INT);
-    arg_t->add_intvalue(t);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::INT);
-    arg_f->add_intvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glOrthoxOES(l, r, b, t, n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterxvOES(GLenum pname, const GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPointParameterxvOES);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPointParameterxvOES(pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointSizexOES(GLfixed size) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPointSizexOES);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPointSizexOES(size);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPolygonOffsetxOES(GLfixed factor, GLfixed units) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPolygonOffsetxOES);
-
-    // copy argument factor
-    GLMessage_DataType *arg_factor = glmsg.add_args();
-    arg_factor->set_isarray(false);
-    arg_factor->set_type(GLMessage::DataType::INT);
-    arg_factor->add_intvalue(factor);
-
-    // copy argument units
-    GLMessage_DataType *arg_units = glmsg.add_args();
-    arg_units->set_isarray(false);
-    arg_units->set_type(GLMessage::DataType::INT);
-    arg_units->add_intvalue(units);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPolygonOffsetxOES(factor, units);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glRotatexOES);
-
-    // copy argument angle
-    GLMessage_DataType *arg_angle = glmsg.add_args();
-    arg_angle->set_isarray(false);
-    arg_angle->set_type(GLMessage::DataType::INT);
-    arg_angle->add_intvalue(angle);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::INT);
-    arg_z->add_intvalue(z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glRotatexOES(angle, x, y, z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSampleCoverageOES(GLfixed value, GLboolean invert) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSampleCoverageOES);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT);
-    arg_value->add_intvalue(value);
-
-    // copy argument invert
-    GLMessage_DataType *arg_invert = glmsg.add_args();
-    arg_invert->set_isarray(false);
-    arg_invert->set_type(GLMessage::DataType::BOOL);
-    arg_invert->add_boolvalue(invert);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSampleCoverageOES(value, invert);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glScalexOES(GLfixed x, GLfixed y, GLfixed z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glScalexOES);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::INT);
-    arg_z->add_intvalue(z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glScalexOES(x, y, z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvxOES(GLenum target, GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexEnvxOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexEnvxOES(target, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexEnvxvOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexEnvxvOES(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterxOES(GLenum target, GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexParameterxOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexParameterxOES(target, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexParameterxvOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexParameterxvOES(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTranslatexOES(GLfixed x, GLfixed y, GLfixed z) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTranslatexOES);
-
-    // copy argument x
-    GLMessage_DataType *arg_x = glmsg.add_args();
-    arg_x->set_isarray(false);
-    arg_x->set_type(GLMessage::DataType::INT);
-    arg_x->add_intvalue(x);
-
-    // copy argument y
-    GLMessage_DataType *arg_y = glmsg.add_args();
-    arg_y->set_isarray(false);
-    arg_y->set_type(GLMessage::DataType::INT);
-    arg_y->add_intvalue(y);
-
-    // copy argument z
-    GLMessage_DataType *arg_z = glmsg.add_args();
-    arg_z->set_isarray(false);
-    arg_z->set_type(GLMessage::DataType::INT);
-    arg_z->add_intvalue(z);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTranslatexOES(x, y, z);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetLightxvOES(GLenum light, GLenum pname, GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetLightxvOES);
-
-    // copy argument light
-    GLMessage_DataType *arg_light = glmsg.add_args();
-    arg_light->set_isarray(false);
-    arg_light->set_type(GLMessage::DataType::ENUM);
-    arg_light->add_intvalue((int)light);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetLightxvOES(light, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetMaterialxvOES);
-
-    // copy argument face
-    GLMessage_DataType *arg_face = glmsg.add_args();
-    arg_face->set_isarray(false);
-    arg_face->set_type(GLMessage::DataType::ENUM);
-    arg_face->add_intvalue((int)face);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetMaterialxvOES(face, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointParameterxOES(GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPointParameterxOES);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPointParameterxOES(pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glSampleCoveragexOES(GLclampx value, GLboolean invert) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glSampleCoveragexOES);
-
-    // copy argument value
-    GLMessage_DataType *arg_value = glmsg.add_args();
-    arg_value->set_isarray(false);
-    arg_value->set_type(GLMessage::DataType::INT);
-    arg_value->add_intvalue(value);
-
-    // copy argument invert
-    GLMessage_DataType *arg_invert = glmsg.add_args();
-    arg_invert->set_isarray(false);
-    arg_invert->set_type(GLMessage::DataType::BOOL);
-    arg_invert->add_boolvalue(invert);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glSampleCoveragexOES(value, invert);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexGenxvOES);
-
-    // copy argument coord
-    GLMessage_DataType *arg_coord = glmsg.add_args();
-    arg_coord->set_isarray(false);
-    arg_coord->set_type(GLMessage::DataType::ENUM);
-    arg_coord->add_intvalue((int)coord);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexGenxvOES(coord, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGenxOES(GLenum coord, GLenum pname, GLfixed param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexGenxOES);
-
-    // copy argument coord
-    GLMessage_DataType *arg_coord = glmsg.add_args();
-    arg_coord->set_isarray(false);
-    arg_coord->set_type(GLMessage::DataType::ENUM);
-    arg_coord->add_intvalue((int)coord);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexGenxOES(coord, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexGenxvOES);
-
-    // copy argument coord
-    GLMessage_DataType *arg_coord = glmsg.add_args();
-    arg_coord->set_isarray(false);
-    arg_coord->set_type(GLMessage::DataType::ENUM);
-    arg_coord->add_intvalue((int)coord);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexGenxvOES(coord, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsRenderbufferOES(GLuint renderbuffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsRenderbufferOES);
-
-    // copy argument renderbuffer
-    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
-    arg_renderbuffer->set_isarray(false);
-    arg_renderbuffer->set_type(GLMessage::DataType::INT);
-    arg_renderbuffer->add_intvalue(renderbuffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsRenderbufferOES(renderbuffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glBindRenderbufferOES(GLenum target, GLuint renderbuffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindRenderbufferOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument renderbuffer
-    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
-    arg_renderbuffer->set_isarray(false);
-    arg_renderbuffer->set_type(GLMessage::DataType::INT);
-    arg_renderbuffer->add_intvalue(renderbuffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindRenderbufferOES(target, renderbuffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteRenderbuffersOES(GLsizei n, const GLuint * renderbuffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteRenderbuffersOES);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument renderbuffers
-    GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
-    arg_renderbuffers->set_isarray(false);
-    arg_renderbuffers->set_type(GLMessage::DataType::INT64);
-    arg_renderbuffers->add_int64value((uintptr_t)renderbuffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteRenderbuffersOES(n, renderbuffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) renderbuffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenRenderbuffersOES(GLsizei n, GLuint * renderbuffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenRenderbuffersOES);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument renderbuffers
-    GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
-    arg_renderbuffers->set_isarray(false);
-    arg_renderbuffers->set_type(GLMessage::DataType::INT64);
-    arg_renderbuffers->add_int64value((uintptr_t)renderbuffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenRenderbuffersOES(n, renderbuffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) renderbuffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glRenderbufferStorageOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument internalformat
-    GLMessage_DataType *arg_internalformat = glmsg.add_args();
-    arg_internalformat->set_isarray(false);
-    arg_internalformat->set_type(GLMessage::DataType::ENUM);
-    arg_internalformat->add_intvalue((int)internalformat);
-
-    // copy argument width
-    GLMessage_DataType *arg_width = glmsg.add_args();
-    arg_width->set_isarray(false);
-    arg_width->set_type(GLMessage::DataType::INT);
-    arg_width->add_intvalue(width);
-
-    // copy argument height
-    GLMessage_DataType *arg_height = glmsg.add_args();
-    arg_height->set_isarray(false);
-    arg_height->set_type(GLMessage::DataType::INT);
-    arg_height->add_intvalue(height);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glRenderbufferStorageOES(target, internalformat, width, height);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetRenderbufferParameterivOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetRenderbufferParameterivOES(target, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLboolean GLTrace_glIsFramebufferOES(GLuint framebuffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glIsFramebufferOES);
-
-    // copy argument framebuffer
-    GLMessage_DataType *arg_framebuffer = glmsg.add_args();
-    arg_framebuffer->set_isarray(false);
-    arg_framebuffer->set_type(GLMessage::DataType::INT);
-    arg_framebuffer->add_intvalue(framebuffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLboolean retValue = glContext->hooks->gl.glIsFramebufferOES(framebuffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::BOOL);
-    rt->add_boolvalue(retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glBindFramebufferOES(GLenum target, GLuint framebuffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glBindFramebufferOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument framebuffer
-    GLMessage_DataType *arg_framebuffer = glmsg.add_args();
-    arg_framebuffer->set_isarray(false);
-    arg_framebuffer->set_type(GLMessage::DataType::INT);
-    arg_framebuffer->add_intvalue(framebuffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glBindFramebufferOES(target, framebuffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDeleteFramebuffersOES(GLsizei n, const GLuint * framebuffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDeleteFramebuffersOES);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument framebuffers
-    GLMessage_DataType *arg_framebuffers = glmsg.add_args();
-    arg_framebuffers->set_isarray(false);
-    arg_framebuffers->set_type(GLMessage::DataType::INT64);
-    arg_framebuffers->add_int64value((uintptr_t)framebuffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDeleteFramebuffersOES(n, framebuffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) framebuffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenFramebuffersOES(GLsizei n, GLuint * framebuffers) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenFramebuffersOES);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::INT);
-    arg_n->add_intvalue(n);
-
-    // copy argument framebuffers
-    GLMessage_DataType *arg_framebuffers = glmsg.add_args();
-    arg_framebuffers->set_isarray(false);
-    arg_framebuffers->set_type(GLMessage::DataType::INT64);
-    arg_framebuffers->add_int64value((uintptr_t)framebuffers);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenFramebuffersOES(n, framebuffers);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) framebuffers,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLenum GLTrace_glCheckFramebufferStatusOES(GLenum target) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCheckFramebufferStatusOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLenum retValue = glContext->hooks->gl.glCheckFramebufferStatusOES(target);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::ENUM);
-    rt->add_intvalue((int)retValue);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFramebufferRenderbufferOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument attachment
-    GLMessage_DataType *arg_attachment = glmsg.add_args();
-    arg_attachment->set_isarray(false);
-    arg_attachment->set_type(GLMessage::DataType::ENUM);
-    arg_attachment->add_intvalue((int)attachment);
-
-    // copy argument renderbuffertarget
-    GLMessage_DataType *arg_renderbuffertarget = glmsg.add_args();
-    arg_renderbuffertarget->set_isarray(false);
-    arg_renderbuffertarget->set_type(GLMessage::DataType::ENUM);
-    arg_renderbuffertarget->add_intvalue((int)renderbuffertarget);
-
-    // copy argument renderbuffer
-    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
-    arg_renderbuffer->set_isarray(false);
-    arg_renderbuffer->set_type(GLMessage::DataType::INT);
-    arg_renderbuffer->add_intvalue(renderbuffer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFramebufferRenderbufferOES(target, attachment, renderbuffertarget, renderbuffer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFramebufferTexture2DOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument attachment
-    GLMessage_DataType *arg_attachment = glmsg.add_args();
-    arg_attachment->set_isarray(false);
-    arg_attachment->set_type(GLMessage::DataType::ENUM);
-    arg_attachment->add_intvalue((int)attachment);
-
-    // copy argument textarget
-    GLMessage_DataType *arg_textarget = glmsg.add_args();
-    arg_textarget->set_isarray(false);
-    arg_textarget->set_type(GLMessage::DataType::ENUM);
-    arg_textarget->add_intvalue((int)textarget);
-
-    // copy argument texture
-    GLMessage_DataType *arg_texture = glmsg.add_args();
-    arg_texture->set_isarray(false);
-    arg_texture->set_type(GLMessage::DataType::INT);
-    arg_texture->add_intvalue(texture);
-
-    // copy argument level
-    GLMessage_DataType *arg_level = glmsg.add_args();
-    arg_level->set_isarray(false);
-    arg_level->set_type(GLMessage::DataType::INT);
-    arg_level->add_intvalue(level);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFramebufferTexture2DOES(target, attachment, textarget, texture, level);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetFramebufferAttachmentParameterivOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // copy argument attachment
-    GLMessage_DataType *arg_attachment = glmsg.add_args();
-    arg_attachment->set_isarray(false);
-    arg_attachment->set_type(GLMessage::DataType::ENUM);
-    arg_attachment->add_intvalue((int)attachment);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetFramebufferAttachmentParameterivOES(target, attachment, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGenerateMipmapOES(GLenum target) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGenerateMipmapOES);
-
-    // copy argument target
-    GLMessage_DataType *arg_target = glmsg.add_args();
-    arg_target->set_isarray(false);
-    arg_target->set_type(GLMessage::DataType::ENUM);
-    arg_target->add_intvalue((int)target);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGenerateMipmapOES(target);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glCurrentPaletteMatrixOES(GLuint matrixpaletteindex) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glCurrentPaletteMatrixOES);
-
-    // copy argument matrixpaletteindex
-    GLMessage_DataType *arg_matrixpaletteindex = glmsg.add_args();
-    arg_matrixpaletteindex->set_isarray(false);
-    arg_matrixpaletteindex->set_type(GLMessage::DataType::INT);
-    arg_matrixpaletteindex->add_intvalue(matrixpaletteindex);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glCurrentPaletteMatrixOES(matrixpaletteindex);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glLoadPaletteFromModelViewMatrixOES(void) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glLoadPaletteFromModelViewMatrixOES);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glLoadPaletteFromModelViewMatrixOES();
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const void * pointer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glMatrixIndexPointerOES);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument stride
-    GLMessage_DataType *arg_stride = glmsg.add_args();
-    arg_stride->set_isarray(false);
-    arg_stride->set_type(GLMessage::DataType::INT);
-    arg_stride->add_intvalue(stride);
-
-    // copy argument pointer
-    GLMessage_DataType *arg_pointer = glmsg.add_args();
-    arg_pointer->set_isarray(false);
-    arg_pointer->set_type(GLMessage::DataType::INT64);
-    arg_pointer->add_int64value((uintptr_t)pointer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glMatrixIndexPointerOES(size, type, stride, pointer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pointer,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const void * pointer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glWeightPointerOES);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument stride
-    GLMessage_DataType *arg_stride = glmsg.add_args();
-    arg_stride->set_isarray(false);
-    arg_stride->set_type(GLMessage::DataType::INT);
-    arg_stride->add_intvalue(stride);
-
-    // copy argument pointer
-    GLMessage_DataType *arg_pointer = glmsg.add_args();
-    arg_pointer->set_isarray(false);
-    arg_pointer->set_type(GLMessage::DataType::INT64);
-    arg_pointer->add_int64value((uintptr_t)pointer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glWeightPointerOES(size, type, stride, pointer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pointer,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glPointSizePointerOES(GLenum type, GLsizei stride, const void * pointer) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glPointSizePointerOES);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument stride
-    GLMessage_DataType *arg_stride = glmsg.add_args();
-    arg_stride->set_isarray(false);
-    arg_stride->set_type(GLMessage::DataType::INT);
-    arg_stride->add_intvalue(stride);
-
-    // copy argument pointer
-    GLMessage_DataType *arg_pointer = glmsg.add_args();
-    arg_pointer->set_isarray(false);
-    arg_pointer->set_type(GLMessage::DataType::INT64);
-    arg_pointer->add_int64value((uintptr_t)pointer);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glPointSizePointerOES(type, stride, pointer);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) pointer,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-GLbitfield GLTrace_glQueryMatrixxOES(GLfixed * mantissa, GLint * exponent) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glQueryMatrixxOES);
-
-    // copy argument mantissa
-    GLMessage_DataType *arg_mantissa = glmsg.add_args();
-    arg_mantissa->set_isarray(false);
-    arg_mantissa->set_type(GLMessage::DataType::INT64);
-    arg_mantissa->add_int64value((uintptr_t)mantissa);
-
-    // copy argument exponent
-    GLMessage_DataType *arg_exponent = glmsg.add_args();
-    arg_exponent->set_isarray(false);
-    arg_exponent->set_type(GLMessage::DataType::INT64);
-    arg_exponent->add_int64value((uintptr_t)exponent);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    GLbitfield retValue = glContext->hooks->gl.glQueryMatrixxOES(mantissa, exponent);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::INT);
-    rt->add_intvalue(retValue);
-
-    void *pointerArgs[] = {
-        (void *) mantissa,
-        (void *) exponent,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-
-    return retValue;
-}
-
-void GLTrace_glClearDepthfOES(GLclampf depth) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClearDepthfOES);
-
-    // copy argument depth
-    GLMessage_DataType *arg_depth = glmsg.add_args();
-    arg_depth->set_isarray(false);
-    arg_depth->set_type(GLMessage::DataType::FLOAT);
-    arg_depth->add_floatvalue(depth);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClearDepthfOES(depth);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanefOES(GLenum plane, const GLfloat * equation) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClipPlanefOES);
-
-    // copy argument plane
-    GLMessage_DataType *arg_plane = glmsg.add_args();
-    arg_plane->set_isarray(false);
-    arg_plane->set_type(GLMessage::DataType::ENUM);
-    arg_plane->add_intvalue((int)plane);
-
-    // copy argument equation
-    GLMessage_DataType *arg_equation = glmsg.add_args();
-    arg_equation->set_isarray(false);
-    arg_equation->set_type(GLMessage::DataType::INT64);
-    arg_equation->add_int64value((uintptr_t)equation);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClipPlanefOES(plane, equation);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) equation,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glDepthRangefOES(GLclampf n, GLclampf f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glDepthRangefOES);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::FLOAT);
-    arg_n->add_floatvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::FLOAT);
-    arg_f->add_floatvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glDepthRangefOES(n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glFrustumfOES(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glFrustumfOES);
-
-    // copy argument l
-    GLMessage_DataType *arg_l = glmsg.add_args();
-    arg_l->set_isarray(false);
-    arg_l->set_type(GLMessage::DataType::FLOAT);
-    arg_l->add_floatvalue(l);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::FLOAT);
-    arg_r->add_floatvalue(r);
-
-    // copy argument b
-    GLMessage_DataType *arg_b = glmsg.add_args();
-    arg_b->set_isarray(false);
-    arg_b->set_type(GLMessage::DataType::FLOAT);
-    arg_b->add_floatvalue(b);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::FLOAT);
-    arg_t->add_floatvalue(t);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::FLOAT);
-    arg_n->add_floatvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::FLOAT);
-    arg_f->add_floatvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glFrustumfOES(l, r, b, t, n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetClipPlanefOES(GLenum plane, GLfloat * equation) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetClipPlanefOES);
-
-    // copy argument plane
-    GLMessage_DataType *arg_plane = glmsg.add_args();
-    arg_plane->set_isarray(false);
-    arg_plane->set_type(GLMessage::DataType::ENUM);
-    arg_plane->add_intvalue((int)plane);
-
-    // copy argument equation
-    GLMessage_DataType *arg_equation = glmsg.add_args();
-    arg_equation->set_isarray(false);
-    arg_equation->set_type(GLMessage::DataType::INT64);
-    arg_equation->add_int64value((uintptr_t)equation);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetClipPlanefOES(plane, equation);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) equation,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glOrthofOES(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glOrthofOES);
-
-    // copy argument l
-    GLMessage_DataType *arg_l = glmsg.add_args();
-    arg_l->set_isarray(false);
-    arg_l->set_type(GLMessage::DataType::FLOAT);
-    arg_l->add_floatvalue(l);
-
-    // copy argument r
-    GLMessage_DataType *arg_r = glmsg.add_args();
-    arg_r->set_isarray(false);
-    arg_r->set_type(GLMessage::DataType::FLOAT);
-    arg_r->add_floatvalue(r);
-
-    // copy argument b
-    GLMessage_DataType *arg_b = glmsg.add_args();
-    arg_b->set_isarray(false);
-    arg_b->set_type(GLMessage::DataType::FLOAT);
-    arg_b->add_floatvalue(b);
-
-    // copy argument t
-    GLMessage_DataType *arg_t = glmsg.add_args();
-    arg_t->set_isarray(false);
-    arg_t->set_type(GLMessage::DataType::FLOAT);
-    arg_t->add_floatvalue(t);
-
-    // copy argument n
-    GLMessage_DataType *arg_n = glmsg.add_args();
-    arg_n->set_isarray(false);
-    arg_n->set_type(GLMessage::DataType::FLOAT);
-    arg_n->add_floatvalue(n);
-
-    // copy argument f
-    GLMessage_DataType *arg_f = glmsg.add_args();
-    arg_f->set_isarray(false);
-    arg_f->set_type(GLMessage::DataType::FLOAT);
-    arg_f->add_floatvalue(f);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glOrthofOES(l, r, b, t, n, f);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGenfOES(GLenum coord, GLenum pname, GLfloat param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexGenfOES);
-
-    // copy argument coord
-    GLMessage_DataType *arg_coord = glmsg.add_args();
-    arg_coord->set_isarray(false);
-    arg_coord->set_type(GLMessage::DataType::ENUM);
-    arg_coord->add_intvalue((int)coord);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::FLOAT);
-    arg_param->add_floatvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexGenfOES(coord, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexGenfvOES);
-
-    // copy argument coord
-    GLMessage_DataType *arg_coord = glmsg.add_args();
-    arg_coord->set_isarray(false);
-    arg_coord->set_type(GLMessage::DataType::ENUM);
-    arg_coord->add_intvalue((int)coord);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexGenfvOES(coord, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGeniOES(GLenum coord, GLenum pname, GLint param) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexGeniOES);
-
-    // copy argument coord
-    GLMessage_DataType *arg_coord = glmsg.add_args();
-    arg_coord->set_isarray(false);
-    arg_coord->set_type(GLMessage::DataType::ENUM);
-    arg_coord->add_intvalue((int)coord);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument param
-    GLMessage_DataType *arg_param = glmsg.add_args();
-    arg_param->set_isarray(false);
-    arg_param->set_type(GLMessage::DataType::INT);
-    arg_param->add_intvalue(param);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexGeniOES(coord, pname, param);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glTexGenivOES(GLenum coord, GLenum pname, const GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glTexGenivOES);
-
-    // copy argument coord
-    GLMessage_DataType *arg_coord = glmsg.add_args();
-    arg_coord->set_isarray(false);
-    arg_coord->set_type(GLMessage::DataType::ENUM);
-    arg_coord->add_intvalue((int)coord);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glTexGenivOES(coord, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexGenfvOES);
-
-    // copy argument coord
-    GLMessage_DataType *arg_coord = glmsg.add_args();
-    arg_coord->set_isarray(false);
-    arg_coord->set_type(GLMessage::DataType::ENUM);
-    arg_coord->add_intvalue((int)coord);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexGenfvOES(coord, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glGetTexGenivOES(GLenum coord, GLenum pname, GLint * params) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glGetTexGenivOES);
-
-    // copy argument coord
-    GLMessage_DataType *arg_coord = glmsg.add_args();
-    arg_coord->set_isarray(false);
-    arg_coord->set_type(GLMessage::DataType::ENUM);
-    arg_coord->add_intvalue((int)coord);
-
-    // copy argument pname
-    GLMessage_DataType *arg_pname = glmsg.add_args();
-    arg_pname->set_isarray(false);
-    arg_pname->set_type(GLMessage::DataType::ENUM);
-    arg_pname->add_intvalue((int)pname);
-
-    // copy argument params
-    GLMessage_DataType *arg_params = glmsg.add_args();
-    arg_params->set_isarray(false);
-    arg_params->set_type(GLMessage::DataType::INT64);
-    arg_params->add_int64value((uintptr_t)params);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glGetTexGenivOES(coord, pname, params);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) params,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanefIMG(GLenum p, const GLfloat * eqn) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClipPlanefIMG);
-
-    // copy argument p
-    GLMessage_DataType *arg_p = glmsg.add_args();
-    arg_p->set_isarray(false);
-    arg_p->set_type(GLMessage::DataType::ENUM);
-    arg_p->add_intvalue((int)p);
-
-    // copy argument eqn
-    GLMessage_DataType *arg_eqn = glmsg.add_args();
-    arg_eqn->set_isarray(false);
-    arg_eqn->set_type(GLMessage::DataType::INT64);
-    arg_eqn->add_int64value((uintptr_t)eqn);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClipPlanefIMG(p, eqn);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) eqn,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-void GLTrace_glClipPlanexIMG(GLenum p, const GLfixed * eqn) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::glClipPlanexIMG);
-
-    // copy argument p
-    GLMessage_DataType *arg_p = glmsg.add_args();
-    arg_p->set_isarray(false);
-    arg_p->set_type(GLMessage::DataType::ENUM);
-    arg_p->add_intvalue((int)p);
-
-    // copy argument eqn
-    GLMessage_DataType *arg_eqn = glmsg.add_args();
-    arg_eqn->set_isarray(false);
-    arg_eqn->set_type(GLMessage::DataType::INT64);
-    arg_eqn->add_int64value((uintptr_t)eqn);
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-    glContext->hooks->gl.glClipPlanexIMG(p, eqn);
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
-    void *pointerArgs[] = {
-        (void *) eqn,
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-}
-
-
-}; // namespace gltrace
-}; // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_api.h b/opengl/libs/GLES_trace/src/gltrace_api.h
deleted file mode 100644 (file)
index a9ca3c4..0000000
+++ /dev/null
@@ -1,767 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * THIS FILE WAS GENERATED BY A SCRIPT. DO NOT EDIT.
- */
-
-namespace android {
-namespace gltrace {
-
-// Declarations for GL2 APIs
-
-void GLTrace_glActiveTexture(GLenum texture);
-void GLTrace_glAttachShader(GLuint program, GLuint shader);
-void GLTrace_glBindAttribLocation(GLuint program, GLuint index, const GLchar * name);
-void GLTrace_glBindBuffer(GLenum target, GLuint buffer);
-void GLTrace_glBindFramebuffer(GLenum target, GLuint framebuffer);
-void GLTrace_glBindRenderbuffer(GLenum target, GLuint renderbuffer);
-void GLTrace_glBindTexture(GLenum target, GLuint texture);
-void GLTrace_glBlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-void GLTrace_glBlendEquation(GLenum mode);
-void GLTrace_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
-void GLTrace_glBlendFunc(GLenum sfactor, GLenum dfactor);
-void GLTrace_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-void GLTrace_glBufferData(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
-void GLTrace_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
-GLenum GLTrace_glCheckFramebufferStatus(GLenum target);
-void GLTrace_glClear(GLbitfield mask);
-void GLTrace_glClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-void GLTrace_glClearDepthf(GLfloat d);
-void GLTrace_glClearStencil(GLint s);
-void GLTrace_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-void GLTrace_glCompileShader(GLuint shader);
-void GLTrace_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data);
-void GLTrace_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
-void GLTrace_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-void GLTrace_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLuint GLTrace_glCreateProgram(void);
-GLuint GLTrace_glCreateShader(GLenum type);
-void GLTrace_glCullFace(GLenum mode);
-void GLTrace_glDeleteBuffers(GLsizei n, const GLuint * buffers);
-void GLTrace_glDeleteFramebuffers(GLsizei n, const GLuint * framebuffers);
-void GLTrace_glDeleteProgram(GLuint program);
-void GLTrace_glDeleteRenderbuffers(GLsizei n, const GLuint * renderbuffers);
-void GLTrace_glDeleteShader(GLuint shader);
-void GLTrace_glDeleteTextures(GLsizei n, const GLuint * textures);
-void GLTrace_glDepthFunc(GLenum func);
-void GLTrace_glDepthMask(GLboolean flag);
-void GLTrace_glDepthRangef(GLfloat n, GLfloat f);
-void GLTrace_glDetachShader(GLuint program, GLuint shader);
-void GLTrace_glDisable(GLenum cap);
-void GLTrace_glDisableVertexAttribArray(GLuint index);
-void GLTrace_glDrawArrays(GLenum mode, GLint first, GLsizei count);
-void GLTrace_glDrawElements(GLenum mode, GLsizei count, GLenum type, const void * indices);
-void GLTrace_glEnable(GLenum cap);
-void GLTrace_glEnableVertexAttribArray(GLuint index);
-void GLTrace_glFinish(void);
-void GLTrace_glFlush(void);
-void GLTrace_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-void GLTrace_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-void GLTrace_glFrontFace(GLenum mode);
-void GLTrace_glGenBuffers(GLsizei n, GLuint * buffers);
-void GLTrace_glGenerateMipmap(GLenum target);
-void GLTrace_glGenFramebuffers(GLsizei n, GLuint * framebuffers);
-void GLTrace_glGenRenderbuffers(GLsizei n, GLuint * renderbuffers);
-void GLTrace_glGenTextures(GLsizei n, GLuint * textures);
-void GLTrace_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
-void GLTrace_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
-void GLTrace_glGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders);
-GLint GLTrace_glGetAttribLocation(GLuint program, const GLchar * name);
-void GLTrace_glGetBooleanv(GLenum pname, GLboolean * data);
-void GLTrace_glGetBufferParameteriv(GLenum target, GLenum pname, GLint * params);
-GLenum GLTrace_glGetError(void);
-void GLTrace_glGetFloatv(GLenum pname, GLfloat * data);
-void GLTrace_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params);
-void GLTrace_glGetIntegerv(GLenum pname, GLint * data);
-void GLTrace_glGetProgramiv(GLuint program, GLenum pname, GLint * params);
-void GLTrace_glGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
-void GLTrace_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params);
-void GLTrace_glGetShaderiv(GLuint shader, GLenum pname, GLint * params);
-void GLTrace_glGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
-void GLTrace_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision);
-void GLTrace_glGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source);
-const GLubyte * GLTrace_glGetString(GLenum name);
-void GLTrace_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params);
-void GLTrace_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params);
-void GLTrace_glGetUniformfv(GLuint program, GLint location, GLfloat * params);
-void GLTrace_glGetUniformiv(GLuint program, GLint location, GLint * params);
-GLint GLTrace_glGetUniformLocation(GLuint program, const GLchar * name);
-void GLTrace_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat * params);
-void GLTrace_glGetVertexAttribiv(GLuint index, GLenum pname, GLint * params);
-void GLTrace_glGetVertexAttribPointerv(GLuint index, GLenum pname, void ** pointer);
-void GLTrace_glHint(GLenum target, GLenum mode);
-GLboolean GLTrace_glIsBuffer(GLuint buffer);
-GLboolean GLTrace_glIsEnabled(GLenum cap);
-GLboolean GLTrace_glIsFramebuffer(GLuint framebuffer);
-GLboolean GLTrace_glIsProgram(GLuint program);
-GLboolean GLTrace_glIsRenderbuffer(GLuint renderbuffer);
-GLboolean GLTrace_glIsShader(GLuint shader);
-GLboolean GLTrace_glIsTexture(GLuint texture);
-void GLTrace_glLineWidth(GLfloat width);
-void GLTrace_glLinkProgram(GLuint program);
-void GLTrace_glPixelStorei(GLenum pname, GLint param);
-void GLTrace_glPolygonOffset(GLfloat factor, GLfloat units);
-void GLTrace_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
-void GLTrace_glReleaseShaderCompiler(void);
-void GLTrace_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glSampleCoverage(GLfloat value, GLboolean invert);
-void GLTrace_glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
-void GLTrace_glShaderBinary(GLsizei count, const GLuint * shaders, GLenum binaryformat, const void * binary, GLsizei length);
-void GLTrace_glShaderSource(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
-void GLTrace_glStencilFunc(GLenum func, GLint ref, GLuint mask);
-void GLTrace_glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
-void GLTrace_glStencilMask(GLuint mask);
-void GLTrace_glStencilMaskSeparate(GLenum face, GLuint mask);
-void GLTrace_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
-void GLTrace_glStencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-void GLTrace_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
-void GLTrace_glTexParameterf(GLenum target, GLenum pname, GLfloat param);
-void GLTrace_glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params);
-void GLTrace_glTexParameteri(GLenum target, GLenum pname, GLint param);
-void GLTrace_glTexParameteriv(GLenum target, GLenum pname, const GLint * params);
-void GLTrace_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
-void GLTrace_glUniform1f(GLint location, GLfloat v0);
-void GLTrace_glUniform1fv(GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glUniform1i(GLint location, GLint v0);
-void GLTrace_glUniform1iv(GLint location, GLsizei count, const GLint * value);
-void GLTrace_glUniform2f(GLint location, GLfloat v0, GLfloat v1);
-void GLTrace_glUniform2fv(GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glUniform2i(GLint location, GLint v0, GLint v1);
-void GLTrace_glUniform2iv(GLint location, GLsizei count, const GLint * value);
-void GLTrace_glUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-void GLTrace_glUniform3fv(GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glUniform3i(GLint location, GLint v0, GLint v1, GLint v2);
-void GLTrace_glUniform3iv(GLint location, GLsizei count, const GLint * value);
-void GLTrace_glUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-void GLTrace_glUniform4fv(GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glUniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-void GLTrace_glUniform4iv(GLint location, GLsizei count, const GLint * value);
-void GLTrace_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUseProgram(GLuint program);
-void GLTrace_glValidateProgram(GLuint program);
-void GLTrace_glVertexAttrib1f(GLuint index, GLfloat x);
-void GLTrace_glVertexAttrib1fv(GLuint index, const GLfloat * v);
-void GLTrace_glVertexAttrib2f(GLuint index, GLfloat x, GLfloat y);
-void GLTrace_glVertexAttrib2fv(GLuint index, const GLfloat * v);
-void GLTrace_glVertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z);
-void GLTrace_glVertexAttrib3fv(GLuint index, const GLfloat * v);
-void GLTrace_glVertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-void GLTrace_glVertexAttrib4fv(GLuint index, const GLfloat * v);
-void GLTrace_glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer);
-void GLTrace_glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
-void GLTrace_glReadBuffer(GLenum mode);
-void GLTrace_glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices);
-void GLTrace_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
-void GLTrace_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
-void GLTrace_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-void GLTrace_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data);
-void GLTrace_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data);
-void GLTrace_glGenQueries(GLsizei n, GLuint * ids);
-void GLTrace_glDeleteQueries(GLsizei n, const GLuint * ids);
-GLboolean GLTrace_glIsQuery(GLuint id);
-void GLTrace_glBeginQuery(GLenum target, GLuint id);
-void GLTrace_glEndQuery(GLenum target);
-void GLTrace_glGetQueryiv(GLenum target, GLenum pname, GLint * params);
-void GLTrace_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint * params);
-GLboolean GLTrace_glUnmapBuffer(GLenum target);
-void GLTrace_glGetBufferPointerv(GLenum target, GLenum pname, void ** params);
-void GLTrace_glDrawBuffers(GLsizei n, const GLenum * bufs);
-void GLTrace_glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-void GLTrace_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-void * GLTrace_glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-void GLTrace_glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
-void GLTrace_glBindVertexArray(GLuint array);
-void GLTrace_glDeleteVertexArrays(GLsizei n, const GLuint * arrays);
-void GLTrace_glGenVertexArrays(GLsizei n, GLuint * arrays);
-GLboolean GLTrace_glIsVertexArray(GLuint array);
-void GLTrace_glGetIntegeri_v(GLenum target, GLuint index, GLint * data);
-void GLTrace_glBeginTransformFeedback(GLenum primitiveMode);
-void GLTrace_glEndTransformFeedback(void);
-void GLTrace_glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-void GLTrace_glBindBufferBase(GLenum target, GLuint index, GLuint buffer);
-void GLTrace_glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
-void GLTrace_glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name);
-void GLTrace_glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer);
-void GLTrace_glGetVertexAttribIiv(GLuint index, GLenum pname, GLint * params);
-void GLTrace_glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint * params);
-void GLTrace_glVertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
-void GLTrace_glVertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-void GLTrace_glVertexAttribI4iv(GLuint index, const GLint * v);
-void GLTrace_glVertexAttribI4uiv(GLuint index, const GLuint * v);
-void GLTrace_glGetUniformuiv(GLuint program, GLint location, GLuint * params);
-GLint GLTrace_glGetFragDataLocation(GLuint program, const GLchar * name);
-void GLTrace_glUniform1ui(GLint location, GLuint v0);
-void GLTrace_glUniform2ui(GLint location, GLuint v0, GLuint v1);
-void GLTrace_glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2);
-void GLTrace_glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void GLTrace_glUniform1uiv(GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glUniform2uiv(GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glUniform3uiv(GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glUniform4uiv(GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint * value);
-void GLTrace_glClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint * value);
-void GLTrace_glClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat * value);
-void GLTrace_glClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
-const GLubyte * GLTrace_glGetStringi(GLenum name, GLuint index);
-void GLTrace_glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-void GLTrace_glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices);
-void GLTrace_glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params);
-GLuint GLTrace_glGetUniformBlockIndex(GLuint program, const GLchar * uniformBlockName);
-void GLTrace_glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params);
-void GLTrace_glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName);
-void GLTrace_glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-void GLTrace_glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
-void GLTrace_glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount);
-GLsync GLTrace_glFenceSync(GLenum condition, GLbitfield flags);
-GLboolean GLTrace_glIsSync(GLsync sync);
-void GLTrace_glDeleteSync(GLsync sync);
-GLenum GLTrace_glClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
-void GLTrace_glWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
-void GLTrace_glGetInteger64v(GLenum pname, GLint64 * data);
-void GLTrace_glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values);
-void GLTrace_glGetInteger64i_v(GLenum target, GLuint index, GLint64 * data);
-void GLTrace_glGetBufferParameteri64v(GLenum target, GLenum pname, GLint64 * params);
-void GLTrace_glGenSamplers(GLsizei count, GLuint * samplers);
-void GLTrace_glDeleteSamplers(GLsizei count, const GLuint * samplers);
-GLboolean GLTrace_glIsSampler(GLuint sampler);
-void GLTrace_glBindSampler(GLuint unit, GLuint sampler);
-void GLTrace_glSamplerParameteri(GLuint sampler, GLenum pname, GLint param);
-void GLTrace_glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint * param);
-void GLTrace_glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param);
-void GLTrace_glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat * param);
-void GLTrace_glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint * params);
-void GLTrace_glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat * params);
-void GLTrace_glVertexAttribDivisor(GLuint index, GLuint divisor);
-void GLTrace_glBindTransformFeedback(GLenum target, GLuint id);
-void GLTrace_glDeleteTransformFeedbacks(GLsizei n, const GLuint * ids);
-void GLTrace_glGenTransformFeedbacks(GLsizei n, GLuint * ids);
-GLboolean GLTrace_glIsTransformFeedback(GLuint id);
-void GLTrace_glPauseTransformFeedback(void);
-void GLTrace_glResumeTransformFeedback(void);
-void GLTrace_glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary);
-void GLTrace_glProgramBinary(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length);
-void GLTrace_glProgramParameteri(GLuint program, GLenum pname, GLint value);
-void GLTrace_glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments);
-void GLTrace_glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-void GLTrace_glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-void GLTrace_glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint * params);
-void GLTrace_glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
-void GLTrace_glDispatchComputeIndirect(GLintptr indirect);
-void GLTrace_glDrawArraysIndirect(GLenum mode, const void * indirect);
-void GLTrace_glDrawElementsIndirect(GLenum mode, GLenum type, const void * indirect);
-void GLTrace_glFramebufferParameteri(GLenum target, GLenum pname, GLint param);
-void GLTrace_glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint * params);
-void GLTrace_glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint * params);
-GLuint GLTrace_glGetProgramResourceIndex(GLuint program, GLenum programInterface, const GLchar * name);
-void GLTrace_glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei * length, GLchar * name);
-void GLTrace_glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params);
-GLint GLTrace_glGetProgramResourceLocation(GLuint program, GLenum programInterface, const GLchar * name);
-void GLTrace_glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);
-void GLTrace_glActiveShaderProgram(GLuint pipeline, GLuint program);
-GLuint GLTrace_glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const* strings);
-void GLTrace_glBindProgramPipeline(GLuint pipeline);
-void GLTrace_glDeleteProgramPipelines(GLsizei n, const GLuint * pipelines);
-void GLTrace_glGenProgramPipelines(GLsizei n, GLuint * pipelines);
-GLboolean GLTrace_glIsProgramPipeline(GLuint pipeline);
-void GLTrace_glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint * params);
-void GLTrace_glProgramUniform1i(GLuint program, GLint location, GLint v0);
-void GLTrace_glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1);
-void GLTrace_glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-void GLTrace_glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-void GLTrace_glProgramUniform1ui(GLuint program, GLint location, GLuint v0);
-void GLTrace_glProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1);
-void GLTrace_glProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-void GLTrace_glProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void GLTrace_glProgramUniform1f(GLuint program, GLint location, GLfloat v0);
-void GLTrace_glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1);
-void GLTrace_glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-void GLTrace_glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-void GLTrace_glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint * value);
-void GLTrace_glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint * value);
-void GLTrace_glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint * value);
-void GLTrace_glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint * value);
-void GLTrace_glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glValidateProgramPipeline(GLuint pipeline);
-void GLTrace_glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
-void GLTrace_glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-void GLTrace_glGetBooleani_v(GLenum target, GLuint index, GLboolean * data);
-void GLTrace_glMemoryBarrier(GLbitfield barriers);
-void GLTrace_glMemoryBarrierByRegion(GLbitfield barriers);
-void GLTrace_glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-void GLTrace_glGetMultisamplefv(GLenum pname, GLuint index, GLfloat * val);
-void GLTrace_glSampleMaski(GLuint maskNumber, GLbitfield mask);
-void GLTrace_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params);
-void GLTrace_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params);
-void GLTrace_glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-void GLTrace_glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-void GLTrace_glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-void GLTrace_glVertexAttribBinding(GLuint attribindex, GLuint bindingindex);
-void GLTrace_glVertexBindingDivisor(GLuint bindingindex, GLuint divisor);
-
-// Declarations for GL2Ext APIs
-
-void GLTrace_glBlendBarrierKHR(void);
-void GLTrace_glDebugMessageControlKHR(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled);
-void GLTrace_glDebugMessageInsertKHR(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf);
-void GLTrace_glDebugMessageCallbackKHR(GLDEBUGPROCKHR callback, const void * userParam);
-GLuint GLTrace_glGetDebugMessageLogKHR(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog);
-void GLTrace_glPushDebugGroupKHR(GLenum source, GLuint id, GLsizei length, const GLchar * message);
-void GLTrace_glPopDebugGroupKHR(void);
-void GLTrace_glObjectLabelKHR(GLenum identifier, GLuint name, GLsizei length, const GLchar * label);
-void GLTrace_glGetObjectLabelKHR(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label);
-void GLTrace_glObjectPtrLabelKHR(const void * ptr, GLsizei length, const GLchar * label);
-void GLTrace_glGetObjectPtrLabelKHR(const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label);
-void GLTrace_glGetPointervKHR(GLenum pname, void ** params);
-void GLTrace_glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
-void GLTrace_glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
-void GLTrace_glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary);
-void GLTrace_glProgramBinaryOES(GLuint program, GLenum binaryFormat, const void * binary, GLint length);
-void * GLTrace_glMapBufferOES(GLenum target, GLenum access);
-GLboolean GLTrace_glUnmapBufferOES(GLenum target);
-void GLTrace_glGetBufferPointervOES(GLenum target, GLenum pname, void ** params);
-void GLTrace_glMinSampleShadingOES(GLfloat value);
-void GLTrace_glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
-void GLTrace_glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
-void GLTrace_glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-void GLTrace_glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data);
-void GLTrace_glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data);
-void GLTrace_glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-void GLTrace_glTexStorage3DMultisampleOES(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-void GLTrace_glBindVertexArrayOES(GLuint array);
-void GLTrace_glDeleteVertexArraysOES(GLsizei n, const GLuint * arrays);
-void GLTrace_glGenVertexArraysOES(GLsizei n, GLuint * arrays);
-GLboolean GLTrace_glIsVertexArrayOES(GLuint array);
-void GLTrace_glGetPerfMonitorGroupsAMD(GLint * numGroups, GLsizei groupsSize, GLuint * groups);
-void GLTrace_glGetPerfMonitorCountersAMD(GLuint group, GLint * numCounters, GLint * maxActiveCounters, GLsizei counterSize, GLuint * counters);
-void GLTrace_glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei * length, GLchar * groupString);
-void GLTrace_glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei * length, GLchar * counterString);
-void GLTrace_glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, void * data);
-void GLTrace_glGenPerfMonitorsAMD(GLsizei n, GLuint * monitors);
-void GLTrace_glDeletePerfMonitorsAMD(GLsizei n, GLuint * monitors);
-void GLTrace_glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint * counterList);
-void GLTrace_glBeginPerfMonitorAMD(GLuint monitor);
-void GLTrace_glEndPerfMonitorAMD(GLuint monitor);
-void GLTrace_glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint * data, GLint * bytesWritten);
-void GLTrace_glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-void GLTrace_glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-void GLTrace_glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount);
-void GLTrace_glVertexAttribDivisorANGLE(GLuint index, GLuint divisor);
-void GLTrace_glGetTranslatedShaderSourceANGLE(GLuint shader, GLsizei bufsize, GLsizei * length, GLchar * source);
-void GLTrace_glCopyTextureLevelsAPPLE(GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
-void GLTrace_glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glResolveMultisampleFramebufferAPPLE(void);
-GLsync GLTrace_glFenceSyncAPPLE(GLenum condition, GLbitfield flags);
-GLboolean GLTrace_glIsSyncAPPLE(GLsync sync);
-void GLTrace_glDeleteSyncAPPLE(GLsync sync);
-GLenum GLTrace_glClientWaitSyncAPPLE(GLsync sync, GLbitfield flags, GLuint64 timeout);
-void GLTrace_glWaitSyncAPPLE(GLsync sync, GLbitfield flags, GLuint64 timeout);
-void GLTrace_glGetInteger64vAPPLE(GLenum pname, GLint64 * params);
-void GLTrace_glGetSyncivAPPLE(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values);
-void GLTrace_glCopyImageSubDataEXT(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-void GLTrace_glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar * label);
-void GLTrace_glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei * length, GLchar * label);
-void GLTrace_glInsertEventMarkerEXT(GLsizei length, const GLchar * marker);
-void GLTrace_glPushGroupMarkerEXT(GLsizei length, const GLchar * marker);
-void GLTrace_glPopGroupMarkerEXT(void);
-void GLTrace_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum * attachments);
-void GLTrace_glGenQueriesEXT(GLsizei n, GLuint * ids);
-void GLTrace_glDeleteQueriesEXT(GLsizei n, const GLuint * ids);
-GLboolean GLTrace_glIsQueryEXT(GLuint id);
-void GLTrace_glBeginQueryEXT(GLenum target, GLuint id);
-void GLTrace_glEndQueryEXT(GLenum target);
-void GLTrace_glQueryCounterEXT(GLuint id, GLenum target);
-void GLTrace_glGetQueryivEXT(GLenum target, GLenum pname, GLint * params);
-void GLTrace_glGetQueryObjectivEXT(GLuint id, GLenum pname, GLint * params);
-void GLTrace_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint * params);
-void GLTrace_glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64 * params);
-void GLTrace_glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64 * params);
-void GLTrace_glDrawBuffersEXT(GLsizei n, const GLenum * bufs);
-void GLTrace_glEnableiEXT(GLenum target, GLuint index);
-void GLTrace_glDisableiEXT(GLenum target, GLuint index);
-void GLTrace_glBlendEquationiEXT(GLuint buf, GLenum mode);
-void GLTrace_glBlendEquationSeparateiEXT(GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-void GLTrace_glBlendFunciEXT(GLuint buf, GLenum src, GLenum dst);
-void GLTrace_glBlendFuncSeparateiEXT(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-void GLTrace_glColorMaskiEXT(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-GLboolean GLTrace_glIsEnablediEXT(GLenum target, GLuint index);
-void GLTrace_glDrawArraysInstancedEXT(GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-void GLTrace_glDrawElementsInstancedEXT(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount);
-void GLTrace_glFramebufferTextureEXT(GLenum target, GLenum attachment, GLuint texture, GLint level);
-void GLTrace_glVertexAttribDivisorEXT(GLuint index, GLuint divisor);
-void * GLTrace_glMapBufferRangeEXT(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-void GLTrace_glFlushMappedBufferRangeEXT(GLenum target, GLintptr offset, GLsizeiptr length);
-void GLTrace_glMultiDrawArraysEXT(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount);
-void GLTrace_glMultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei primcount);
-void GLTrace_glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-void GLTrace_glReadBufferIndexedEXT(GLenum src, GLint index);
-void GLTrace_glDrawBuffersIndexedEXT(GLint n, const GLenum * location, const GLint * indices);
-void GLTrace_glGetIntegeri_vEXT(GLenum target, GLuint index, GLint * data);
-void GLTrace_glPrimitiveBoundingBoxEXT(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
-GLenum GLTrace_glGetGraphicsResetStatusEXT(void);
-void GLTrace_glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data);
-void GLTrace_glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, GLfloat * params);
-void GLTrace_glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint * params);
-void GLTrace_glActiveShaderProgramEXT(GLuint pipeline, GLuint program);
-void GLTrace_glBindProgramPipelineEXT(GLuint pipeline);
-GLuint GLTrace_glCreateShaderProgramvEXT(GLenum type, GLsizei count, const GLchar ** strings);
-void GLTrace_glDeleteProgramPipelinesEXT(GLsizei n, const GLuint * pipelines);
-void GLTrace_glGenProgramPipelinesEXT(GLsizei n, GLuint * pipelines);
-void GLTrace_glGetProgramPipelineInfoLogEXT(GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
-void GLTrace_glGetProgramPipelineivEXT(GLuint pipeline, GLenum pname, GLint * params);
-GLboolean GLTrace_glIsProgramPipelineEXT(GLuint pipeline);
-void GLTrace_glProgramParameteriEXT(GLuint program, GLenum pname, GLint value);
-void GLTrace_glProgramUniform1fEXT(GLuint program, GLint location, GLfloat v0);
-void GLTrace_glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glProgramUniform1iEXT(GLuint program, GLint location, GLint v0);
-void GLTrace_glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value);
-void GLTrace_glProgramUniform2fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1);
-void GLTrace_glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glProgramUniform2iEXT(GLuint program, GLint location, GLint v0, GLint v1);
-void GLTrace_glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value);
-void GLTrace_glProgramUniform3fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-void GLTrace_glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glProgramUniform3iEXT(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-void GLTrace_glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value);
-void GLTrace_glProgramUniform4fEXT(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-void GLTrace_glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat * value);
-void GLTrace_glProgramUniform4iEXT(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-void GLTrace_glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint * value);
-void GLTrace_glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program);
-void GLTrace_glValidateProgramPipelineEXT(GLuint pipeline);
-void GLTrace_glProgramUniform1uiEXT(GLuint program, GLint location, GLuint v0);
-void GLTrace_glProgramUniform2uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1);
-void GLTrace_glProgramUniform3uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-void GLTrace_glProgramUniform4uiEXT(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-void GLTrace_glProgramUniform1uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glProgramUniform2uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glProgramUniform3uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glProgramUniform4uivEXT(GLuint program, GLint location, GLsizei count, const GLuint * value);
-void GLTrace_glProgramUniformMatrix2x3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix3x2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix2x4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix4x2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix3x4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glProgramUniformMatrix4x3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glPatchParameteriEXT(GLenum pname, GLint value);
-void GLTrace_glTexParameterIivEXT(GLenum target, GLenum pname, const GLint * params);
-void GLTrace_glTexParameterIuivEXT(GLenum target, GLenum pname, const GLuint * params);
-void GLTrace_glGetTexParameterIivEXT(GLenum target, GLenum pname, GLint * params);
-void GLTrace_glGetTexParameterIuivEXT(GLenum target, GLenum pname, GLuint * params);
-void GLTrace_glSamplerParameterIivEXT(GLuint sampler, GLenum pname, const GLint * param);
-void GLTrace_glSamplerParameterIuivEXT(GLuint sampler, GLenum pname, const GLuint * param);
-void GLTrace_glGetSamplerParameterIivEXT(GLuint sampler, GLenum pname, GLint * params);
-void GLTrace_glGetSamplerParameterIuivEXT(GLuint sampler, GLenum pname, GLuint * params);
-void GLTrace_glTexBufferEXT(GLenum target, GLenum internalformat, GLuint buffer);
-void GLTrace_glTexBufferRangeEXT(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-void GLTrace_glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-void GLTrace_glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glTexStorage3DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-void GLTrace_glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-void GLTrace_glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-void GLTrace_glTextureViewEXT(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
-void GLTrace_glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
-void GLTrace_glBeginPerfQueryINTEL(GLuint queryHandle);
-void GLTrace_glCreatePerfQueryINTEL(GLuint queryId, GLuint * queryHandle);
-void GLTrace_glDeletePerfQueryINTEL(GLuint queryHandle);
-void GLTrace_glEndPerfQueryINTEL(GLuint queryHandle);
-void GLTrace_glGetFirstPerfQueryIdINTEL(GLuint * queryId);
-void GLTrace_glGetNextPerfQueryIdINTEL(GLuint queryId, GLuint * nextQueryId);
-void GLTrace_glGetPerfCounterInfoINTEL(GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar * counterName, GLuint counterDescLength, GLchar * counterDesc, GLuint * counterOffset, GLuint * counterDataSize, GLuint * counterTypeEnum, GLuint * counterDataTypeEnum, GLuint64 * rawCounterMaxValue);
-void GLTrace_glGetPerfQueryDataINTEL(GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid * data, GLuint * bytesWritten);
-void GLTrace_glGetPerfQueryIdByNameINTEL(GLchar * queryName, GLuint * queryId);
-void GLTrace_glGetPerfQueryInfoINTEL(GLuint queryId, GLuint queryNameLength, GLchar * queryName, GLuint * dataSize, GLuint * noCounters, GLuint * noInstances, GLuint * capsMask);
-void GLTrace_glBlendParameteriNV(GLenum pname, GLint value);
-void GLTrace_glBlendBarrierNV(void);
-void GLTrace_glCopyBufferSubDataNV(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-void GLTrace_glCoverageMaskNV(GLboolean mask);
-void GLTrace_glCoverageOperationNV(GLenum operation);
-void GLTrace_glDrawBuffersNV(GLsizei n, const GLenum * bufs);
-void GLTrace_glDrawArraysInstancedNV(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-void GLTrace_glDrawElementsInstancedNV(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount);
-void GLTrace_glDeleteFencesNV(GLsizei n, const GLuint * fences);
-void GLTrace_glGenFencesNV(GLsizei n, GLuint * fences);
-GLboolean GLTrace_glIsFenceNV(GLuint fence);
-GLboolean GLTrace_glTestFenceNV(GLuint fence);
-void GLTrace_glGetFenceivNV(GLuint fence, GLenum pname, GLint * params);
-void GLTrace_glFinishFenceNV(GLuint fence);
-void GLTrace_glSetFenceNV(GLuint fence, GLenum condition);
-void GLTrace_glBlitFramebufferNV(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-void GLTrace_glRenderbufferStorageMultisampleNV(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glVertexAttribDivisorNV(GLuint index, GLuint divisor);
-void GLTrace_glUniformMatrix2x3fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix3x2fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix2x4fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix4x2fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix3x4fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glUniformMatrix4x3fvNV(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
-void GLTrace_glReadBufferNV(GLenum mode);
-void GLTrace_glAlphaFuncQCOM(GLenum func, GLclampf ref);
-void GLTrace_glGetDriverControlsQCOM(GLint * num, GLsizei size, GLuint * driverControls);
-void GLTrace_glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei * length, GLchar * driverControlString);
-void GLTrace_glEnableDriverControlQCOM(GLuint driverControl);
-void GLTrace_glDisableDriverControlQCOM(GLuint driverControl);
-void GLTrace_glExtGetTexturesQCOM(GLuint * textures, GLint maxTextures, GLint * numTextures);
-void GLTrace_glExtGetBuffersQCOM(GLuint * buffers, GLint maxBuffers, GLint * numBuffers);
-void GLTrace_glExtGetRenderbuffersQCOM(GLuint * renderbuffers, GLint maxRenderbuffers, GLint * numRenderbuffers);
-void GLTrace_glExtGetFramebuffersQCOM(GLuint * framebuffers, GLint maxFramebuffers, GLint * numFramebuffers);
-void GLTrace_glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint * params);
-void GLTrace_glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param);
-void GLTrace_glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void * texels);
-void GLTrace_glExtGetBufferPointervQCOM(GLenum target, void ** params);
-void GLTrace_glExtGetShadersQCOM(GLuint * shaders, GLint maxShaders, GLint * numShaders);
-void GLTrace_glExtGetProgramsQCOM(GLuint * programs, GLint maxPrograms, GLint * numPrograms);
-GLboolean GLTrace_glExtIsProgramBinaryQCOM(GLuint program);
-void GLTrace_glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar * source, GLint * length);
-void GLTrace_glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
-void GLTrace_glEndTilingQCOM(GLbitfield preserveMask);
-
-// Declarations for GL1 APIs
-
-void GLTrace_glAlphaFunc(GLenum func, GLfloat ref);
-void GLTrace_glClipPlanef(GLenum p, const GLfloat * eqn);
-void GLTrace_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-void GLTrace_glFogf(GLenum pname, GLfloat param);
-void GLTrace_glFogfv(GLenum pname, const GLfloat * params);
-void GLTrace_glFrustumf(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-void GLTrace_glGetClipPlanef(GLenum plane, GLfloat * equation);
-void GLTrace_glGetLightfv(GLenum light, GLenum pname, GLfloat * params);
-void GLTrace_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params);
-void GLTrace_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params);
-void GLTrace_glLightModelf(GLenum pname, GLfloat param);
-void GLTrace_glLightModelfv(GLenum pname, const GLfloat * params);
-void GLTrace_glLightf(GLenum light, GLenum pname, GLfloat param);
-void GLTrace_glLightfv(GLenum light, GLenum pname, const GLfloat * params);
-void GLTrace_glLoadMatrixf(const GLfloat * m);
-void GLTrace_glMaterialf(GLenum face, GLenum pname, GLfloat param);
-void GLTrace_glMaterialfv(GLenum face, GLenum pname, const GLfloat * params);
-void GLTrace_glMultMatrixf(const GLfloat * m);
-void GLTrace_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-void GLTrace_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
-void GLTrace_glOrthof(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-void GLTrace_glPointParameterf(GLenum pname, GLfloat param);
-void GLTrace_glPointParameterfv(GLenum pname, const GLfloat * params);
-void GLTrace_glPointSize(GLfloat size);
-void GLTrace_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-void GLTrace_glScalef(GLfloat x, GLfloat y, GLfloat z);
-void GLTrace_glTexEnvf(GLenum target, GLenum pname, GLfloat param);
-void GLTrace_glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params);
-void GLTrace_glTranslatef(GLfloat x, GLfloat y, GLfloat z);
-void GLTrace_glAlphaFuncx(GLenum func, GLfixed ref);
-void GLTrace_glClearColorx(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-void GLTrace_glClearDepthx(GLfixed depth);
-void GLTrace_glClientActiveTexture(GLenum texture);
-void GLTrace_glClipPlanex(GLenum plane, const GLfixed * equation);
-void GLTrace_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-void GLTrace_glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-void GLTrace_glColorPointer(GLint size, GLenum type, GLsizei stride, const void * pointer);
-void GLTrace_glDepthRangex(GLfixed n, GLfixed f);
-void GLTrace_glDisableClientState(GLenum array);
-void GLTrace_glEnableClientState(GLenum array);
-void GLTrace_glFogx(GLenum pname, GLfixed param);
-void GLTrace_glFogxv(GLenum pname, const GLfixed * param);
-void GLTrace_glFrustumx(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
-void GLTrace_glGetClipPlanex(GLenum plane, GLfixed * equation);
-void GLTrace_glGetFixedv(GLenum pname, GLfixed * params);
-void GLTrace_glGetLightxv(GLenum light, GLenum pname, GLfixed * params);
-void GLTrace_glGetMaterialxv(GLenum face, GLenum pname, GLfixed * params);
-void GLTrace_glGetPointerv(GLenum pname, void ** params);
-void GLTrace_glGetTexEnviv(GLenum target, GLenum pname, GLint * params);
-void GLTrace_glGetTexEnvxv(GLenum target, GLenum pname, GLfixed * params);
-void GLTrace_glGetTexParameterxv(GLenum target, GLenum pname, GLfixed * params);
-void GLTrace_glLightModelx(GLenum pname, GLfixed param);
-void GLTrace_glLightModelxv(GLenum pname, const GLfixed * param);
-void GLTrace_glLightx(GLenum light, GLenum pname, GLfixed param);
-void GLTrace_glLightxv(GLenum light, GLenum pname, const GLfixed * params);
-void GLTrace_glLineWidthx(GLfixed width);
-void GLTrace_glLoadIdentity(void);
-void GLTrace_glLoadMatrixx(const GLfixed * m);
-void GLTrace_glLogicOp(GLenum opcode);
-void GLTrace_glMaterialx(GLenum face, GLenum pname, GLfixed param);
-void GLTrace_glMaterialxv(GLenum face, GLenum pname, const GLfixed * param);
-void GLTrace_glMatrixMode(GLenum mode);
-void GLTrace_glMultMatrixx(const GLfixed * m);
-void GLTrace_glMultiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-void GLTrace_glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz);
-void GLTrace_glNormalPointer(GLenum type, GLsizei stride, const void * pointer);
-void GLTrace_glOrthox(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
-void GLTrace_glPointParameterx(GLenum pname, GLfixed param);
-void GLTrace_glPointParameterxv(GLenum pname, const GLfixed * params);
-void GLTrace_glPointSizex(GLfixed size);
-void GLTrace_glPolygonOffsetx(GLfixed factor, GLfixed units);
-void GLTrace_glPopMatrix(void);
-void GLTrace_glPushMatrix(void);
-void GLTrace_glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-void GLTrace_glSampleCoveragex(GLclampx value, GLboolean invert);
-void GLTrace_glScalex(GLfixed x, GLfixed y, GLfixed z);
-void GLTrace_glShadeModel(GLenum mode);
-void GLTrace_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const void * pointer);
-void GLTrace_glTexEnvi(GLenum target, GLenum pname, GLint param);
-void GLTrace_glTexEnvx(GLenum target, GLenum pname, GLfixed param);
-void GLTrace_glTexEnviv(GLenum target, GLenum pname, const GLint * params);
-void GLTrace_glTexEnvxv(GLenum target, GLenum pname, const GLfixed * params);
-void GLTrace_glTexParameterx(GLenum target, GLenum pname, GLfixed param);
-void GLTrace_glTexParameterxv(GLenum target, GLenum pname, const GLfixed * params);
-void GLTrace_glTranslatex(GLfixed x, GLfixed y, GLfixed z);
-void GLTrace_glVertexPointer(GLint size, GLenum type, GLsizei stride, const void * pointer);
-
-// Declarations for GL1Ext APIs
-
-void GLTrace_glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha);
-void GLTrace_glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-void GLTrace_glBlendEquationOES(GLenum mode);
-void GLTrace_glMultiTexCoord1bOES(GLenum texture, GLbyte s);
-void GLTrace_glMultiTexCoord1bvOES(GLenum texture, const GLbyte * coords);
-void GLTrace_glMultiTexCoord2bOES(GLenum texture, GLbyte s, GLbyte t);
-void GLTrace_glMultiTexCoord2bvOES(GLenum texture, const GLbyte * coords);
-void GLTrace_glMultiTexCoord3bOES(GLenum texture, GLbyte s, GLbyte t, GLbyte r);
-void GLTrace_glMultiTexCoord3bvOES(GLenum texture, const GLbyte * coords);
-void GLTrace_glMultiTexCoord4bOES(GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q);
-void GLTrace_glMultiTexCoord4bvOES(GLenum texture, const GLbyte * coords);
-void GLTrace_glTexCoord1bOES(GLbyte s);
-void GLTrace_glTexCoord1bvOES(const GLbyte * coords);
-void GLTrace_glTexCoord2bOES(GLbyte s, GLbyte t);
-void GLTrace_glTexCoord2bvOES(const GLbyte * coords);
-void GLTrace_glTexCoord3bOES(GLbyte s, GLbyte t, GLbyte r);
-void GLTrace_glTexCoord3bvOES(const GLbyte * coords);
-void GLTrace_glTexCoord4bOES(GLbyte s, GLbyte t, GLbyte r, GLbyte q);
-void GLTrace_glTexCoord4bvOES(const GLbyte * coords);
-void GLTrace_glVertex2bOES(GLbyte x);
-void GLTrace_glVertex2bvOES(const GLbyte * coords);
-void GLTrace_glVertex3bOES(GLbyte x, GLbyte y);
-void GLTrace_glVertex3bvOES(const GLbyte * coords);
-void GLTrace_glVertex4bOES(GLbyte x, GLbyte y, GLbyte z);
-void GLTrace_glVertex4bvOES(const GLbyte * coords);
-void GLTrace_glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
-void GLTrace_glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height);
-void GLTrace_glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
-void GLTrace_glDrawTexsvOES(const GLshort * coords);
-void GLTrace_glDrawTexivOES(const GLint * coords);
-void GLTrace_glDrawTexxvOES(const GLfixed * coords);
-void GLTrace_glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
-void GLTrace_glDrawTexfvOES(const GLfloat * coords);
-void GLTrace_glAlphaFuncxOES(GLenum func, GLfixed ref);
-void GLTrace_glClearColorxOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-void GLTrace_glClearDepthxOES(GLfixed depth);
-void GLTrace_glClipPlanexOES(GLenum plane, const GLfixed * equation);
-void GLTrace_glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-void GLTrace_glDepthRangexOES(GLfixed n, GLfixed f);
-void GLTrace_glFogxOES(GLenum pname, GLfixed param);
-void GLTrace_glFogxvOES(GLenum pname, const GLfixed * param);
-void GLTrace_glFrustumxOES(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
-void GLTrace_glGetClipPlanexOES(GLenum plane, GLfixed * equation);
-void GLTrace_glGetFixedvOES(GLenum pname, GLfixed * params);
-void GLTrace_glGetTexEnvxvOES(GLenum target, GLenum pname, GLfixed * params);
-void GLTrace_glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed * params);
-void GLTrace_glLightModelxOES(GLenum pname, GLfixed param);
-void GLTrace_glLightModelxvOES(GLenum pname, const GLfixed * param);
-void GLTrace_glLightxOES(GLenum light, GLenum pname, GLfixed param);
-void GLTrace_glLightxvOES(GLenum light, GLenum pname, const GLfixed * params);
-void GLTrace_glLineWidthxOES(GLfixed width);
-void GLTrace_glLoadMatrixxOES(const GLfixed * m);
-void GLTrace_glMaterialxOES(GLenum face, GLenum pname, GLfixed param);
-void GLTrace_glMaterialxvOES(GLenum face, GLenum pname, const GLfixed * param);
-void GLTrace_glMultMatrixxOES(const GLfixed * m);
-void GLTrace_glMultiTexCoord4xOES(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-void GLTrace_glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz);
-void GLTrace_glOrthoxOES(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
-void GLTrace_glPointParameterxvOES(GLenum pname, const GLfixed * params);
-void GLTrace_glPointSizexOES(GLfixed size);
-void GLTrace_glPolygonOffsetxOES(GLfixed factor, GLfixed units);
-void GLTrace_glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-void GLTrace_glSampleCoverageOES(GLfixed value, GLboolean invert);
-void GLTrace_glScalexOES(GLfixed x, GLfixed y, GLfixed z);
-void GLTrace_glTexEnvxOES(GLenum target, GLenum pname, GLfixed param);
-void GLTrace_glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed * params);
-void GLTrace_glTexParameterxOES(GLenum target, GLenum pname, GLfixed param);
-void GLTrace_glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed * params);
-void GLTrace_glTranslatexOES(GLfixed x, GLfixed y, GLfixed z);
-void GLTrace_glGetLightxvOES(GLenum light, GLenum pname, GLfixed * params);
-void GLTrace_glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed * params);
-void GLTrace_glPointParameterxOES(GLenum pname, GLfixed param);
-void GLTrace_glSampleCoveragexOES(GLclampx value, GLboolean invert);
-void GLTrace_glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed * params);
-void GLTrace_glTexGenxOES(GLenum coord, GLenum pname, GLfixed param);
-void GLTrace_glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed * params);
-GLboolean GLTrace_glIsRenderbufferOES(GLuint renderbuffer);
-void GLTrace_glBindRenderbufferOES(GLenum target, GLuint renderbuffer);
-void GLTrace_glDeleteRenderbuffersOES(GLsizei n, const GLuint * renderbuffers);
-void GLTrace_glGenRenderbuffersOES(GLsizei n, GLuint * renderbuffers);
-void GLTrace_glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-void GLTrace_glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint * params);
-GLboolean GLTrace_glIsFramebufferOES(GLuint framebuffer);
-void GLTrace_glBindFramebufferOES(GLenum target, GLuint framebuffer);
-void GLTrace_glDeleteFramebuffersOES(GLsizei n, const GLuint * framebuffers);
-void GLTrace_glGenFramebuffersOES(GLsizei n, GLuint * framebuffers);
-GLenum GLTrace_glCheckFramebufferStatusOES(GLenum target);
-void GLTrace_glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-void GLTrace_glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-void GLTrace_glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint * params);
-void GLTrace_glGenerateMipmapOES(GLenum target);
-void GLTrace_glCurrentPaletteMatrixOES(GLuint matrixpaletteindex);
-void GLTrace_glLoadPaletteFromModelViewMatrixOES(void);
-void GLTrace_glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const void * pointer);
-void GLTrace_glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const void * pointer);
-void GLTrace_glPointSizePointerOES(GLenum type, GLsizei stride, const void * pointer);
-GLbitfield GLTrace_glQueryMatrixxOES(GLfixed * mantissa, GLint * exponent);
-void GLTrace_glClearDepthfOES(GLclampf depth);
-void GLTrace_glClipPlanefOES(GLenum plane, const GLfloat * equation);
-void GLTrace_glDepthRangefOES(GLclampf n, GLclampf f);
-void GLTrace_glFrustumfOES(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-void GLTrace_glGetClipPlanefOES(GLenum plane, GLfloat * equation);
-void GLTrace_glOrthofOES(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-void GLTrace_glTexGenfOES(GLenum coord, GLenum pname, GLfloat param);
-void GLTrace_glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat * params);
-void GLTrace_glTexGeniOES(GLenum coord, GLenum pname, GLint param);
-void GLTrace_glTexGenivOES(GLenum coord, GLenum pname, const GLint * params);
-void GLTrace_glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat * params);
-void GLTrace_glGetTexGenivOES(GLenum coord, GLenum pname, GLint * params);
-void GLTrace_glClipPlanefIMG(GLenum p, const GLfloat * eqn);
-void GLTrace_glClipPlanexIMG(GLenum p, const GLfixed * eqn);
-
-}; // namespace gltrace
-}; // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_context.cpp b/opengl/libs/GLES_trace/src/gltrace_context.cpp
deleted file mode 100644 (file)
index d1b3586..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <pthread.h>
-#include <cutils/log.h>
-
-extern "C" {
-#include "liblzf/lzf.h"
-}
-
-#include "gltrace_context.h"
-
-namespace android {
-namespace gltrace {
-
-using ::android::gl_hooks_t;
-
-static pthread_key_t sTLSKey = -1;
-static pthread_once_t sPthreadOnceKey = PTHREAD_ONCE_INIT;
-
-void createTLSKey() {
-    pthread_key_create(&sTLSKey, (void (*)(void*))&releaseContext);
-}
-
-GLTraceContext *getGLTraceContext() {
-    return (GLTraceContext*) pthread_getspecific(sTLSKey);
-}
-
-void setGLTraceContext(GLTraceContext *c) {
-    pthread_setspecific(sTLSKey, c);
-}
-
-void setupTraceContextThreadSpecific(GLTraceContext *context) {
-    pthread_once(&sPthreadOnceKey, createTLSKey);
-    setGLTraceContext(context);
-}
-
-void releaseContext() {
-    GLTraceContext *c = getGLTraceContext();
-    if (c != NULL) {
-        delete c;
-        setGLTraceContext(NULL);
-    }
-}
-
-GLTraceState::GLTraceState(TCPStream *stream) {
-    mTraceContextIds = 0;
-    mStream = stream;
-
-    mCollectFbOnEglSwap = false;
-    mCollectFbOnGlDraw = false;
-    mCollectTextureDataOnGlTexImage = false;
-    pthread_rwlock_init(&mTraceOptionsRwLock, NULL);
-}
-
-GLTraceState::~GLTraceState() {
-    if (mStream) {
-        mStream->closeStream();
-        mStream = NULL;
-    }
-}
-
-TCPStream *GLTraceState::getStream() {
-    return mStream;
-}
-
-void GLTraceState::safeSetValue(bool *ptr, bool value, pthread_rwlock_t *lock) {
-    pthread_rwlock_wrlock(lock);
-    *ptr = value;
-    pthread_rwlock_unlock(lock);
-}
-
-bool GLTraceState::safeGetValue(bool *ptr, pthread_rwlock_t *lock) {
-    pthread_rwlock_rdlock(lock);
-    bool value = *ptr;
-    pthread_rwlock_unlock(lock);
-    return value;
-}
-
-void GLTraceState::setCollectFbOnEglSwap(bool en) {
-    safeSetValue(&mCollectFbOnEglSwap, en, &mTraceOptionsRwLock);
-}
-
-void GLTraceState::setCollectFbOnGlDraw(bool en) {
-    safeSetValue(&mCollectFbOnGlDraw, en, &mTraceOptionsRwLock);
-}
-
-void GLTraceState::setCollectTextureDataOnGlTexImage(bool en) {
-    safeSetValue(&mCollectTextureDataOnGlTexImage, en, &mTraceOptionsRwLock);
-}
-
-bool GLTraceState::shouldCollectFbOnEglSwap() {
-    return safeGetValue(&mCollectFbOnEglSwap, &mTraceOptionsRwLock);
-}
-
-bool GLTraceState::shouldCollectFbOnGlDraw() {
-    return safeGetValue(&mCollectFbOnGlDraw, &mTraceOptionsRwLock);
-}
-
-bool GLTraceState::shouldCollectTextureDataOnGlTexImage() {
-    return safeGetValue(&mCollectTextureDataOnGlTexImage, &mTraceOptionsRwLock);
-}
-
-GLTraceContext *GLTraceState::createTraceContext(int version, EGLContext eglContext) {
-    int id = __sync_fetch_and_add(&mTraceContextIds, 1);
-
-    const size_t DEFAULT_BUFFER_SIZE = 8192;
-    BufferedOutputStream *stream = new BufferedOutputStream(mStream, DEFAULT_BUFFER_SIZE);
-    GLTraceContext *traceContext = new GLTraceContext(id, version, this, stream);
-    mPerContextState[eglContext] = traceContext;
-
-    return traceContext;
-}
-
-GLTraceContext *GLTraceState::getTraceContext(EGLContext c) {
-    return mPerContextState[c];
-}
-
-GLTraceContext::GLTraceContext(int id, int version, GLTraceState *state,
-        BufferedOutputStream *stream) :
-    mId(id),
-    mVersion(version),
-    mVersionMajor(0),
-    mVersionMinor(0),
-    mVersionParsed(false),
-    mState(state),
-    mBufferedOutputStream(stream),
-    mElementArrayBuffers(DefaultKeyedVector<GLuint, ElementArrayBuffer*>(NULL))
-{
-    fbcontents = fbcompressed = NULL;
-    fbcontentsSize = 0;
-}
-
-int GLTraceContext::getId() {
-    return mId;
-}
-
-int GLTraceContext::getVersion() {
-    return mVersion;
-}
-
-int GLTraceContext::getVersionMajor() {
-    if (!mVersionParsed) {
-        parseGlesVersion();
-        mVersionParsed = true;
-    }
-    return mVersionMajor;
-}
-
-int GLTraceContext::getVersionMinor() {
-    if (!mVersionParsed) {
-        parseGlesVersion();
-        mVersionParsed = true;
-    }
-    return mVersionMinor;
-}
-
-GLTraceState *GLTraceContext::getGlobalTraceState() {
-    return mState;
-}
-
-void GLTraceContext::parseGlesVersion() {
-    const char* str = (const char*)hooks->gl.glGetString(GL_VERSION);
-    int major, minor;
-    if (sscanf(str, "OpenGL ES-CM %d.%d", &major, &minor) != 2) {
-        if (sscanf(str, "OpenGL ES %d.%d", &major, &minor) != 2) {
-            ALOGW("Unable to parse GL_VERSION string: \"%s\"", str);
-            major = 1;
-            minor = 0;
-        }
-    }
-    mVersionMajor = major;
-    mVersionMinor = minor;
-}
-
-void GLTraceContext::resizeFBMemory(unsigned minSize) {
-    if (fbcontentsSize >= minSize) {
-        return;
-    }
-
-    if (fbcontents != NULL) {
-        free(fbcontents);
-        free(fbcompressed);
-    }
-
-    fbcontents = malloc(minSize);
-    fbcompressed = malloc(minSize);
-
-    fbcontentsSize = minSize;
-}
-
-/** obtain a pointer to the compressed framebuffer image */
-void GLTraceContext::getCompressedFB(void **fb, unsigned *fbsize, unsigned *fbwidth, 
-                            unsigned *fbheight, FBBinding fbToRead) {
-    int viewport[4] = {};
-    hooks->gl.glGetIntegerv(GL_VIEWPORT, viewport);
-    unsigned fbContentsSize = viewport[2] * viewport[3] * 4;
-
-    resizeFBMemory(fbContentsSize);
-
-    // switch current framebuffer binding if necessary
-    GLint currentFb = -1;
-    bool fbSwitched = false;
-    if (fbToRead != CURRENTLY_BOUND_FB) {
-        hooks->gl.glGetIntegerv(GL_FRAMEBUFFER_BINDING, &currentFb);
-
-        if (currentFb != 0) {
-            hooks->gl.glBindFramebuffer(GL_FRAMEBUFFER, 0);
-            fbSwitched = true;
-        }
-    }
-
-    hooks->gl.glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
-                                        GL_RGBA, GL_UNSIGNED_BYTE, fbcontents);
-
-    // switch back to previously bound buffer if necessary
-    if (fbSwitched) {
-        hooks->gl.glBindFramebuffer(GL_FRAMEBUFFER, currentFb);
-    }
-
-    *fbsize = lzf_compress(fbcontents, fbContentsSize, fbcompressed, fbContentsSize);
-    *fb = fbcompressed;
-    *fbwidth = viewport[2];
-    *fbheight = viewport[3];
-}
-
-void GLTraceContext::traceGLMessage(GLMessage *msg) {
-    mBufferedOutputStream->send(msg);
-
-    GLMessage_Function func = msg->function();
-    if (func == GLMessage::eglSwapBuffers
-        || func == GLMessage::eglCreateContext
-        || func == GLMessage::eglMakeCurrent
-        || func == GLMessage::glDrawArrays
-        || func == GLMessage::glDrawElements) {
-        mBufferedOutputStream->flush();
-    }
-}
-
-void GLTraceContext::bindBuffer(GLuint bufferId, GLvoid *data, GLsizeiptr size) {
-    // free previously bound buffer if any
-    ElementArrayBuffer *oldBuffer = mElementArrayBuffers.valueFor(bufferId);
-    if (oldBuffer != NULL) {
-        delete oldBuffer;
-    }
-
-    mElementArrayBuffers.add(bufferId, new ElementArrayBuffer(data, size));
-}
-
-void GLTraceContext::getBuffer(GLuint bufferId, GLvoid **data, GLsizeiptr *size) {
-    ElementArrayBuffer *buffer = mElementArrayBuffers.valueFor(bufferId);
-    if (buffer == NULL) {
-        *data = NULL;
-        *size = 0;
-    } else {
-        *data = buffer->getBuffer();
-        *size = buffer->getSize();
-    }
-}
-
-void GLTraceContext::updateBufferSubData(GLuint bufferId, GLintptr offset, GLvoid *data,
-                                                            GLsizeiptr size) {
-    ElementArrayBuffer *buffer = mElementArrayBuffers.valueFor(bufferId);
-    if (buffer != NULL) {
-        buffer->updateSubBuffer(offset, data, size);
-    }
-}
-
-void GLTraceContext::deleteBuffer(GLuint bufferId) {
-    ElementArrayBuffer *buffer = mElementArrayBuffers.valueFor(bufferId);
-    if (buffer != NULL) {
-        delete buffer;
-        mElementArrayBuffers.removeItem(bufferId);
-    }
-}
-
-ElementArrayBuffer::ElementArrayBuffer(GLvoid *buf, GLsizeiptr size) {
-    mBuf = malloc(size);
-    mSize = size;
-
-    if (buf != NULL) {
-        memcpy(mBuf, buf, size);
-    }
-}
-
-ElementArrayBuffer::~ElementArrayBuffer() {
-    if (mBuf != NULL) {
-        free(mBuf);
-        mSize = 0;
-    }
-
-    mBuf = NULL;
-}
-
-void ElementArrayBuffer::updateSubBuffer(GLintptr offset, const GLvoid* data, GLsizeiptr size) {
-    if (offset + size <= mSize) {
-        memcpy((char*)mBuf + offset, data, size);
-    }
-}
-
-GLvoid *ElementArrayBuffer::getBuffer() {
-    return mBuf;
-}
-
-GLsizeiptr ElementArrayBuffer::getSize() {
-    return mSize;
-}
-
-}; // namespace gltrace
-}; // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_context.h b/opengl/libs/GLES_trace/src/gltrace_context.h
deleted file mode 100644 (file)
index 38c7315..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __GLTRACE_CONTEXT_H_
-#define __GLTRACE_CONTEXT_H_
-
-#include <map>
-#include <pthread.h>
-#include <utils/KeyedVector.h>
-
-#include "hooks.h"
-#include "gltrace_transport.h"
-
-namespace android {
-namespace gltrace {
-
-using ::android::gl_hooks_t;
-
-enum FBBinding {CURRENTLY_BOUND_FB, FB0};
-
-class GLTraceState;
-
-class ElementArrayBuffer {
-    GLvoid *mBuf;
-    GLsizeiptr mSize;
-
-public:
-    ElementArrayBuffer():mBuf(NULL), mSize(0) {}
-    ElementArrayBuffer(GLvoid *buf, GLsizeiptr size);
-    ~ElementArrayBuffer();
-
-    void updateSubBuffer(GLintptr offset, const GLvoid* data, GLsizeiptr size);
-    GLvoid *getBuffer();
-    GLsizeiptr getSize();
-};
-
-/** GL Trace Context info associated with each EGLContext */
-class GLTraceContext {
-    int mId;                    /* unique context id */
-    int mVersion;               /* GL version, e.g: egl_connection_t::GLESv2_INDEX */
-    int mVersionMajor;          /* GL major version. Lazily parsed in getVersionX(). */
-    int mVersionMinor;          /* GL minor version. Lazily parsed in getVersionX(). */
-    bool mVersionParsed;        /* True if major and minor versions have been parsed. */
-    GLTraceState *mState;       /* parent GL Trace state (for per process GL Trace State Info) */
-
-    void *fbcontents;           /* memory area to read framebuffer contents */
-    void *fbcompressed;         /* destination for lzf compressed framebuffer */
-    unsigned fbcontentsSize;    /* size of fbcontents & fbcompressed buffers */
-
-    BufferedOutputStream *mBufferedOutputStream; /* stream where trace info is sent */
-
-    /* list of element array buffers in use. */
-    DefaultKeyedVector<GLuint, ElementArrayBuffer*> mElementArrayBuffers;
-
-    /* Parses the GL version string returned from glGetString(GL_VERSION) to get find the major and
-       minor versions of the GLES API. The context must be current before calling. */
-    void parseGlesVersion();
-    void resizeFBMemory(unsigned minSize);
-public:
-    gl_hooks_t *hooks;
-
-    GLTraceContext(int id, int version, GLTraceState *state, BufferedOutputStream *stream);
-    int getId();
-    int getVersion();
-    int getVersionMajor();
-    int getVersionMinor();
-    GLTraceState *getGlobalTraceState();
-    void getCompressedFB(void **fb, unsigned *fbsize,
-                            unsigned *fbwidth, unsigned *fbheight,
-                            FBBinding fbToRead);
-
-    // Methods to work with element array buffers
-    void bindBuffer(GLuint bufferId, GLvoid *data, GLsizeiptr size);
-    void getBuffer(GLuint bufferId, GLvoid **data, GLsizeiptr *size);
-    void updateBufferSubData(GLuint bufferId, GLintptr offset, GLvoid *data, GLsizeiptr size);
-    void deleteBuffer(GLuint bufferId);
-
-    void traceGLMessage(GLMessage *msg);
-};
-
-/** Per process trace state. */
-class GLTraceState {
-    int mTraceContextIds;
-    TCPStream *mStream;
-    std::map<EGLContext, GLTraceContext*> mPerContextState;
-
-    /* Options controlling additional data to be collected on
-       certain trace calls. */
-    bool mCollectFbOnEglSwap;
-    bool mCollectFbOnGlDraw;
-    bool mCollectTextureDataOnGlTexImage;
-    pthread_rwlock_t mTraceOptionsRwLock;
-
-    /* helper methods to get/set values using provided lock for mutual exclusion. */
-    void safeSetValue(bool *ptr, bool value, pthread_rwlock_t *lock);
-    bool safeGetValue(bool *ptr, pthread_rwlock_t *lock);
-public:
-    GLTraceState(TCPStream *stream);
-    ~GLTraceState();
-
-    GLTraceContext *createTraceContext(int version, EGLContext c);
-    GLTraceContext *getTraceContext(EGLContext c);
-
-    TCPStream *getStream();
-
-    /* Methods to set trace options. */
-    void setCollectFbOnEglSwap(bool en);
-    void setCollectFbOnGlDraw(bool en);
-    void setCollectTextureDataOnGlTexImage(bool en);
-
-    /* Methods to retrieve trace options. */
-    bool shouldCollectFbOnEglSwap();
-    bool shouldCollectFbOnGlDraw();
-    bool shouldCollectTextureDataOnGlTexImage();
-};
-
-void setupTraceContextThreadSpecific(GLTraceContext *context);
-GLTraceContext *getGLTraceContext();
-void releaseContext();
-
-};
-};
-
-#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_egl.cpp b/opengl/libs/GLES_trace/src/gltrace_egl.cpp
deleted file mode 100644 (file)
index a7878f2..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <cutils/log.h>
-#include <utils/Timers.h>
-
-#include "frameworks/native/opengl/libs/GLES_trace/proto/gltrace.pb.h"
-#include "gltrace_context.h"
-#include "gltrace_fixup.h"
-#include "gltrace_transport.h"
-
-namespace android {
-namespace gltrace {
-
-void GLTrace_eglCreateContext(int version, int contextId) {
-    GLMessage glmessage;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmessage.set_context_id(contextId);
-    glmessage.set_function(GLMessage::eglCreateContext);
-
-    // copy argument version
-    GLMessage_DataType *arg_version = glmessage.add_args();
-    arg_version->set_isarray(false);
-    arg_version->set_type(GLMessage::DataType::INT);
-    arg_version->add_intvalue(version);
-
-    // copy argument context
-    GLMessage_DataType *arg_context = glmessage.add_args();
-    arg_context->set_isarray(false);
-    arg_context->set_type(GLMessage::DataType::INT);
-    arg_context->add_intvalue(contextId);
-
-    // set start time and duration
-    glmessage.set_start_time(systemTime());
-    glmessage.set_duration(0);
-
-    glContext->traceGLMessage(&glmessage);
-}
-
-void GLTrace_eglMakeCurrent(int contextId) {
-    GLMessage glmessage;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmessage.set_context_id(contextId);
-    glmessage.set_function(GLMessage::eglMakeCurrent);
-
-    // copy argument context
-    GLMessage_DataType *arg_context = glmessage.add_args();
-    arg_context->set_isarray(false);
-    arg_context->set_type(GLMessage::DataType::INT);
-    arg_context->add_intvalue(contextId);
-
-    // set start time and duration
-    glmessage.set_start_time(systemTime());
-    glmessage.set_duration(0);
-
-    glContext->traceGLMessage(&glmessage);
-}
-
-void GLTrace_eglSwapBuffers(void* /*dpy*/, void* /*draw*/) {
-    GLMessage glmessage;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmessage.set_context_id(glContext->getId());
-    glmessage.set_function(GLMessage::eglSwapBuffers);
-
-    if (glContext->getGlobalTraceState()->shouldCollectFbOnEglSwap()) {
-        // read FB0 since that is what is displayed on the screen
-        fixup_addFBContents(glContext, &glmessage, FB0);
-    }
-
-    // set start time and duration
-    glmessage.set_start_time(systemTime());
-    glmessage.set_duration(0);
-
-    glContext->traceGLMessage(&glmessage);
-}
-
-};
-};
diff --git a/opengl/libs/GLES_trace/src/gltrace_egl.h b/opengl/libs/GLES_trace/src/gltrace_egl.h
deleted file mode 100644 (file)
index f4684c5..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __GLTRACE_EGL_H_
-#define __GLTRACE_EGL_H_
-
-namespace android {
-namespace gltrace {
-
-void GLTrace_eglCreateContext(int version, int contextId);
-void GLTrace_eglMakeCurrent(int contextId);
-void GLTrace_eglSwapBuffers(void *dpy, void *draw);
-
-};
-};
-
-#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp b/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp
deleted file mode 100644 (file)
index 512d562..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <arpa/inet.h>
-#include <stdlib.h>
-#include <cutils/log.h>
-#include <cutils/properties.h>
-
-#include "hooks.h"
-#include "glestrace.h"
-
-#include "gltrace_context.h"
-#include "gltrace_egl.h"
-#include "gltrace_hooks.h"
-#include "gltrace_transport.h"
-
-namespace android {
-
-using gltrace::GLTraceState;
-using gltrace::GLTraceContext;
-using gltrace::TCPStream;
-
-static pthread_mutex_t sGlTraceStateLock = PTHREAD_MUTEX_INITIALIZER;
-
-static int sGlTraceInProgress;
-static GLTraceState *sGLTraceState;
-static pthread_t sReceiveThreadId;
-
-/**
- * Task that monitors the control stream from the host and updates
- * the trace status according to commands received from the host.
- */
-static void *commandReceiveTask(void *arg) {
-    GLTraceState *state = (GLTraceState *)arg;
-    TCPStream *stream = state->getStream();
-
-    // The control stream always receives an integer size of the
-    // command buffer, followed by the actual command buffer.
-    uint32_t cmdSize;
-
-    // Command Buffer
-    void *cmdBuf = NULL;
-    uint32_t cmdBufSize = 0;
-
-    enum TraceSettingsMasks {
-        READ_FB_ON_EGLSWAP_MASK = 1 << 0,
-        READ_FB_ON_GLDRAW_MASK = 1 << 1,
-        READ_TEXTURE_DATA_ON_GLTEXIMAGE_MASK = 1 << 2,
-    };
-
-    while (true) {
-        // read command size
-        if (stream->receive(&cmdSize, sizeof(uint32_t)) < 0) {
-            break;
-        }
-        cmdSize = ntohl(cmdSize);
-
-        // ensure command buffer is of required size
-        if (cmdBufSize < cmdSize) {
-            free(cmdBuf);
-            cmdBufSize = cmdSize;
-            cmdBuf = malloc(cmdSize);
-            if (cmdBuf == NULL)
-                break;
-        }
-
-        // receive the command
-        if (stream->receive(cmdBuf, cmdSize) < 0) {
-            break;
-        }
-
-        if (cmdSize != sizeof(uint32_t)) {
-            // Currently, we only support commands that are a single integer,
-            // so we skip all other commands
-            continue;
-        }
-
-        uint32_t cmd = ntohl(*(uint32_t*)cmdBuf);
-
-        bool collectFbOnEglSwap = (cmd & READ_FB_ON_EGLSWAP_MASK) != 0;
-        bool collectFbOnGlDraw = (cmd & READ_FB_ON_GLDRAW_MASK) != 0;
-        bool collectTextureData = (cmd & READ_TEXTURE_DATA_ON_GLTEXIMAGE_MASK) != 0;
-
-        state->setCollectFbOnEglSwap(collectFbOnEglSwap);
-        state->setCollectFbOnGlDraw(collectFbOnGlDraw);
-        state->setCollectTextureDataOnGlTexImage(collectTextureData);
-
-        ALOGD("trace options: eglswap: %d, gldraw: %d, texImage: %d",
-            collectFbOnEglSwap, collectFbOnGlDraw, collectTextureData);
-    }
-
-    ALOGE("Stopping OpenGL Trace Command Receiver\n");
-
-    free(cmdBuf);
-    return NULL;
-}
-
-/**
- * Starts Trace Server and waits for connection from the host.
- * Returns -1 in case of connection error, 0 otherwise.
- */
-int GLTrace_start() {
-    int status = 0;
-    int clientSocket = -1;
-    TCPStream *stream = NULL;
-
-    pthread_mutex_lock(&sGlTraceStateLock);
-
-    if (sGlTraceInProgress) {
-        goto done;
-    }
-
-    char udsName[PROPERTY_VALUE_MAX];
-    property_get("debug.egl.debug_portname", udsName, "gltrace");
-    clientSocket = gltrace::acceptClientConnection(udsName);
-    if (clientSocket < 0) {
-        ALOGE("Error creating GLTrace server socket. Tracing disabled.");
-        status = -1;
-        goto done;
-    }
-
-    sGlTraceInProgress = 1;
-
-    // create communication channel to the host
-    stream = new TCPStream(clientSocket);
-
-    // initialize tracing state
-    sGLTraceState = new GLTraceState(stream);
-
-    pthread_create(&sReceiveThreadId, NULL, commandReceiveTask, sGLTraceState);
-
-done:
-    pthread_mutex_unlock(&sGlTraceStateLock);
-    return status;
-}
-
-void GLTrace_stop() {
-    pthread_mutex_lock(&sGlTraceStateLock);
-
-    if (sGlTraceInProgress) {
-        sGlTraceInProgress = 0;
-        delete sGLTraceState;
-        sGLTraceState = NULL;
-    }
-
-    pthread_mutex_unlock(&sGlTraceStateLock);
-}
-
-void GLTrace_eglCreateContext(int version, EGLContext c) {
-    pthread_mutex_lock(&sGlTraceStateLock);
-    GLTraceState *state = sGLTraceState;
-    pthread_mutex_unlock(&sGlTraceStateLock);
-
-    if (state == NULL) return;
-
-    // update trace state for new EGL context
-    GLTraceContext *traceContext = state->createTraceContext(version, c);
-    gltrace::setupTraceContextThreadSpecific(traceContext);
-
-    // trace command through to the host
-    gltrace::GLTrace_eglCreateContext(version, traceContext->getId());
-}
-
-void GLTrace_eglMakeCurrent(const unsigned version, gl_hooks_t *hooks, EGLContext c) {
-    pthread_mutex_lock(&sGlTraceStateLock);
-    GLTraceState *state = sGLTraceState;
-    pthread_mutex_unlock(&sGlTraceStateLock);
-
-    if (state == NULL) return;
-
-    // setup per context state
-    GLTraceContext *traceContext = state->getTraceContext(c);
-    if (traceContext == NULL) {
-        GLTrace_eglCreateContext(version, c);
-        traceContext = state->getTraceContext(c);
-    }
-
-    traceContext->hooks = hooks;
-    gltrace::setupTraceContextThreadSpecific(traceContext);
-
-    // trace command through to the host
-    gltrace::GLTrace_eglMakeCurrent(traceContext->getId());
-}
-
-void GLTrace_eglReleaseThread() {
-    gltrace::releaseContext();
-}
-
-void GLTrace_eglSwapBuffers(void *dpy, void *draw) {
-    gltrace::GLTrace_eglSwapBuffers(dpy, draw);
-}
-
-gl_hooks_t *GLTrace_getGLHooks() {
-    return gltrace::getGLHooks();
-}
-
-}
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
deleted file mode 100644 (file)
index a4a187a..0000000
+++ /dev/null
@@ -1,920 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <cutils/log.h>
-#include <EGL/egldefs.h>
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include "frameworks/native/opengl/libs/GLES_trace/proto/gltrace.pb.h"
-#include "gltrace_api.h"
-#include "gltrace_context.h"
-#include "gltrace_fixup.h"
-
-namespace android {
-namespace gltrace {
-
-GLint glGetInteger(GLTraceContext *context, GLenum param) {
-    GLint x;
-    context->hooks->gl.glGetIntegerv(param, &x);
-    return x;
-}
-
-GLint glGetVertexAttrib(GLTraceContext *context, GLuint index, GLenum pname) {
-    GLint x;
-    context->hooks->gl.glGetVertexAttribiv(index, pname, &x);
-    return x;
-}
-
-bool isUsingPixelBuffers(GLTraceContext *context) {
-    if (context->getVersionMajor() < 3) {
-        return false; // PBOs not supported prior to GLES 3.0
-    }
-    return glGetInteger(context, GL_PIXEL_UNPACK_BUFFER_BINDING) != 0;
-}
-
-bool isUsingArrayBuffers(GLTraceContext *context) {
-    return glGetInteger(context, GL_ARRAY_BUFFER_BINDING) != 0;
-}
-
-bool isUsingElementArrayBuffers(GLTraceContext *context) {
-    return glGetInteger(context, GL_ELEMENT_ARRAY_BUFFER_BINDING) != 0;
-}
-
-unsigned getBytesPerTexel(const GLenum format, const GLenum type) {
-    /*
-    Description from glTexImage2D spec:
-
-    Data is read from data as a sequence of unsigned bytes or shorts, depending on type.
-    When type is GL_UNSIGNED_BYTE, each of the bytes is interpreted as one color component.
-    When type is one of GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_4_4_4_4, or
-    GL_UNSIGNED_SHORT_5_5_5_1, each unsigned short value is interpreted as containing all
-    the components for a single texel, with the color components arranged according to
-    format. Color components are treated as groups of one, two, three, or four values,
-    again based on format. Groups of components are referred to as texels.
-
-    width Ã— height texels are read from memory, starting at location data. By default,
-    these texels are taken from adjacent memory locations, except that after all width
-    texels are read, the read pointer is advanced to the next four-byte boundary.
-    The four-byte row alignment is specified by glPixelStorei with argument
-    GL_UNPACK_ALIGNMENT, and it can be set to one, two, four, or eight bytes.
-    */
-
-    switch (type) {
-    case GL_UNSIGNED_SHORT_5_6_5:
-    case GL_UNSIGNED_SHORT_4_4_4_4:
-    case GL_UNSIGNED_SHORT_5_5_5_1:
-        return 2;
-    case GL_UNSIGNED_BYTE:
-        break;
-    default:
-        ALOGE("GetBytesPerPixel: unknown type %x", type);
-    }
-
-    switch (format) {
-    case GL_ALPHA:
-    case GL_LUMINANCE:
-        return 1;
-    case GL_LUMINANCE_ALPHA:
-        return 2;
-    case GL_RGB:
-        return 3;
-    case GL_RGBA:
-    case 0x80E1: // GL_BGRA_EXT
-        return 4;
-    default:
-        ALOGE("GetBytesPerPixel: unknown format %x", format);
-    }
-
-    return 1;   // in doubt...
-}
-
-void fixup_GenericFloatArray(int argIndex, int nFloats, GLMessage *glmsg, void *src) {
-    GLMessage_DataType *arg_floatarray = glmsg->mutable_args(argIndex);
-    GLfloat *floatp = (GLfloat *)src;
-
-    if (floatp == NULL) {
-        return;
-    }
-
-    arg_floatarray->set_type(GLMessage::DataType::FLOAT);
-    arg_floatarray->set_isarray(true);
-    arg_floatarray->clear_floatvalue();
-
-    for (int i = 0; i < nFloats; i++, floatp++) {
-        arg_floatarray->add_floatvalue(*floatp);
-    }
-}
-
-void fixup_GenericIntArray(int argIndex, int nInts, GLMessage *glmsg, void *src) {
-    GLMessage_DataType *arg_intarray = glmsg->mutable_args(argIndex);
-    GLint *intp = (GLint *)src;
-
-    if (intp == NULL) {
-        return;
-    }
-
-    arg_intarray->set_type(GLMessage::DataType::INT);
-    arg_intarray->set_isarray(true);
-    arg_intarray->clear_intvalue();
-
-    for (int i = 0; i < nInts; i++, intp++) {
-        arg_intarray->add_intvalue(*intp);
-    }
-}
-
-void fixup_GenericEnumArray(int argIndex, int nEnums, GLMessage *glmsg, void *src) {
-    // fixup as if they were ints
-    fixup_GenericIntArray(argIndex, nEnums, glmsg, src);
-
-    // and then set the data type to be enum
-    GLMessage_DataType *arg_enumarray = glmsg->mutable_args(argIndex);
-    arg_enumarray->set_type(GLMessage::DataType::ENUM);
-}
-
-/** Generic helper function: extract pointer at argIndex and
-    replace it with the C style string at *pointer */
-void fixup_CStringPtr(int argIndex, GLMessage *glmsg, void *src) {
-    GLMessage_DataType *arg = glmsg->mutable_args(argIndex);
-    GLchar *ptr = (GLchar *) src;
-
-    arg->set_type(GLMessage::DataType::CHAR);
-    arg->set_isarray(true);
-    arg->add_charvalue(ptr);
-}
-
-void fixup_glGetString(GLMessage *glmsg, void *pointersToFixup[]) {
-    /* const GLubyte* GLTrace_glGetString(GLenum name) */
-    GLMessage_DataType *ret = glmsg->mutable_returnvalue();
-    GLchar *ptr = (GLchar *) pointersToFixup[0];
-
-    if (ptr != NULL) {
-        ret->set_type(GLMessage::DataType::CHAR);
-        ret->set_isarray(true);
-        ret->add_charvalue(ptr);
-    }
-}
-
-/* Add the contents of the framebuffer to the protobuf message */
-void fixup_addFBContents(GLTraceContext *context, GLMessage *glmsg, FBBinding fbToRead) {
-    void *fbcontents;
-    unsigned fbsize, fbwidth, fbheight;
-    context->getCompressedFB(&fbcontents, &fbsize, &fbwidth, &fbheight, fbToRead);
-
-    GLMessage_FrameBuffer *fb = glmsg->mutable_fb();
-    fb->set_width(fbwidth);
-    fb->set_height(fbheight);
-    fb->add_contents(fbcontents, fbsize);
-}
-
-/** Common fixup routing for glTexImage2D & glTexSubImage2D. */
-void fixup_glTexImage(GLTraceContext *context, int widthIndex, int heightIndex, GLMessage *glmsg,
-                        void *dataSrc) {
-    GLMessage_DataType arg_width  = glmsg->args(widthIndex);
-    GLMessage_DataType arg_height = glmsg->args(heightIndex);
-
-    GLMessage_DataType arg_format = glmsg->args(6);
-    GLMessage_DataType arg_type   = glmsg->args(7);
-    GLMessage_DataType *arg_data  = glmsg->mutable_args(8);
-
-    GLsizei width  = arg_width.intvalue(0);
-    GLsizei height = arg_height.intvalue(0);
-    GLenum format  = arg_format.intvalue(0);
-    GLenum type    = arg_type.intvalue(0);
-    void *data     = (void *) dataSrc;
-
-    int bytesPerTexel = getBytesPerTexel(format, type);
-
-    arg_data->set_type(GLMessage::DataType::BYTE);
-    arg_data->clear_rawbytes();
-
-    if (data != NULL && !isUsingPixelBuffers(context)) {
-        arg_data->set_isarray(true);
-        arg_data->add_rawbytes(data, bytesPerTexel * width * height);
-    } else {
-        arg_data->set_isarray(false);
-        arg_data->set_type(GLMessage::DataType::VOID);
-    }
-}
-
-
-void fixup_glTexImage2D(GLTraceContext *context, GLMessage *glmsg, void *pointersToFixup[]) {
-    /* void glTexImage2D(GLenum target,
-                        GLint level,
-                        GLint internalformat,
-                        GLsizei width,
-                        GLsizei height,
-                        GLint border,
-                        GLenum format,
-                        GLenum type,
-                        const GLvoid *data);
-    */
-    int widthIndex = 3;
-    int heightIndex = 4;
-    fixup_glTexImage(context, widthIndex, heightIndex, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glTexSubImage2D(GLTraceContext *context, GLMessage *glmsg, void *pointersToFixup[]) {
-    /*
-    void glTexSubImage2D(GLenum target,
-                        GLint level,
-                        GLint xoffset,
-                        GLint yoffset,
-                        GLsizei width,
-                        GLsizei height,
-                        GLenum format,
-                        GLenum type,
-                        const GLvoid * data);
-    */
-    int widthIndex = 4;
-    int heightIndex = 5;
-    fixup_glTexImage(context, widthIndex, heightIndex, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glCompressedTexImage2D(GLTraceContext *context, GLMessage *glmsg,
-                                    void *pointersToFixup[]) {
-    /* void glCompressedTexImage2D(GLenum target,
-                                   GLint level,
-                                   GLenum internalformat,
-                                   GLsizei width,
-                                   GLsizei height,
-                                   GLint border,
-                                   GLsizei imageSize,
-                                   const GLvoid* data);
-    */
-    GLsizei size  = glmsg->args(6).intvalue(0);
-    void *data = pointersToFixup[0];
-
-    GLMessage_DataType *arg_data  = glmsg->mutable_args(7);
-    arg_data->set_type(GLMessage::DataType::BYTE);
-    arg_data->clear_rawbytes();
-
-    if (data != NULL && !isUsingPixelBuffers(context)) {
-        arg_data->set_isarray(true);
-        arg_data->add_rawbytes(data, size);
-    } else {
-        arg_data->set_isarray(false);
-        arg_data->set_type(GLMessage::DataType::VOID);
-    }
-}
-
-void fixup_glCompressedTexSubImage2D(GLTraceContext *context, GLMessage *glmsg,
-                                        void *pointersToFixup[]) {
-    /* void glCompressedTexSubImage2D(GLenum target,
-                                      GLint level,
-                                      GLint xoffset,
-                                      GLint yoffset,
-                                      GLsizei width,
-                                      GLsizei height,
-                                      GLenum format,
-                                      GLsizei imageSize,
-                                      const GLvoid* data);
-    */
-    GLsizei size  = glmsg->args(7).intvalue(0);
-    void *data = pointersToFixup[0];
-
-    GLMessage_DataType *arg_data  = glmsg->mutable_args(8);
-    arg_data->set_type(GLMessage::DataType::BYTE);
-    arg_data->clear_rawbytes();
-
-    if (data != NULL && !isUsingPixelBuffers(context)) {
-        arg_data->set_isarray(true);
-        arg_data->add_rawbytes(data, size);
-    } else {
-        arg_data->set_isarray(false);
-        arg_data->set_type(GLMessage::DataType::VOID);
-    }
-}
-
-void fixup_glShaderSource(GLMessage *glmsg, void *pointersToFixup[]) {
-    /* void glShaderSource(GLuint shader, GLsizei count, const GLchar** string,
-                                    const GLint* length) */
-    GLMessage_DataType arg_count  = glmsg->args(1);
-    GLMessage_DataType arg_lenp   = glmsg->args(3);
-    GLMessage_DataType *arg_strpp = glmsg->mutable_args(2);
-
-    GLsizei count = arg_count.intvalue(0);
-    GLchar **stringpp = (GLchar **) pointersToFixup[0];
-    GLint *lengthp = (GLint *) pointersToFixup[1];
-
-    arg_strpp->set_type(GLMessage::DataType::CHAR);
-    arg_strpp->set_isarray(true);
-    arg_strpp->clear_charvalue();
-
-    ::std::string src = "";
-    for (int i = 0; i < count; i++) {
-        if (lengthp != NULL)
-            src.append(*stringpp++, *lengthp++);
-        else
-            src.append(*stringpp++);  // assume null terminated
-    }
-
-    arg_strpp->add_charvalue(src);
-}
-
-void fixup_glUniformGenericInteger(int argIndex, int nElemsPerVector, GLMessage *glmsg,
-                                                                    void *pointersToFixup[]) {
-    /* void glUniform?iv(GLint location, GLsizei count, const GLint *value); */
-    GLMessage_DataType arg_count  = glmsg->args(1);
-    int n_vectors = arg_count.intvalue(0);
-    fixup_GenericIntArray(argIndex, nElemsPerVector * n_vectors, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glUniformGeneric(int argIndex, int nElemsPerVector, GLMessage *glmsg, void *src) {
-    GLMessage_DataType arg_count  = glmsg->args(1);
-    int n_vectors = arg_count.intvalue(0);
-    fixup_GenericFloatArray(argIndex, nElemsPerVector * n_vectors, glmsg, src);
-}
-
-void fixup_glUniformMatrixGeneric(int matrixSize, GLMessage *glmsg, void *pointersToFixup[]) {
-    /* void glUniformMatrix?fv(GLint location, GLsizei count, GLboolean transpose,
-                                                                const GLfloat* value) */
-    GLMessage_DataType arg_count  = glmsg->args(1);
-    int n_matrices = arg_count.intvalue(0);
-    fixup_glUniformGeneric(3, matrixSize * matrixSize * n_matrices, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glGenGeneric(GLMessage *glmsg, void *pointersToFixup[]) {
-    /* void glGen*(GLsizei n, GLuint * buffers); */
-    GLMessage_DataType arg_n  = glmsg->args(0);
-    GLsizei n = arg_n.intvalue(0);
-
-    fixup_GenericIntArray(1, n, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glDeleteGeneric(GLMessage *glmsg, void *pointersToFixup[]) {
-    /* void glDelete*(GLsizei n, GLuint *buffers); */
-    GLMessage_DataType arg_n  = glmsg->args(0);
-    GLsizei n = arg_n.intvalue(0);
-
-    fixup_GenericIntArray(1, n, glmsg, pointersToFixup[0]);
-}
-
-void fixup_glGetBooleanv(GLMessage *glmsg, void *pointersToFixup[]) {
-    /* void glGetBooleanv(GLenum pname, GLboolean *params); */
-    GLMessage_DataType *arg_params = glmsg->mutable_args(1);
-    GLboolean *src = (GLboolean*) pointersToFixup[0];
-
-    arg_params->set_type(GLMessage::DataType::BOOL);
-    arg_params->set_isarray(true);
-    arg_params->clear_boolvalue();
-    arg_params->add_boolvalue(*src);
-}
-
-void fixup_glGetFloatv(GLMessage *glmsg, void *pointersToFixup[]) {
-    /* void glGetFloatv(GLenum pname, GLfloat *params); */
-    GLMessage_DataType *arg_params = glmsg->mutable_args(1);
-    GLfloat *src = (GLfloat*) pointersToFixup[0];
-
-    arg_params->set_type(GLMessage::DataType::FLOAT);
-    arg_params->set_isarray(true);
-    arg_params->clear_floatvalue();
-    arg_params->add_floatvalue(*src);
-}
-
-void fixup_glLinkProgram(GLMessage *glmsg) {
-    /* void glLinkProgram(GLuint program); */
-    GLuint program = glmsg->args(0).intvalue(0);
-
-    /* We don't have to fixup this call, but as soon as a program is linked,
-       we obtain information about all active attributes and uniforms to
-       pass on to the debugger. Note that in order to pass this info to
-       the debugger, all we need to do is call the trace versions of the
-       necessary calls. */
-
-    GLint n, maxNameLength;
-    GLchar *name;
-    GLint size;
-    GLenum type;
-
-    // obtain info regarding active attributes
-    GLTrace_glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &n);
-    GLTrace_glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxNameLength);
-
-    name = (GLchar *) malloc(maxNameLength);
-    for (int i = 0; i < n; i++) {
-        GLTrace_glGetActiveAttrib(program, i, maxNameLength, NULL, &size, &type, name);
-    }
-    free(name);
-
-    // obtain info regarding active uniforms
-    GLTrace_glGetProgramiv(program, GL_ACTIVE_UNIFORMS, &n);
-    GLTrace_glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxNameLength);
-
-    name = (GLchar *) malloc(maxNameLength);
-    for (int i = 0; i < n; i++) {
-        GLTrace_glGetActiveUniform(program, i, maxNameLength, NULL, &size, &type, name);
-    }
-    free(name);
-}
-
-/** Given a glGetActive[Uniform|Attrib] call, obtain the location
- *  of the variable of given name in the call.
- */
-GLint getShaderVariableLocation(GLTraceContext *context, GLMessage *glmsg, GLchar *name) {
-    GLMessage_Function func = glmsg->function();
-    if (func != GLMessage::glGetActiveAttrib && func != GLMessage::glGetActiveUniform) {
-        return -1;
-    }
-
-    int program = glmsg->args(0).intvalue(0);
-
-    if (func == GLMessage::glGetActiveAttrib) {
-        return context->hooks->gl.glGetAttribLocation(program, name);
-    } else {
-        return context->hooks->gl.glGetUniformLocation(program, name);
-    }
-}
-
-void fixup_glGetActiveAttribOrUniform(GLTraceContext *context, GLMessage *glmsg,
-                                                                void *pointersToFixup[]) {
-    /* void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize,
-                GLsizei* length, GLint* size, GLenum* type, GLchar* name); */
-    /* void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize,
-                GLsizei* length, GLint* size, GLenum* type, GLchar* name) */
-
-    fixup_GenericIntArray(3, 1, glmsg, pointersToFixup[0]);     // length
-    fixup_GenericIntArray(4, 1, glmsg, pointersToFixup[1]);     // size
-    fixup_GenericEnumArray(5, 1, glmsg, pointersToFixup[2]);    // type
-    fixup_CStringPtr(6, glmsg, pointersToFixup[3]);             // name
-
-    // The index argument in the glGetActive[Attrib|Uniform] functions
-    // does not correspond to the actual location index as used in
-    // glUniform*() or glVertexAttrib*() to actually upload the data.
-    // In order to make things simpler for the debugger, we also pass
-    // a hidden location argument that stores the actual location.
-    // append the location value to the end of the argument list
-    GLint location = getShaderVariableLocation(context, glmsg, (GLchar*)pointersToFixup[3]);
-    GLMessage_DataType *arg_location = glmsg->add_args();
-    arg_location->set_isarray(false);
-    arg_location->set_type(GLMessage::DataType::INT);
-    arg_location->add_intvalue(location);
-}
-
-/** Copy @len bytes of data from @src into the @dataIndex'th argument of the message. */
-void addGlBufferData(GLMessage *glmsg, int dataIndex, GLvoid *src, GLsizeiptr len) {
-    GLMessage_DataType *arg_datap = glmsg->mutable_args(dataIndex);
-    arg_datap->set_type(GLMessage::DataType::VOID);
-    arg_datap->set_isarray(true);
-    arg_datap->clear_intvalue();
-    arg_datap->add_rawbytes(src, len);
-}
-
-void fixup_glBufferData(GLTraceContext *context, GLMessage *glmsg, void *pointersToFixup[]) {
-    /* void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) */
-    GLsizeiptr size = glmsg->args(1).intvalue(0);
-    GLvoid *datap = (GLvoid *) pointersToFixup[0];
-
-    // Save element array buffers for future use to fixup glVertexAttribPointers
-    // when a glDrawElements() call is performed.
-    GLenum target = glmsg->args(0).intvalue(0);
-    if (target == GL_ELEMENT_ARRAY_BUFFER) {
-        GLint bufferId = glGetInteger(context, GL_ELEMENT_ARRAY_BUFFER_BINDING);
-        context->bindBuffer(bufferId, datap, size);
-    }
-
-    // add buffer data to the protobuf message
-    if (datap != NULL) {
-        addGlBufferData(glmsg, 2, datap, size);
-    }
-}
-
-void fixup_glBufferSubData(GLTraceContext *context, GLMessage *glmsg, void *pointersToFixup[]) {
-    /* void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) */
-    GLenum target = glmsg->args(0).intvalue(0);
-    GLintptr offset = glmsg->args(1).intvalue(0);
-    GLsizeiptr size = glmsg->args(2).intvalue(0);
-    GLvoid *datap = (GLvoid *) pointersToFixup[0];
-    if (target == GL_ELEMENT_ARRAY_BUFFER) {
-        GLint bufferId = glGetInteger(context, GL_ELEMENT_ARRAY_BUFFER_BINDING);
-        context->updateBufferSubData(bufferId, offset, datap, size);
-    }
-
-    // add buffer data to the protobuf message
-    addGlBufferData(glmsg, 3, datap, size);
-}
-
-/** Obtain the size of each vertex attribute. */
-int vertexAttribSize(GLenum type, GLsizei numComponents) {
-    int sizePerComponent;
-
-    switch(type) {
-    case GL_BYTE:
-    case GL_UNSIGNED_BYTE:
-        sizePerComponent = 1;
-        break;
-    case GL_SHORT:
-    case GL_UNSIGNED_SHORT:
-        sizePerComponent = 2;
-        break;
-    case GL_FIXED:
-    case GL_FLOAT:
-    default:
-        sizePerComponent = 4;
-        break;
-    }
-
-    return sizePerComponent * numComponents;
-}
-
-/** Create and send a glVertexAttribPointerData trace message to the host. */
-void trace_glVertexAttribPointerData(GLTraceContext *context,
-                    GLuint indx, GLint size, GLenum type,
-                    GLboolean normalized, GLsizei stride, const GLvoid* ptr,
-                    GLuint minIndex, GLuint maxIndex, nsecs_t startTime) {
-    /* void glVertexAttribPointerData(GLuint indx, GLint size, GLenum type,
-                    GLboolean normalized, GLsizei stride, const GLvoid* ptr,
-                    int minIndex, int maxIndex) */
-    GLMessage glmsg;
-    GLTraceContext *glContext = context;
-
-    glmsg.set_function(GLMessage::glVertexAttribPointerData);
-
-    // copy argument indx
-    GLMessage_DataType *arg_indx = glmsg.add_args();
-    arg_indx->set_isarray(false);
-    arg_indx->set_type(GLMessage::DataType::INT);
-    arg_indx->add_intvalue(indx);
-
-    // copy argument size
-    GLMessage_DataType *arg_size = glmsg.add_args();
-    arg_size->set_isarray(false);
-    arg_size->set_type(GLMessage::DataType::INT);
-    arg_size->add_intvalue(size);
-
-    // copy argument type
-    GLMessage_DataType *arg_type = glmsg.add_args();
-    arg_type->set_isarray(false);
-    arg_type->set_type(GLMessage::DataType::ENUM);
-    arg_type->add_intvalue((int)type);
-
-    // copy argument normalized
-    GLMessage_DataType *arg_normalized = glmsg.add_args();
-    arg_normalized->set_isarray(false);
-    arg_normalized->set_type(GLMessage::DataType::BOOL);
-    arg_normalized->add_boolvalue(normalized);
-
-    // copy argument stride
-    GLMessage_DataType *arg_stride = glmsg.add_args();
-    arg_stride->set_isarray(false);
-    arg_stride->set_type(GLMessage::DataType::INT);
-    arg_stride->add_intvalue(stride);
-
-    // copy argument ptr
-    GLMessage_DataType *arg_ptr = glmsg.add_args();
-    arg_ptr->set_isarray(true);
-    arg_ptr->set_type(GLMessage::DataType::BYTE);
-    int perVertexSize = vertexAttribSize(type, size);
-    GLchar *p = (GLchar*) ptr;
-    std::string data;
-    for (GLuint i = minIndex; i < maxIndex; i++) {
-        data.append(p, perVertexSize);
-        p += stride == 0 ? perVertexSize : stride;
-    }
-    arg_ptr->add_rawbytes(data);
-
-    // copy argument min index
-    GLMessage_DataType *arg_min = glmsg.add_args();
-    arg_min->set_isarray(false);
-    arg_min->set_type(GLMessage::DataType::INT);
-    arg_min->add_intvalue(minIndex);
-
-    // copy argument max index
-    GLMessage_DataType *arg_max = glmsg.add_args();
-    arg_max->set_isarray(false);
-    arg_max->set_type(GLMessage::DataType::INT);
-    arg_max->add_intvalue(maxIndex);
-
-    glmsg.set_context_id(context->getId());
-    glmsg.set_start_time(startTime);
-    glmsg.set_threadtime(0);
-    glmsg.set_duration(0);
-
-    context->traceGLMessage(&glmsg);
-}
-
-void findMinAndMaxIndices(GLvoid *indices, GLsizei count, GLenum type,
-                            GLuint *minIndex, GLuint *maxIndex) {
-    GLuint index;
-    *minIndex = UINT_MAX;
-    *maxIndex = 0;
-
-    if (indices == NULL) {
-        return;
-    }
-
-    for (GLsizei i = 0; i < count; i++) {
-        if (type == GL_UNSIGNED_BYTE) {
-            index = *((GLubyte*) indices + i);
-        } else {
-            index = *((GLushort*) indices + i);
-        }
-
-        if (index < *minIndex) *minIndex = index;
-        if (index > *maxIndex) *maxIndex = index;
-    }
-}
-
-void trace_VertexAttribPointerData(GLTraceContext *context,
-                            GLuint minIndex, GLuint maxIndex, nsecs_t time) {
-    GLuint maxAttribs = glGetInteger(context, GL_MAX_VERTEX_ATTRIBS);
-    for (GLuint index = 0; index < maxAttribs; index++) {
-        if (!glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_ENABLED)) {
-            // vertex array disabled
-            continue;
-        }
-
-        if (glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)) {
-            // vbo
-            continue;
-        }
-
-        GLint size = glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_SIZE);
-        GLenum type = glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_TYPE);
-        GLboolean norm = glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED);
-        GLsizei stride = glGetVertexAttrib(context, index, GL_VERTEX_ATTRIB_ARRAY_STRIDE);
-        GLvoid* ptr;
-        context->hooks->gl.glGetVertexAttribPointerv(index, GL_VERTEX_ATTRIB_ARRAY_POINTER, &ptr);
-
-        trace_glVertexAttribPointerData(context,
-                    index, size, type, norm, stride, ptr,
-                    minIndex, maxIndex, time);
-    }
-}
-
-void trace_VertexAttribPointerDataForGlDrawArrays(GLTraceContext *context, GLMessage *glmsg) {
-    if (context->getVersion() == egl_connection_t::GLESv1_INDEX) {
-        // only supported for GLES2 and above
-        return;
-    }
-
-    /* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */
-    GLsizei count = glmsg->args(2).intvalue(0);
-
-    // Vertex attrib pointer data patchup calls should appear as if
-    // they occurred right before the draw call.
-    nsecs_t time = glmsg->start_time() - 1;
-
-    trace_VertexAttribPointerData(context, 0, count, time);
-}
-
-void trace_VertexAttribPointerDataForGlDrawElements(GLTraceContext *context, GLMessage *glmsg,
-                            GLvoid *indices) {
-    if (context->getVersion() == egl_connection_t::GLESv1_INDEX) {
-        // only supported for GLES2 and above
-        return;
-    }
-
-    /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */
-    GLsizei count = glmsg->args(1).intvalue(0);
-    GLenum type = glmsg->args(2).intvalue(0);
-    GLuint index;
-
-    GLuint minIndex, maxIndex;
-
-    // The index buffer is either passed in as an argument to the glDrawElements() call,
-    // or it is stored in the current GL_ELEMENT_ARRAY_BUFFER.
-    GLvoid *indexBuffer;
-    if (isUsingElementArrayBuffers(context)) {
-        GLsizeiptr eaBufferSize;
-        GLuint bufferId = glGetInteger(context, GL_ELEMENT_ARRAY_BUFFER_BINDING);
-        context->getBuffer(bufferId, &indexBuffer, &eaBufferSize);
-    } else {
-        indexBuffer = indices;
-    }
-
-    // Rather than sending vertex attribute data that corresponds to the indices
-    // being drawn, we send the vertex attribute data for the entire range of
-    // indices being drawn, including the ones not drawn. The min & max indices
-    // provide the range of indices being drawn.
-    findMinAndMaxIndices(indexBuffer, count, type, &minIndex, &maxIndex);
-
-    // Vertex attrib pointer data patchup calls should appear as if
-    // they occurred right before the draw call.
-    nsecs_t time = glmsg->start_time() - 1;
-
-    trace_VertexAttribPointerData(context, minIndex, maxIndex + 1, time);
-}
-
-void fixup_glDrawArrays(GLTraceContext *context, GLMessage *glmsg) {
-    // Trace all vertex attribute data stored in client space.
-    trace_VertexAttribPointerDataForGlDrawArrays(context, glmsg);
-
-    // Attach the FB if requested
-    if (context->getGlobalTraceState()->shouldCollectFbOnGlDraw()) {
-        fixup_addFBContents(context, glmsg, CURRENTLY_BOUND_FB);
-    }
-}
-
-void fixup_glDrawElements(GLTraceContext *context, GLMessage *glmsg, void *pointersToFixup[]) {
-    /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */
-    GLvoid *indices = pointersToFixup[0];
-    GLenum type = glmsg->args(2).intvalue(0);
-    GLsizei count = glmsg->args(1).intvalue(0);
-    GLuint index;
-
-    // Trace all vertex attribute data stored in client space.
-    trace_VertexAttribPointerDataForGlDrawElements(context, glmsg, indices);
-
-    // Fixup indices argument
-    if (!isUsingElementArrayBuffers(context)) {
-        GLMessage_DataType *arg_indices = glmsg->mutable_args(3);
-        arg_indices->set_isarray(true);
-        arg_indices->clear_intvalue();
-        arg_indices->set_type(GLMessage::DataType::INT);
-        for (GLsizei i = 0; i < count; i++) {
-            if (type == GL_UNSIGNED_BYTE) {
-                index = *((GLubyte*) indices + i);
-            } else {
-                index = *((GLushort*) indices + i);
-            }
-            arg_indices->add_intvalue(index);
-        }
-    }
-
-    // Attach the FB if requested
-    if (context->getGlobalTraceState()->shouldCollectFbOnGlDraw()) {
-        fixup_addFBContents(context, glmsg, CURRENTLY_BOUND_FB);
-    }
-}
-
-void fixupGLMessage(GLTraceContext *context, nsecs_t wallStart, nsecs_t wallEnd,
-                                             nsecs_t threadStart, nsecs_t threadEnd,
-                                             GLMessage *glmsg, void *pointersToFixup[]) {
-    // for all messages, set the current context id
-    glmsg->set_context_id(context->getId());
-
-    // set start time and duration
-    glmsg->set_start_time(wallStart);
-    glmsg->set_duration((unsigned)(wallEnd - wallStart));
-    glmsg->set_threadtime((unsigned)(threadEnd - threadStart));
-
-    // do any custom message dependent processing
-    switch (glmsg->function()) {
-    case GLMessage::glDeleteBuffers:      /* glDeleteBuffers(GLsizei n, GLuint *buffers); */
-    case GLMessage::glDeleteFramebuffers: /* glDeleteFramebuffers(GLsizei n, GLuint *buffers); */
-    case GLMessage::glDeleteRenderbuffers:/* glDeleteRenderbuffers(GLsizei n, GLuint *buffers); */
-    case GLMessage::glDeleteTextures:     /* glDeleteTextures(GLsizei n, GLuint *textures); */
-        fixup_glDeleteGeneric(glmsg, pointersToFixup);
-        break;
-    case GLMessage::glGenBuffers:        /* void glGenBuffers(GLsizei n, GLuint *buffers); */
-    case GLMessage::glGenFramebuffers:   /* void glGenFramebuffers(GLsizei n, GLuint *buffers); */
-    case GLMessage::glGenRenderbuffers:  /* void glGenFramebuffers(GLsizei n, GLuint *buffers); */
-    case GLMessage::glGenTextures:       /* void glGenTextures(GLsizei n, GLuint *textures); */
-        fixup_glGenGeneric(glmsg, pointersToFixup);
-        break;
-    case GLMessage::glLinkProgram:       /* void glLinkProgram(GLuint program); */
-        fixup_glLinkProgram(glmsg);
-        break;
-    case GLMessage::glGetActiveAttrib:
-        fixup_glGetActiveAttribOrUniform(context, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glGetActiveUniform:
-        fixup_glGetActiveAttribOrUniform(context, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glBindAttribLocation:
-        /* void glBindAttribLocation(GLuint program, GLuint index, const GLchar* name); */
-        fixup_CStringPtr(2, glmsg, pointersToFixup[0]);
-        break;
-    case GLMessage::glGetAttribLocation:
-    case GLMessage::glGetUniformLocation:
-        /* int glGetAttribLocation(GLuint program, const GLchar* name) */
-        /* int glGetUniformLocation(GLuint program, const GLchar* name) */
-        fixup_CStringPtr(1, glmsg, pointersToFixup[0]);
-        break;
-    case GLMessage::glGetBooleanv:
-        fixup_glGetBooleanv(glmsg, pointersToFixup);
-        break;
-    case GLMessage::glGetFloatv:
-        fixup_glGetFloatv(glmsg, pointersToFixup);
-        break;
-    case GLMessage::glGetIntegerv:        /* void glGetIntegerv(GLenum pname, GLint *params); */
-        fixup_GenericIntArray(1, 1, glmsg, pointersToFixup[0]);
-        break;
-    case GLMessage::glGetProgramiv:
-    case GLMessage::glGetRenderbufferParameteriv:
-    case GLMessage::glGetShaderiv:
-        /* void glGetProgramiv(GLuint program, GLenum pname, GLint* params) */
-        /* void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) */
-        /* void glGetShaderiv(GLuint shader, GLenum pname, GLint* params) */
-        fixup_GenericIntArray(2, 1, glmsg, pointersToFixup[0]);
-        break;
-    case GLMessage::glGetString:
-        fixup_glGetString(glmsg, pointersToFixup);
-        break;
-    case GLMessage::glTexImage2D:
-        if (context->getGlobalTraceState()->shouldCollectTextureDataOnGlTexImage()) {
-            fixup_glTexImage2D(context, glmsg, pointersToFixup);
-        }
-        break;
-    case GLMessage::glTexSubImage2D:
-        if (context->getGlobalTraceState()->shouldCollectTextureDataOnGlTexImage()) {
-            fixup_glTexSubImage2D(context, glmsg, pointersToFixup);
-        }
-        break;
-    case GLMessage::glCompressedTexImage2D:
-        if (context->getGlobalTraceState()->shouldCollectTextureDataOnGlTexImage()) {
-            fixup_glCompressedTexImage2D(context, glmsg, pointersToFixup);
-        }
-        break;
-    case GLMessage::glCompressedTexSubImage2D:
-        if (context->getGlobalTraceState()->shouldCollectTextureDataOnGlTexImage()) {
-            fixup_glCompressedTexSubImage2D(context, glmsg, pointersToFixup);
-        }
-        break;
-    case GLMessage::glShaderSource:
-        fixup_glShaderSource(glmsg, pointersToFixup);
-        break;
-    case GLMessage::glUniform1iv:
-        /* void glUniform1iv(GLint location, GLsizei count, const GLint *value); */
-        fixup_glUniformGenericInteger(2, 1, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glUniform2iv:
-        /* void glUniform2iv(GLint location, GLsizei count, const GLint *value); */
-        fixup_glUniformGenericInteger(2, 2, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glUniform3iv:
-        /* void glUniform3iv(GLint location, GLsizei count, const GLint *value); */
-        fixup_glUniformGenericInteger(2, 3, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glUniform4iv:
-        /* void glUniform4iv(GLint location, GLsizei count, const GLint *value); */
-        fixup_glUniformGenericInteger(2, 4, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glUniform1fv:
-        /* void glUniform1fv(GLint location, GLsizei count, const GLfloat *value); */
-        fixup_glUniformGeneric(2, 1, glmsg, pointersToFixup[0]);
-        break;
-    case GLMessage::glUniform2fv:
-        /* void glUniform2fv(GLint location, GLsizei count, const GLfloat *value); */
-        fixup_glUniformGeneric(2, 2, glmsg, pointersToFixup[0]);
-        break;
-    case GLMessage::glUniform3fv:
-        /* void glUniform3fv(GLint location, GLsizei count, const GLfloat *value); */
-        fixup_glUniformGeneric(2, 3, glmsg, pointersToFixup[0]);
-        break;
-    case GLMessage::glUniform4fv:
-        /* void glUniform4fv(GLint location, GLsizei count, const GLfloat *value); */
-        fixup_glUniformGeneric(2, 4, glmsg, pointersToFixup[0]);
-        break;
-    case GLMessage::glUniformMatrix2fv:
-        /* void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
-                                                                    const GLfloat* value) */
-        fixup_glUniformMatrixGeneric(2, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glUniformMatrix3fv:
-        /* void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
-                                                                    const GLfloat* value) */
-        fixup_glUniformMatrixGeneric(3, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glUniformMatrix4fv:
-        /* void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
-                                                                    const GLfloat* value) */
-        fixup_glUniformMatrixGeneric(4, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glBufferData:
-        /* void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) */
-        fixup_glBufferData(context, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glBufferSubData:
-        /* void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) */
-        fixup_glBufferSubData(context, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glDrawArrays:
-        /* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */
-        fixup_glDrawArrays(context, glmsg);
-        break;
-    case GLMessage::glDrawElements:
-        /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */
-        fixup_glDrawElements(context, glmsg, pointersToFixup);
-        break;
-    case GLMessage::glPushGroupMarkerEXT:
-        /* void PushGroupMarkerEXT(sizei length, const char *marker); */
-        fixup_CStringPtr(1, glmsg, pointersToFixup[0]);
-        break;
-    case GLMessage::glInsertEventMarkerEXT:
-        /* void InsertEventMarkerEXT(sizei length, const char *marker); */
-        fixup_CStringPtr(1, glmsg, pointersToFixup[0]);
-        break;
-    default:
-        break;
-    }
-}
-
-};
-};
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.h b/opengl/libs/GLES_trace/src/gltrace_fixup.h
deleted file mode 100644 (file)
index c90dbeb..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __GLTRACE_FIXUP_H_
-#define __GLTRACE_FIXUP_H_
-
-#include <utils/Timers.h>
-
-#include "frameworks/native/opengl/libs/GLES_trace/proto/gltrace.pb.h"
-#include "gltrace_context.h"
-
-namespace android {
-namespace gltrace {
-
-void fixupGLMessage(GLTraceContext *curContext, nsecs_t wallStart, nsecs_t wallEnd,
-                                                nsecs_t threadStart, nsecs_t threadEnd,
-                                                GLMessage *message, void *pointersToFixup[]);
-void fixup_addFBContents(GLTraceContext *curContext, GLMessage *message, FBBinding fbToRead);
-
-};
-};
-
-#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_hooks.cpp b/opengl/libs/GLES_trace/src/gltrace_hooks.cpp
deleted file mode 100644 (file)
index de8d463..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "hooks.h"
-#include "gltrace_api.h"
-#include "gltrace_hooks.h"
-
-namespace android {
-namespace gltrace {
-
-// Hook up all the GLTrace functions
-#define GL_ENTRY(_r, _api, ...) GLTrace_ ## _api,
-EGLAPI gl_hooks_t gHooksDebug = {
-    {
-        #include "entries.in"
-    },
-    {
-        {0}
-    }
-};
-#undef GL_ENTRY
-
-gl_hooks_t *getGLHooks() {
-    return &gHooksDebug;
-}
-
-};
-};
diff --git a/opengl/libs/GLES_trace/src/gltrace_hooks.h b/opengl/libs/GLES_trace/src/gltrace_hooks.h
deleted file mode 100644 (file)
index c946a09..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __GLD_HOOKS_H_
-#define __GLD_HOOKS_H_
-
-#include "hooks.h"
-
-namespace android {
-namespace gltrace {
-
-using ::android::gl_hooks_t;
-
-gl_hooks_t *getGLHooks();
-
-};
-};
-
-#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_transport.cpp b/opengl/libs/GLES_trace/src/gltrace_transport.cpp
deleted file mode 100644 (file)
index 2996d32..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <netinet/in.h>
-
-#include <cutils/log.h>
-#include <private/android_filesystem_config.h>
-
-#include "gltrace_transport.h"
-
-namespace android {
-namespace gltrace {
-
-int acceptClientConnection(char *sockname) {
-    int serverSocket = socket(AF_LOCAL, SOCK_STREAM, 0);
-    if (serverSocket < 0) {
-        ALOGE("Error (%d) while creating socket. Check if app has network permissions.",
-                                                                            serverSocket);
-        return -1;
-    }
-
-    struct sockaddr_un server, client;
-
-    memset(&server, 0, sizeof server);
-    server.sun_family = AF_UNIX;
-    // the first byte of sun_path should be '\0' for abstract namespace
-    strcpy(server.sun_path + 1, sockname);
-
-    // note that sockaddr_len should be set to the exact size of the buffer that is used.
-    socklen_t sockaddr_len = sizeof(server.sun_family) + strlen(sockname) + 1;
-    if (bind(serverSocket, (struct sockaddr *) &server, sockaddr_len) < 0) {
-        close(serverSocket);
-        ALOGE("Failed to bind the server socket");
-        return -1;
-    }
-
-    if (listen(serverSocket, 1) < 0) {
-        close(serverSocket);
-        ALOGE("Failed to listen on server socket");
-        return -1;
-    }
-
-    ALOGD("gltrace::waitForClientConnection: server listening @ path %s", sockname);
-
-    int clientSocket = accept(serverSocket, (struct sockaddr *)&client, &sockaddr_len);
-    if (clientSocket < 0) {
-        close(serverSocket);
-        ALOGE("Failed to accept client connection");
-        return -1;
-    }
-
-    struct ucred cr;
-    socklen_t cr_len = sizeof(cr);
-    if (getsockopt(clientSocket, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) != 0) {
-        ALOGE("Error obtaining credentials of peer");
-        return -1;
-    }
-
-    // Only accept connects from the shell (adb forward comes to us as shell user),
-    // or the root user.
-    if (cr.uid != AID_SHELL && cr.uid != AID_ROOT) {
-        ALOGE("Unknown peer type (%d), expected shell to be the peer", cr.uid);
-        return -1;
-    }
-
-    ALOGD("gltrace::waitForClientConnection: client connected.");
-
-    // do not accept any more incoming connections
-    close(serverSocket);
-
-    return clientSocket;
-}
-
-TCPStream::TCPStream(int socket) {
-    mSocket = socket;
-    pthread_mutex_init(&mSocketWriteMutex, NULL);
-}
-
-TCPStream::~TCPStream() {
-    pthread_mutex_destroy(&mSocketWriteMutex);
-}
-
-void TCPStream::closeStream() {
-    if (mSocket > 0) {
-        close(mSocket);
-        mSocket = 0;
-    }
-}
-
-int TCPStream::send(void *buf, size_t len) {
-    if (mSocket <= 0) {
-        return -1;
-    }
-
-    pthread_mutex_lock(&mSocketWriteMutex);
-    int n = write(mSocket, buf, len);
-    pthread_mutex_unlock(&mSocketWriteMutex);
-
-    return n;
-}
-
-int TCPStream::receive(void *data, size_t len) {
-    if (mSocket <= 0) {
-        return -1;
-    }
-
-    size_t totalRead = 0;
-    while (totalRead < len) {
-        int n = read(mSocket, (uint8_t*)data + totalRead, len - totalRead);
-        if (n < 0) {
-            ALOGE("Error receiving data from stream: %d", errno);
-            return -1;
-        }
-
-        totalRead += n;
-    }
-
-    return 0;
-}
-
-BufferedOutputStream::BufferedOutputStream(TCPStream *stream, size_t bufferSize) {
-    mStream = stream;
-
-    mBufferSize = bufferSize;
-    mStringBuffer = "";
-    mStringBuffer.reserve(bufferSize);
-}
-
-int BufferedOutputStream::flush() {
-    if (mStringBuffer.size() == 0) {
-        return 0;
-    }
-
-    int n = mStream->send((void *)mStringBuffer.data(), mStringBuffer.size());
-    mStringBuffer.clear();
-    return n;
-}
-
-void BufferedOutputStream::enqueueMessage(GLMessage *msg) {
-    const uint32_t len = msg->ByteSize();
-
-    mStringBuffer.append((const char *)&len, sizeof(len));    // append header
-    msg->AppendToString(&mStringBuffer);                      // append message
-}
-
-int BufferedOutputStream::send(GLMessage *msg) {
-    enqueueMessage(msg);
-
-    if (mStringBuffer.size() > mBufferSize) {
-        return flush();
-    }
-
-    return 0;
-}
-
-};  // namespace gltrace
-};  // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_transport.h b/opengl/libs/GLES_trace/src/gltrace_transport.h
deleted file mode 100644 (file)
index fd6cb8c..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __GLTRACE_TRANSPORT_H_
-#define __GLTRACE_TRANSPORT_H_
-
-#include <pthread.h>
-
-#include "frameworks/native/opengl/libs/GLES_trace/proto/gltrace.pb.h"
-
-namespace android {
-namespace gltrace {
-
-/**
- * TCPStream provides a TCP based communication channel from the device to
- * the host for transferring GLMessages.
- */
-class TCPStream {
-    int mSocket;
-    pthread_mutex_t mSocketWriteMutex;
-public:
-    /** Create a TCP based communication channel over @socket */
-    TCPStream(int socket);
-    ~TCPStream();
-
-    /** Close the channel. */
-    void closeStream();
-
-    /** Send @data of size @len to host. . Returns -1 on error, 0 on success. */
-    int send(void *data, size_t len);
-
-    /**
-     * Receive @len bytes of data into @buf from the remote end. This is a blocking call.
-     * Returns -1 on failure, 0 on success.
-     */
-    int receive(void *buf, size_t len);
-};
-
-/**
- * BufferedOutputStream provides buffering of data sent to the underlying
- * unbuffered channel.
- */
-class BufferedOutputStream {
-    TCPStream *mStream;
-
-    size_t mBufferSize;
-    std::string mStringBuffer;
-
-    /** Enqueue message into internal buffer. */
-    void enqueueMessage(GLMessage *msg);
-public:
-    /**
-     * Construct a Buffered stream of size @bufferSize, using @stream as
-     * its underlying channel for transport.
-     */
-    BufferedOutputStream(TCPStream *stream, size_t bufferSize);
-
-    /**
-     * Send @msg. The message could be buffered and sent later with a
-     * subsequent message. Returns -1 on error, 0 on success.
-     */
-    int send(GLMessage *msg);
-
-    /** Send any buffered messages, returns -1 on error, 0 on success. */
-    int flush();
-};
-
-/**
- * Utility method: start a server listening at @sockName (unix domain socket,
- * abstract namespace path), and wait for a client connection.
- * Returns the connected client socket on success, or -1 on failure.
- */
-int acceptClientConnection(char *sockName);
-
-};
-};
-
-#endif
diff --git a/opengl/libs/GLES_trace/tools/genapi.py b/opengl/libs/GLES_trace/tools/genapi.py
deleted file mode 100755 (executable)
index c44b985..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2011 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# ABOUT
-#   This script is used to generate the trace implementations of all
-#   OpenGL calls. When executed, it reads the specs for the OpenGL calls
-#   from the files GLES2/gl2_api.in, GLES2/gl2ext_api.in, GLES_CM/gl_api.in,
-#   and GLES_CM/glext_api.in, and generates trace versions for all the
-#   defined functions.
-#
-# PREREQUISITES
-#   To generate C++ files, this script uses the 'pyratemp' template
-#   module. The only reason to use pyratemp is that it is extremly
-#   simple to install:
-#   $ wget http://www.simple-is-better.org/template/pyratemp-0.3.2.tgz
-#   Extract and put the pyratemp.py file in the GLES_trace/tools folder,
-#   or update PYTHONPATH to point to wherever it was downloaded.
-#
-# USAGE
-#   $ cd GLES_trace       - run the program from GLES2_trace folder
-#   $ ./tools/genapi.py   - generates a .cpp and .h file
-#   $ mv *.cpp *.h src/   - move the generated files into the src folder
-
-import sys
-import re
-import pyratemp
-
-# Constants corresponding to the protobuf DataType.Type
-class DataType:
-    def __init__(self, name):
-        self.name = name
-
-    def __str__(self):
-        if self.name == "pointer":  # pointers map to the INT64 DataType
-            return "INT64"
-        return self.name.upper()
-
-    def getProtobufCall(self):
-        if self.name == "void":
-            raise ValueError("Attempt to set void value")
-        elif self.name == "char" or self.name == "byte" \
-                or self.name == "enum":
-            return "add_intvalue((int)"
-        elif self.name == "pointer":
-            return "add_int64value((uintptr_t)"
-        elif self.name == "int":
-            return "add_intvalue("
-        elif self.name == "float":
-            return "add_floatvalue("
-        elif self.name == "bool":
-            return "add_boolvalue("
-        elif self.name == "int64":
-            return "add_int64value("
-        else:
-            raise ValueError("Unknown value type %s" % self.name)
-
-DataType.VOID = DataType("void")
-DataType.CHAR = DataType("char")
-DataType.BYTE = DataType("byte")
-DataType.ENUM = DataType("enum")
-DataType.BOOL = DataType("bool")
-DataType.INT = DataType("int")
-DataType.FLOAT = DataType("float")
-DataType.POINTER = DataType("pointer")
-DataType.INT64 = DataType("int64")
-
-# mapping of GL types to protobuf DataType
-GLPROTOBUF_TYPE_MAP = {
-    "GLvoid":DataType.VOID,
-    "void":DataType.VOID,
-    "GLchar":DataType.CHAR,
-    "GLenum":DataType.ENUM,
-    "GLboolean":DataType.BOOL,
-    "GLbitfield":DataType.INT,
-    "GLbyte":DataType.BYTE,
-    "GLshort":DataType.INT,
-    "GLint":DataType.INT,
-    "int":DataType.INT,
-    "GLsizei":DataType.INT,
-    "GLubyte":DataType.BYTE,
-    "GLushort":DataType.INT,
-    "GLuint":DataType.INT,
-    "GLfloat":DataType.FLOAT,
-    "GLclampf":DataType.FLOAT,
-    "GLfixed":DataType.INT,
-    "GLclampx":DataType.INT,
-    "GLsizeiptr":DataType.INT,
-    "GLintptr":DataType.INT,
-    "GLeglImageOES":DataType.POINTER,
-    "GLint64":DataType.INT64,
-    "GLuint64":DataType.INT64,
-    "GLsync":DataType.POINTER,
-    "GLDEBUGPROCKHR":DataType.POINTER,
-}
-
-API_SPECS = [
-    ('GL2','../GLES2/gl2_api.in'),
-    ('GL2Ext','../GLES2/gl2ext_api.in'),
-    ('GL1','../GLES_CM/gl_api.in'),
-    ('GL1Ext','../GLES_CM/glext_api.in'),
-]
-
-HEADER_LICENSE = """/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * THIS FILE WAS GENERATED BY A SCRIPT. DO NOT EDIT.
- */
-"""
-
-HEADER_INCLUDES = """
-#include <cutils/log.h>
-#include <utils/Timers.h>
-
-#include "gltrace.pb.h"
-#include "gltrace_context.h"
-#include "gltrace_fixup.h"
-#include "gltrace_transport.h"
-"""
-
-HEADER_NAMESPACE_START = """
-namespace android {
-namespace gltrace {
-"""
-
-FOOTER_TEXT = """
-}; // namespace gltrace
-}; // namespace android
-"""
-
-TRACE_CALL_TEMPLATE = pyratemp.Template(
-"""$!retType!$ GLTrace_$!func!$($!inputArgList!$) {
-    GLMessage glmsg;
-    GLTraceContext *glContext = getGLTraceContext();
-
-    glmsg.set_function(GLMessage::$!func!$);
-<!--(if len(parsedArgs) > 0)-->
-    <!--(for argname, argtype in parsedArgs)-->
-
-    // copy argument $!argname!$
-    GLMessage_DataType *arg_$!argname!$ = glmsg.add_args();
-    arg_$!argname!$->set_isarray(false);
-    arg_$!argname!$->set_type(GLMessage::DataType::$!argtype!$);
-    arg_$!argname!$->$!argtype.getProtobufCall()!$$!argname!$);
-    <!--(end)-->
-<!--(end)-->
-
-    // call function
-    nsecs_t wallStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
-    nsecs_t threadStartTime = systemTime(SYSTEM_TIME_THREAD);
-<!--(if retType != "void")-->
-    $!retType!$ retValue = glContext->hooks->gl.$!callsite!$;
-<!--(else)-->
-    glContext->hooks->gl.$!callsite!$;
-<!--(end)-->
-    nsecs_t threadEndTime = systemTime(SYSTEM_TIME_THREAD);
-    nsecs_t wallEndTime = systemTime(SYSTEM_TIME_MONOTONIC);
-<!--(if retType != "void")-->
-
-    // set return value
-    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
-    rt->set_isarray(false);
-    rt->set_type(GLMessage::DataType::$!retDataType!$);
-    rt->$!retDataType.getProtobufCall()!$retValue);
-<!--(end)-->
-
-    void *pointerArgs[] = {
-<!--(for argname, argtype in parsedArgs)-->
-    <!--(if argtype == DataType.POINTER)-->
-        (void *) $!argname!$,
-    <!--(end)-->
-<!--(end)-->
-<!--(if retDataType == DataType.POINTER)-->
-        (void *) retValue,
-<!--(end)-->
-    };
-
-    fixupGLMessage(glContext, wallStartTime, wallEndTime,
-                              threadStartTime, threadEndTime,
-                              &glmsg, pointerArgs);
-    glContext->traceGLMessage(&glmsg);
-<!--(if retType != "void")-->
-
-    return retValue;
-<!--(end)-->
-}
-""")
-
-def getDataTypeFromKw(kw):
-    """ Get the data type given declaration.
-    All pointer declarations are of type DataType.POINTER
-
-    e.g.: GLvoid -> DataType.VOID"""
-
-    if kw.count('*') > 0:
-        return DataType.POINTER
-    return GLPROTOBUF_TYPE_MAP.get(kw)
-
-def getNameTypePair(decl):
-    """ Split declaration of a variable to a tuple of (variable name, DataType).
-    e.g. "const GLChar* varName" -> (varName, POINTER) """
-    elements = decl.strip().split(' ')
-    name = None
-    if len(elements) > 1:
-        name = " ".join(elements[-1:]).strip()      # last element is the name
-        dataType = " ".join(elements[:-1]).strip()  # everything else is the data type
-
-        # if name is a pointer (e.g. "*ptr"), then remove the "*" from the name
-        # and add it to the data type
-        pointersInName = name.count("*")
-        if pointersInName > 0:
-            name = name.replace("*", "")
-            dataType += "*" * pointersInName
-
-        # if name is an array (e.g. "array[10]"), then remove the "[X]" from the name
-        # and make the datatype to be a pointer
-        arraysInName = name.count("[")
-        if arraysInName > 0:
-            name = name.split('[')[0]
-            dataType += "*"
-    else:
-        dataType = elements[0]
-    return (name, getDataTypeFromKw(dataType))
-
-def parseArgs(arglist):
-    """ Parse the argument list into a list of (var name, DataType) tuples """
-    args = arglist.split(',')
-    args = map(lambda x: x.strip(), args)    # remove unnecessary whitespaces
-    argtypelist = map(getNameTypePair, args) # split arg into arg type and arg name
-    if len(argtypelist) == 1:
-        (name, argtype) = argtypelist[0]
-        if argtype == DataType.VOID:
-            return []
-
-    return argtypelist
-
-class ApiCall(object):
-    """An ApiCall models all information about a single OpenGL API"""
-
-    # Regex to match API_ENTRY specification:
-    #       e.g. void API_ENTRY(glActiveTexture)(GLenum texture) {
-    # the regex uses a non greedy match (?) to match the first closing paren
-    API_ENTRY_REGEX = "(.*)API_ENTRY\(.*?\)\((.*?)\)"
-
-    # Regex to match CALL_GL_API specification:
-    #       e.g. CALL_GL_API(glCullFace, mode);
-    #            CALL_GL_API_RETURN(glCreateProgram);
-    CALL_GL_API_REGEX = "CALL_GL_API(_RETURN)?\((.*)\);"
-
-    def __init__(self, prefix, apientry, callsite):
-        """Construct an ApiCall from its specification.
-
-        The specification is provided by the two arguments:
-        prefix: prefix to use for function names
-        defn: specification line containing API_ENTRY macro
-              e.g: void API_ENTRY(glActiveTexture)(GLenum texture) {
-        callsite: specification line containing CALL_GL_API macro
-              e.g: CALL_GL_API(glActiveTexture, texture);
-        """
-        self.prefix = prefix
-        self.ret = self.getReturnType(apientry)
-        self.arglist = self.getArgList(apientry)
-
-        # some functions (e.g. __glEGLImageTargetRenderbufferStorageOES), define their
-        # names one way in the API_ENTRY and another way in the CALL_GL_API macros.
-        # so self.func is reassigned based on what is there in the call site
-        self.func = self.getFunc(callsite)
-        self.callsite = self.getCallSite(callsite)
-
-    def getReturnType(self, apientry):
-        '''Extract the return type from the API_ENTRY specification'''
-        m = re.search(self.API_ENTRY_REGEX, apientry)
-        if not m:
-            raise ValueError("%s does not match API_ENTRY specification %s"
-                             % (apientry, self.API_ENTRY_REGEX))
-
-        return m.group(1).strip()
-
-    def getArgList(self, apientry):
-        '''Extract the argument list from the API_ENTRY specification'''
-        m = re.search(self.API_ENTRY_REGEX, apientry)
-        if not m:
-            raise ValueError("%s does not match API_ENTRY specification %s"
-                             % (apientry, self.API_ENTRY_REGEX))
-
-        return m.group(2).strip()
-
-    def parseCallSite(self, callsite):
-        m = re.search(self.CALL_GL_API_REGEX, callsite)
-        if not m:
-            raise ValueError("%s does not match CALL_GL_API specification (%s)"
-                             % (callsite, self.CALL_GL_API_REGEX))
-
-        arglist = m.group(2)
-        args = arglist.split(',')
-        args = map(lambda x: x.strip(), args)
-
-        return args
-
-    def getCallSite(self, callsite):
-        '''Extract the callsite from the CALL_GL_API specification'''
-        args = self.parseCallSite(callsite)
-        return "%s(%s)" % (args[0], ", ".join(args[1:]))
-
-    def getFunc(self, callsite):
-        '''Extract the function name from the CALL_GL_API specification'''
-        args = self.parseCallSite(callsite)
-        return args[0]
-
-    def genDeclaration(self):
-        return "%s GLTrace_%s(%s);" % (self.ret, self.func, self.arglist)
-
-    def genCode(self):
-        return TRACE_CALL_TEMPLATE(func = self.func,
-                                   retType = self.ret,
-                                   retDataType = getDataTypeFromKw(self.ret),
-                                   inputArgList = self.arglist,
-                                   callsite = self.callsite,
-                                   parsedArgs = parseArgs(self.arglist),
-                                   DataType=DataType)
-
-def getApis(apiEntryFile, prefix):
-    '''Get a list of all ApiCalls in provided specification file'''
-    lines = open(apiEntryFile).readlines()
-
-    apis = []
-    for i in range(0, len(lines)/3):
-        apis.append(ApiCall(prefix, lines[i*3], lines[i*3+1]))
-
-    return apis
-
-def parseAllSpecs(specs):
-    apis = []
-    for name, specfile in specs:
-        a = getApis(specfile, name)
-        print 'Parsed %s APIs from %s, # of entries = %d' % (name, specfile, len(a))
-        apis.extend(a)
-    return apis
-
-def removeDuplicates(apis):
-    '''Remove all duplicate function entries.
-
-    The input list contains functions declared in GL1, GL2, and GL3 APIs.
-    This will return a list that contains only the first function if there are
-    multiple functions with the same name.'''
-    uniqs = []
-    funcs = set()
-    for api in apis:
-        if api.func not in funcs:
-            uniqs.append(api)
-            funcs.add(api.func)
-
-    return uniqs
-
-def genHeaders(apis, fname):
-    lines = []
-    lines.append(HEADER_LICENSE)
-    lines.append(HEADER_NAMESPACE_START)
-    prefix = ""
-    for api in apis:
-        if prefix != api.prefix:
-            lines.append("\n// Declarations for %s APIs\n\n" % api.prefix)
-            prefix = api.prefix
-        lines.append(api.genDeclaration())
-        lines.append("\n")
-    lines.append(FOOTER_TEXT)
-
-    with open(fname, "w") as f:
-        f.writelines(lines)
-
-def genSrcs(apis, fname):
-    lines = []
-    lines.append(HEADER_LICENSE)
-    lines.append(HEADER_INCLUDES)
-    lines.append(HEADER_NAMESPACE_START)
-    prefix = ""
-    for api in apis:
-        if prefix != api.prefix:
-            lines.append("\n// Definitions for %s APIs\n\n" % api.prefix)
-            prefix = api.prefix
-        lines.append(api.genCode())
-        lines.append("\n")
-    lines.append(FOOTER_TEXT)
-
-    with open(fname, "w") as f:
-        f.writelines(lines)
-
-if __name__ == '__main__':
-    apis = parseAllSpecs(API_SPECS)    # read in all the specfiles
-    apis = removeDuplicates(apis)      # remove duplication of functions common to multiple versions
-    genHeaders(apis, 'gltrace_api.h')  # generate header file
-    genSrcs(apis, 'gltrace_api.cpp')   # generate source file
diff --git a/opengl/libs/GLES_trace/tools/testgenapi.py b/opengl/libs/GLES_trace/tools/testgenapi.py
deleted file mode 100644 (file)
index fe14954..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2011 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# USAGE
-#   $ cd GLES_trace/tools
-#   $ python testgenapi.py
-
-import unittest
-from genapi import DataType, ApiCall, getApis, parseArgs
-
-class TestApiCall(unittest.TestCase):
-    def test_parsing(self):
-        apientry = 'void API_ENTRY(glCopyTexSubImage2D)(GLenum target, GLint level, ' \
-                   'GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, ' \
-                   'GLsizei height) {'
-        callsite = 'CALL_GL_API(glCopyTexImage2D, target, level, internalformat, x, y,' \
-                   'width, height, border);'
-
-        api = ApiCall("GL", apientry, callsite)
-        self.assertEqual(api.func, "glCopyTexImage2D")
-        self.assertEqual(api.callsite, 'glCopyTexImage2D(target, level, internalformat, ' \
-                                        'x, y, width, height, border)')
-        self.assertEqual(api.ret, 'void')
-        self.assertEqual(api.arglist, 'GLenum target, GLint level, ' \
-                   'GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, ' \
-                   'GLsizei height')
-
-    def test_num_functions_parsed(self):
-        gl2_apis = getApis('../../GLES2/gl2_api.in', 'GL2')
-        gl2ext_apis = getApis('../../GLES2/gl2ext_api.in', 'GL2Ext')
-        gl_apis = getApis('../../GLES_CM/gl_api.in', "GL1")
-        glext_apis = getApis('../../GLES_CM/glext_api.in', 'GL1Ext')
-
-        self.assertEqual(len(gl2_apis), 142)
-        self.assertEqual(len(gl2ext_apis), 121)
-        self.assertEqual(len(gl_apis), 145)
-        self.assertEqual(len(glext_apis), 140)
-
-    def test_parseArgs(self):
-        args = parseArgs("void")
-        self.assertEqual(len(args), 0)
-
-        args = parseArgs("GLchar a")
-        self.assertEqual(args, [("a", DataType.CHAR)])
-
-        args = parseArgs("GLchar *a")
-        self.assertEqual(args, [("a", DataType.POINTER)])
-
-        args = parseArgs("GLint exponent[16]")
-        self.assertEqual(args, [("exponent", DataType.POINTER)])
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/opengl/libs/glestrace.h b/opengl/libs/glestrace.h
deleted file mode 100644 (file)
index 868b18d..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This file declares the API provided by the glestrace library.
- */
-
-#ifndef _GLES_TRACE_H_
-#define _GLES_TRACE_H_
-
-#include "hooks.h"
-
-namespace android {
-
-/* Hooks to be called by "interesting" EGL functions. */
-void GLTrace_eglCreateContext(int version, EGLContext c);
-void GLTrace_eglMakeCurrent(unsigned version, gl_hooks_t *hooks, EGLContext c);
-void GLTrace_eglReleaseThread();
-void GLTrace_eglSwapBuffers(void*, void*);
-
-/* Start and stop GL Tracing. */
-int GLTrace_start();
-void GLTrace_stop();
-
-/* Obtain the gl_hooks structure filled with the trace implementation for all GL functions. */
-gl_hooks_t *GLTrace_getGLHooks();
-
-};
-
-#endif
index a4a1958..feef318 100755 (executable)
@@ -40,8 +40,6 @@ cat /tmp/gl_entries.in \
         | awk -F, '!_[$2]++' \
             > ../entries.in
 
-./gltracegen ../entries.in >../trace.in
-
 cat ../../include/GLES/gl.h \
     ../../include/GLES/glext.h \
     ../../include/GLES2/gl2ext.h \
diff --git a/opengl/libs/tools/gltracegen b/opengl/libs/tools/gltracegen
deleted file mode 100755 (executable)
index da42653..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#! /usr/bin/perl
-#
-# Copyright (C) 2010 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-
-sub rtrim($)
-{
-    my $string = shift;
-    $string =~ s/\s+$//;
-    return $string;
-}
-
-while (my $line = <>) {
-  next if $line =~ /^\//;
-  next if $line =~ /^#/;
-  next if $line =~ /^\s*$/;
-  if ($line !~ /^GL_ENTRY\(([^,]+), ([^,]+), ([^\)]+)\)/) {
-    next;
-  }
-  my $type = $1;
-  my $name = $2;
-  my $args = $3;
-  
-  my @args = split ',', $args;
-  my $len = scalar(@args);
-  my $nonVoidArgLen = 0;
-  for (my $num = 0; $num < $len; $num++) {
-    if ($args[$num] ne "void") {
-      $nonVoidArgLen++;
-    }
-  }
-  if ($type eq "void") {
-    printf("TRACE_GL_VOID(");
-  } else {
-    printf("TRACE_GL(%s, ", $type);
-  }
-  
-  printf("%s, (%s), (", $name, $args);
-    for (my $num = 0; $num < $len; $num++) {
-    if ($args[$num] ne "void") {
-      if ($num > 0) {
-        print ", ";
-      }
-      #
-      # extract the name from the parameter
-      # type name
-      # const type *name
-      # type *name
-      # type name[4]
-      #
-      if ($args[$num] =~ /(\S+\s)+\**\s*([\w]+)/) {
-        printf("%s", $2);
-      }
-    }
-  }
-  printf("), %d", $nonVoidArgLen);
-  for (my $num = 0; $num < $len; $num++) {
-    if ($args[$num] ne "void") {
-      #
-      # extract the name from the parameter
-      # type name
-      # const type *name
-      # type *name
-      # type name[4]
-      #
-      my $arg = $args[$num];
-      if ($arg =~ /(\S+\s)+\**\s*([\w]+)/) {
-        my $name = $2;
-        if ($arg =~ /((const )*(\S+\s)+\**)\s*([\w]+)/) {
-          my $type = rtrim($1);
-          printf(", \"%s\", %s", $type, $name);
-        }
-      }
-    }
-  }
-  printf(")\n");
-}
-
-
-
-
-
diff --git a/opengl/libs/trace.in b/opengl/libs/trace.in
deleted file mode 100644 (file)
index 4375a94..0000000
+++ /dev/null
@@ -1,732 +0,0 @@
-TRACE_GL_VOID(glActiveShaderProgram, (GLuint pipeline, GLuint program), (pipeline, program), 2, "GLuint", pipeline, "GLuint", program)
-TRACE_GL_VOID(glActiveShaderProgramEXT, (GLuint pipeline, GLuint program), (pipeline, program), 2, "GLuint", pipeline, "GLuint", program)
-TRACE_GL_VOID(glActiveTexture, (GLenum texture), (texture), 1, "GLenum", texture)
-TRACE_GL_VOID(glAlphaFunc, (GLenum func, GLfloat ref), (func, ref), 2, "GLenum", func, "GLfloat", ref)
-TRACE_GL_VOID(glAlphaFuncQCOM, (GLenum func, GLclampf ref), (func, ref), 2, "GLenum", func, "GLclampf", ref)
-TRACE_GL_VOID(glAlphaFuncx, (GLenum func, GLfixed ref), (func, ref), 2, "GLenum", func, "GLfixed", ref)
-TRACE_GL_VOID(glAlphaFuncxOES, (GLenum func, GLfixed ref), (func, ref), 2, "GLenum", func, "GLfixed", ref)
-TRACE_GL_VOID(glAttachShader, (GLuint program, GLuint shader), (program, shader), 2, "GLuint", program, "GLuint", shader)
-TRACE_GL_VOID(glBeginPerfMonitorAMD, (GLuint monitor), (monitor), 1, "GLuint", monitor)
-TRACE_GL_VOID(glBeginPerfQueryINTEL, (GLuint queryHandle), (queryHandle), 1, "GLuint", queryHandle)
-TRACE_GL_VOID(glBeginQuery, (GLenum target, GLuint id), (target, id), 2, "GLenum", target, "GLuint", id)
-TRACE_GL_VOID(glBeginQueryEXT, (GLenum target, GLuint id), (target, id), 2, "GLenum", target, "GLuint", id)
-TRACE_GL_VOID(glBeginTransformFeedback, (GLenum primitiveMode), (primitiveMode), 1, "GLenum", primitiveMode)
-TRACE_GL_VOID(glBindAttribLocation, (GLuint program, GLuint index, const GLchar * name), (program, index, name), 3, "GLuint", program, "GLuint", index, "const GLchar *", name)
-TRACE_GL_VOID(glBindBuffer, (GLenum target, GLuint buffer), (target, buffer), 2, "GLenum", target, "GLuint", buffer)
-TRACE_GL_VOID(glBindBufferBase, (GLenum target, GLuint index, GLuint buffer), (target, index, buffer), 3, "GLenum", target, "GLuint", index, "GLuint", buffer)
-TRACE_GL_VOID(glBindBufferRange, (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size), (target, index, buffer, offset, size), 5, "GLenum", target, "GLuint", index, "GLuint", buffer, "GLintptr", offset, "GLsizeiptr", size)
-TRACE_GL_VOID(glBindFramebuffer, (GLenum target, GLuint framebuffer), (target, framebuffer), 2, "GLenum", target, "GLuint", framebuffer)
-TRACE_GL_VOID(glBindFramebufferOES, (GLenum target, GLuint framebuffer), (target, framebuffer), 2, "GLenum", target, "GLuint", framebuffer)
-TRACE_GL_VOID(glBindImageTexture, (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), (unit, texture, level, layered, layer, access, format), 7, "GLuint", unit, "GLuint", texture, "GLint", level, "GLboolean", layered, "GLint", layer, "GLenum", access, "GLenum", format)
-TRACE_GL_VOID(glBindProgramPipeline, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
-TRACE_GL_VOID(glBindProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
-TRACE_GL_VOID(glBindRenderbuffer, (GLenum target, GLuint renderbuffer), (target, renderbuffer), 2, "GLenum", target, "GLuint", renderbuffer)
-TRACE_GL_VOID(glBindRenderbufferOES, (GLenum target, GLuint renderbuffer), (target, renderbuffer), 2, "GLenum", target, "GLuint", renderbuffer)
-TRACE_GL_VOID(glBindSampler, (GLuint unit, GLuint sampler), (unit, sampler), 2, "GLuint", unit, "GLuint", sampler)
-TRACE_GL_VOID(glBindTexture, (GLenum target, GLuint texture), (target, texture), 2, "GLenum", target, "GLuint", texture)
-TRACE_GL_VOID(glBindTransformFeedback, (GLenum target, GLuint id), (target, id), 2, "GLenum", target, "GLuint", id)
-TRACE_GL_VOID(glBindVertexArray, (GLuint array), (array), 1, "GLuint", array)
-TRACE_GL_VOID(glBindVertexArrayOES, (GLuint array), (array), 1, "GLuint", array)
-TRACE_GL_VOID(glBindVertexBuffer, (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride), (bindingindex, buffer, offset, stride), 4, "GLuint", bindingindex, "GLuint", buffer, "GLintptr", offset, "GLsizei", stride)
-TRACE_GL_VOID(glBlendBarrierKHR, (void), (), 0)
-TRACE_GL_VOID(glBlendBarrierNV, (void), (), 0)
-TRACE_GL_VOID(glBlendColor, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), (red, green, blue, alpha), 4, "GLfloat", red, "GLfloat", green, "GLfloat", blue, "GLfloat", alpha)
-TRACE_GL_VOID(glBlendEquation, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glBlendEquationOES, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glBlendEquationSeparate, (GLenum modeRGB, GLenum modeAlpha), (modeRGB, modeAlpha), 2, "GLenum", modeRGB, "GLenum", modeAlpha)
-TRACE_GL_VOID(glBlendEquationSeparateOES, (GLenum modeRGB, GLenum modeAlpha), (modeRGB, modeAlpha), 2, "GLenum", modeRGB, "GLenum", modeAlpha)
-TRACE_GL_VOID(glBlendEquationSeparateiEXT, (GLuint buf, GLenum modeRGB, GLenum modeAlpha), (buf, modeRGB, modeAlpha), 3, "GLuint", buf, "GLenum", modeRGB, "GLenum", modeAlpha)
-TRACE_GL_VOID(glBlendEquationiEXT, (GLuint buf, GLenum mode), (buf, mode), 2, "GLuint", buf, "GLenum", mode)
-TRACE_GL_VOID(glBlendFunc, (GLenum sfactor, GLenum dfactor), (sfactor, dfactor), 2, "GLenum", sfactor, "GLenum", dfactor)
-TRACE_GL_VOID(glBlendFuncSeparate, (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha), (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), 4, "GLenum", sfactorRGB, "GLenum", dfactorRGB, "GLenum", sfactorAlpha, "GLenum", dfactorAlpha)
-TRACE_GL_VOID(glBlendFuncSeparateOES, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha), 4, "GLenum", srcRGB, "GLenum", dstRGB, "GLenum", srcAlpha, "GLenum", dstAlpha)
-TRACE_GL_VOID(glBlendFuncSeparateiEXT, (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (buf, srcRGB, dstRGB, srcAlpha, dstAlpha), 5, "GLuint", buf, "GLenum", srcRGB, "GLenum", dstRGB, "GLenum", srcAlpha, "GLenum", dstAlpha)
-TRACE_GL_VOID(glBlendFunciEXT, (GLuint buf, GLenum src, GLenum dst), (buf, src, dst), 3, "GLuint", buf, "GLenum", src, "GLenum", dst)
-TRACE_GL_VOID(glBlendParameteriNV, (GLenum pname, GLint value), (pname, value), 2, "GLenum", pname, "GLint", value)
-TRACE_GL_VOID(glBlitFramebuffer, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter), (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), 10, "GLint", srcX0, "GLint", srcY0, "GLint", srcX1, "GLint", srcY1, "GLint", dstX0, "GLint", dstY0, "GLint", dstX1, "GLint", dstY1, "GLbitfield", mask, "GLenum", filter)
-TRACE_GL_VOID(glBlitFramebufferANGLE, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter), (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), 10, "GLint", srcX0, "GLint", srcY0, "GLint", srcX1, "GLint", srcY1, "GLint", dstX0, "GLint", dstY0, "GLint", dstX1, "GLint", dstY1, "GLbitfield", mask, "GLenum", filter)
-TRACE_GL_VOID(glBlitFramebufferNV, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter), (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), 10, "GLint", srcX0, "GLint", srcY0, "GLint", srcX1, "GLint", srcY1, "GLint", dstX0, "GLint", dstY0, "GLint", dstX1, "GLint", dstY1, "GLbitfield", mask, "GLenum", filter)
-TRACE_GL_VOID(glBufferData, (GLenum target, GLsizeiptr size, const void * data, GLenum usage), (target, size, data, usage), 4, "GLenum", target, "GLsizeiptr", size, "const void *", data, "GLenum", usage)
-TRACE_GL_VOID(glBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, const void * data), (target, offset, size, data), 4, "GLenum", target, "GLintptr", offset, "GLsizeiptr", size, "const void *", data)
-TRACE_GL(GLenum, glCheckFramebufferStatus, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL(GLenum, glCheckFramebufferStatusOES, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glClear, (GLbitfield mask), (mask), 1, "GLbitfield", mask)
-TRACE_GL_VOID(glClearBufferfi, (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil), (buffer, drawbuffer, depth, stencil), 4, "GLenum", buffer, "GLint", drawbuffer, "GLfloat", depth, "GLint", stencil)
-TRACE_GL_VOID(glClearBufferfv, (GLenum buffer, GLint drawbuffer, const GLfloat * value), (buffer, drawbuffer, value), 3, "GLenum", buffer, "GLint", drawbuffer, "const GLfloat *", value)
-TRACE_GL_VOID(glClearBufferiv, (GLenum buffer, GLint drawbuffer, const GLint * value), (buffer, drawbuffer, value), 3, "GLenum", buffer, "GLint", drawbuffer, "const GLint *", value)
-TRACE_GL_VOID(glClearBufferuiv, (GLenum buffer, GLint drawbuffer, const GLuint * value), (buffer, drawbuffer, value), 3, "GLenum", buffer, "GLint", drawbuffer, "const GLuint *", value)
-TRACE_GL_VOID(glClearColor, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), (red, green, blue, alpha), 4, "GLfloat", red, "GLfloat", green, "GLfloat", blue, "GLfloat", alpha)
-TRACE_GL_VOID(glClearColorx, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha), (red, green, blue, alpha), 4, "GLfixed", red, "GLfixed", green, "GLfixed", blue, "GLfixed", alpha)
-TRACE_GL_VOID(glClearColorxOES, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha), (red, green, blue, alpha), 4, "GLfixed", red, "GLfixed", green, "GLfixed", blue, "GLfixed", alpha)
-TRACE_GL_VOID(glClearDepthf, (GLfloat d), (d), 1, "GLfloat", d)
-TRACE_GL_VOID(glClearDepthfOES, (GLclampf depth), (depth), 1, "GLclampf", depth)
-TRACE_GL_VOID(glClearDepthx, (GLfixed depth), (depth), 1, "GLfixed", depth)
-TRACE_GL_VOID(glClearDepthxOES, (GLfixed depth), (depth), 1, "GLfixed", depth)
-TRACE_GL_VOID(glClearStencil, (GLint s), (s), 1, "GLint", s)
-TRACE_GL_VOID(glClientActiveTexture, (GLenum texture), (texture), 1, "GLenum", texture)
-TRACE_GL(GLenum, glClientWaitSync, (GLsync sync, GLbitfield flags, GLuint64 timeout), (sync, flags, timeout), 3, "GLsync", sync, "GLbitfield", flags, "GLuint64", timeout)
-TRACE_GL(GLenum, glClientWaitSyncAPPLE, (GLsync sync, GLbitfield flags, GLuint64 timeout), (sync, flags, timeout), 3, "GLsync", sync, "GLbitfield", flags, "GLuint64", timeout)
-TRACE_GL_VOID(glClipPlanef, (GLenum p, const GLfloat * eqn), (p, eqn), 2, "GLenum", p, "const GLfloat *", eqn)
-TRACE_GL_VOID(glClipPlanefIMG, (GLenum p, const GLfloat * eqn), (p, eqn), 2, "GLenum", p, "const GLfloat *", eqn)
-TRACE_GL_VOID(glClipPlanefOES, (GLenum plane, const GLfloat * equation), (plane, equation), 2, "GLenum", plane, "const GLfloat *", equation)
-TRACE_GL_VOID(glClipPlanex, (GLenum plane, const GLfixed * equation), (plane, equation), 2, "GLenum", plane, "const GLfixed *", equation)
-TRACE_GL_VOID(glClipPlanexIMG, (GLenum p, const GLfixed * eqn), (p, eqn), 2, "GLenum", p, "const GLfixed *", eqn)
-TRACE_GL_VOID(glClipPlanexOES, (GLenum plane, const GLfixed * equation), (plane, equation), 2, "GLenum", plane, "const GLfixed *", equation)
-TRACE_GL_VOID(glColor4f, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), (red, green, blue, alpha), 4, "GLfloat", red, "GLfloat", green, "GLfloat", blue, "GLfloat", alpha)
-TRACE_GL_VOID(glColor4ub, (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha), (red, green, blue, alpha), 4, "GLubyte", red, "GLubyte", green, "GLubyte", blue, "GLubyte", alpha)
-TRACE_GL_VOID(glColor4x, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha), (red, green, blue, alpha), 4, "GLfixed", red, "GLfixed", green, "GLfixed", blue, "GLfixed", alpha)
-TRACE_GL_VOID(glColor4xOES, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha), (red, green, blue, alpha), 4, "GLfixed", red, "GLfixed", green, "GLfixed", blue, "GLfixed", alpha)
-TRACE_GL_VOID(glColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha), (red, green, blue, alpha), 4, "GLboolean", red, "GLboolean", green, "GLboolean", blue, "GLboolean", alpha)
-TRACE_GL_VOID(glColorMaskiEXT, (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a), (index, r, g, b, a), 5, "GLuint", index, "GLboolean", r, "GLboolean", g, "GLboolean", b, "GLboolean", a)
-TRACE_GL_VOID(glColorPointer, (GLint size, GLenum type, GLsizei stride, const void * pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const void *", pointer)
-TRACE_GL_VOID(glCompileShader, (GLuint shader), (shader), 1, "GLuint", shader)
-TRACE_GL_VOID(glCompressedTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data), (target, level, internalformat, width, height, border, imageSize, data), 8, "GLenum", target, "GLint", level, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLint", border, "GLsizei", imageSize, "const void *", data)
-TRACE_GL_VOID(glCompressedTexImage3D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data), (target, level, internalformat, width, height, depth, border, imageSize, data), 9, "GLenum", target, "GLint", level, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLint", border, "GLsizei", imageSize, "const void *", data)
-TRACE_GL_VOID(glCompressedTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data), (target, level, internalformat, width, height, depth, border, imageSize, data), 9, "GLenum", target, "GLint", level, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLint", border, "GLsizei", imageSize, "const void *", data)
-TRACE_GL_VOID(glCompressedTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data), (target, level, xoffset, yoffset, width, height, format, imageSize, data), 9, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLsizei", imageSize, "const void *", data)
-TRACE_GL_VOID(glCompressedTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLsizei", imageSize, "const void *", data)
-TRACE_GL_VOID(glCompressedTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLsizei", imageSize, "const void *", data)
-TRACE_GL_VOID(glCopyBufferSubData, (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size), (readTarget, writeTarget, readOffset, writeOffset, size), 5, "GLenum", readTarget, "GLenum", writeTarget, "GLintptr", readOffset, "GLintptr", writeOffset, "GLsizeiptr", size)
-TRACE_GL_VOID(glCopyBufferSubDataNV, (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size), (readTarget, writeTarget, readOffset, writeOffset, size), 5, "GLenum", readTarget, "GLenum", writeTarget, "GLintptr", readOffset, "GLintptr", writeOffset, "GLsizeiptr", size)
-TRACE_GL_VOID(glCopyImageSubDataEXT, (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth), (srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth), 15, "GLuint", srcName, "GLenum", srcTarget, "GLint", srcLevel, "GLint", srcX, "GLint", srcY, "GLint", srcZ, "GLuint", dstName, "GLenum", dstTarget, "GLint", dstLevel, "GLint", dstX, "GLint", dstY, "GLint", dstZ, "GLsizei", srcWidth, "GLsizei", srcHeight, "GLsizei", srcDepth)
-TRACE_GL_VOID(glCopyTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border), (target, level, internalformat, x, y, width, height, border), 8, "GLenum", target, "GLint", level, "GLenum", internalformat, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height, "GLint", border)
-TRACE_GL_VOID(glCopyTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target, level, xoffset, yoffset, x, y, width, height), 8, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glCopyTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target, level, xoffset, yoffset, zoffset, x, y, width, height), 9, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glCopyTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target, level, xoffset, yoffset, zoffset, x, y, width, height), 9, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glCopyTextureLevelsAPPLE, (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount), (destinationTexture, sourceTexture, sourceBaseLevel, sourceLevelCount), 4, "GLuint", destinationTexture, "GLuint", sourceTexture, "GLint", sourceBaseLevel, "GLsizei", sourceLevelCount)
-TRACE_GL_VOID(glCoverageMaskNV, (GLboolean mask), (mask), 1, "GLboolean", mask)
-TRACE_GL_VOID(glCoverageOperationNV, (GLenum operation), (operation), 1, "GLenum", operation)
-TRACE_GL_VOID(glCreatePerfQueryINTEL, (GLuint queryId, GLuint * queryHandle), (queryId, queryHandle), 2, "GLuint", queryId, "GLuint *", queryHandle)
-TRACE_GL(GLuint, glCreateProgram, (void), (), 0)
-TRACE_GL(GLuint, glCreateShader, (GLenum type), (type), 1, "GLenum", type)
-TRACE_GL(GLuint, glCreateShaderProgramv, (GLenum type, GLsizei count, const GLchar *const* strings), (type, count, strings), 3, "GLenum", type, "GLsizei", count, "const GLchar *const*", strings)
-TRACE_GL(GLuint, glCreateShaderProgramvEXT, (GLenum type, GLsizei count, const GLchar ** strings), (type, count, strings), 3, "GLenum", type, "GLsizei", count, "const GLchar **", strings)
-TRACE_GL_VOID(glCullFace, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glCurrentPaletteMatrixOES, (GLuint matrixpaletteindex), (matrixpaletteindex), 1, "GLuint", matrixpaletteindex)
-TRACE_GL_VOID(glDebugMessageCallbackKHR, (GLDEBUGPROCKHR callback, const void * userParam), (callback, userParam), 2, "GLDEBUGPROCKHR", callback, "const void *", userParam)
-TRACE_GL_VOID(glDebugMessageControlKHR, (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled), (source, type, severity, count, ids, enabled), 6, "GLenum", source, "GLenum", type, "GLenum", severity, "GLsizei", count, "const GLuint *", ids, "GLboolean", enabled)
-TRACE_GL_VOID(glDebugMessageInsertKHR, (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf), (source, type, id, severity, length, buf), 6, "GLenum", source, "GLenum", type, "GLuint", id, "GLenum", severity, "GLsizei", length, "const GLchar *", buf)
-TRACE_GL_VOID(glDeleteBuffers, (GLsizei n, const GLuint * buffers), (n, buffers), 2, "GLsizei", n, "const GLuint *", buffers)
-TRACE_GL_VOID(glDeleteFencesNV, (GLsizei n, const GLuint * fences), (n, fences), 2, "GLsizei", n, "const GLuint *", fences)
-TRACE_GL_VOID(glDeleteFramebuffers, (GLsizei n, const GLuint * framebuffers), (n, framebuffers), 2, "GLsizei", n, "const GLuint *", framebuffers)
-TRACE_GL_VOID(glDeleteFramebuffersOES, (GLsizei n, const GLuint * framebuffers), (n, framebuffers), 2, "GLsizei", n, "const GLuint *", framebuffers)
-TRACE_GL_VOID(glDeletePerfMonitorsAMD, (GLsizei n, GLuint * monitors), (n, monitors), 2, "GLsizei", n, "GLuint *", monitors)
-TRACE_GL_VOID(glDeletePerfQueryINTEL, (GLuint queryHandle), (queryHandle), 1, "GLuint", queryHandle)
-TRACE_GL_VOID(glDeleteProgram, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL_VOID(glDeleteProgramPipelines, (GLsizei n, const GLuint * pipelines), (n, pipelines), 2, "GLsizei", n, "const GLuint *", pipelines)
-TRACE_GL_VOID(glDeleteProgramPipelinesEXT, (GLsizei n, const GLuint * pipelines), (n, pipelines), 2, "GLsizei", n, "const GLuint *", pipelines)
-TRACE_GL_VOID(glDeleteQueries, (GLsizei n, const GLuint * ids), (n, ids), 2, "GLsizei", n, "const GLuint *", ids)
-TRACE_GL_VOID(glDeleteQueriesEXT, (GLsizei n, const GLuint * ids), (n, ids), 2, "GLsizei", n, "const GLuint *", ids)
-TRACE_GL_VOID(glDeleteRenderbuffers, (GLsizei n, const GLuint * renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "const GLuint *", renderbuffers)
-TRACE_GL_VOID(glDeleteRenderbuffersOES, (GLsizei n, const GLuint * renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "const GLuint *", renderbuffers)
-TRACE_GL_VOID(glDeleteSamplers, (GLsizei count, const GLuint * samplers), (count, samplers), 2, "GLsizei", count, "const GLuint *", samplers)
-TRACE_GL_VOID(glDeleteShader, (GLuint shader), (shader), 1, "GLuint", shader)
-TRACE_GL_VOID(glDeleteSync, (GLsync sync), (sync), 1, "GLsync", sync)
-TRACE_GL_VOID(glDeleteSyncAPPLE, (GLsync sync), (sync), 1, "GLsync", sync)
-TRACE_GL_VOID(glDeleteTextures, (GLsizei n, const GLuint * textures), (n, textures), 2, "GLsizei", n, "const GLuint *", textures)
-TRACE_GL_VOID(glDeleteTransformFeedbacks, (GLsizei n, const GLuint * ids), (n, ids), 2, "GLsizei", n, "const GLuint *", ids)
-TRACE_GL_VOID(glDeleteVertexArrays, (GLsizei n, const GLuint * arrays), (n, arrays), 2, "GLsizei", n, "const GLuint *", arrays)
-TRACE_GL_VOID(glDeleteVertexArraysOES, (GLsizei n, const GLuint * arrays), (n, arrays), 2, "GLsizei", n, "const GLuint *", arrays)
-TRACE_GL_VOID(glDepthFunc, (GLenum func), (func), 1, "GLenum", func)
-TRACE_GL_VOID(glDepthMask, (GLboolean flag), (flag), 1, "GLboolean", flag)
-TRACE_GL_VOID(glDepthRangef, (GLfloat n, GLfloat f), (n, f), 2, "GLfloat", n, "GLfloat", f)
-TRACE_GL_VOID(glDepthRangefOES, (GLclampf n, GLclampf f), (n, f), 2, "GLclampf", n, "GLclampf", f)
-TRACE_GL_VOID(glDepthRangex, (GLfixed n, GLfixed f), (n, f), 2, "GLfixed", n, "GLfixed", f)
-TRACE_GL_VOID(glDepthRangexOES, (GLfixed n, GLfixed f), (n, f), 2, "GLfixed", n, "GLfixed", f)
-TRACE_GL_VOID(glDetachShader, (GLuint program, GLuint shader), (program, shader), 2, "GLuint", program, "GLuint", shader)
-TRACE_GL_VOID(glDisable, (GLenum cap), (cap), 1, "GLenum", cap)
-TRACE_GL_VOID(glDisableClientState, (GLenum array), (array), 1, "GLenum", array)
-TRACE_GL_VOID(glDisableDriverControlQCOM, (GLuint driverControl), (driverControl), 1, "GLuint", driverControl)
-TRACE_GL_VOID(glDisableVertexAttribArray, (GLuint index), (index), 1, "GLuint", index)
-TRACE_GL_VOID(glDisableiEXT, (GLenum target, GLuint index), (target, index), 2, "GLenum", target, "GLuint", index)
-TRACE_GL_VOID(glDiscardFramebufferEXT, (GLenum target, GLsizei numAttachments, const GLenum * attachments), (target, numAttachments, attachments), 3, "GLenum", target, "GLsizei", numAttachments, "const GLenum *", attachments)
-TRACE_GL_VOID(glDispatchCompute, (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z), (num_groups_x, num_groups_y, num_groups_z), 3, "GLuint", num_groups_x, "GLuint", num_groups_y, "GLuint", num_groups_z)
-TRACE_GL_VOID(glDispatchComputeIndirect, (GLintptr indirect), (indirect), 1, "GLintptr", indirect)
-TRACE_GL_VOID(glDrawArrays, (GLenum mode, GLint first, GLsizei count), (mode, first, count), 3, "GLenum", mode, "GLint", first, "GLsizei", count)
-TRACE_GL_VOID(glDrawArraysIndirect, (GLenum mode, const void * indirect), (mode, indirect), 2, "GLenum", mode, "const void *", indirect)
-TRACE_GL_VOID(glDrawArraysInstanced, (GLenum mode, GLint first, GLsizei count, GLsizei instancecount), (mode, first, count, instancecount), 4, "GLenum", mode, "GLint", first, "GLsizei", count, "GLsizei", instancecount)
-TRACE_GL_VOID(glDrawArraysInstancedANGLE, (GLenum mode, GLint first, GLsizei count, GLsizei primcount), (mode, first, count, primcount), 4, "GLenum", mode, "GLint", first, "GLsizei", count, "GLsizei", primcount)
-TRACE_GL_VOID(glDrawArraysInstancedEXT, (GLenum mode, GLint start, GLsizei count, GLsizei primcount), (mode, start, count, primcount), 4, "GLenum", mode, "GLint", start, "GLsizei", count, "GLsizei", primcount)
-TRACE_GL_VOID(glDrawArraysInstancedNV, (GLenum mode, GLint first, GLsizei count, GLsizei primcount), (mode, first, count, primcount), 4, "GLenum", mode, "GLint", first, "GLsizei", count, "GLsizei", primcount)
-TRACE_GL_VOID(glDrawBuffers, (GLsizei n, const GLenum * bufs), (n, bufs), 2, "GLsizei", n, "const GLenum *", bufs)
-TRACE_GL_VOID(glDrawBuffersEXT, (GLsizei n, const GLenum * bufs), (n, bufs), 2, "GLsizei", n, "const GLenum *", bufs)
-TRACE_GL_VOID(glDrawBuffersIndexedEXT, (GLint n, const GLenum * location, const GLint * indices), (n, location, indices), 3, "GLint", n, "const GLenum *", location, "const GLint *", indices)
-TRACE_GL_VOID(glDrawBuffersNV, (GLsizei n, const GLenum * bufs), (n, bufs), 2, "GLsizei", n, "const GLenum *", bufs)
-TRACE_GL_VOID(glDrawElements, (GLenum mode, GLsizei count, GLenum type, const void * indices), (mode, count, type, indices), 4, "GLenum", mode, "GLsizei", count, "GLenum", type, "const void *", indices)
-TRACE_GL_VOID(glDrawElementsIndirect, (GLenum mode, GLenum type, const void * indirect), (mode, type, indirect), 3, "GLenum", mode, "GLenum", type, "const void *", indirect)
-TRACE_GL_VOID(glDrawElementsInstanced, (GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount), (mode, count, type, indices, instancecount), 5, "GLenum", mode, "GLsizei", count, "GLenum", type, "const void *", indices, "GLsizei", instancecount)
-TRACE_GL_VOID(glDrawElementsInstancedANGLE, (GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount), (mode, count, type, indices, primcount), 5, "GLenum", mode, "GLsizei", count, "GLenum", type, "const void *", indices, "GLsizei", primcount)
-TRACE_GL_VOID(glDrawElementsInstancedEXT, (GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount), (mode, count, type, indices, primcount), 5, "GLenum", mode, "GLsizei", count, "GLenum", type, "const void *", indices, "GLsizei", primcount)
-TRACE_GL_VOID(glDrawElementsInstancedNV, (GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount), (mode, count, type, indices, primcount), 5, "GLenum", mode, "GLsizei", count, "GLenum", type, "const void *", indices, "GLsizei", primcount)
-TRACE_GL_VOID(glDrawRangeElements, (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices), (mode, start, end, count, type, indices), 6, "GLenum", mode, "GLuint", start, "GLuint", end, "GLsizei", count, "GLenum", type, "const void *", indices)
-TRACE_GL_VOID(glDrawTexfOES, (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height), (x, y, z, width, height), 5, "GLfloat", x, "GLfloat", y, "GLfloat", z, "GLfloat", width, "GLfloat", height)
-TRACE_GL_VOID(glDrawTexfvOES, (const GLfloat * coords), (coords), 1, "const GLfloat *", coords)
-TRACE_GL_VOID(glDrawTexiOES, (GLint x, GLint y, GLint z, GLint width, GLint height), (x, y, z, width, height), 5, "GLint", x, "GLint", y, "GLint", z, "GLint", width, "GLint", height)
-TRACE_GL_VOID(glDrawTexivOES, (const GLint * coords), (coords), 1, "const GLint *", coords)
-TRACE_GL_VOID(glDrawTexsOES, (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height), (x, y, z, width, height), 5, "GLshort", x, "GLshort", y, "GLshort", z, "GLshort", width, "GLshort", height)
-TRACE_GL_VOID(glDrawTexsvOES, (const GLshort * coords), (coords), 1, "const GLshort *", coords)
-TRACE_GL_VOID(glDrawTexxOES, (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height), (x, y, z, width, height), 5, "GLfixed", x, "GLfixed", y, "GLfixed", z, "GLfixed", width, "GLfixed", height)
-TRACE_GL_VOID(glDrawTexxvOES, (const GLfixed * coords), (coords), 1, "const GLfixed *", coords)
-TRACE_GL_VOID(glEGLImageTargetRenderbufferStorageOES, (GLenum target, GLeglImageOES image), (target, image), 2, "GLenum", target, "GLeglImageOES", image)
-TRACE_GL_VOID(glEGLImageTargetTexture2DOES, (GLenum target, GLeglImageOES image), (target, image), 2, "GLenum", target, "GLeglImageOES", image)
-TRACE_GL_VOID(glEnable, (GLenum cap), (cap), 1, "GLenum", cap)
-TRACE_GL_VOID(glEnableClientState, (GLenum array), (array), 1, "GLenum", array)
-TRACE_GL_VOID(glEnableDriverControlQCOM, (GLuint driverControl), (driverControl), 1, "GLuint", driverControl)
-TRACE_GL_VOID(glEnableVertexAttribArray, (GLuint index), (index), 1, "GLuint", index)
-TRACE_GL_VOID(glEnableiEXT, (GLenum target, GLuint index), (target, index), 2, "GLenum", target, "GLuint", index)
-TRACE_GL_VOID(glEndPerfMonitorAMD, (GLuint monitor), (monitor), 1, "GLuint", monitor)
-TRACE_GL_VOID(glEndPerfQueryINTEL, (GLuint queryHandle), (queryHandle), 1, "GLuint", queryHandle)
-TRACE_GL_VOID(glEndQuery, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glEndQueryEXT, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glEndTilingQCOM, (GLbitfield preserveMask), (preserveMask), 1, "GLbitfield", preserveMask)
-TRACE_GL_VOID(glEndTransformFeedback, (void), (), 0)
-TRACE_GL_VOID(glExtGetBufferPointervQCOM, (GLenum target, void ** params), (target, params), 2, "GLenum", target, "void **", params)
-TRACE_GL_VOID(glExtGetBuffersQCOM, (GLuint * buffers, GLint maxBuffers, GLint * numBuffers), (buffers, maxBuffers, numBuffers), 3, "GLuint *", buffers, "GLint", maxBuffers, "GLint *", numBuffers)
-TRACE_GL_VOID(glExtGetFramebuffersQCOM, (GLuint * framebuffers, GLint maxFramebuffers, GLint * numFramebuffers), (framebuffers, maxFramebuffers, numFramebuffers), 3, "GLuint *", framebuffers, "GLint", maxFramebuffers, "GLint *", numFramebuffers)
-TRACE_GL_VOID(glExtGetProgramBinarySourceQCOM, (GLuint program, GLenum shadertype, GLchar * source, GLint * length), (program, shadertype, source, length), 4, "GLuint", program, "GLenum", shadertype, "GLchar *", source, "GLint *", length)
-TRACE_GL_VOID(glExtGetProgramsQCOM, (GLuint * programs, GLint maxPrograms, GLint * numPrograms), (programs, maxPrograms, numPrograms), 3, "GLuint *", programs, "GLint", maxPrograms, "GLint *", numPrograms)
-TRACE_GL_VOID(glExtGetRenderbuffersQCOM, (GLuint * renderbuffers, GLint maxRenderbuffers, GLint * numRenderbuffers), (renderbuffers, maxRenderbuffers, numRenderbuffers), 3, "GLuint *", renderbuffers, "GLint", maxRenderbuffers, "GLint *", numRenderbuffers)
-TRACE_GL_VOID(glExtGetShadersQCOM, (GLuint * shaders, GLint maxShaders, GLint * numShaders), (shaders, maxShaders, numShaders), 3, "GLuint *", shaders, "GLint", maxShaders, "GLint *", numShaders)
-TRACE_GL_VOID(glExtGetTexLevelParameterivQCOM, (GLuint texture, GLenum face, GLint level, GLenum pname, GLint * params), (texture, face, level, pname, params), 5, "GLuint", texture, "GLenum", face, "GLint", level, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glExtGetTexSubImageQCOM, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void * texels), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLenum", type, "void *", texels)
-TRACE_GL_VOID(glExtGetTexturesQCOM, (GLuint * textures, GLint maxTextures, GLint * numTextures), (textures, maxTextures, numTextures), 3, "GLuint *", textures, "GLint", maxTextures, "GLint *", numTextures)
-TRACE_GL(GLboolean, glExtIsProgramBinaryQCOM, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL_VOID(glExtTexObjectStateOverrideiQCOM, (GLenum target, GLenum pname, GLint param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLint", param)
-TRACE_GL(GLsync, glFenceSync, (GLenum condition, GLbitfield flags), (condition, flags), 2, "GLenum", condition, "GLbitfield", flags)
-TRACE_GL(GLsync, glFenceSyncAPPLE, (GLenum condition, GLbitfield flags), (condition, flags), 2, "GLenum", condition, "GLbitfield", flags)
-TRACE_GL_VOID(glFinish, (void), (), 0)
-TRACE_GL_VOID(glFinishFenceNV, (GLuint fence), (fence), 1, "GLuint", fence)
-TRACE_GL_VOID(glFlush, (void), (), 0)
-TRACE_GL_VOID(glFlushMappedBufferRange, (GLenum target, GLintptr offset, GLsizeiptr length), (target, offset, length), 3, "GLenum", target, "GLintptr", offset, "GLsizeiptr", length)
-TRACE_GL_VOID(glFlushMappedBufferRangeEXT, (GLenum target, GLintptr offset, GLsizeiptr length), (target, offset, length), 3, "GLenum", target, "GLintptr", offset, "GLsizeiptr", length)
-TRACE_GL_VOID(glFogf, (GLenum pname, GLfloat param), (pname, param), 2, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glFogfv, (GLenum pname, const GLfloat * params), (pname, params), 2, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glFogx, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glFogxOES, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glFogxv, (GLenum pname, const GLfixed * param), (pname, param), 2, "GLenum", pname, "const GLfixed *", param)
-TRACE_GL_VOID(glFogxvOES, (GLenum pname, const GLfixed * param), (pname, param), 2, "GLenum", pname, "const GLfixed *", param)
-TRACE_GL_VOID(glFramebufferParameteri, (GLenum target, GLenum pname, GLint param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glFramebufferRenderbuffer, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer), 4, "GLenum", target, "GLenum", attachment, "GLenum", renderbuffertarget, "GLuint", renderbuffer)
-TRACE_GL_VOID(glFramebufferRenderbufferOES, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer), 4, "GLenum", target, "GLenum", attachment, "GLenum", renderbuffertarget, "GLuint", renderbuffer)
-TRACE_GL_VOID(glFramebufferTexture2D, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level), 5, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level)
-TRACE_GL_VOID(glFramebufferTexture2DMultisampleEXT, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples), (target, attachment, textarget, texture, level, samples), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLsizei", samples)
-TRACE_GL_VOID(glFramebufferTexture2DMultisampleIMG, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples), (target, attachment, textarget, texture, level, samples), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLsizei", samples)
-TRACE_GL_VOID(glFramebufferTexture2DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level), 5, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level)
-TRACE_GL_VOID(glFramebufferTexture3DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset), (target, attachment, textarget, texture, level, zoffset), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLint", zoffset)
-TRACE_GL_VOID(glFramebufferTextureEXT, (GLenum target, GLenum attachment, GLuint texture, GLint level), (target, attachment, texture, level), 4, "GLenum", target, "GLenum", attachment, "GLuint", texture, "GLint", level)
-TRACE_GL_VOID(glFramebufferTextureLayer, (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer), (target, attachment, texture, level, layer), 5, "GLenum", target, "GLenum", attachment, "GLuint", texture, "GLint", level, "GLint", layer)
-TRACE_GL_VOID(glFrontFace, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glFrustumf, (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f), (l, r, b, t, n, f), 6, "GLfloat", l, "GLfloat", r, "GLfloat", b, "GLfloat", t, "GLfloat", n, "GLfloat", f)
-TRACE_GL_VOID(glFrustumfOES, (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f), (l, r, b, t, n, f), 6, "GLfloat", l, "GLfloat", r, "GLfloat", b, "GLfloat", t, "GLfloat", n, "GLfloat", f)
-TRACE_GL_VOID(glFrustumx, (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f), (l, r, b, t, n, f), 6, "GLfixed", l, "GLfixed", r, "GLfixed", b, "GLfixed", t, "GLfixed", n, "GLfixed", f)
-TRACE_GL_VOID(glFrustumxOES, (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f), (l, r, b, t, n, f), 6, "GLfixed", l, "GLfixed", r, "GLfixed", b, "GLfixed", t, "GLfixed", n, "GLfixed", f)
-TRACE_GL_VOID(glGenBuffers, (GLsizei n, GLuint * buffers), (n, buffers), 2, "GLsizei", n, "GLuint *", buffers)
-TRACE_GL_VOID(glGenFencesNV, (GLsizei n, GLuint * fences), (n, fences), 2, "GLsizei", n, "GLuint *", fences)
-TRACE_GL_VOID(glGenFramebuffers, (GLsizei n, GLuint * framebuffers), (n, framebuffers), 2, "GLsizei", n, "GLuint *", framebuffers)
-TRACE_GL_VOID(glGenFramebuffersOES, (GLsizei n, GLuint * framebuffers), (n, framebuffers), 2, "GLsizei", n, "GLuint *", framebuffers)
-TRACE_GL_VOID(glGenPerfMonitorsAMD, (GLsizei n, GLuint * monitors), (n, monitors), 2, "GLsizei", n, "GLuint *", monitors)
-TRACE_GL_VOID(glGenProgramPipelines, (GLsizei n, GLuint * pipelines), (n, pipelines), 2, "GLsizei", n, "GLuint *", pipelines)
-TRACE_GL_VOID(glGenProgramPipelinesEXT, (GLsizei n, GLuint * pipelines), (n, pipelines), 2, "GLsizei", n, "GLuint *", pipelines)
-TRACE_GL_VOID(glGenQueries, (GLsizei n, GLuint * ids), (n, ids), 2, "GLsizei", n, "GLuint *", ids)
-TRACE_GL_VOID(glGenQueriesEXT, (GLsizei n, GLuint * ids), (n, ids), 2, "GLsizei", n, "GLuint *", ids)
-TRACE_GL_VOID(glGenRenderbuffers, (GLsizei n, GLuint * renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "GLuint *", renderbuffers)
-TRACE_GL_VOID(glGenRenderbuffersOES, (GLsizei n, GLuint * renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "GLuint *", renderbuffers)
-TRACE_GL_VOID(glGenSamplers, (GLsizei count, GLuint * samplers), (count, samplers), 2, "GLsizei", count, "GLuint *", samplers)
-TRACE_GL_VOID(glGenTextures, (GLsizei n, GLuint * textures), (n, textures), 2, "GLsizei", n, "GLuint *", textures)
-TRACE_GL_VOID(glGenTransformFeedbacks, (GLsizei n, GLuint * ids), (n, ids), 2, "GLsizei", n, "GLuint *", ids)
-TRACE_GL_VOID(glGenVertexArrays, (GLsizei n, GLuint * arrays), (n, arrays), 2, "GLsizei", n, "GLuint *", arrays)
-TRACE_GL_VOID(glGenVertexArraysOES, (GLsizei n, GLuint * arrays), (n, arrays), 2, "GLsizei", n, "GLuint *", arrays)
-TRACE_GL_VOID(glGenerateMipmap, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glGenerateMipmapOES, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glGetActiveAttrib, (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name), (program, index, bufSize, length, size, type, name), 7, "GLuint", program, "GLuint", index, "GLsizei", bufSize, "GLsizei *", length, "GLint *", size, "GLenum *", type, "GLchar *", name)
-TRACE_GL_VOID(glGetActiveUniform, (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name), (program, index, bufSize, length, size, type, name), 7, "GLuint", program, "GLuint", index, "GLsizei", bufSize, "GLsizei *", length, "GLint *", size, "GLenum *", type, "GLchar *", name)
-TRACE_GL_VOID(glGetActiveUniformBlockName, (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName), (program, uniformBlockIndex, bufSize, length, uniformBlockName), 5, "GLuint", program, "GLuint", uniformBlockIndex, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", uniformBlockName)
-TRACE_GL_VOID(glGetActiveUniformBlockiv, (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params), (program, uniformBlockIndex, pname, params), 4, "GLuint", program, "GLuint", uniformBlockIndex, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetActiveUniformsiv, (GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params), (program, uniformCount, uniformIndices, pname, params), 5, "GLuint", program, "GLsizei", uniformCount, "const GLuint *", uniformIndices, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetAttachedShaders, (GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders), (program, maxCount, count, shaders), 4, "GLuint", program, "GLsizei", maxCount, "GLsizei *", count, "GLuint *", shaders)
-TRACE_GL(GLint, glGetAttribLocation, (GLuint program, const GLchar * name), (program, name), 2, "GLuint", program, "const GLchar *", name)
-TRACE_GL_VOID(glGetBooleani_v, (GLenum target, GLuint index, GLboolean * data), (target, index, data), 3, "GLenum", target, "GLuint", index, "GLboolean *", data)
-TRACE_GL_VOID(glGetBooleanv, (GLenum pname, GLboolean * data), (pname, data), 2, "GLenum", pname, "GLboolean *", data)
-TRACE_GL_VOID(glGetBufferParameteri64v, (GLenum target, GLenum pname, GLint64 * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint64 *", params)
-TRACE_GL_VOID(glGetBufferParameteriv, (GLenum target, GLenum pname, GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetBufferPointerv, (GLenum target, GLenum pname, void ** params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "void **", params)
-TRACE_GL_VOID(glGetBufferPointervOES, (GLenum target, GLenum pname, void ** params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "void **", params)
-TRACE_GL_VOID(glGetClipPlanef, (GLenum plane, GLfloat * equation), (plane, equation), 2, "GLenum", plane, "GLfloat *", equation)
-TRACE_GL_VOID(glGetClipPlanefOES, (GLenum plane, GLfloat * equation), (plane, equation), 2, "GLenum", plane, "GLfloat *", equation)
-TRACE_GL_VOID(glGetClipPlanex, (GLenum plane, GLfixed * equation), (plane, equation), 2, "GLenum", plane, "GLfixed *", equation)
-TRACE_GL_VOID(glGetClipPlanexOES, (GLenum plane, GLfixed * equation), (plane, equation), 2, "GLenum", plane, "GLfixed *", equation)
-TRACE_GL(GLuint, glGetDebugMessageLogKHR, (GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog), (count, bufSize, sources, types, ids, severities, lengths, messageLog), 8, "GLuint", count, "GLsizei", bufSize, "GLenum *", sources, "GLenum *", types, "GLuint *", ids, "GLenum *", severities, "GLsizei *", lengths, "GLchar *", messageLog)
-TRACE_GL_VOID(glGetDriverControlStringQCOM, (GLuint driverControl, GLsizei bufSize, GLsizei * length, GLchar * driverControlString), (driverControl, bufSize, length, driverControlString), 4, "GLuint", driverControl, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", driverControlString)
-TRACE_GL_VOID(glGetDriverControlsQCOM, (GLint * num, GLsizei size, GLuint * driverControls), (num, size, driverControls), 3, "GLint *", num, "GLsizei", size, "GLuint *", driverControls)
-TRACE_GL(GLenum, glGetError, (void), (), 0)
-TRACE_GL_VOID(glGetFenceivNV, (GLuint fence, GLenum pname, GLint * params), (fence, pname, params), 3, "GLuint", fence, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetFirstPerfQueryIdINTEL, (GLuint * queryId), (queryId), 1, "GLuint *", queryId)
-TRACE_GL_VOID(glGetFixedv, (GLenum pname, GLfixed * params), (pname, params), 2, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetFixedvOES, (GLenum pname, GLfixed * params), (pname, params), 2, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetFloatv, (GLenum pname, GLfloat * data), (pname, data), 2, "GLenum", pname, "GLfloat *", data)
-TRACE_GL(GLint, glGetFragDataLocation, (GLuint program, const GLchar * name), (program, name), 2, "GLuint", program, "const GLchar *", name)
-TRACE_GL_VOID(glGetFramebufferAttachmentParameteriv, (GLenum target, GLenum attachment, GLenum pname, GLint * params), (target, attachment, pname, params), 4, "GLenum", target, "GLenum", attachment, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetFramebufferAttachmentParameterivOES, (GLenum target, GLenum attachment, GLenum pname, GLint * params), (target, attachment, pname, params), 4, "GLenum", target, "GLenum", attachment, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetFramebufferParameteriv, (GLenum target, GLenum pname, GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL(GLenum, glGetGraphicsResetStatusEXT, (void), (), 0)
-TRACE_GL_VOID(glGetInteger64i_v, (GLenum target, GLuint index, GLint64 * data), (target, index, data), 3, "GLenum", target, "GLuint", index, "GLint64 *", data)
-TRACE_GL_VOID(glGetInteger64v, (GLenum pname, GLint64 * data), (pname, data), 2, "GLenum", pname, "GLint64 *", data)
-TRACE_GL_VOID(glGetInteger64vAPPLE, (GLenum pname, GLint64 * params), (pname, params), 2, "GLenum", pname, "GLint64 *", params)
-TRACE_GL_VOID(glGetIntegeri_v, (GLenum target, GLuint index, GLint * data), (target, index, data), 3, "GLenum", target, "GLuint", index, "GLint *", data)
-TRACE_GL_VOID(glGetIntegeri_vEXT, (GLenum target, GLuint index, GLint * data), (target, index, data), 3, "GLenum", target, "GLuint", index, "GLint *", data)
-TRACE_GL_VOID(glGetIntegerv, (GLenum pname, GLint * data), (pname, data), 2, "GLenum", pname, "GLint *", data)
-TRACE_GL_VOID(glGetInternalformativ, (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint * params), (target, internalformat, pname, bufSize, params), 5, "GLenum", target, "GLenum", internalformat, "GLenum", pname, "GLsizei", bufSize, "GLint *", params)
-TRACE_GL_VOID(glGetLightfv, (GLenum light, GLenum pname, GLfloat * params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetLightxv, (GLenum light, GLenum pname, GLfixed * params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetLightxvOES, (GLenum light, GLenum pname, GLfixed * params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetMaterialfv, (GLenum face, GLenum pname, GLfloat * params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetMaterialxv, (GLenum face, GLenum pname, GLfixed * params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetMaterialxvOES, (GLenum face, GLenum pname, GLfixed * params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetMultisamplefv, (GLenum pname, GLuint index, GLfloat * val), (pname, index, val), 3, "GLenum", pname, "GLuint", index, "GLfloat *", val)
-TRACE_GL_VOID(glGetNextPerfQueryIdINTEL, (GLuint queryId, GLuint * nextQueryId), (queryId, nextQueryId), 2, "GLuint", queryId, "GLuint *", nextQueryId)
-TRACE_GL_VOID(glGetObjectLabelEXT, (GLenum type, GLuint object, GLsizei bufSize, GLsizei * length, GLchar * label), (type, object, bufSize, length, label), 5, "GLenum", type, "GLuint", object, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", label)
-TRACE_GL_VOID(glGetObjectLabelKHR, (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label), (identifier, name, bufSize, length, label), 5, "GLenum", identifier, "GLuint", name, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", label)
-TRACE_GL_VOID(glGetObjectPtrLabelKHR, (const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label), (ptr, bufSize, length, label), 4, "const void *", ptr, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", label)
-TRACE_GL_VOID(glGetPerfCounterInfoINTEL, (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar * counterName, GLuint counterDescLength, GLchar * counterDesc, GLuint * counterOffset, GLuint * counterDataSize, GLuint * counterTypeEnum, GLuint * counterDataTypeEnum, GLuint64 * rawCounterMaxValue), (queryId, counterId, counterNameLength, counterName, counterDescLength, counterDesc, counterOffset, counterDataSize, counterTypeEnum, counterDataTypeEnum, rawCounterMaxValue), 11, "GLuint", queryId, "GLuint", counterId, "GLuint", counterNameLength, "GLchar *", counterName, "GLuint", counterDescLength, "GLchar *", counterDesc, "GLuint *", counterOffset, "GLuint *", counterDataSize, "GLuint *", counterTypeEnum, "GLuint *", counterDataTypeEnum, "GLuint64 *", rawCounterMaxValue)
-TRACE_GL_VOID(glGetPerfMonitorCounterDataAMD, (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint * data, GLint * bytesWritten), (monitor, pname, dataSize, data, bytesWritten), 5, "GLuint", monitor, "GLenum", pname, "GLsizei", dataSize, "GLuint *", data, "GLint *", bytesWritten)
-TRACE_GL_VOID(glGetPerfMonitorCounterInfoAMD, (GLuint group, GLuint counter, GLenum pname, void * data), (group, counter, pname, data), 4, "GLuint", group, "GLuint", counter, "GLenum", pname, "void *", data)
-TRACE_GL_VOID(glGetPerfMonitorCounterStringAMD, (GLuint group, GLuint counter, GLsizei bufSize, GLsizei * length, GLchar * counterString), (group, counter, bufSize, length, counterString), 5, "GLuint", group, "GLuint", counter, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", counterString)
-TRACE_GL_VOID(glGetPerfMonitorCountersAMD, (GLuint group, GLint * numCounters, GLint * maxActiveCounters, GLsizei counterSize, GLuint * counters), (group, numCounters, maxActiveCounters, counterSize, counters), 5, "GLuint", group, "GLint *", numCounters, "GLint *", maxActiveCounters, "GLsizei", counterSize, "GLuint *", counters)
-TRACE_GL_VOID(glGetPerfMonitorGroupStringAMD, (GLuint group, GLsizei bufSize, GLsizei * length, GLchar * groupString), (group, bufSize, length, groupString), 4, "GLuint", group, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", groupString)
-TRACE_GL_VOID(glGetPerfMonitorGroupsAMD, (GLint * numGroups, GLsizei groupsSize, GLuint * groups), (numGroups, groupsSize, groups), 3, "GLint *", numGroups, "GLsizei", groupsSize, "GLuint *", groups)
-TRACE_GL_VOID(glGetPerfQueryDataINTEL, (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid * data, GLuint * bytesWritten), (queryHandle, flags, dataSize, data, bytesWritten), 5, "GLuint", queryHandle, "GLuint", flags, "GLsizei", dataSize, "GLvoid *", data, "GLuint *", bytesWritten)
-TRACE_GL_VOID(glGetPerfQueryIdByNameINTEL, (GLchar * queryName, GLuint * queryId), (queryName, queryId), 2, "GLchar *", queryName, "GLuint *", queryId)
-TRACE_GL_VOID(glGetPerfQueryInfoINTEL, (GLuint queryId, GLuint queryNameLength, GLchar * queryName, GLuint * dataSize, GLuint * noCounters, GLuint * noInstances, GLuint * capsMask), (queryId, queryNameLength, queryName, dataSize, noCounters, noInstances, capsMask), 7, "GLuint", queryId, "GLuint", queryNameLength, "GLchar *", queryName, "GLuint *", dataSize, "GLuint *", noCounters, "GLuint *", noInstances, "GLuint *", capsMask)
-TRACE_GL_VOID(glGetPointerv, (GLenum pname, void ** params), (pname, params), 2, "GLenum", pname, "void **", params)
-TRACE_GL_VOID(glGetPointervKHR, (GLenum pname, void ** params), (pname, params), 2, "GLenum", pname, "void **", params)
-TRACE_GL_VOID(glGetProgramBinary, (GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary), (program, bufSize, length, binaryFormat, binary), 5, "GLuint", program, "GLsizei", bufSize, "GLsizei *", length, "GLenum *", binaryFormat, "void *", binary)
-TRACE_GL_VOID(glGetProgramBinaryOES, (GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary), (program, bufSize, length, binaryFormat, binary), 5, "GLuint", program, "GLsizei", bufSize, "GLsizei *", length, "GLenum *", binaryFormat, "void *", binary)
-TRACE_GL_VOID(glGetProgramInfoLog, (GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog), (program, bufSize, length, infoLog), 4, "GLuint", program, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", infoLog)
-TRACE_GL_VOID(glGetProgramInterfaceiv, (GLuint program, GLenum programInterface, GLenum pname, GLint * params), (program, programInterface, pname, params), 4, "GLuint", program, "GLenum", programInterface, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetProgramPipelineInfoLog, (GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog), (pipeline, bufSize, length, infoLog), 4, "GLuint", pipeline, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", infoLog)
-TRACE_GL_VOID(glGetProgramPipelineInfoLogEXT, (GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog), (pipeline, bufSize, length, infoLog), 4, "GLuint", pipeline, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", infoLog)
-TRACE_GL_VOID(glGetProgramPipelineiv, (GLuint pipeline, GLenum pname, GLint * params), (pipeline, pname, params), 3, "GLuint", pipeline, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetProgramPipelineivEXT, (GLuint pipeline, GLenum pname, GLint * params), (pipeline, pname, params), 3, "GLuint", pipeline, "GLenum", pname, "GLint *", params)
-TRACE_GL(GLuint, glGetProgramResourceIndex, (GLuint program, GLenum programInterface, const GLchar * name), (program, programInterface, name), 3, "GLuint", program, "GLenum", programInterface, "const GLchar *", name)
-TRACE_GL(GLint, glGetProgramResourceLocation, (GLuint program, GLenum programInterface, const GLchar * name), (program, programInterface, name), 3, "GLuint", program, "GLenum", programInterface, "const GLchar *", name)
-TRACE_GL_VOID(glGetProgramResourceName, (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei * length, GLchar * name), (program, programInterface, index, bufSize, length, name), 6, "GLuint", program, "GLenum", programInterface, "GLuint", index, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", name)
-TRACE_GL_VOID(glGetProgramResourceiv, (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params), (program, programInterface, index, propCount, props, bufSize, length, params), 8, "GLuint", program, "GLenum", programInterface, "GLuint", index, "GLsizei", propCount, "const GLenum *", props, "GLsizei", bufSize, "GLsizei *", length, "GLint *", params)
-TRACE_GL_VOID(glGetProgramiv, (GLuint program, GLenum pname, GLint * params), (program, pname, params), 3, "GLuint", program, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetQueryObjecti64vEXT, (GLuint id, GLenum pname, GLint64 * params), (id, pname, params), 3, "GLuint", id, "GLenum", pname, "GLint64 *", params)
-TRACE_GL_VOID(glGetQueryObjectivEXT, (GLuint id, GLenum pname, GLint * params), (id, pname, params), 3, "GLuint", id, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetQueryObjectui64vEXT, (GLuint id, GLenum pname, GLuint64 * params), (id, pname, params), 3, "GLuint", id, "GLenum", pname, "GLuint64 *", params)
-TRACE_GL_VOID(glGetQueryObjectuiv, (GLuint id, GLenum pname, GLuint * params), (id, pname, params), 3, "GLuint", id, "GLenum", pname, "GLuint *", params)
-TRACE_GL_VOID(glGetQueryObjectuivEXT, (GLuint id, GLenum pname, GLuint * params), (id, pname, params), 3, "GLuint", id, "GLenum", pname, "GLuint *", params)
-TRACE_GL_VOID(glGetQueryiv, (GLenum target, GLenum pname, GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetQueryivEXT, (GLenum target, GLenum pname, GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetRenderbufferParameteriv, (GLenum target, GLenum pname, GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetRenderbufferParameterivOES, (GLenum target, GLenum pname, GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetSamplerParameterIivEXT, (GLuint sampler, GLenum pname, GLint * params), (sampler, pname, params), 3, "GLuint", sampler, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetSamplerParameterIuivEXT, (GLuint sampler, GLenum pname, GLuint * params), (sampler, pname, params), 3, "GLuint", sampler, "GLenum", pname, "GLuint *", params)
-TRACE_GL_VOID(glGetSamplerParameterfv, (GLuint sampler, GLenum pname, GLfloat * params), (sampler, pname, params), 3, "GLuint", sampler, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetSamplerParameteriv, (GLuint sampler, GLenum pname, GLint * params), (sampler, pname, params), 3, "GLuint", sampler, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetShaderInfoLog, (GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog), (shader, bufSize, length, infoLog), 4, "GLuint", shader, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", infoLog)
-TRACE_GL_VOID(glGetShaderPrecisionFormat, (GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision), (shadertype, precisiontype, range, precision), 4, "GLenum", shadertype, "GLenum", precisiontype, "GLint *", range, "GLint *", precision)
-TRACE_GL_VOID(glGetShaderSource, (GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source), (shader, bufSize, length, source), 4, "GLuint", shader, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", source)
-TRACE_GL_VOID(glGetShaderiv, (GLuint shader, GLenum pname, GLint * params), (shader, pname, params), 3, "GLuint", shader, "GLenum", pname, "GLint *", params)
-TRACE_GL(const GLubyte *, glGetString, (GLenum name), (name), 1, "GLenum", name)
-TRACE_GL(const GLubyte *, glGetStringi, (GLenum name, GLuint index), (name, index), 2, "GLenum", name, "GLuint", index)
-TRACE_GL_VOID(glGetSynciv, (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values), (sync, pname, bufSize, length, values), 5, "GLsync", sync, "GLenum", pname, "GLsizei", bufSize, "GLsizei *", length, "GLint *", values)
-TRACE_GL_VOID(glGetSyncivAPPLE, (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values), (sync, pname, bufSize, length, values), 5, "GLsync", sync, "GLenum", pname, "GLsizei", bufSize, "GLsizei *", length, "GLint *", values)
-TRACE_GL_VOID(glGetTexEnvfv, (GLenum target, GLenum pname, GLfloat * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetTexEnviv, (GLenum target, GLenum pname, GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetTexEnvxv, (GLenum target, GLenum pname, GLfixed * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexEnvxvOES, (GLenum target, GLenum pname, GLfixed * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexGenfvOES, (GLenum coord, GLenum pname, GLfloat * params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetTexGenivOES, (GLenum coord, GLenum pname, GLint * params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetTexGenxvOES, (GLenum coord, GLenum pname, GLfixed * params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexLevelParameterfv, (GLenum target, GLint level, GLenum pname, GLfloat * params), (target, level, pname, params), 4, "GLenum", target, "GLint", level, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetTexLevelParameteriv, (GLenum target, GLint level, GLenum pname, GLint * params), (target, level, pname, params), 4, "GLenum", target, "GLint", level, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetTexParameterIivEXT, (GLenum target, GLenum pname, GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetTexParameterIuivEXT, (GLenum target, GLenum pname, GLuint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLuint *", params)
-TRACE_GL_VOID(glGetTexParameterfv, (GLenum target, GLenum pname, GLfloat * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetTexParameteriv, (GLenum target, GLenum pname, GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetTexParameterxv, (GLenum target, GLenum pname, GLfixed * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTexParameterxvOES, (GLenum target, GLenum pname, GLfixed * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLfixed *", params)
-TRACE_GL_VOID(glGetTransformFeedbackVarying, (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name), (program, index, bufSize, length, size, type, name), 7, "GLuint", program, "GLuint", index, "GLsizei", bufSize, "GLsizei *", length, "GLsizei *", size, "GLenum *", type, "GLchar *", name)
-TRACE_GL_VOID(glGetTranslatedShaderSourceANGLE, (GLuint shader, GLsizei bufsize, GLsizei * length, GLchar * source), (shader, bufsize, length, source), 4, "GLuint", shader, "GLsizei", bufsize, "GLsizei *", length, "GLchar *", source)
-TRACE_GL(GLuint, glGetUniformBlockIndex, (GLuint program, const GLchar * uniformBlockName), (program, uniformBlockName), 2, "GLuint", program, "const GLchar *", uniformBlockName)
-TRACE_GL_VOID(glGetUniformIndices, (GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices), (program, uniformCount, uniformNames, uniformIndices), 4, "GLuint", program, "GLsizei", uniformCount, "const GLchar *const*", uniformNames, "GLuint *", uniformIndices)
-TRACE_GL(GLint, glGetUniformLocation, (GLuint program, const GLchar * name), (program, name), 2, "GLuint", program, "const GLchar *", name)
-TRACE_GL_VOID(glGetUniformfv, (GLuint program, GLint location, GLfloat * params), (program, location, params), 3, "GLuint", program, "GLint", location, "GLfloat *", params)
-TRACE_GL_VOID(glGetUniformiv, (GLuint program, GLint location, GLint * params), (program, location, params), 3, "GLuint", program, "GLint", location, "GLint *", params)
-TRACE_GL_VOID(glGetUniformuiv, (GLuint program, GLint location, GLuint * params), (program, location, params), 3, "GLuint", program, "GLint", location, "GLuint *", params)
-TRACE_GL_VOID(glGetVertexAttribIiv, (GLuint index, GLenum pname, GLint * params), (index, pname, params), 3, "GLuint", index, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetVertexAttribIuiv, (GLuint index, GLenum pname, GLuint * params), (index, pname, params), 3, "GLuint", index, "GLenum", pname, "GLuint *", params)
-TRACE_GL_VOID(glGetVertexAttribPointerv, (GLuint index, GLenum pname, void ** pointer), (index, pname, pointer), 3, "GLuint", index, "GLenum", pname, "void **", pointer)
-TRACE_GL_VOID(glGetVertexAttribfv, (GLuint index, GLenum pname, GLfloat * params), (index, pname, params), 3, "GLuint", index, "GLenum", pname, "GLfloat *", params)
-TRACE_GL_VOID(glGetVertexAttribiv, (GLuint index, GLenum pname, GLint * params), (index, pname, params), 3, "GLuint", index, "GLenum", pname, "GLint *", params)
-TRACE_GL_VOID(glGetnUniformfvEXT, (GLuint program, GLint location, GLsizei bufSize, GLfloat * params), (program, location, bufSize, params), 4, "GLuint", program, "GLint", location, "GLsizei", bufSize, "GLfloat *", params)
-TRACE_GL_VOID(glGetnUniformivEXT, (GLuint program, GLint location, GLsizei bufSize, GLint * params), (program, location, bufSize, params), 4, "GLuint", program, "GLint", location, "GLsizei", bufSize, "GLint *", params)
-TRACE_GL_VOID(glHint, (GLenum target, GLenum mode), (target, mode), 2, "GLenum", target, "GLenum", mode)
-TRACE_GL_VOID(glInsertEventMarkerEXT, (GLsizei length, const GLchar * marker), (length, marker), 2, "GLsizei", length, "const GLchar *", marker)
-TRACE_GL_VOID(glInvalidateFramebuffer, (GLenum target, GLsizei numAttachments, const GLenum * attachments), (target, numAttachments, attachments), 3, "GLenum", target, "GLsizei", numAttachments, "const GLenum *", attachments)
-TRACE_GL_VOID(glInvalidateSubFramebuffer, (GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height), (target, numAttachments, attachments, x, y, width, height), 7, "GLenum", target, "GLsizei", numAttachments, "const GLenum *", attachments, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height)
-TRACE_GL(GLboolean, glIsBuffer, (GLuint buffer), (buffer), 1, "GLuint", buffer)
-TRACE_GL(GLboolean, glIsEnabled, (GLenum cap), (cap), 1, "GLenum", cap)
-TRACE_GL(GLboolean, glIsEnablediEXT, (GLenum target, GLuint index), (target, index), 2, "GLenum", target, "GLuint", index)
-TRACE_GL(GLboolean, glIsFenceNV, (GLuint fence), (fence), 1, "GLuint", fence)
-TRACE_GL(GLboolean, glIsFramebuffer, (GLuint framebuffer), (framebuffer), 1, "GLuint", framebuffer)
-TRACE_GL(GLboolean, glIsFramebufferOES, (GLuint framebuffer), (framebuffer), 1, "GLuint", framebuffer)
-TRACE_GL(GLboolean, glIsProgram, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL(GLboolean, glIsProgramPipeline, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
-TRACE_GL(GLboolean, glIsProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
-TRACE_GL(GLboolean, glIsQuery, (GLuint id), (id), 1, "GLuint", id)
-TRACE_GL(GLboolean, glIsQueryEXT, (GLuint id), (id), 1, "GLuint", id)
-TRACE_GL(GLboolean, glIsRenderbuffer, (GLuint renderbuffer), (renderbuffer), 1, "GLuint", renderbuffer)
-TRACE_GL(GLboolean, glIsRenderbufferOES, (GLuint renderbuffer), (renderbuffer), 1, "GLuint", renderbuffer)
-TRACE_GL(GLboolean, glIsSampler, (GLuint sampler), (sampler), 1, "GLuint", sampler)
-TRACE_GL(GLboolean, glIsShader, (GLuint shader), (shader), 1, "GLuint", shader)
-TRACE_GL(GLboolean, glIsSync, (GLsync sync), (sync), 1, "GLsync", sync)
-TRACE_GL(GLboolean, glIsSyncAPPLE, (GLsync sync), (sync), 1, "GLsync", sync)
-TRACE_GL(GLboolean, glIsTexture, (GLuint texture), (texture), 1, "GLuint", texture)
-TRACE_GL(GLboolean, glIsTransformFeedback, (GLuint id), (id), 1, "GLuint", id)
-TRACE_GL(GLboolean, glIsVertexArray, (GLuint array), (array), 1, "GLuint", array)
-TRACE_GL(GLboolean, glIsVertexArrayOES, (GLuint array), (array), 1, "GLuint", array)
-TRACE_GL_VOID(glLabelObjectEXT, (GLenum type, GLuint object, GLsizei length, const GLchar * label), (type, object, length, label), 4, "GLenum", type, "GLuint", object, "GLsizei", length, "const GLchar *", label)
-TRACE_GL_VOID(glLightModelf, (GLenum pname, GLfloat param), (pname, param), 2, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glLightModelfv, (GLenum pname, const GLfloat * params), (pname, params), 2, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glLightModelx, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightModelxOES, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightModelxv, (GLenum pname, const GLfixed * param), (pname, param), 2, "GLenum", pname, "const GLfixed *", param)
-TRACE_GL_VOID(glLightModelxvOES, (GLenum pname, const GLfixed * param), (pname, param), 2, "GLenum", pname, "const GLfixed *", param)
-TRACE_GL_VOID(glLightf, (GLenum light, GLenum pname, GLfloat param), (light, pname, param), 3, "GLenum", light, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glLightfv, (GLenum light, GLenum pname, const GLfloat * params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glLightx, (GLenum light, GLenum pname, GLfixed param), (light, pname, param), 3, "GLenum", light, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightxOES, (GLenum light, GLenum pname, GLfixed param), (light, pname, param), 3, "GLenum", light, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glLightxv, (GLenum light, GLenum pname, const GLfixed * params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glLightxvOES, (GLenum light, GLenum pname, const GLfixed * params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glLineWidth, (GLfloat width), (width), 1, "GLfloat", width)
-TRACE_GL_VOID(glLineWidthx, (GLfixed width), (width), 1, "GLfixed", width)
-TRACE_GL_VOID(glLineWidthxOES, (GLfixed width), (width), 1, "GLfixed", width)
-TRACE_GL_VOID(glLinkProgram, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL_VOID(glLoadIdentity, (void), (), 0)
-TRACE_GL_VOID(glLoadMatrixf, (const GLfloat * m), (m), 1, "const GLfloat *", m)
-TRACE_GL_VOID(glLoadMatrixx, (const GLfixed * m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glLoadMatrixxOES, (const GLfixed * m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glLoadPaletteFromModelViewMatrixOES, (void), (), 0)
-TRACE_GL_VOID(glLogicOp, (GLenum opcode), (opcode), 1, "GLenum", opcode)
-TRACE_GL(void *, glMapBufferOES, (GLenum target, GLenum access), (target, access), 2, "GLenum", target, "GLenum", access)
-TRACE_GL(void *, glMapBufferRange, (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access), (target, offset, length, access), 4, "GLenum", target, "GLintptr", offset, "GLsizeiptr", length, "GLbitfield", access)
-TRACE_GL(void *, glMapBufferRangeEXT, (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access), (target, offset, length, access), 4, "GLenum", target, "GLintptr", offset, "GLsizeiptr", length, "GLbitfield", access)
-TRACE_GL_VOID(glMaterialf, (GLenum face, GLenum pname, GLfloat param), (face, pname, param), 3, "GLenum", face, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glMaterialfv, (GLenum face, GLenum pname, const GLfloat * params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glMaterialx, (GLenum face, GLenum pname, GLfixed param), (face, pname, param), 3, "GLenum", face, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glMaterialxOES, (GLenum face, GLenum pname, GLfixed param), (face, pname, param), 3, "GLenum", face, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glMaterialxv, (GLenum face, GLenum pname, const GLfixed * param), (face, pname, param), 3, "GLenum", face, "GLenum", pname, "const GLfixed *", param)
-TRACE_GL_VOID(glMaterialxvOES, (GLenum face, GLenum pname, const GLfixed * param), (face, pname, param), 3, "GLenum", face, "GLenum", pname, "const GLfixed *", param)
-TRACE_GL_VOID(glMatrixIndexPointerOES, (GLint size, GLenum type, GLsizei stride, const void * pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const void *", pointer)
-TRACE_GL_VOID(glMatrixMode, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glMemoryBarrier, (GLbitfield barriers), (barriers), 1, "GLbitfield", barriers)
-TRACE_GL_VOID(glMemoryBarrierByRegion, (GLbitfield barriers), (barriers), 1, "GLbitfield", barriers)
-TRACE_GL_VOID(glMinSampleShadingOES, (GLfloat value), (value), 1, "GLfloat", value)
-TRACE_GL_VOID(glMultMatrixf, (const GLfloat * m), (m), 1, "const GLfloat *", m)
-TRACE_GL_VOID(glMultMatrixx, (const GLfixed * m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glMultMatrixxOES, (const GLfixed * m), (m), 1, "const GLfixed *", m)
-TRACE_GL_VOID(glMultiDrawArraysEXT, (GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount), (mode, first, count, primcount), 4, "GLenum", mode, "const GLint *", first, "const GLsizei *", count, "GLsizei", primcount)
-TRACE_GL_VOID(glMultiDrawElementsEXT, (GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei primcount), (mode, count, type, indices, primcount), 5, "GLenum", mode, "const GLsizei *", count, "GLenum", type, "const void *const*", indices, "GLsizei", primcount)
-TRACE_GL_VOID(glMultiTexCoord1bOES, (GLenum texture, GLbyte s), (texture, s), 2, "GLenum", texture, "GLbyte", s)
-TRACE_GL_VOID(glMultiTexCoord1bvOES, (GLenum texture, const GLbyte * coords), (texture, coords), 2, "GLenum", texture, "const GLbyte *", coords)
-TRACE_GL_VOID(glMultiTexCoord2bOES, (GLenum texture, GLbyte s, GLbyte t), (texture, s, t), 3, "GLenum", texture, "GLbyte", s, "GLbyte", t)
-TRACE_GL_VOID(glMultiTexCoord2bvOES, (GLenum texture, const GLbyte * coords), (texture, coords), 2, "GLenum", texture, "const GLbyte *", coords)
-TRACE_GL_VOID(glMultiTexCoord3bOES, (GLenum texture, GLbyte s, GLbyte t, GLbyte r), (texture, s, t, r), 4, "GLenum", texture, "GLbyte", s, "GLbyte", t, "GLbyte", r)
-TRACE_GL_VOID(glMultiTexCoord3bvOES, (GLenum texture, const GLbyte * coords), (texture, coords), 2, "GLenum", texture, "const GLbyte *", coords)
-TRACE_GL_VOID(glMultiTexCoord4bOES, (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q), (texture, s, t, r, q), 5, "GLenum", texture, "GLbyte", s, "GLbyte", t, "GLbyte", r, "GLbyte", q)
-TRACE_GL_VOID(glMultiTexCoord4bvOES, (GLenum texture, const GLbyte * coords), (texture, coords), 2, "GLenum", texture, "const GLbyte *", coords)
-TRACE_GL_VOID(glMultiTexCoord4f, (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q), (target, s, t, r, q), 5, "GLenum", target, "GLfloat", s, "GLfloat", t, "GLfloat", r, "GLfloat", q)
-TRACE_GL_VOID(glMultiTexCoord4x, (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q), (texture, s, t, r, q), 5, "GLenum", texture, "GLfixed", s, "GLfixed", t, "GLfixed", r, "GLfixed", q)
-TRACE_GL_VOID(glMultiTexCoord4xOES, (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q), (texture, s, t, r, q), 5, "GLenum", texture, "GLfixed", s, "GLfixed", t, "GLfixed", r, "GLfixed", q)
-TRACE_GL_VOID(glNormal3f, (GLfloat nx, GLfloat ny, GLfloat nz), (nx, ny, nz), 3, "GLfloat", nx, "GLfloat", ny, "GLfloat", nz)
-TRACE_GL_VOID(glNormal3x, (GLfixed nx, GLfixed ny, GLfixed nz), (nx, ny, nz), 3, "GLfixed", nx, "GLfixed", ny, "GLfixed", nz)
-TRACE_GL_VOID(glNormal3xOES, (GLfixed nx, GLfixed ny, GLfixed nz), (nx, ny, nz), 3, "GLfixed", nx, "GLfixed", ny, "GLfixed", nz)
-TRACE_GL_VOID(glNormalPointer, (GLenum type, GLsizei stride, const void * pointer), (type, stride, pointer), 3, "GLenum", type, "GLsizei", stride, "const void *", pointer)
-TRACE_GL_VOID(glObjectLabelKHR, (GLenum identifier, GLuint name, GLsizei length, const GLchar * label), (identifier, name, length, label), 4, "GLenum", identifier, "GLuint", name, "GLsizei", length, "const GLchar *", label)
-TRACE_GL_VOID(glObjectPtrLabelKHR, (const void * ptr, GLsizei length, const GLchar * label), (ptr, length, label), 3, "const void *", ptr, "GLsizei", length, "const GLchar *", label)
-TRACE_GL_VOID(glOrthof, (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f), (l, r, b, t, n, f), 6, "GLfloat", l, "GLfloat", r, "GLfloat", b, "GLfloat", t, "GLfloat", n, "GLfloat", f)
-TRACE_GL_VOID(glOrthofOES, (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f), (l, r, b, t, n, f), 6, "GLfloat", l, "GLfloat", r, "GLfloat", b, "GLfloat", t, "GLfloat", n, "GLfloat", f)
-TRACE_GL_VOID(glOrthox, (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f), (l, r, b, t, n, f), 6, "GLfixed", l, "GLfixed", r, "GLfixed", b, "GLfixed", t, "GLfixed", n, "GLfixed", f)
-TRACE_GL_VOID(glOrthoxOES, (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f), (l, r, b, t, n, f), 6, "GLfixed", l, "GLfixed", r, "GLfixed", b, "GLfixed", t, "GLfixed", n, "GLfixed", f)
-TRACE_GL_VOID(glPatchParameteriEXT, (GLenum pname, GLint value), (pname, value), 2, "GLenum", pname, "GLint", value)
-TRACE_GL_VOID(glPauseTransformFeedback, (void), (), 0)
-TRACE_GL_VOID(glPixelStorei, (GLenum pname, GLint param), (pname, param), 2, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glPointParameterf, (GLenum pname, GLfloat param), (pname, param), 2, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glPointParameterfv, (GLenum pname, const GLfloat * params), (pname, params), 2, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glPointParameterx, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glPointParameterxOES, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glPointParameterxv, (GLenum pname, const GLfixed * params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glPointParameterxvOES, (GLenum pname, const GLfixed * params), (pname, params), 2, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glPointSize, (GLfloat size), (size), 1, "GLfloat", size)
-TRACE_GL_VOID(glPointSizePointerOES, (GLenum type, GLsizei stride, const void * pointer), (type, stride, pointer), 3, "GLenum", type, "GLsizei", stride, "const void *", pointer)
-TRACE_GL_VOID(glPointSizex, (GLfixed size), (size), 1, "GLfixed", size)
-TRACE_GL_VOID(glPointSizexOES, (GLfixed size), (size), 1, "GLfixed", size)
-TRACE_GL_VOID(glPolygonOffset, (GLfloat factor, GLfloat units), (factor, units), 2, "GLfloat", factor, "GLfloat", units)
-TRACE_GL_VOID(glPolygonOffsetx, (GLfixed factor, GLfixed units), (factor, units), 2, "GLfixed", factor, "GLfixed", units)
-TRACE_GL_VOID(glPolygonOffsetxOES, (GLfixed factor, GLfixed units), (factor, units), 2, "GLfixed", factor, "GLfixed", units)
-TRACE_GL_VOID(glPopDebugGroupKHR, (void), (), 0)
-TRACE_GL_VOID(glPopGroupMarkerEXT, (void), (), 0)
-TRACE_GL_VOID(glPopMatrix, (void), (), 0)
-TRACE_GL_VOID(glPrimitiveBoundingBoxEXT, (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW), (minX, minY, minZ, minW, maxX, maxY, maxZ, maxW), 8, "GLfloat", minX, "GLfloat", minY, "GLfloat", minZ, "GLfloat", minW, "GLfloat", maxX, "GLfloat", maxY, "GLfloat", maxZ, "GLfloat", maxW)
-TRACE_GL_VOID(glProgramBinary, (GLuint program, GLenum binaryFormat, const void * binary, GLsizei length), (program, binaryFormat, binary, length), 4, "GLuint", program, "GLenum", binaryFormat, "const void *", binary, "GLsizei", length)
-TRACE_GL_VOID(glProgramBinaryOES, (GLuint program, GLenum binaryFormat, const void * binary, GLint length), (program, binaryFormat, binary, length), 4, "GLuint", program, "GLenum", binaryFormat, "const void *", binary, "GLint", length)
-TRACE_GL_VOID(glProgramParameteri, (GLuint program, GLenum pname, GLint value), (program, pname, value), 3, "GLuint", program, "GLenum", pname, "GLint", value)
-TRACE_GL_VOID(glProgramParameteriEXT, (GLuint program, GLenum pname, GLint value), (program, pname, value), 3, "GLuint", program, "GLenum", pname, "GLint", value)
-TRACE_GL_VOID(glProgramUniform1f, (GLuint program, GLint location, GLfloat v0), (program, location, v0), 3, "GLuint", program, "GLint", location, "GLfloat", v0)
-TRACE_GL_VOID(glProgramUniform1fEXT, (GLuint program, GLint location, GLfloat v0), (program, location, v0), 3, "GLuint", program, "GLint", location, "GLfloat", v0)
-TRACE_GL_VOID(glProgramUniform1fv, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform1fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform1i, (GLuint program, GLint location, GLint v0), (program, location, v0), 3, "GLuint", program, "GLint", location, "GLint", v0)
-TRACE_GL_VOID(glProgramUniform1iEXT, (GLuint program, GLint location, GLint v0), (program, location, v0), 3, "GLuint", program, "GLint", location, "GLint", v0)
-TRACE_GL_VOID(glProgramUniform1iv, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniform1ivEXT, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniform1ui, (GLuint program, GLint location, GLuint v0), (program, location, v0), 3, "GLuint", program, "GLint", location, "GLuint", v0)
-TRACE_GL_VOID(glProgramUniform1uiEXT, (GLuint program, GLint location, GLuint v0), (program, location, v0), 3, "GLuint", program, "GLint", location, "GLuint", v0)
-TRACE_GL_VOID(glProgramUniform1uiv, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glProgramUniform1uivEXT, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glProgramUniform2f, (GLuint program, GLint location, GLfloat v0, GLfloat v1), (program, location, v0, v1), 4, "GLuint", program, "GLint", location, "GLfloat", v0, "GLfloat", v1)
-TRACE_GL_VOID(glProgramUniform2fEXT, (GLuint program, GLint location, GLfloat v0, GLfloat v1), (program, location, v0, v1), 4, "GLuint", program, "GLint", location, "GLfloat", v0, "GLfloat", v1)
-TRACE_GL_VOID(glProgramUniform2fv, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform2fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform2i, (GLuint program, GLint location, GLint v0, GLint v1), (program, location, v0, v1), 4, "GLuint", program, "GLint", location, "GLint", v0, "GLint", v1)
-TRACE_GL_VOID(glProgramUniform2iEXT, (GLuint program, GLint location, GLint v0, GLint v1), (program, location, v0, v1), 4, "GLuint", program, "GLint", location, "GLint", v0, "GLint", v1)
-TRACE_GL_VOID(glProgramUniform2iv, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniform2ivEXT, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniform2ui, (GLuint program, GLint location, GLuint v0, GLuint v1), (program, location, v0, v1), 4, "GLuint", program, "GLint", location, "GLuint", v0, "GLuint", v1)
-TRACE_GL_VOID(glProgramUniform2uiEXT, (GLuint program, GLint location, GLuint v0, GLuint v1), (program, location, v0, v1), 4, "GLuint", program, "GLint", location, "GLuint", v0, "GLuint", v1)
-TRACE_GL_VOID(glProgramUniform2uiv, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glProgramUniform2uivEXT, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glProgramUniform3f, (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2), (program, location, v0, v1, v2), 5, "GLuint", program, "GLint", location, "GLfloat", v0, "GLfloat", v1, "GLfloat", v2)
-TRACE_GL_VOID(glProgramUniform3fEXT, (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2), (program, location, v0, v1, v2), 5, "GLuint", program, "GLint", location, "GLfloat", v0, "GLfloat", v1, "GLfloat", v2)
-TRACE_GL_VOID(glProgramUniform3fv, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform3fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform3i, (GLuint program, GLint location, GLint v0, GLint v1, GLint v2), (program, location, v0, v1, v2), 5, "GLuint", program, "GLint", location, "GLint", v0, "GLint", v1, "GLint", v2)
-TRACE_GL_VOID(glProgramUniform3iEXT, (GLuint program, GLint location, GLint v0, GLint v1, GLint v2), (program, location, v0, v1, v2), 5, "GLuint", program, "GLint", location, "GLint", v0, "GLint", v1, "GLint", v2)
-TRACE_GL_VOID(glProgramUniform3iv, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniform3ivEXT, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniform3ui, (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2), (program, location, v0, v1, v2), 5, "GLuint", program, "GLint", location, "GLuint", v0, "GLuint", v1, "GLuint", v2)
-TRACE_GL_VOID(glProgramUniform3uiEXT, (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2), (program, location, v0, v1, v2), 5, "GLuint", program, "GLint", location, "GLuint", v0, "GLuint", v1, "GLuint", v2)
-TRACE_GL_VOID(glProgramUniform3uiv, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glProgramUniform3uivEXT, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glProgramUniform4f, (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3), (program, location, v0, v1, v2, v3), 6, "GLuint", program, "GLint", location, "GLfloat", v0, "GLfloat", v1, "GLfloat", v2, "GLfloat", v3)
-TRACE_GL_VOID(glProgramUniform4fEXT, (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3), (program, location, v0, v1, v2, v3), 6, "GLuint", program, "GLint", location, "GLfloat", v0, "GLfloat", v1, "GLfloat", v2, "GLfloat", v3)
-TRACE_GL_VOID(glProgramUniform4fv, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform4fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniform4i, (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3), (program, location, v0, v1, v2, v3), 6, "GLuint", program, "GLint", location, "GLint", v0, "GLint", v1, "GLint", v2, "GLint", v3)
-TRACE_GL_VOID(glProgramUniform4iEXT, (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3), (program, location, v0, v1, v2, v3), 6, "GLuint", program, "GLint", location, "GLint", v0, "GLint", v1, "GLint", v2, "GLint", v3)
-TRACE_GL_VOID(glProgramUniform4iv, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniform4ivEXT, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glProgramUniform4ui, (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3), (program, location, v0, v1, v2, v3), 6, "GLuint", program, "GLint", location, "GLuint", v0, "GLuint", v1, "GLuint", v2, "GLuint", v3)
-TRACE_GL_VOID(glProgramUniform4uiEXT, (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3), (program, location, v0, v1, v2, v3), 6, "GLuint", program, "GLint", location, "GLuint", v0, "GLuint", v1, "GLuint", v2, "GLuint", v3)
-TRACE_GL_VOID(glProgramUniform4uiv, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glProgramUniform4uivEXT, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glProgramUniformMatrix2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix2fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix2x3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix2x3fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix2x4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix2x4fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix3fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix3x2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix3x2fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix3x4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix3x4fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix4fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix4x2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix4x2fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix4x3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glProgramUniformMatrix4x3fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glPushDebugGroupKHR, (GLenum source, GLuint id, GLsizei length, const GLchar * message), (source, id, length, message), 4, "GLenum", source, "GLuint", id, "GLsizei", length, "const GLchar *", message)
-TRACE_GL_VOID(glPushGroupMarkerEXT, (GLsizei length, const GLchar * marker), (length, marker), 2, "GLsizei", length, "const GLchar *", marker)
-TRACE_GL_VOID(glPushMatrix, (void), (), 0)
-TRACE_GL_VOID(glQueryCounterEXT, (GLuint id, GLenum target), (id, target), 2, "GLuint", id, "GLenum", target)
-TRACE_GL(GLbitfield, glQueryMatrixxOES, (GLfixed * mantissa, GLint * exponent), (mantissa, exponent), 2, "GLfixed *", mantissa, "GLint *", exponent)
-TRACE_GL_VOID(glReadBuffer, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glReadBufferIndexedEXT, (GLenum src, GLint index), (src, index), 2, "GLenum", src, "GLint", index)
-TRACE_GL_VOID(glReadBufferNV, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels), (x, y, width, height, format, type, pixels), 7, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "void *", pixels)
-TRACE_GL_VOID(glReadnPixelsEXT, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data), (x, y, width, height, format, type, bufSize, data), 8, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "GLsizei", bufSize, "void *", data)
-TRACE_GL_VOID(glReleaseShaderCompiler, (void), (), 0)
-TRACE_GL_VOID(glRenderbufferStorage, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height), 4, "GLenum", target, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageMultisampleANGLE, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageMultisampleAPPLE, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageMultisampleEXT, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageMultisampleIMG, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageMultisampleNV, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glRenderbufferStorageOES, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height), 4, "GLenum", target, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glResolveMultisampleFramebufferAPPLE, (void), (), 0)
-TRACE_GL_VOID(glResumeTransformFeedback, (void), (), 0)
-TRACE_GL_VOID(glRotatef, (GLfloat angle, GLfloat x, GLfloat y, GLfloat z), (angle, x, y, z), 4, "GLfloat", angle, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glRotatex, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z), 4, "GLfixed", angle, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glRotatexOES, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z), 4, "GLfixed", angle, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glSampleCoverage, (GLfloat value, GLboolean invert), (value, invert), 2, "GLfloat", value, "GLboolean", invert)
-TRACE_GL_VOID(glSampleCoverageOES, (GLfixed value, GLboolean invert), (value, invert), 2, "GLfixed", value, "GLboolean", invert)
-TRACE_GL_VOID(glSampleCoveragex, (GLclampx value, GLboolean invert), (value, invert), 2, "GLclampx", value, "GLboolean", invert)
-TRACE_GL_VOID(glSampleCoveragexOES, (GLclampx value, GLboolean invert), (value, invert), 2, "GLclampx", value, "GLboolean", invert)
-TRACE_GL_VOID(glSampleMaski, (GLuint maskNumber, GLbitfield mask), (maskNumber, mask), 2, "GLuint", maskNumber, "GLbitfield", mask)
-TRACE_GL_VOID(glSamplerParameterIivEXT, (GLuint sampler, GLenum pname, const GLint * param), (sampler, pname, param), 3, "GLuint", sampler, "GLenum", pname, "const GLint *", param)
-TRACE_GL_VOID(glSamplerParameterIuivEXT, (GLuint sampler, GLenum pname, const GLuint * param), (sampler, pname, param), 3, "GLuint", sampler, "GLenum", pname, "const GLuint *", param)
-TRACE_GL_VOID(glSamplerParameterf, (GLuint sampler, GLenum pname, GLfloat param), (sampler, pname, param), 3, "GLuint", sampler, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glSamplerParameterfv, (GLuint sampler, GLenum pname, const GLfloat * param), (sampler, pname, param), 3, "GLuint", sampler, "GLenum", pname, "const GLfloat *", param)
-TRACE_GL_VOID(glSamplerParameteri, (GLuint sampler, GLenum pname, GLint param), (sampler, pname, param), 3, "GLuint", sampler, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glSamplerParameteriv, (GLuint sampler, GLenum pname, const GLint * param), (sampler, pname, param), 3, "GLuint", sampler, "GLenum", pname, "const GLint *", param)
-TRACE_GL_VOID(glScalef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z), 3, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glScalex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glScalexOES, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glScissor, (GLint x, GLint y, GLsizei width, GLsizei height), (x, y, width, height), 4, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glSelectPerfMonitorCountersAMD, (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint * counterList), (monitor, enable, group, numCounters, counterList), 5, "GLuint", monitor, "GLboolean", enable, "GLuint", group, "GLint", numCounters, "GLuint *", counterList)
-TRACE_GL_VOID(glSetFenceNV, (GLuint fence, GLenum condition), (fence, condition), 2, "GLuint", fence, "GLenum", condition)
-TRACE_GL_VOID(glShadeModel, (GLenum mode), (mode), 1, "GLenum", mode)
-TRACE_GL_VOID(glShaderBinary, (GLsizei count, const GLuint * shaders, GLenum binaryformat, const void * binary, GLsizei length), (count, shaders, binaryformat, binary, length), 5, "GLsizei", count, "const GLuint *", shaders, "GLenum", binaryformat, "const void *", binary, "GLsizei", length)
-TRACE_GL_VOID(glShaderSource, (GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length), (shader, count, string, length), 4, "GLuint", shader, "GLsizei", count, "const GLchar *const*", string, "const GLint *", length)
-TRACE_GL_VOID(glStartTilingQCOM, (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask), (x, y, width, height, preserveMask), 5, "GLuint", x, "GLuint", y, "GLuint", width, "GLuint", height, "GLbitfield", preserveMask)
-TRACE_GL_VOID(glStencilFunc, (GLenum func, GLint ref, GLuint mask), (func, ref, mask), 3, "GLenum", func, "GLint", ref, "GLuint", mask)
-TRACE_GL_VOID(glStencilFuncSeparate, (GLenum face, GLenum func, GLint ref, GLuint mask), (face, func, ref, mask), 4, "GLenum", face, "GLenum", func, "GLint", ref, "GLuint", mask)
-TRACE_GL_VOID(glStencilMask, (GLuint mask), (mask), 1, "GLuint", mask)
-TRACE_GL_VOID(glStencilMaskSeparate, (GLenum face, GLuint mask), (face, mask), 2, "GLenum", face, "GLuint", mask)
-TRACE_GL_VOID(glStencilOp, (GLenum fail, GLenum zfail, GLenum zpass), (fail, zfail, zpass), 3, "GLenum", fail, "GLenum", zfail, "GLenum", zpass)
-TRACE_GL_VOID(glStencilOpSeparate, (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass), (face, sfail, dpfail, dppass), 4, "GLenum", face, "GLenum", sfail, "GLenum", dpfail, "GLenum", dppass)
-TRACE_GL(GLboolean, glTestFenceNV, (GLuint fence), (fence), 1, "GLuint", fence)
-TRACE_GL_VOID(glTexBufferEXT, (GLenum target, GLenum internalformat, GLuint buffer), (target, internalformat, buffer), 3, "GLenum", target, "GLenum", internalformat, "GLuint", buffer)
-TRACE_GL_VOID(glTexBufferRangeEXT, (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size), (target, internalformat, buffer, offset, size), 5, "GLenum", target, "GLenum", internalformat, "GLuint", buffer, "GLintptr", offset, "GLsizeiptr", size)
-TRACE_GL_VOID(glTexCoord1bOES, (GLbyte s), (s), 1, "GLbyte", s)
-TRACE_GL_VOID(glTexCoord1bvOES, (const GLbyte * coords), (coords), 1, "const GLbyte *", coords)
-TRACE_GL_VOID(glTexCoord2bOES, (GLbyte s, GLbyte t), (s, t), 2, "GLbyte", s, "GLbyte", t)
-TRACE_GL_VOID(glTexCoord2bvOES, (const GLbyte * coords), (coords), 1, "const GLbyte *", coords)
-TRACE_GL_VOID(glTexCoord3bOES, (GLbyte s, GLbyte t, GLbyte r), (s, t, r), 3, "GLbyte", s, "GLbyte", t, "GLbyte", r)
-TRACE_GL_VOID(glTexCoord3bvOES, (const GLbyte * coords), (coords), 1, "const GLbyte *", coords)
-TRACE_GL_VOID(glTexCoord4bOES, (GLbyte s, GLbyte t, GLbyte r, GLbyte q), (s, t, r, q), 4, "GLbyte", s, "GLbyte", t, "GLbyte", r, "GLbyte", q)
-TRACE_GL_VOID(glTexCoord4bvOES, (const GLbyte * coords), (coords), 1, "const GLbyte *", coords)
-TRACE_GL_VOID(glTexCoordPointer, (GLint size, GLenum type, GLsizei stride, const void * pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const void *", pointer)
-TRACE_GL_VOID(glTexEnvf, (GLenum target, GLenum pname, GLfloat param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glTexEnvfv, (GLenum target, GLenum pname, const GLfloat * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glTexEnvi, (GLenum target, GLenum pname, GLint param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glTexEnviv, (GLenum target, GLenum pname, const GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLint *", params)
-TRACE_GL_VOID(glTexEnvx, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexEnvxOES, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexEnvxv, (GLenum target, GLenum pname, const GLfixed * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexEnvxvOES, (GLenum target, GLenum pname, const GLfixed * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexGenfOES, (GLenum coord, GLenum pname, GLfloat param), (coord, pname, param), 3, "GLenum", coord, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glTexGenfvOES, (GLenum coord, GLenum pname, const GLfloat * params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glTexGeniOES, (GLenum coord, GLenum pname, GLint param), (coord, pname, param), 3, "GLenum", coord, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glTexGenivOES, (GLenum coord, GLenum pname, const GLint * params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "const GLint *", params)
-TRACE_GL_VOID(glTexGenxOES, (GLenum coord, GLenum pname, GLfixed param), (coord, pname, param), 3, "GLenum", coord, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexGenxvOES, (GLenum coord, GLenum pname, const GLfixed * params), (coord, pname, params), 3, "GLenum", coord, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels), (target, level, internalformat, width, height, border, format, type, pixels), 9, "GLenum", target, "GLint", level, "GLint", internalformat, "GLsizei", width, "GLsizei", height, "GLint", border, "GLenum", format, "GLenum", type, "const void *", pixels)
-TRACE_GL_VOID(glTexImage3D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels), (target, level, internalformat, width, height, depth, border, format, type, pixels), 10, "GLenum", target, "GLint", level, "GLint", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLint", border, "GLenum", format, "GLenum", type, "const void *", pixels)
-TRACE_GL_VOID(glTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels), (target, level, internalformat, width, height, depth, border, format, type, pixels), 10, "GLenum", target, "GLint", level, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLint", border, "GLenum", format, "GLenum", type, "const void *", pixels)
-TRACE_GL_VOID(glTexParameterIivEXT, (GLenum target, GLenum pname, const GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLint *", params)
-TRACE_GL_VOID(glTexParameterIuivEXT, (GLenum target, GLenum pname, const GLuint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLuint *", params)
-TRACE_GL_VOID(glTexParameterf, (GLenum target, GLenum pname, GLfloat param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfloat", param)
-TRACE_GL_VOID(glTexParameterfv, (GLenum target, GLenum pname, const GLfloat * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfloat *", params)
-TRACE_GL_VOID(glTexParameteri, (GLenum target, GLenum pname, GLint param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLint", param)
-TRACE_GL_VOID(glTexParameteriv, (GLenum target, GLenum pname, const GLint * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLint *", params)
-TRACE_GL_VOID(glTexParameterx, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexParameterxOES, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
-TRACE_GL_VOID(glTexParameterxv, (GLenum target, GLenum pname, const GLfixed * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexParameterxvOES, (GLenum target, GLenum pname, const GLfixed * params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
-TRACE_GL_VOID(glTexStorage1DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width), (target, levels, internalformat, width), 4, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width)
-TRACE_GL_VOID(glTexStorage2D, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height), (target, levels, internalformat, width, height), 5, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glTexStorage2DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height), (target, levels, internalformat, width, height), 5, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glTexStorage2DMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations), (target, samples, internalformat, width, height, fixedsamplelocations), 6, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLboolean", fixedsamplelocations)
-TRACE_GL_VOID(glTexStorage3D, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth), (target, levels, internalformat, width, height, depth), 6, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth)
-TRACE_GL_VOID(glTexStorage3DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth), (target, levels, internalformat, width, height, depth), 6, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth)
-TRACE_GL_VOID(glTexStorage3DMultisampleOES, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations), (target, samples, internalformat, width, height, depth, fixedsamplelocations), 7, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLboolean", fixedsamplelocations)
-TRACE_GL_VOID(glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels), (target, level, xoffset, yoffset, width, height, format, type, pixels), 9, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "const void *", pixels)
-TRACE_GL_VOID(glTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLenum", type, "const void *", pixels)
-TRACE_GL_VOID(glTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLenum", type, "const void *", pixels)
-TRACE_GL_VOID(glTextureStorage1DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width), (texture, target, levels, internalformat, width), 5, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width)
-TRACE_GL_VOID(glTextureStorage2DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height), (texture, target, levels, internalformat, width, height), 6, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glTextureStorage3DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth), (texture, target, levels, internalformat, width, height, depth), 7, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth)
-TRACE_GL_VOID(glTextureViewEXT, (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers), (texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers), 8, "GLuint", texture, "GLenum", target, "GLuint", origtexture, "GLenum", internalformat, "GLuint", minlevel, "GLuint", numlevels, "GLuint", minlayer, "GLuint", numlayers)
-TRACE_GL_VOID(glTransformFeedbackVaryings, (GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode), (program, count, varyings, bufferMode), 4, "GLuint", program, "GLsizei", count, "const GLchar *const*", varyings, "GLenum", bufferMode)
-TRACE_GL_VOID(glTranslatef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z), 3, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glTranslatex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glTranslatexOES, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
-TRACE_GL_VOID(glUniform1f, (GLint location, GLfloat v0), (location, v0), 2, "GLint", location, "GLfloat", v0)
-TRACE_GL_VOID(glUniform1fv, (GLint location, GLsizei count, const GLfloat * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glUniform1i, (GLint location, GLint v0), (location, v0), 2, "GLint", location, "GLint", v0)
-TRACE_GL_VOID(glUniform1iv, (GLint location, GLsizei count, const GLint * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glUniform1ui, (GLint location, GLuint v0), (location, v0), 2, "GLint", location, "GLuint", v0)
-TRACE_GL_VOID(glUniform1uiv, (GLint location, GLsizei count, const GLuint * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glUniform2f, (GLint location, GLfloat v0, GLfloat v1), (location, v0, v1), 3, "GLint", location, "GLfloat", v0, "GLfloat", v1)
-TRACE_GL_VOID(glUniform2fv, (GLint location, GLsizei count, const GLfloat * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glUniform2i, (GLint location, GLint v0, GLint v1), (location, v0, v1), 3, "GLint", location, "GLint", v0, "GLint", v1)
-TRACE_GL_VOID(glUniform2iv, (GLint location, GLsizei count, const GLint * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glUniform2ui, (GLint location, GLuint v0, GLuint v1), (location, v0, v1), 3, "GLint", location, "GLuint", v0, "GLuint", v1)
-TRACE_GL_VOID(glUniform2uiv, (GLint location, GLsizei count, const GLuint * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glUniform3f, (GLint location, GLfloat v0, GLfloat v1, GLfloat v2), (location, v0, v1, v2), 4, "GLint", location, "GLfloat", v0, "GLfloat", v1, "GLfloat", v2)
-TRACE_GL_VOID(glUniform3fv, (GLint location, GLsizei count, const GLfloat * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glUniform3i, (GLint location, GLint v0, GLint v1, GLint v2), (location, v0, v1, v2), 4, "GLint", location, "GLint", v0, "GLint", v1, "GLint", v2)
-TRACE_GL_VOID(glUniform3iv, (GLint location, GLsizei count, const GLint * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glUniform3ui, (GLint location, GLuint v0, GLuint v1, GLuint v2), (location, v0, v1, v2), 4, "GLint", location, "GLuint", v0, "GLuint", v1, "GLuint", v2)
-TRACE_GL_VOID(glUniform3uiv, (GLint location, GLsizei count, const GLuint * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glUniform4f, (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3), (location, v0, v1, v2, v3), 5, "GLint", location, "GLfloat", v0, "GLfloat", v1, "GLfloat", v2, "GLfloat", v3)
-TRACE_GL_VOID(glUniform4fv, (GLint location, GLsizei count, const GLfloat * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLfloat *", value)
-TRACE_GL_VOID(glUniform4i, (GLint location, GLint v0, GLint v1, GLint v2, GLint v3), (location, v0, v1, v2, v3), 5, "GLint", location, "GLint", v0, "GLint", v1, "GLint", v2, "GLint", v3)
-TRACE_GL_VOID(glUniform4iv, (GLint location, GLsizei count, const GLint * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLint *", value)
-TRACE_GL_VOID(glUniform4ui, (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3), (location, v0, v1, v2, v3), 5, "GLint", location, "GLuint", v0, "GLuint", v1, "GLuint", v2, "GLuint", v3)
-TRACE_GL_VOID(glUniform4uiv, (GLint location, GLsizei count, const GLuint * value), (location, count, value), 3, "GLint", location, "GLsizei", count, "const GLuint *", value)
-TRACE_GL_VOID(glUniformBlockBinding, (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding), (program, uniformBlockIndex, uniformBlockBinding), 3, "GLuint", program, "GLuint", uniformBlockIndex, "GLuint", uniformBlockBinding)
-TRACE_GL_VOID(glUniformMatrix2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix2x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix2x3fvNV, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix2x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix2x4fvNV, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix3x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix3x2fvNV, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix3x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix3x4fvNV, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix4x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix4x2fvNV, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix4x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL_VOID(glUniformMatrix4x3fvNV, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
-TRACE_GL(GLboolean, glUnmapBuffer, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL(GLboolean, glUnmapBufferOES, (GLenum target), (target), 1, "GLenum", target)
-TRACE_GL_VOID(glUseProgram, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL_VOID(glUseProgramStages, (GLuint pipeline, GLbitfield stages, GLuint program), (pipeline, stages, program), 3, "GLuint", pipeline, "GLbitfield", stages, "GLuint", program)
-TRACE_GL_VOID(glUseProgramStagesEXT, (GLuint pipeline, GLbitfield stages, GLuint program), (pipeline, stages, program), 3, "GLuint", pipeline, "GLbitfield", stages, "GLuint", program)
-TRACE_GL_VOID(glValidateProgram, (GLuint program), (program), 1, "GLuint", program)
-TRACE_GL_VOID(glValidateProgramPipeline, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
-TRACE_GL_VOID(glValidateProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
-TRACE_GL_VOID(glVertex2bOES, (GLbyte x), (x), 1, "GLbyte", x)
-TRACE_GL_VOID(glVertex2bvOES, (const GLbyte * coords), (coords), 1, "const GLbyte *", coords)
-TRACE_GL_VOID(glVertex3bOES, (GLbyte x, GLbyte y), (x, y), 2, "GLbyte", x, "GLbyte", y)
-TRACE_GL_VOID(glVertex3bvOES, (const GLbyte * coords), (coords), 1, "const GLbyte *", coords)
-TRACE_GL_VOID(glVertex4bOES, (GLbyte x, GLbyte y, GLbyte z), (x, y, z), 3, "GLbyte", x, "GLbyte", y, "GLbyte", z)
-TRACE_GL_VOID(glVertex4bvOES, (const GLbyte * coords), (coords), 1, "const GLbyte *", coords)
-TRACE_GL_VOID(glVertexAttrib1f, (GLuint index, GLfloat x), (index, x), 2, "GLuint", index, "GLfloat", x)
-TRACE_GL_VOID(glVertexAttrib1fv, (GLuint index, const GLfloat * v), (index, v), 2, "GLuint", index, "const GLfloat *", v)
-TRACE_GL_VOID(glVertexAttrib2f, (GLuint index, GLfloat x, GLfloat y), (index, x, y), 3, "GLuint", index, "GLfloat", x, "GLfloat", y)
-TRACE_GL_VOID(glVertexAttrib2fv, (GLuint index, const GLfloat * v), (index, v), 2, "GLuint", index, "const GLfloat *", v)
-TRACE_GL_VOID(glVertexAttrib3f, (GLuint index, GLfloat x, GLfloat y, GLfloat z), (index, x, y, z), 4, "GLuint", index, "GLfloat", x, "GLfloat", y, "GLfloat", z)
-TRACE_GL_VOID(glVertexAttrib3fv, (GLuint index, const GLfloat * v), (index, v), 2, "GLuint", index, "const GLfloat *", v)
-TRACE_GL_VOID(glVertexAttrib4f, (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (index, x, y, z, w), 5, "GLuint", index, "GLfloat", x, "GLfloat", y, "GLfloat", z, "GLfloat", w)
-TRACE_GL_VOID(glVertexAttrib4fv, (GLuint index, const GLfloat * v), (index, v), 2, "GLuint", index, "const GLfloat *", v)
-TRACE_GL_VOID(glVertexAttribBinding, (GLuint attribindex, GLuint bindingindex), (attribindex, bindingindex), 2, "GLuint", attribindex, "GLuint", bindingindex)
-TRACE_GL_VOID(glVertexAttribDivisor, (GLuint index, GLuint divisor), (index, divisor), 2, "GLuint", index, "GLuint", divisor)
-TRACE_GL_VOID(glVertexAttribDivisorANGLE, (GLuint index, GLuint divisor), (index, divisor), 2, "GLuint", index, "GLuint", divisor)
-TRACE_GL_VOID(glVertexAttribDivisorEXT, (GLuint index, GLuint divisor), (index, divisor), 2, "GLuint", index, "GLuint", divisor)
-TRACE_GL_VOID(glVertexAttribDivisorNV, (GLuint index, GLuint divisor), (index, divisor), 2, "GLuint", index, "GLuint", divisor)
-TRACE_GL_VOID(glVertexAttribFormat, (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset), (attribindex, size, type, normalized, relativeoffset), 5, "GLuint", attribindex, "GLint", size, "GLenum", type, "GLboolean", normalized, "GLuint", relativeoffset)
-TRACE_GL_VOID(glVertexAttribI4i, (GLuint index, GLint x, GLint y, GLint z, GLint w), (index, x, y, z, w), 5, "GLuint", index, "GLint", x, "GLint", y, "GLint", z, "GLint", w)
-TRACE_GL_VOID(glVertexAttribI4iv, (GLuint index, const GLint * v), (index, v), 2, "GLuint", index, "const GLint *", v)
-TRACE_GL_VOID(glVertexAttribI4ui, (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w), (index, x, y, z, w), 5, "GLuint", index, "GLuint", x, "GLuint", y, "GLuint", z, "GLuint", w)
-TRACE_GL_VOID(glVertexAttribI4uiv, (GLuint index, const GLuint * v), (index, v), 2, "GLuint", index, "const GLuint *", v)
-TRACE_GL_VOID(glVertexAttribIFormat, (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset), (attribindex, size, type, relativeoffset), 4, "GLuint", attribindex, "GLint", size, "GLenum", type, "GLuint", relativeoffset)
-TRACE_GL_VOID(glVertexAttribIPointer, (GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer), (index, size, type, stride, pointer), 5, "GLuint", index, "GLint", size, "GLenum", type, "GLsizei", stride, "const void *", pointer)
-TRACE_GL_VOID(glVertexAttribPointer, (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer), (index, size, type, normalized, stride, pointer), 6, "GLuint", index, "GLint", size, "GLenum", type, "GLboolean", normalized, "GLsizei", stride, "const void *", pointer)
-TRACE_GL_VOID(glVertexBindingDivisor, (GLuint bindingindex, GLuint divisor), (bindingindex, divisor), 2, "GLuint", bindingindex, "GLuint", divisor)
-TRACE_GL_VOID(glVertexPointer, (GLint size, GLenum type, GLsizei stride, const void * pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const void *", pointer)
-TRACE_GL_VOID(glViewport, (GLint x, GLint y, GLsizei width, GLsizei height), (x, y, width, height), 4, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height)
-TRACE_GL_VOID(glWaitSync, (GLsync sync, GLbitfield flags, GLuint64 timeout), (sync, flags, timeout), 3, "GLsync", sync, "GLbitfield", flags, "GLuint64", timeout)
-TRACE_GL_VOID(glWaitSyncAPPLE, (GLsync sync, GLbitfield flags, GLuint64 timeout), (sync, flags, timeout), 3, "GLsync", sync, "GLbitfield", flags, "GLuint64", timeout)
-TRACE_GL_VOID(glWeightPointerOES, (GLint size, GLenum type, GLsizei stride, const void * pointer), (size, type, stride, pointer), 4, "GLint", size, "GLenum", type, "GLsizei", stride, "const void *", pointer)
index 34fb1ee..ae531ee 100644 (file)
@@ -1,13 +1,13 @@
-eglInitialize check major 1 check minor 1
-eglGetConfigs check configs config_size
-eglChooseConfig check configs config_size check num_config 1 sentinel attrib_list EGL_NONE
+eglInitialize nullAllowed major nullAllowed minor check major 1 check minor 1
+eglGetConfigs nullAllowed configs check configs config_size
+eglChooseConfig nullAllowed configs check configs config_size check num_config 1 sentinel attrib_list EGL_NONE
 eglGetConfigAttrib check value 1
-//STUB function: //eglCreateWindowSurface sentinel attrib_list EGL_NONE
-eglCreatePbufferSurface sentinel attrib_list EGL_NONE
-//unsupported: eglCreatePixmapSurface sentinel attrib_list EGL_NONE
+//STUB function: //eglCreateWindowSurface nullAllowed attrib_list sentinel attrib_list EGL_NONE
+eglCreatePbufferSurface nullAllowed attrib_list sentinel attrib_list EGL_NONE
+//unsupported: eglCreatePixmapSurface nullAllowed attrib_list sentinel attrib_list EGL_NONE
 eglCreatePixmapSurface unsupported
 eglCopyBuffers unsupported
 eglQuerySurface check value 1
-eglCreatePbufferFromClientBuffer sentinel attrib_list EGL_NONE
+//STUB function: eglCreatePbufferFromClientBuffer nullAllowed attrib_list sentinel attrib_list EGL_NONE
 eglCreateContext sentinel attrib_list EGL_NONE
 eglQueryContext check value 1
index 9eb0070..e1f76fd 100644 (file)
@@ -19,7 +19,7 @@
 # is not perfect but better than nothing.
 #
 
-glBufferData nullAllowed check data size
+glBufferData nullAllowed data check data size
 glBufferSubData check data size
 # glCompressedTexImage2D
 # glCompressedTexSubImage2D
@@ -45,7 +45,7 @@ glGenRenderbuffers check renderbuffers n
 glGenTextures check textures n
 // glGetActiveAttrib
 // glGetActiveUniform
-glGetAttachedShaders nullAllowed check count 1 check shaders maxcount
+glGetAttachedShaders nullAllowed count check count 1 check shaders maxcount
 // glGetBooleanv
 glGetBufferParameter check params 1
 glGetClipPlanef check eqn 4
@@ -57,8 +57,10 @@ glGetFramebufferAttachmentParameterivOES check params 1
 // glGetIntegerv
 glGetLight ifcheck params 3 pname GL_SPOT_DIRECTION ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION
 glGetMaterial ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION,GL_AMBIENT_AND_DIFFUSE
+glGetProgramBinary nullAllowed length
 // glGetProgramInfoLog
 glGetProgramiv check params 1
+glGetProgramResourceiv nullAllowed length
 glGetRenderbufferParameteriv check params 1
 glGetRenderbufferParameterivOES check params 1
 // glGetShaderInfoLog
@@ -66,6 +68,7 @@ glGetShaderiv check params 1
 glGetShaderPrecisionFormat check range 1 check precision 1
 // glGetShaderSource
 // glGetString
+glGetSynciv nullAllowed length
 glGetTexEnv ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
 glGetTexGen ifcheck params 4 pname GL_OBJECT_PLANE,GL_EYE_PLANE
 glGetTexParameter check params 1
@@ -76,15 +79,17 @@ glLightModel ifcheck params 4 pname GL_LIGHT_MODEL_AMBIENT
 glLoadMatrix check m 16
 glMaterial ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION,GL_AMBIENT_AND_DIFFUSE
 glMultMatrix check m 16
+glObjectLabelKHR nullAllowed label
 glPointParameter check params 1
 glQueryMatrixxOES check mantissa 16 check exponent 16 return -1
 # glReadPixels
 glShaderBinary check binary length
 // glShaderSource
 glTexEnv ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
-glTexImage2D nullAllowed
+glTexImage2D nullAllowed pixels
+glTexImage3D nullAllowed pixels
 glTexParameter check params 1
-glTexSubImage2D nullAllowed
+glTexSubImage2D nullAllowed pixels
 glUniform1 check v count
 glUniform2 check v count*2
 glUniform3 check v count*3
index 9f8a793..750481c 100644 (file)
@@ -19,9 +19,9 @@ glMaterial ifcheck params 1 pname GL_SHININESS ifcheck params 4 pname GL_AMBIENT
 glMultMatrix check m 16
 glPointParameter check params 1
 glTexEnv ifcheck params 1 pname GL_TEXTURE_ENV_MODE,GL_COMBINE_RGB,GL_COMBINE_ALPHA ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
-glTexImage2D nullAllowed
-glTexSubImage2D nullAllowed
-glBufferData nullAllowed check data size
+glTexImage2D nullAllowed pixels
+glTexSubImage2D nullAllowed pixels
+glBufferData nullAllowed data check data size
 glBufferSubData check data size
 glTexParameter check params 1
 glQueryMatrixxOES check mantissa 16 check exponent 16 return -1
index 5a412bf..6caf076 100644 (file)
@@ -222,12 +222,13 @@ public class JniCodeEmitter {
         needsExit = true;
     }
 
-    boolean isNullAllowed(CFunc cfunc) {
+    boolean isNullAllowed(CFunc cfunc, String cname) {
         String[] checks = mChecker.getChecks(cfunc.getName());
         int index = 1;
         if (checks != null) {
             while (index < checks.length) {
-                if (checks[index].equals("nullAllowed")) {
+                if (checks[index].equals("nullAllowed") &&
+                    checks[index + 1].equals(cname)) {
                     return true;
                 } else {
                     index = skipOneCheck(checks, index);
@@ -252,6 +253,22 @@ public class JniCodeEmitter {
         return false;
     }
 
+    boolean hasCheckTest(CFunc cfunc, String cname) {
+        String[] checks = mChecker.getChecks(cfunc.getName());
+        int index = 1;
+        if (checks != null) {
+            while (index < checks.length) {
+                if (checks[index].startsWith("check") &&
+                    cname != null && cname.equals(checks[index + 1])) {
+                    return true;
+                } else {
+                    index = skipOneCheck(checks, index);
+                }
+            }
+        }
+        return false;
+    }
+
     boolean hasIfTest(CFunc cfunc) {
         String[] checks = mChecker.getChecks(cfunc.getName());
         int index = 1;
@@ -281,7 +298,7 @@ public class JniCodeEmitter {
         } else if (checks[index].equals("requires")) {
             index += 2;
         } else if (checks[index].equals("nullAllowed")) {
-            index += 1;
+            index += 2;
         } else {
             System.out.println("Error: unknown keyword \"" +
                                checks[index] + "\"");
@@ -469,6 +486,37 @@ public class JniCodeEmitter {
         }
     }
 
+    void emitStringCheck(CFunc cfunc, String cname, PrintStream out, String iii) {
+
+        String[] checks = mChecker.getChecks(cfunc.getName());
+
+        int index = 1;
+        if (checks != null) {
+            while (index < checks.length) {
+                if (checks[index].startsWith("check")) {
+                    if (cname != null && !cname.equals(checks[index + 1])) {
+                    index += 3;
+                    continue;
+                }
+                    out.println(iii + "_stringlen = _env->GetStringUTFLength(" + cname + ");");
+                    out.println(iii + "if (" + checks[index + 2] + " > _stringlen) {");
+                    out.println(iii + indent + "_exception = 1;");
+                    out.println(iii + indent +
+                            "_exceptionType = \"java/lang/ArrayIndexOutOfBoundsException\";");
+                    out.println(iii + indent +
+                            "_exceptionMessage = \"length of " + cname + " is shorter than " +
+                            checks[index + 2] + " argument\";");
+                    out.println(iii + indent + "goto exit;");
+                    out.println(iii + "}");
+                    index += 3;
+                    needsExit = true;
+                } else {
+                    index = skipOneCheck(checks, index);
+                }
+            }
+        }
+    }
+
     void emitLocalVariablesForSentinel(CFunc cfunc, PrintStream out) {
 
         String[] checks = mChecker.getChecks(cfunc.getName());
@@ -1066,12 +1114,20 @@ public class JniCodeEmitter {
 
         // Emit local variable declaration for strings
         if (stringArgs.size() > 0) {
+            boolean requiresStringLengthCheck = false;
             for (int i = 0; i < stringArgs.size(); i++) {
                 int idx = stringArgs.get(i).intValue();
                 int cIndex = jfunc.getArgCIndex(idx);
                 String cname = cfunc.getArgName(cIndex);
 
                 out.println(indent + "const char* _native" + cname + " = 0;");
+                if (hasCheckTest(cfunc, cname)) {
+                    requiresStringLengthCheck = true;
+                }
+            }
+
+            if (requiresStringLengthCheck) {
+                out.println(indent + "jsize _stringlen = 0;");
             }
 
             out.println();
@@ -1084,19 +1140,34 @@ public class JniCodeEmitter {
                 int cIndex = jfunc.getArgCIndex(idx);
                 String cname = cfunc.getArgName(cIndex);
 
+                boolean nullAllowed = isNullAllowed(cfunc, cname);
+                String nullAllowedIndent = nullAllowed ? indent : "";
+
                 CType type = cfunc.getArgType(jfunc.getArgCIndex(idx));
                 String decl = type.getDeclaration();
-                needsExit = true;
-                out.println(indent + "if (!" + cname + ") {");
-                out.println(indent + indent + "_exception = 1;");
-                out.println(indent + indent +
+
+                if (nullAllowed) {
+                    out.println(indent + "if (" + cname + ") {");
+                } else {
+                    needsExit = true;
+                    out.println(indent + "if (!" + cname + ") {");
+                    out.println(indent + indent + "_exception = 1;");
+                    out.println(indent + indent +
                             "_exceptionType = \"java/lang/IllegalArgumentException\";");
-                out.println(indent + indent +
+                    out.println(indent + indent +
                             "_exceptionMessage = \"" + cname + " == null\";");
-                out.println(indent + indent + "goto exit;");
-                out.println(indent + "}");
+                    out.println(indent + indent + "goto exit;");
+                    out.println(indent + "}");
+                }
+
+                out.println(nullAllowedIndent + indent + "_native" + cname +
+                        " = _env->GetStringUTFChars(" + cname + ", 0);");
 
-                out.println(indent + "_native" + cname + " = _env->GetStringUTFChars(" + cname + ", 0);");
+                emitStringCheck(cfunc, cname, out, nullAllowedIndent + indent);
+
+                if (nullAllowed) {
+                    out.println(indent + "}");
+                }
             }
 
             out.println();
@@ -1115,85 +1186,126 @@ public class JniCodeEmitter {
                 remaining = ((numArrays + numBuffers) <= 1) ? "_remaining" :
                     "_" + cname + "Remaining";
 
+                boolean nullAllowed = isNullAllowed(cfunc, cname);
+                String nullAllowedIndent = nullAllowed ? indent : "";
+
                 if (jfunc.getArgType(idx).isArray()
                        && !jfunc.getArgType(idx).isEGLHandle()) {
                     needsExit = true;
-                    out.println(indent + "if (!" + cname + "_ref) {");
-                    out.println(indent + indent + "_exception = 1;");
-                    out.println(indent + indent +
-                                "_exceptionType = \"java/lang/IllegalArgumentException\";");
-                    out.println(indent + indent +
-                                "_exceptionMessage = \"" + cname +" == null\";");
-                    out.println(indent + indent + "goto exit;");
-                    out.println(indent + "}");
-                    out.println(indent + "if (" + offset + " < 0) {");
-                    out.println(indent + indent + "_exception = 1;");
-                    out.println(indent + indent +
-                                "_exceptionType = \"java/lang/IllegalArgumentException\";");
-                    out.println(indent + indent +
-                                "_exceptionMessage = \"" + offset +" < 0\";");
-                    out.println(indent + indent + "goto exit;");
-                    out.println(indent + "}");
 
-                    out.println(indent + remaining + " = " +
-                                    (mUseCPlusPlus ? "_env" : "(*_env)") +
-                                    "->GetArrayLength(" +
-                                    (mUseCPlusPlus ? "" : "_env, ") +
-                                    cname + "_ref) - " + offset + ";");
+                    if (nullAllowed) {
+                        out.println(indent + "if (" + cname + "_ref) {");
+                    }
+                    else
+                    {
+                        out.println(indent + "if (!" + cname + "_ref) {");
+                        out.println(indent + indent + "_exception = 1;");
+                        out.println(indent + indent +
+                                "_exceptionType = " +
+                                "\"java/lang/IllegalArgumentException\";");
+                        out.println(indent + indent +
+                                "_exceptionMessage = \"" + cname +
+                                " == null\";");
+                        out.println(indent + indent + "goto exit;");
+                        out.println(indent + "}");
+                    }
+
+                    out.println(nullAllowedIndent + indent + "if (" + offset +
+                            " < 0) {");
+                    out.println(nullAllowedIndent + indent + indent +
+                            "_exception = 1;");
+                    out.println(nullAllowedIndent + indent + indent +
+                            "_exceptionType = " +
+                            "\"java/lang/IllegalArgumentException\";");
+                    out.println(nullAllowedIndent + indent + indent +
+                            "_exceptionMessage = \"" + offset +" < 0\";");
+                    out.println(nullAllowedIndent + indent + indent +
+                            "goto exit;");
+                    out.println(nullAllowedIndent + indent + "}");
+
+                    out.println(nullAllowedIndent + indent + remaining + " = " +
+                            (mUseCPlusPlus ? "_env" : "(*_env)") +
+                            "->GetArrayLength(" +
+                            (mUseCPlusPlus ? "" : "_env, ") +
+                            cname + "_ref) - " + offset + ";");
 
                     emitNativeBoundsChecks(cfunc, cname, out, false,
-                                           emitExceptionCheck,
-                                           offset, remaining, "    ");
+                            emitExceptionCheck, offset, remaining,
+                            nullAllowedIndent + indent);
 
-                    out.println(indent +
+                    out.println(nullAllowedIndent + indent +
                                 cname +
                                 "_base = (" +
                                 cfunc.getArgType(cIndex).getDeclaration() +
                                 ")");
                     String arrayGetter = jfunc.getArgType(idx).getArrayGetterForPrimitiveArray();
-                    out.println(indent + "    " +
+                    out.println(nullAllowedIndent + indent + "    " +
                                 (mUseCPlusPlus ? "_env" : "(*_env)") +
                                 "->" + arrayGetter + "(" +
                                 (mUseCPlusPlus ? "" : "_env, ") +
                                 jfunc.getArgName(idx) +
                                 "_ref, (jboolean *)0);");
-                    out.println(indent +
+                    out.println(nullAllowedIndent + indent +
                                 cname + " = " + cname + "_base + " + offset + ";");
 
                     emitSentinelCheck(cfunc, cname, out, false,
-                                      emitExceptionCheck, offset,
-                                      remaining, indent);
+                            emitExceptionCheck, offset, remaining,
+                            nullAllowedIndent + indent);
+
+                    if (nullAllowed) {
+                        out.println(indent + "}");
+                    }
+
                     out.println();
                 } else if (jfunc.getArgType(idx).isArray()
                               && jfunc.getArgType(idx).isEGLHandle()) {
                     needsExit = true;
-                    out.println(indent + "if (!" + cname + "_ref) {");
-                    out.println(indent + indent + "_exception = 1;");
-                    out.println(indent + indent +
-                                "_exceptionType = \"java/lang/IllegalArgumentException\";");
-                    out.println(indent + indent + "_exceptionMessage = \"" + cname +" == null\";");
-                    out.println(indent + indent + "goto exit;");
-                    out.println(indent + "}");
-                    out.println(indent + "if (" + offset + " < 0) {");
-                    out.println(indent + indent + "_exception = 1;");
-                    out.println(indent + indent +
-                                "_exceptionType = \"java/lang/IllegalArgumentException\";");
-                    out.println(indent + indent + "_exceptionMessage = \"" + offset +" < 0\";");
-                    out.println(indent + indent + "goto exit;");
-                    out.println(indent + "}");
 
-                    out.println(indent + remaining + " = " +
+                    if (nullAllowed) {
+                        out.println(indent + "if (" + cname + "_ref) {");
+                    }
+                    else
+                    {
+                        out.println(indent + "if (!" + cname + "_ref) {");
+                        out.println(indent + indent + "_exception = 1;");
+                        out.println(indent + indent + "_exceptionType = " +
+                                "\"java/lang/IllegalArgumentException\";");
+                        out.println(indent + indent + "_exceptionMessage = \"" +
+                                cname +" == null\";");
+                        out.println(indent + indent + "goto exit;");
+                        out.println(indent + "}");
+                    }
+
+                    out.println(nullAllowedIndent + indent + "if (" + offset +
+                            " < 0) {");
+                    out.println(nullAllowedIndent + indent + indent +
+                            "_exception = 1;");
+                    out.println(nullAllowedIndent + indent + indent +
+                            "_exceptionType = " +
+                            "\"java/lang/IllegalArgumentException\";");
+                    out.println(nullAllowedIndent + indent + indent +
+                            "_exceptionMessage = \"" + offset +" < 0\";");
+                    out.println(nullAllowedIndent + indent + indent +
+                            "goto exit;");
+                    out.println(nullAllowedIndent + indent + "}");
+
+                    out.println(nullAllowedIndent + indent + remaining + " = " +
                                     (mUseCPlusPlus ? "_env" : "(*_env)") +
                                     "->GetArrayLength(" +
                                     (mUseCPlusPlus ? "" : "_env, ") +
                                     cname + "_ref) - " + offset + ";");
                     emitNativeBoundsChecks(cfunc, cname, out, false,
-                                           emitExceptionCheck,
-                                           offset, remaining, "    ");
-                    out.println(indent +
+                            emitExceptionCheck, offset, remaining,
+                            nullAllowedIndent + indent);
+                    out.println(nullAllowedIndent + indent +
                                 jfunc.getArgName(idx) + " = new " +
                                 cfunc.getArgType(cIndex).getBaseType() +
                                "["+ remaining + "];");
+
+                    if (nullAllowed) {
+                        out.println(indent + "}");
+                    }
+
                     out.println();
                 } else if (jfunc.getArgType(idx).isBuffer()) {
                     String array = numBufferArgs <= 1 ? "_array" :
@@ -1201,7 +1313,7 @@ public class JniCodeEmitter {
                     String bufferOffset = numBufferArgs <= 1 ? "_bufferOffset" :
                         "_" + cfunc.getArgName(cIndex) + "BufferOffset";
 
-                    boolean nullAllowed = isNullAllowed(cfunc) || isPointerFunc;
+                    nullAllowed = nullAllowed || isPointerFunc;
                     if (nullAllowed) {
                         out.println(indent + "if (" + cname + "_buf) {");
                         out.print(indent);
@@ -1254,7 +1366,8 @@ public class JniCodeEmitter {
                 String array = numBufferArgs <= 1 ? "_array" :
                             "_" + cfunc.getArgName(cIndex) + "Array";
 
-                boolean nullAllowed = isNullAllowed(cfunc) || isPointerFunc;
+                boolean nullAllowed = isNullAllowed(cfunc, cname) ||
+                        isPointerFunc;
                 if (nullAllowed) {
                     out.println(indent + "if (" + cname + "_buf && " + cname +" == NULL) {");
                 } else {
index 6199637..497d284 100755 (executable)
@@ -13,34 +13,30 @@ android_eglCreatePbufferFromClientBuffer
     jint _remaining;
     EGLint *attrib_list = (EGLint *) 0;
 
-    if (!attrib_list_ref) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "attrib_list == null";
-        goto exit;
-    }
-    if (offset < 0) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "offset < 0";
-        goto exit;
-    }
-    _remaining = _env->GetArrayLength(attrib_list_ref) - offset;
-    attrib_list_base = (EGLint *)
-        _env->GetIntArrayElements(attrib_list_ref, (jboolean *)0);
-    attrib_list = attrib_list_base + offset;
-    attrib_list_sentinel = false;
-    for (int i = _remaining - 1; i >= 0; i--)  {
-        if (attrib_list[i] == EGL_NONE){
-            attrib_list_sentinel = true;
-            break;
+    if (attrib_list_ref) {
+        if (offset < 0) {
+            _exception = 1;
+            _exceptionType = "java/lang/IllegalArgumentException";
+            _exceptionMessage = "offset < 0";
+            goto exit;
+        }
+        _remaining = _env->GetArrayLength(attrib_list_ref) - offset;
+        attrib_list_base = (EGLint *)
+            _env->GetIntArrayElements(attrib_list_ref, (jboolean *)0);
+        attrib_list = attrib_list_base + offset;
+        attrib_list_sentinel = false;
+        for (int i = _remaining - 1; i >= 0; i--)  {
+            if (attrib_list[i] == EGL_NONE){
+                attrib_list_sentinel = true;
+                break;
+            }
+        }
+        if (attrib_list_sentinel == false) {
+            _exception = 1;
+            _exceptionType = "java/lang/IllegalArgumentException";
+            _exceptionMessage = "attrib_list must contain EGL_NONE!";
+            goto exit;
         }
-    }
-    if (attrib_list_sentinel == false) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "attrib_list must contain EGL_NONE!";
-        goto exit;
     }
 
     _returnValue = eglCreatePbufferFromClientBuffer(
index cc7b85d..355c4b0 100644 (file)
@@ -14,18 +14,32 @@ android_eglCreateWindowSurface
     EGLint *attrib_list = (EGLint *) 0;
     android::sp<ANativeWindow> window;
 
-    if (!attrib_list_ref) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "attrib_list == null";
-        goto exit;
-    }
-    if (offset < 0) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "offset < 0";
-        goto exit;
+    if (attrib_list_ref) {
+        if (offset < 0) {
+            _exception = 1;
+            _exceptionType = "java/lang/IllegalArgumentException";
+            _exceptionMessage = "offset < 0";
+            goto exit;
+        }
+        _remaining = _env->GetArrayLength(attrib_list_ref) - offset;
+        attrib_list_base = (EGLint *)
+            _env->GetIntArrayElements(attrib_list_ref, (jboolean *)0);
+        attrib_list = attrib_list_base + offset;
+        attrib_list_sentinel = 0;
+        for (int i = _remaining - 1; i >= 0; i--)  {
+            if (*((EGLint*)(attrib_list + i)) == EGL_NONE){
+                attrib_list_sentinel = 1;
+                break;
+            }
+        }
+        if (attrib_list_sentinel == 0) {
+            _exception = 1;
+            _exceptionType = "java/lang/IllegalArgumentException";
+            _exceptionMessage = "attrib_list must contain EGL_NONE!";
+            goto exit;
+        }
     }
+
     if (win == NULL) {
 not_valid_surface:
         _exception = 1;
@@ -39,24 +53,6 @@ not_valid_surface:
     if (window == NULL)
         goto not_valid_surface;
 
-    _remaining = _env->GetArrayLength(attrib_list_ref) - offset;
-    attrib_list_base = (EGLint *)
-        _env->GetIntArrayElements(attrib_list_ref, (jboolean *)0);
-    attrib_list = attrib_list_base + offset;
-    attrib_list_sentinel = 0;
-    for (int i = _remaining - 1; i >= 0; i--)  {
-        if (*((EGLint*)(attrib_list + i)) == EGL_NONE){
-            attrib_list_sentinel = 1;
-            break;
-        }
-    }
-    if (attrib_list_sentinel == 0) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "attrib_list must contain EGL_NONE!";
-        goto exit;
-    }
-
     _returnValue = eglCreateWindowSurface(
         (EGLDisplay)dpy_native,
         (EGLConfig)config_native,
index 5b45df4..c9ed04c 100644 (file)
@@ -24,9 +24,14 @@ public class GLES31 extends GLES30 {
 
     public static final int GL_VERTEX_SHADER_BIT                            = 0x00000001;
     public static final int GL_FRAGMENT_SHADER_BIT                          = 0x00000002;
+    public static final int GL_COMPUTE_SHADER_BIT                           = 0x00000020;
+    public static final int GL_ALL_SHADER_BITS                              = -1; // 0xFFFFFFFF
+
+    public static final int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT              = 0x00000001;
+    public static final int GL_ELEMENT_ARRAY_BARRIER_BIT                    = 0x00000002;
     public static final int GL_UNIFORM_BARRIER_BIT                          = 0x00000004;
     public static final int GL_TEXTURE_FETCH_BARRIER_BIT                    = 0x00000008;
-    public static final int GL_COMPUTE_SHADER_BIT                           = 0x00000020;
+    public static final int GL_SHADER_IMAGE_ACCESS_BARRIER_BIT              = 0x00000020;
     public static final int GL_COMMAND_BARRIER_BIT                          = 0x00000040;
     public static final int GL_PIXEL_BUFFER_BARRIER_BIT                     = 0x00000080;
     public static final int GL_TEXTURE_UPDATE_BARRIER_BIT                   = 0x00000100;
@@ -35,7 +40,8 @@ public class GLES31 extends GLES30 {
     public static final int GL_TRANSFORM_FEEDBACK_BARRIER_BIT               = 0x00000800;
     public static final int GL_ATOMIC_COUNTER_BARRIER_BIT                   = 0x00001000;
     public static final int GL_SHADER_STORAGE_BARRIER_BIT                   = 0x00002000;
-    public static final int GL_ALL_SHADER_BITS                              = -1; // 0xFFFFFFFF
+    public static final int GL_ALL_BARRIER_BITS                             = -1; // 0xFFFFFFFF
+
 
     public static final int GL_TEXTURE_WIDTH                                = 0x1000;
     public static final int GL_TEXTURE_HEIGHT                               = 0x1001;
index a8d63d9..6cdbf71 100644 (file)
@@ -18,22 +18,18 @@ android_glGetActiveAttrib__III_3II_3II_3II_3BI
     jint _nameRemaining;
     char *name = (char *) 0;
 
-    if (!length_ref) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "length == null";
-        goto exit;
-    }
-    if (lengthOffset < 0) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "lengthOffset < 0";
-        goto exit;
+    if (length_ref) {
+        if (lengthOffset < 0) {
+            _exception = 1;
+            _exceptionType = "java/lang/IllegalArgumentException";
+            _exceptionMessage = "lengthOffset < 0";
+            goto exit;
+        }
+        _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
+        length_base = (GLsizei *)
+            _env->GetIntArrayElements(length_ref, (jboolean *)0);
+        length = length_base + lengthOffset;
     }
-    _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
-    length_base = (GLsizei *)
-        _env->GetIntArrayElements(length_ref, (jboolean *)0);
-    length = length_base + lengthOffset;
 
     if (!size_ref) {
         _exception = 1;
index 68e8389..07094bd 100644 (file)
@@ -18,22 +18,18 @@ android_glGetActiveUniform__III_3II_3II_3II_3BI
     jint _nameRemaining;
     char *name = (char *) 0;
 
-    if (!length_ref) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "length == null";
-        goto exit;
-    }
-    if (lengthOffset < 0) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "lengthOffset < 0";
-        goto exit;
+    if (length_ref) {
+        if (lengthOffset < 0) {
+            _exception = 1;
+            _exceptionType = "java/lang/IllegalArgumentException";
+            _exceptionMessage = "lengthOffset < 0";
+            goto exit;
+        }
+        _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
+        length_base = (GLsizei *)
+            _env->GetIntArrayElements(length_ref, (jboolean *)0);
+        length = length_base + lengthOffset;
     }
-    _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
-    length_base = (GLsizei *)
-        _env->GetIntArrayElements(length_ref, (jboolean *)0);
-    length = length_base + lengthOffset;
 
     if (!size_ref) {
         _exception = 1;
index 6104c84..24086e4 100644 (file)
@@ -12,22 +12,18 @@ android_glGetActiveUniformBlockName_III_3II_3BI
     jint _nameRemaining;
     GLchar* _name = (GLchar*)0;
 
-    if (!length_ref) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "length == null";
-        goto exit;
-    }
-    if (lengthOffset < 0) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "lengthOffset < 0";
-        goto exit;
+    if (length_ref) {
+        if (lengthOffset < 0) {
+            _exception = 1;
+            _exceptionType = "java/lang/IllegalArgumentException";
+            _exceptionMessage = "lengthOffset < 0";
+            goto exit;
+        }
+        _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
+        _length_base = (GLsizei*)_env->GetIntArrayElements(
+                length_ref, (jboolean*)0);
+        _length = _length_base + lengthOffset;
     }
-    _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
-    _length_base = (GLsizei*)_env->GetIntArrayElements(
-            length_ref, (jboolean*)0);
-    _length = _length_base + lengthOffset;
 
     if (!name_ref) {
         _exception = 1;
index d9808ef..55469db 100644 (file)
@@ -12,22 +12,18 @@ android_glGetShaderSource__II_3II_3BI
     jint _sourceRemaining;
     char *source = (char *) 0;
 
-    if (!length_ref) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "length == null";
-        goto exit;
-    }
-    if (lengthOffset < 0) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "lengthOffset < 0";
-        goto exit;
+    if (length_ref) {
+        if (lengthOffset < 0) {
+            _exception = 1;
+            _exceptionType = "java/lang/IllegalArgumentException";
+            _exceptionMessage = "lengthOffset < 0";
+            goto exit;
+        }
+        _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
+        length_base = (GLsizei *)
+            _env->GetIntArrayElements(length_ref, (jboolean *)0);
+        length = length_base + lengthOffset;
     }
-    _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
-    length_base = (GLsizei *)
-        _env->GetIntArrayElements(length_ref, (jboolean *)0);
-    length = length_base + lengthOffset;
 
     if (!source_ref) {
         _exception = 1;
index cb656c8..47f232d 100644 (file)
@@ -18,22 +18,18 @@ android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI
     jint _nameRemaining;
     char *name = (char *) 0;
 
-    if (!length_ref) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "length == null";
-        goto exit;
-    }
-    if (lengthOffset < 0) {
-        _exception = 1;
-        _exceptionType = "java/lang/IllegalArgumentException";
-        _exceptionMessage = "lengthOffset < 0";
-        goto exit;
+    if (length_ref) {
+        if (lengthOffset < 0) {
+            _exception = 1;
+            _exceptionType = "java/lang/IllegalArgumentException";
+            _exceptionMessage = "lengthOffset < 0";
+            goto exit;
+        }
+        _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
+        length_base = (GLsizei *)
+            _env->GetIntArrayElements(length_ref, (jboolean *)0);
+        length = length_base + lengthOffset;
     }
-    _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
-    length_base = (GLsizei *)
-        _env->GetIntArrayElements(length_ref, (jboolean *)0);
-    length = length_base + lengthOffset;
 
     if (!size_ref) {
         _exception = 1;
index 3ba38b5..2aee8ad 100644 (file)
@@ -3053,15 +3053,15 @@ void TouchInputMapper::configureParameters() {
     // multitouch.  The spot-based presentation relies on being able to accurately
     // locate two or more fingers on the touch pad.
     mParameters.gestureMode = getEventHub()->hasInputProperty(getDeviceId(), INPUT_PROP_SEMI_MT)
-            ? Parameters::GESTURE_MODE_POINTER : Parameters::GESTURE_MODE_SPOTS;
+            ? Parameters::GESTURE_MODE_SINGLE_TOUCH : Parameters::GESTURE_MODE_MULTI_TOUCH;
 
     String8 gestureModeString;
     if (getDevice()->getConfiguration().tryGetProperty(String8("touch.gestureMode"),
             gestureModeString)) {
-        if (gestureModeString == "pointer") {
-            mParameters.gestureMode = Parameters::GESTURE_MODE_POINTER;
-        } else if (gestureModeString == "spots") {
-            mParameters.gestureMode = Parameters::GESTURE_MODE_SPOTS;
+        if (gestureModeString == "single-touch") {
+            mParameters.gestureMode = Parameters::GESTURE_MODE_SINGLE_TOUCH;
+        } else if (gestureModeString == "multi-touch") {
+            mParameters.gestureMode = Parameters::GESTURE_MODE_MULTI_TOUCH;
         } else if (gestureModeString != "default") {
             ALOGW("Invalid value for touch.gestureMode: '%s'", gestureModeString.string());
         }
@@ -3129,11 +3129,11 @@ void TouchInputMapper::dumpParameters(String8& dump) {
     dump.append(INDENT3 "Parameters:\n");
 
     switch (mParameters.gestureMode) {
-    case Parameters::GESTURE_MODE_POINTER:
-        dump.append(INDENT4 "GestureMode: pointer\n");
+    case Parameters::GESTURE_MODE_SINGLE_TOUCH:
+        dump.append(INDENT4 "GestureMode: single-touch\n");
         break;
-    case Parameters::GESTURE_MODE_SPOTS:
-        dump.append(INDENT4 "GestureMode: spots\n");
+    case Parameters::GESTURE_MODE_MULTI_TOUCH:
+        dump.append(INDENT4 "GestureMode: multi-touch\n");
         break;
     default:
         assert(false);
@@ -4929,14 +4929,17 @@ void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlag
     }
 
     // Update the pointer presentation and spots.
-    if (mParameters.gestureMode == Parameters::GESTURE_MODE_SPOTS) {
-        mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_SPOT);
+    if (mParameters.gestureMode == Parameters::GESTURE_MODE_MULTI_TOUCH) {
+        mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER);
         if (finishPreviousGesture || cancelPreviousGesture) {
             mPointerController->clearSpots();
         }
-        mPointerController->setSpots(mPointerGesture.currentGestureCoords,
-                mPointerGesture.currentGestureIdToIndex,
-                mPointerGesture.currentGestureIdBits);
+
+        if (mPointerGesture.currentGestureMode == PointerGesture::FREEFORM) {
+            mPointerController->setSpots(mPointerGesture.currentGestureCoords,
+                     mPointerGesture.currentGestureIdToIndex,
+                     mPointerGesture.currentGestureIdBits);
+        }
     } else {
         mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER);
     }
@@ -4945,9 +4948,8 @@ void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlag
     switch (mPointerGesture.currentGestureMode) {
     case PointerGesture::NEUTRAL:
     case PointerGesture::QUIET:
-        if (mParameters.gestureMode == Parameters::GESTURE_MODE_SPOTS
-                && (mPointerGesture.lastGestureMode == PointerGesture::SWIPE
-                        || mPointerGesture.lastGestureMode == PointerGesture::FREEFORM)) {
+        if (mParameters.gestureMode == Parameters::GESTURE_MODE_MULTI_TOUCH
+                && mPointerGesture.lastGestureMode == PointerGesture::FREEFORM) {
             // Remind the user of where the pointer is after finishing a gesture with spots.
             mPointerController->unfade(PointerControllerInterface::TRANSITION_GRADUAL);
         }
@@ -4957,15 +4959,15 @@ void TouchInputMapper::dispatchPointerGestures(nsecs_t when, uint32_t policyFlag
     case PointerGesture::BUTTON_CLICK_OR_DRAG:
     case PointerGesture::HOVER:
     case PointerGesture::PRESS:
+    case PointerGesture::SWIPE:
         // Unfade the pointer when the current gesture manipulates the
         // area directly under the pointer.
         mPointerController->unfade(PointerControllerInterface::TRANSITION_IMMEDIATE);
         break;
-    case PointerGesture::SWIPE:
     case PointerGesture::FREEFORM:
         // Fade the pointer when the current gesture manipulates a different
         // area and there are spots to guide the user experience.
-        if (mParameters.gestureMode == Parameters::GESTURE_MODE_SPOTS) {
+        if (mParameters.gestureMode == Parameters::GESTURE_MODE_MULTI_TOUCH) {
             mPointerController->fade(PointerControllerInterface::TRANSITION_GRADUAL);
         } else {
             mPointerController->unfade(PointerControllerInterface::TRANSITION_IMMEDIATE);
index 3e931fe..1de9d19 100644 (file)
@@ -1325,8 +1325,8 @@ protected:
         bool hasButtonUnderPad;
 
         enum GestureMode {
-            GESTURE_MODE_POINTER,
-            GESTURE_MODE_SPOTS,
+            GESTURE_MODE_SINGLE_TOUCH,
+            GESTURE_MODE_MULTI_TOUCH,
         };
         GestureMode gestureMode;
 
index b828175..0a7fc27 100644 (file)
@@ -58,5 +58,6 @@ LOCAL_SHARED_LIBRARIES := \
        libutils
 
 LOCAL_MODULE := inputflinger
+LOCAL_INIT_RC := inputflinger.rc
 
 include $(BUILD_EXECUTABLE)
index 630a596..bd11d56 100644 (file)
  * limitations under the License.
  */
 
+#include <functional>
 #include <stdint.h>
 #include <sys/types.h>
+#include <unordered_map>
+#include <vector>
 
 #define LOG_TAG "InputDriver"
 
 #include "InputHost.h"
 
 #include <hardware/input.h>
+#include <input/InputDevice.h>
 #include <utils/Log.h>
+#include <utils/PropertyMap.h>
 #include <utils/String8.h>
 
 #define INDENT2 "    "
 
+struct input_property_map {
+    android::PropertyMap* propertyMap;
+};
+
+struct input_property {
+    android::String8 key;
+    android::String8 value;
+};
+
+struct input_device_identifier {
+    const char* name;
+    const char* uniqueId;
+    input_bus_t bus;
+    int32_t     vendorId;
+    int32_t     productId;
+    int32_t     version;
+};
+
+struct input_device_definition {
+    std::vector<input_report_definition*> reportDefs;
+};
+
+struct input_device_handle {
+    input_device_identifier_t* id;
+    input_device_definition_t* def;
+};
+
+struct input_int_usage {
+    input_usage_t usage;
+    int32_t min;
+    int32_t max;
+    float   resolution;
+};
+
+struct input_collection {
+    int32_t arity;
+    std::vector<input_int_usage> intUsages;
+    std::vector<input_usage_t> boolUsages;
+};
+
+struct InputCollectionIdHasher {
+    std::size_t operator()(const input_collection_id& id) const {
+        return std::hash<int>()(static_cast<int>(id));
+    }
+};
+
+struct input_report_definition {
+    std::unordered_map<input_collection_id_t, input_collection, InputCollectionIdHasher> collections;
+};
+
+
 namespace android {
 
 static input_host_callbacks_t kCallbacks = {
@@ -37,6 +93,7 @@ static input_host_callbacks_t kCallbacks = {
     .create_device_definition = create_device_definition,
     .create_input_report_definition = create_input_report_definition,
     .create_output_report_definition = create_output_report_definition,
+    .free_report_definition = free_report_definition,
     .input_device_definition_add_report = input_device_definition_add_report,
     .input_report_definition_add_collection = input_report_definition_add_collection,
     .input_report_definition_declare_usage_int = input_report_definition_declare_usage_int,
@@ -61,86 +118,295 @@ InputDriver::InputDriver(const char* name) : mName(String8(name)) {
     mHal = reinterpret_cast<const input_module_t*>(module);
 }
 
-void InputDriver::init(InputHostInterface* host) {
-    mHal->init(mHal, static_cast<input_host_t*>(host), kCallbacks);
+void InputDriver::init() {
+    mHal->init(mHal, static_cast<input_host_t*>(this), kCallbacks);
+}
+
+input_device_identifier_t* InputDriver::createDeviceIdentifier(
+            const char* name, int32_t productId, int32_t vendorId,
+            input_bus_t bus, const char* uniqueId) {
+    auto identifier = new ::input_device_identifier {
+        .name = name,
+        .productId = productId,
+        .vendorId = vendorId,
+        .bus = bus,
+        .uniqueId = uniqueId,
+    };
+    // TODO: store this identifier somewhere
+    return identifier;
+}
+
+input_device_definition_t* InputDriver::createDeviceDefinition() {
+    return new ::input_device_definition;
+}
+
+input_report_definition_t* InputDriver::createInputReportDefinition() {
+    return new ::input_report_definition;
+}
+
+input_report_definition_t* InputDriver::createOutputReportDefinition() {
+    return new ::input_report_definition;
+}
+
+void InputDriver::freeReportDefinition(input_report_definition_t* reportDef) {
+    delete reportDef;
+}
+
+void InputDriver::inputDeviceDefinitionAddReport(input_device_definition_t* d,
+        input_report_definition_t* r) {
+    d->reportDefs.push_back(r);
+}
+
+void InputDriver::inputReportDefinitionAddCollection(input_report_definition_t* report,
+        input_collection_id_t id, int32_t arity) {
+    report->collections[id] = {.arity = arity};
+}
+
+void InputDriver::inputReportDefinitionDeclareUsageInt(input_report_definition_t* report,
+        input_collection_id_t id, input_usage_t usage, int32_t min, int32_t max,
+        float resolution) {
+    if (report->collections.find(id) != report->collections.end()) {
+        report->collections[id].intUsages.push_back({
+                .usage = usage, .min = min, .max = max, .resolution = resolution});
+    }
+}
+
+void InputDriver::inputReportDefinitionDeclareUsagesBool(input_report_definition_t* report,
+        input_collection_id_t id, input_usage_t* usage, size_t usageCount) {
+    if (report->collections.find(id) != report->collections.end()) {
+        for (size_t i = 0; i < usageCount; ++i) {
+            report->collections[id].boolUsages.push_back(usage[i]);
+        }
+    }
+}
+
+input_device_handle_t* InputDriver::registerDevice(input_device_identifier_t* id,
+        input_device_definition_t* d) {
+    ALOGD("Registering device %s with %zu input reports", id->name, d->reportDefs.size());
+    // TODO: save this device handle
+    return new input_device_handle{ .id = id, .def = d };
+}
+
+void InputDriver::unregisterDevice(input_device_handle_t* handle) {
+    delete handle;
+}
+
+input_report_t* InputDriver::inputAllocateReport(input_report_definition_t* r) {
+    ALOGD("Allocating input report for definition %p", r);
+    return nullptr;
+}
+
+void InputDriver::inputReportSetUsageInt(input_report_t* r, input_collection_id_t id,
+        input_usage_t usage, int32_t value, int32_t arity_index) {
+}
+
+void InputDriver::inputReportSetUsageBool(input_report_t* r, input_collection_id_t id,
+        input_usage_t usage, bool value, int32_t arity_index) {
+}
+
+void InputDriver::reportEvent(input_device_handle_t* d, input_report_t* report) {
+    ALOGD("report_event %p for handle %p", report, d);
+}
+
+input_property_map_t* InputDriver::inputGetDevicePropertyMap(input_device_identifier_t* id) {
+    InputDeviceIdentifier idi;
+    idi.name = id->name;
+    idi.uniqueId = id->uniqueId;
+    idi.bus = id->bus;
+    idi.vendor = id->vendorId;
+    idi.product = id->productId;
+    idi.version = id->version;
+
+    String8 configFile = getInputDeviceConfigurationFilePathByDeviceIdentifier(
+            idi, INPUT_DEVICE_CONFIGURATION_FILE_TYPE_CONFIGURATION);
+    if (configFile.isEmpty()) {
+        ALOGD("No input device configuration file found for device '%s'.",
+                idi.name.string());
+    } else {
+        auto propMap = new input_property_map_t();
+        status_t status = PropertyMap::load(configFile, &propMap->propertyMap);
+        if (status) {
+            ALOGE("Error loading input device configuration file for device '%s'. "
+                    "Using default configuration.",
+                    idi.name.string());
+            delete propMap;
+            return nullptr;
+        }
+        return propMap;
+    }
+    return nullptr;
+}
+
+input_property_t* InputDriver::inputGetDeviceProperty(input_property_map_t* map,
+        const char* key) {
+    String8 keyString(key);
+    if (map != nullptr) {
+        if (map->propertyMap->hasProperty(keyString)) {
+            auto prop = new input_property_t();
+            if (!map->propertyMap->tryGetProperty(keyString, prop->value)) {
+                delete prop;
+                return nullptr;
+            }
+            prop->key = keyString;
+            return prop;
+        }
+    }
+    return nullptr;
+}
+
+const char* InputDriver::inputGetPropertyKey(input_property_t* property) {
+    if (property != nullptr) {
+        return property->key.string();
+    }
+    return nullptr;
+}
+
+const char* InputDriver::inputGetPropertyValue(input_property_t* property) {
+    if (property != nullptr) {
+        return property->value.string();
+    }
+    return nullptr;
+}
+
+void InputDriver::inputFreeDeviceProperty(input_property_t* property) {
+    if (property != nullptr) {
+        delete property;
+    }
+}
+
+void InputDriver::inputFreeDevicePropertyMap(input_property_map_t* map) {
+    if (map != nullptr) {
+        delete map->propertyMap;
+        delete map;
+    }
 }
 
 void InputDriver::dump(String8& result) {
     result.appendFormat(INDENT2 "HAL Input Driver (%s)\n", mName.string());
 }
 
+} // namespace android
 
 // HAL wrapper functions
 
-input_device_identifier_t* create_device_identifier(input_host_t* host,
+namespace android {
+
+::input_device_identifier_t* create_device_identifier(input_host_t* host,
         const char* name, int32_t product_id, int32_t vendor_id,
         input_bus_t bus, const char* unique_id) {
-    return nullptr;
+    auto driver = static_cast<InputDriverInterface*>(host);
+    return driver->createDeviceIdentifier(name, product_id, vendor_id, bus, unique_id);
 }
 
 input_device_definition_t* create_device_definition(input_host_t* host) {
-    return nullptr;
+    auto driver = static_cast<InputDriverInterface*>(host);
+    return driver->createDeviceDefinition();
 }
 
 input_report_definition_t* create_input_report_definition(input_host_t* host) {
-    return nullptr;
+    auto driver = static_cast<InputDriverInterface*>(host);
+    return driver->createInputReportDefinition();
 }
 
 input_report_definition_t* create_output_report_definition(input_host_t* host) {
-    return nullptr;
+    auto driver = static_cast<InputDriverInterface*>(host);
+    return driver->createOutputReportDefinition();
+}
+
+void free_report_definition(input_host_t* host, input_report_definition_t* report_def) {
+    auto driver = static_cast<InputDriverInterface*>(host);
+    driver->freeReportDefinition(report_def);
 }
 
 void input_device_definition_add_report(input_host_t* host,
-        input_device_definition_t* d, input_report_definition_t* r) { }
+        input_device_definition_t* d, input_report_definition_t* r) {
+    auto driver = static_cast<InputDriverInterface*>(host);
+    driver->inputDeviceDefinitionAddReport(d, r);
+}
 
 void input_report_definition_add_collection(input_host_t* host,
-        input_report_definition_t* report, input_collection_id_t id, int32_t arity) { }
+        input_report_definition_t* report, input_collection_id_t id, int32_t arity) {
+    auto driver = static_cast<InputDriverInterface*>(host);
+    driver->inputReportDefinitionAddCollection(report, id, arity);
+}
 
 void input_report_definition_declare_usage_int(input_host_t* host,
         input_report_definition_t* report, input_collection_id_t id,
-        input_usage_t usage, int32_t min, int32_t max, float resolution) { }
+        input_usage_t usage, int32_t min, int32_t max, float resolution) {
+    auto driver = static_cast<InputDriverInterface*>(host);
+    driver->inputReportDefinitionDeclareUsageInt(report, id, usage, min, max, resolution);
+}
 
 void input_report_definition_declare_usages_bool(input_host_t* host,
         input_report_definition_t* report, input_collection_id_t id,
-        input_usage_t* usage, size_t usage_count) { }
-
+        input_usage_t* usage, size_t usage_count) {
+    auto driver = static_cast<InputDriverInterface*>(host);
+    driver->inputReportDefinitionDeclareUsagesBool(report, id, usage, usage_count);
+}
 
 input_device_handle_t* register_device(input_host_t* host,
         input_device_identifier_t* id, input_device_definition_t* d) {
-    return nullptr;
+    auto driver = static_cast<InputDriverInterface*>(host);
+    return driver->registerDevice(id, d);
+}
+
+void unregister_device(input_host_t* host, input_device_handle_t* handle) {
+    auto driver = static_cast<InputDriverInterface*>(host);
+    driver->unregisterDevice(handle);
 }
 
 input_report_t* input_allocate_report(input_host_t* host, input_report_definition_t* r) {
-    return nullptr;
+    auto driver = static_cast<InputDriverInterface*>(host);
+    return driver->inputAllocateReport(r);
 }
+
 void input_report_set_usage_int(input_host_t* host, input_report_t* r,
-        input_collection_id_t id, input_usage_t usage, int32_t value, int32_t arity_index) { }
+        input_collection_id_t id, input_usage_t usage, int32_t value, int32_t arity_index) {
+    auto driver = static_cast<InputDriverInterface*>(host);
+    driver->inputReportSetUsageInt(r, id, usage, value, arity_index);
+}
 
 void input_report_set_usage_bool(input_host_t* host, input_report_t* r,
-        input_collection_id_t id, input_usage_t usage, bool value, int32_t arity_index) { }
+        input_collection_id_t id, input_usage_t usage, bool value, int32_t arity_index) {
+    auto driver = static_cast<InputDriverInterface*>(host);
+    driver->inputReportSetUsageBool(r, id, usage, value, arity_index);
+}
 
-void report_event(input_host_t* host, input_device_handle_t* d, input_report_t* report) { }
+void report_event(input_host_t* host, input_device_handle_t* d, input_report_t* report) {
+    auto driver = static_cast<InputDriverInterface*>(host);
+    driver->reportEvent(d, report);
+}
 
 input_property_map_t* input_get_device_property_map(input_host_t* host,
         input_device_identifier_t* id) {
-    return nullptr;
+    auto driver = static_cast<InputDriverInterface*>(host);
+    return driver->inputGetDevicePropertyMap(id);
 }
 
 input_property_t* input_get_device_property(input_host_t* host, input_property_map_t* map,
         const char* key) {
-    return nullptr;
+    auto driver = static_cast<InputDriverInterface*>(host);
+    return driver->inputGetDeviceProperty(map, key);
 }
 
 const char* input_get_property_key(input_host_t* host, input_property_t* property) {
-    return nullptr;
+    auto driver = static_cast<InputDriverInterface*>(host);
+    return driver->inputGetPropertyKey(property);
 }
 
 const char* input_get_property_value(input_host_t* host, input_property_t* property) {
-    return nullptr;
+    auto driver = static_cast<InputDriverInterface*>(host);
+    return driver->inputGetPropertyValue(property);
 }
 
-void input_free_device_property(input_host_t* host, input_property_t* property) { }
+void input_free_device_property(input_host_t* host, input_property_t* property) {
+    auto driver = static_cast<InputDriverInterface*>(host);
+    driver->inputFreeDeviceProperty(property);
+}
 
-void input_free_device_property_map(input_host_t* host, input_property_map_t* map) { }
+void input_free_device_property_map(input_host_t* host, input_property_map_t* map) {
+    auto driver = static_cast<InputDriverInterface*>(host);
+    driver->inputFreeDevicePropertyMap(map);
+}
 
 } // namespace android
index 7734ac2..8d5a31e 100644 (file)
 #include <utils/RefBase.h>
 #include <utils/String8.h>
 
-namespace android {
+// Declare a concrete type for the HAL
+struct input_host {
+};
 
-class InputHostInterface;
+namespace android {
 
-class InputDriverInterface : public virtual RefBase {
+class InputDriverInterface : public input_host_t, public virtual RefBase {
 protected:
     InputDriverInterface() = default;
     virtual ~InputDriverInterface() = default;
 
 public:
-    virtual void init(InputHostInterface* host) = 0;
+    virtual void init() = 0;
+
+    virtual input_device_identifier_t* createDeviceIdentifier(
+            const char* name, int32_t productId, int32_t vendorId,
+            input_bus_t bus, const char* uniqueId) = 0;
+    virtual input_device_definition_t* createDeviceDefinition() = 0;
+    virtual input_report_definition_t* createInputReportDefinition() = 0;
+    virtual input_report_definition_t* createOutputReportDefinition() = 0;
+    virtual void freeReportDefinition(input_report_definition_t* reportDef) = 0;
+
+    virtual void inputDeviceDefinitionAddReport(input_device_definition_t* d,
+            input_report_definition_t* r) = 0;
+    virtual void inputReportDefinitionAddCollection(input_report_definition_t* report,
+            input_collection_id_t id, int32_t arity) = 0;
+    virtual void inputReportDefinitionDeclareUsageInt(input_report_definition_t* report,
+            input_collection_id_t id, input_usage_t usage, int32_t min, int32_t max,
+            float resolution) = 0;
+    virtual void inputReportDefinitionDeclareUsagesBool(input_report_definition_t* report,
+            input_collection_id_t id, input_usage_t* usage, size_t usageCount) = 0;
+
+    virtual input_device_handle_t* registerDevice(input_device_identifier_t* id,
+            input_device_definition_t* d) = 0;
+    virtual void unregisterDevice(input_device_handle_t* handle) = 0;
+
+    virtual input_report_t* inputAllocateReport(input_report_definition_t* r) = 0;
+    virtual void inputReportSetUsageInt(input_report_t* r, input_collection_id_t id,
+            input_usage_t usage, int32_t value, int32_t arity_index) = 0;
+    virtual void inputReportSetUsageBool(input_report_t* r, input_collection_id_t id,
+            input_usage_t usage, bool value, int32_t arity_index) = 0;
+    virtual void reportEvent(input_device_handle_t* d, input_report_t* report) = 0;
+
+    virtual input_property_map_t* inputGetDevicePropertyMap(input_device_identifier_t* id) = 0;
+    virtual input_property_t* inputGetDeviceProperty(input_property_map_t* map,
+            const char* key) = 0;
+    virtual const char* inputGetPropertyKey(input_property_t* property) = 0;
+    virtual const char* inputGetPropertyValue(input_property_t* property) = 0;
+    virtual void inputFreeDeviceProperty(input_property_t* property) = 0;
+    virtual void inputFreeDevicePropertyMap(input_property_map_t* map) = 0;
 
     virtual void dump(String8& result) = 0;
 };
@@ -46,7 +85,44 @@ public:
     InputDriver(const char* name);
     virtual ~InputDriver() = default;
 
-    virtual void init(InputHostInterface* host) override;
+    virtual void init() override;
+
+    virtual input_device_identifier_t* createDeviceIdentifier(
+            const char* name, int32_t productId, int32_t vendorId,
+            input_bus_t bus, const char* uniqueId) override;
+    virtual input_device_definition_t* createDeviceDefinition() override;
+    virtual input_report_definition_t* createInputReportDefinition() override;
+    virtual input_report_definition_t* createOutputReportDefinition() override;
+    virtual void freeReportDefinition(input_report_definition_t* reportDef) override;
+
+    virtual void inputDeviceDefinitionAddReport(input_device_definition_t* d,
+            input_report_definition_t* r) override;
+    virtual void inputReportDefinitionAddCollection(input_report_definition_t* report,
+            input_collection_id_t id, int32_t arity) override;
+    virtual void inputReportDefinitionDeclareUsageInt(input_report_definition_t* report,
+            input_collection_id_t id, input_usage_t usage, int32_t min, int32_t max,
+            float resolution) override;
+    virtual void inputReportDefinitionDeclareUsagesBool(input_report_definition_t* report,
+            input_collection_id_t id, input_usage_t* usage, size_t usageCount) override;
+
+    virtual input_device_handle_t* registerDevice(input_device_identifier_t* id,
+            input_device_definition_t* d) override;
+    virtual void unregisterDevice(input_device_handle_t* handle) override;
+
+    virtual input_report_t* inputAllocateReport(input_report_definition_t* r) override;
+    virtual void inputReportSetUsageInt(input_report_t* r, input_collection_id_t id,
+            input_usage_t usage, int32_t value, int32_t arity_index) override;
+    virtual void inputReportSetUsageBool(input_report_t* r, input_collection_id_t id,
+            input_usage_t usage, bool value, int32_t arity_index) override;
+    virtual void reportEvent(input_device_handle_t* d, input_report_t* report) override;
+
+    virtual input_property_map_t* inputGetDevicePropertyMap(input_device_identifier_t* id) override;
+    virtual input_property_t* inputGetDeviceProperty(input_property_map_t* map,
+            const char* key) override;
+    virtual const char* inputGetPropertyKey(input_property_t* property) override;
+    virtual const char* inputGetPropertyValue(input_property_t* property) override;
+    virtual void inputFreeDeviceProperty(input_property_t* property) override;
+    virtual void inputFreeDevicePropertyMap(input_property_map_t* map) override;
 
     virtual void dump(String8& result) override;
 
@@ -68,6 +144,8 @@ input_report_definition_t* create_input_report_definition(input_host_t* host);
 
 input_report_definition_t* create_output_report_definition(input_host_t* host);
 
+void free_report_definition(input_host_t* host, input_report_definition_t* report_def);
+
 void input_device_definition_add_report(input_host_t* host,
         input_device_definition_t* d, input_report_definition_t* r);
 
index 51d3e6b..094200a 100644 (file)
@@ -28,7 +28,7 @@ namespace android {
 
 void InputHost::registerInputDriver(InputDriverInterface* driver) {
     LOG_ALWAYS_FATAL_IF(driver == nullptr, "Cannot register a nullptr as an InputDriver!");
-    driver->init(this);
+    driver->init();
     mDrivers.push_back(driver);
 }
 
index 42a66e0..eda4a89 100644 (file)
 
 #include "InputDriver.h"
 
-// Declare a concrete type for the HAL
-struct input_host {
-};
-
 namespace android {
 
 class InputDriverInterface;
 
-class InputHostInterface : public input_host_t, public virtual RefBase {
+class InputHostInterface : public virtual RefBase {
 protected:
     InputHostInterface() = default;
     virtual ~InputHostInterface() = default;
diff --git a/services/inputflinger/host/inputflinger.rc b/services/inputflinger/host/inputflinger.rc
new file mode 100644 (file)
index 0000000..ae71ee5
--- /dev/null
@@ -0,0 +1,5 @@
+service inputflinger /system/bin/inputflinger
+    class main
+    user system
+    group input
+#    onrestart restart zygote
index b07d544..7b1f346 100644 (file)
@@ -58,12 +58,12 @@ bool CorrectedGyroSensor::process(sensors_event_t* outEvent,
 
 status_t CorrectedGyroSensor::activate(void* ident, bool enabled) {
     mSensorDevice.activate(ident, mGyro.getHandle(), enabled);
-    return mSensorFusion.activate(ident, enabled);
+    return mSensorFusion.activate(FUSION_9AXIS, ident, enabled);
 }
 
 status_t CorrectedGyroSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {
     mSensorDevice.setDelay(ident, mGyro.getHandle(), ns);
-    return mSensorFusion.setDelay(ident, ns);
+    return mSensorFusion.setDelay(FUSION_9AXIS, ident, ns);
 }
 
 Sensor CorrectedGyroSensor::getSensor() const {
index 4f63c31..359d289 100644 (file)
@@ -24,28 +24,44 @@ namespace android {
 
 // -----------------------------------------------------------------------
 
+/*==================== BEGIN FUSION SENSOR PARAMETER =========================*/
+
+/* Note:
+ *   If a platform uses software fusion, it is necessary to tune the following
+ *   parameters to fit the hardware sensors prior to release.
+ *
+ *   The DEFAULT_ parameters will be used in FUSION_9AXIS and FUSION_NOMAG mode.
+ *   The GEOMAG_ parameters will be used in FUSION_NOGYRO mode.
+ */
+
 /*
- * gyroVAR gives the measured variance of the gyro's output per
+ * GYRO_VAR gives the measured variance of the gyro's output per
  * Hz (or variance at 1 Hz). This is an "intrinsic" parameter of the gyro,
  * which is independent of the sampling frequency.
  *
  * The variance of gyro's output at a given sampling period can be
  * calculated as:
- *      variance(T) = gyroVAR / T
+ *      variance(T) = GYRO_VAR / T
  *
  * The variance of the INTEGRATED OUTPUT at a given sampling period can be
  * calculated as:
- *       variance_integrate_output(T) = gyroVAR * T
- *
+ *       variance_integrate_output(T) = GYRO_VAR * T
  */
-static const float gyroVAR = 1e-7;      // (rad/s)^2 / Hz
-static const float biasVAR = 1e-8;      // (rad/s)^2 / s (guessed)
+static const float DEFAULT_GYRO_VAR = 1e-7;      // (rad/s)^2 / Hz
+static const float DEFAULT_GYRO_BIAS_VAR = 1e-12;  // (rad/s)^2 / s (guessed)
+static const float GEOMAG_GYRO_VAR = 1e-4;      // (rad/s)^2 / Hz
+static const float GEOMAG_GYRO_BIAS_VAR = 1e-8;  // (rad/s)^2 / s (guessed)
 
 /*
  * Standard deviations of accelerometer and magnetometer
  */
-static const float accSTDEV  = 0.05f;   // m/s^2 (measured 0.08 / CDD 0.05)
-static const float magSTDEV  = 0.5f;    // uT    (measured 0.7  / CDD 0.5)
+static const float DEFAULT_ACC_STDEV  = 0.015f; // m/s^2 (measured 0.08 / CDD 0.05)
+static const float DEFAULT_MAG_STDEV  = 0.1f;   // uT    (measured 0.7  / CDD 0.5)
+static const float GEOMAG_ACC_STDEV  = 0.05f; // m/s^2 (measured 0.08 / CDD 0.05)
+static const float GEOMAG_MAG_STDEV  = 0.1f;   // uT    (measured 0.7  / CDD 0.5)
+
+
+/* ====================== END FUSION SENSOR PARAMETER ========================*/
 
 static const float SYMMETRY_TOLERANCE = 1e-10f;
 
@@ -54,7 +70,8 @@ static const float SYMMETRY_TOLERANCE = 1e-10f;
  * ill-conditioning and div by zeros.
  * Threshhold: 10% of g, in m/s^2
  */
-static const float FREE_FALL_THRESHOLD = 0.981f;
+static const float NOMINAL_GRAVITY = 9.81f;
+static const float FREE_FALL_THRESHOLD = 0.1f * (NOMINAL_GRAVITY);
 static const float FREE_FALL_THRESHOLD_SQ =
         FREE_FALL_THRESHOLD*FREE_FALL_THRESHOLD;
 
@@ -87,6 +104,9 @@ static const float MIN_VALID_CROSS_PRODUCT_MAG = 1.0e-3;
 static const float MIN_VALID_CROSS_PRODUCT_MAG_SQ =
     MIN_VALID_CROSS_PRODUCT_MAG*MIN_VALID_CROSS_PRODUCT_MAG;
 
+static const float W_EPS = 1e-4f;
+static const float SQRT_3 = 1.732f;
+static const float WVEC_EPS = 1e-4f/SQRT_3;
 // -----------------------------------------------------------------------
 
 template <typename TYPE, size_t C, size_t R>
@@ -173,7 +193,7 @@ Fusion::Fusion() {
     init();
 }
 
-void Fusion::init() {
+void Fusion::init(int mode) {
     mInitState = 0;
 
     mGyroRate = 0;
@@ -183,6 +203,19 @@ void Fusion::init() {
     mCount[2] = 0;
 
     mData = 0;
+    mMode = mode;
+
+    if (mMode != FUSION_NOGYRO) { //normal or game rotation
+        mParam.gyroVar = DEFAULT_GYRO_VAR;
+        mParam.gyroBiasVar = DEFAULT_GYRO_BIAS_VAR;
+        mParam.accStdev = DEFAULT_ACC_STDEV;
+        mParam.magStdev = DEFAULT_MAG_STDEV;
+    } else {
+        mParam.gyroVar = GEOMAG_GYRO_VAR;
+        mParam.gyroBiasVar = GEOMAG_GYRO_BIAS_VAR;
+        mParam.accStdev = GEOMAG_ACC_STDEV;
+        mParam.magStdev = GEOMAG_MAG_STDEV;
+    }
 }
 
 void Fusion::initFusion(const vec4_t& q, float dT)
@@ -205,11 +238,11 @@ void Fusion::initFusion(const vec4_t& q, float dT)
     const float dT3 = dT2*dT;
 
     // variance of integrated output at 1/dT Hz (random drift)
-    const float q00 = gyroVAR * dT + 0.33333f * biasVAR * dT3;
+    const float q00 = mParam.gyroVar * dT + 0.33333f * mParam.gyroBiasVar * dT3;
 
     // variance of drift rate ramp
-    const float q11 = biasVAR * dT;
-    const float q10 = 0.5f * biasVAR * dT2;
+    const float q11 = mParam.gyroBiasVar * dT;
+    const float q10 = 0.5f * mParam.gyroBiasVar * dT2;
     const float q01 = q10;
 
     GQGt[0][0] =  q00;      // rad^2
@@ -223,7 +256,9 @@ void Fusion::initFusion(const vec4_t& q, float dT)
 }
 
 bool Fusion::hasEstimate() const {
-    return (mInitState == (MAG|ACC|GYRO));
+    return ((mInitState & MAG) || (mMode == FUSION_NOMAG)) &&
+           ((mInitState & GYRO) || (mMode == FUSION_NOGYRO)) &&
+           (mInitState & ACC);
 }
 
 bool Fusion::checkInitComplete(int what, const vec3_t& d, float dT) {
@@ -234,6 +269,9 @@ bool Fusion::checkInitComplete(int what, const vec3_t& d, float dT) {
         mData[0] += d * (1/length(d));
         mCount[0]++;
         mInitState |= ACC;
+        if (mMode == FUSION_NOGYRO ) {
+            mGyroRate = dT;
+        }
     } else if (what == MAG) {
         mData[1] += d * (1/length(d));
         mCount[1]++;
@@ -242,25 +280,29 @@ bool Fusion::checkInitComplete(int what, const vec3_t& d, float dT) {
         mGyroRate = dT;
         mData[2] += d*dT;
         mCount[2]++;
-        if (mCount[2] == 64) {
-            // 64 samples is good enough to estimate the gyro drift and
-            // doesn't take too much time.
-            mInitState |= GYRO;
-        }
+        mInitState |= GYRO;
     }
 
-    if (mInitState == (MAG|ACC|GYRO)) {
+    if (hasEstimate()) {
         // Average all the values we collected so far
         mData[0] *= 1.0f/mCount[0];
-        mData[1] *= 1.0f/mCount[1];
+        if (mMode != FUSION_NOMAG) {
+            mData[1] *= 1.0f/mCount[1];
+        }
         mData[2] *= 1.0f/mCount[2];
 
         // calculate the MRPs from the data collection, this gives us
         // a rough estimate of our initial state
         mat33_t R;
-        vec3_t up(mData[0]);
-        vec3_t east(cross_product(mData[1], up));
-        east *= 1/length(east);
+        vec3_t  up(mData[0]);
+        vec3_t  east;
+
+        if (mMode != FUSION_NOMAG) {
+            east = normalize(cross_product(mData[1], up));
+        } else {
+            east = getOrthogonal(up);
+        }
+
         vec3_t north(cross_product(up, east));
         R << east << north << up;
         const vec4_t q = matrixToQuat(R);
@@ -278,21 +320,43 @@ void Fusion::handleGyro(const vec3_t& w, float dT) {
     predict(w, dT);
 }
 
-status_t Fusion::handleAcc(const vec3_t& a) {
+status_t Fusion::handleAcc(const vec3_t& a, float dT) {
+    if (!checkInitComplete(ACC, a, dT))
+        return BAD_VALUE;
+
     // ignore acceleration data if we're close to free-fall
-    if (length_squared(a) < FREE_FALL_THRESHOLD_SQ) {
+    const float l = length(a);
+    if (l < FREE_FALL_THRESHOLD) {
         return BAD_VALUE;
     }
 
-    if (!checkInitComplete(ACC, a))
-        return BAD_VALUE;
+    const float l_inv = 1.0f/l;
+
+    if ( mMode == FUSION_NOGYRO ) {
+        //geo mag
+        vec3_t w_dummy;
+        w_dummy = x1; //bias
+        predict(w_dummy, dT);
+    }
+
+    if ( mMode == FUSION_NOMAG) {
+        vec3_t m;
+        m = getRotationMatrix()*Bm;
+        update(m, Bm, mParam.magStdev);
+    }
 
-    const float l = 1/length(a);
-    update(a*l, Ba, accSTDEV*l);
+    vec3_t unityA = a * l_inv;
+    const float d = sqrtf(fabsf(l- NOMINAL_GRAVITY));
+    const float p = l_inv * mParam.accStdev*expf(d);
+
+    update(unityA, Ba, p);
     return NO_ERROR;
 }
 
 status_t Fusion::handleMag(const vec3_t& m) {
+    if (!checkInitComplete(MAG, m))
+        return BAD_VALUE;
+
     // the geomagnetic-field should be between 30uT and 60uT
     // reject if too large to avoid spurious magnetic sources
     const float magFieldSq = length_squared(m);
@@ -304,9 +368,6 @@ status_t Fusion::handleMag(const vec3_t& m) {
         return BAD_VALUE;
     }
 
-    if (!checkInitComplete(MAG, m))
-        return BAD_VALUE;
-
     // Orthogonalize the magnetic field to the gravity field, mapping it into
     // tangent to Earth.
     const vec3_t up( getRotationMatrix() * Ba );
@@ -324,10 +385,10 @@ status_t Fusion::handleMag(const vec3_t& m) {
     // then pass it in as the update.
     vec3_t north( cross_product(up, east) );
 
-    const float l = 1 / length(north);
-    north *= l;
+    const float l_inv = 1 / length(north);
+    north *= l_inv;
 
-    update(north, Bm, magSTDEV*l);
+    update(north, Bm,  mParam.magStdev*l_inv);
     return NO_ERROR;
 }
 
@@ -372,8 +433,11 @@ mat34_t Fusion::getF(const vec4_t& q) {
 void Fusion::predict(const vec3_t& w, float dT) {
     const vec4_t q  = x0;
     const vec3_t b  = x1;
-    const vec3_t we = w - b;
+    vec3_t we = w - b;
 
+    if (length(we) < WVEC_EPS) {
+        we = (we[0]>0.f)?WVEC_EPS:-WVEC_EPS;
+    }
     // q(k+1) = O(we)*q(k)
     // --------------------
     //
@@ -406,7 +470,7 @@ void Fusion::predict(const vec3_t& w, float dT) {
     const mat33_t wx2(wx*wx);
     const float lwedT = length(we)*dT;
     const float hlwedT = 0.5f*lwedT;
-    const float ilwe = 1/length(we);
+    const float ilwe = 1.f/length(we);
     const float k0 = (1-cosf(lwedT))*(ilwe*ilwe);
     const float k1 = sinf(lwedT);
     const float k2 = cosf(hlwedT);
@@ -422,6 +486,7 @@ void Fusion::predict(const vec3_t& w, float dT) {
     Phi[1][0] = wx*k0 - I33dT - wx2*(ilwe*ilwe*ilwe)*(lwedT-k1);
 
     x0 = O*q;
+
     if (x0.w < 0)
         x0 = -x0;
 
@@ -466,15 +531,37 @@ void Fusion::update(const vec3_t& z, const vec3_t& Bi, float sigma) {
 
     const vec3_t e(z - Bb);
     const vec3_t dq(K[0]*e);
-    const vec3_t db(K[1]*e);
 
     q += getF(q)*(0.5f*dq);
     x0 = normalize_quat(q);
-    x1 += db;
+
+    if (mMode != FUSION_NOMAG) {
+        const vec3_t db(K[1]*e);
+        x1 += db;
+    }
 
     checkState();
 }
 
+vec3_t Fusion::getOrthogonal(const vec3_t &v) {
+    vec3_t w;
+    if (fabsf(v[0])<= fabsf(v[1]) && fabsf(v[0]) <= fabsf(v[2]))  {
+        w[0]=0.f;
+        w[1] = v[2];
+        w[2] = -v[1];
+    } else if (fabsf(v[1]) <= fabsf(v[2])) {
+        w[0] = v[2];
+        w[1] = 0.f;
+        w[2] = -v[0];
+    }else {
+        w[0] = v[1];
+        w[1] = -v[0];
+        w[2] = 0.f;
+    }
+    return normalize(w);
+}
+
+
 // -----------------------------------------------------------------------
 
 }; // namespace android
index 7062999..602779f 100644 (file)
@@ -27,6 +27,13 @@ namespace android {
 
 typedef mat<float, 3, 4> mat34_t;
 
+enum FUSION_MODE{
+    FUSION_9AXIS, // use accel gyro mag
+    FUSION_NOMAG, // use accel gyro (game rotation, gravity)
+    FUSION_NOGYRO, // use accel mag (geomag rotation)
+    NUM_FUSION_MODE
+};
+
 class Fusion {
     /*
      * the state vector is made of two sub-vector containing respectively:
@@ -55,9 +62,9 @@ class Fusion {
 
 public:
     Fusion();
-    void init();
+    void init(int mode = FUSION_9AXIS);
     void handleGyro(const vec3_t& w, float dT);
-    status_t handleAcc(const vec3_t& a);
+    status_t handleAcc(const vec3_t& a, float dT);
     status_t handleMag(const vec3_t& m);
     vec4_t getAttitude() const;
     vec3_t getBias() const;
@@ -65,12 +72,21 @@ public:
     bool hasEstimate() const;
 
 private:
+    struct Parameter {
+        float gyroVar;
+        float gyroBiasVar;
+        float accStdev;
+        float magStdev;
+    } mParam;
+
     mat<mat33_t, 2, 2> Phi;
     vec3_t Ba, Bm;
     uint32_t mInitState;
     float mGyroRate;
     vec<vec3_t, 3> mData;
     size_t mCount[3];
+    int mMode;
+
     enum { ACC=0x1, MAG=0x2, GYRO=0x4 };
     bool checkInitComplete(int, const vec3_t& w, float d = 0);
     void initFusion(const vec4_t& q0, float dT);
@@ -78,6 +94,7 @@ private:
     void predict(const vec3_t& w, float dT);
     void update(const vec3_t& z, const vec3_t& Bi, float sigma);
     static mat34_t getF(const vec4_t& p);
+    static vec3_t getOrthogonal(const vec3_t &v);
 };
 
 }; // namespace android
index 61118bc..a165a5b 100644 (file)
@@ -46,9 +46,9 @@ bool GravitySensor::process(sensors_event_t* outEvent,
 {
     if (event.type == SENSOR_TYPE_ACCELEROMETER) {
         vec3_t g;
-        if (!mSensorFusion.hasEstimate())
+        if (!mSensorFusion.hasEstimate(FUSION_NOMAG))
             return false;
-        const mat33_t R(mSensorFusion.getRotationMatrix());
+        const mat33_t R(mSensorFusion.getRotationMatrix(FUSION_NOMAG));
         // FIXME: we need to estimate the length of gravity because
         // the accelerometer may have a small scaling error. This
         // translates to an offset in the linear-acceleration sensor.
@@ -66,11 +66,11 @@ bool GravitySensor::process(sensors_event_t* outEvent,
 }
 
 status_t GravitySensor::activate(void* ident, bool enabled) {
-    return mSensorFusion.activate(ident, enabled);
+    return mSensorFusion.activate(FUSION_NOMAG, ident, enabled);
 }
 
 status_t GravitySensor::setDelay(void* ident, int /*handle*/, int64_t ns) {
-    return mSensorFusion.setDelay(ident, ns);
+    return mSensorFusion.setDelay(FUSION_NOMAG, ident, ns);
 }
 
 Sensor GravitySensor::getSensor() const {
index 6d85cca..d55f336 100644 (file)
@@ -66,11 +66,11 @@ bool OrientationSensor::process(sensors_event_t* outEvent,
 }
 
 status_t OrientationSensor::activate(void* ident, bool enabled) {
-    return mSensorFusion.activate(ident, enabled);
+    return mSensorFusion.activate(FUSION_9AXIS, ident, enabled);
 }
 
 status_t OrientationSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {
-    return mSensorFusion.setDelay(ident, ns);
+    return mSensorFusion.setDelay(FUSION_9AXIS, ident, ns);
 }
 
 Sensor OrientationSensor::getSensor() const {
index cb305eb..238845b 100644 (file)
 namespace android {
 // ---------------------------------------------------------------------------
 
-RotationVectorSensor::RotationVectorSensor()
+RotationVectorSensor::RotationVectorSensor(int mode)
     : mSensorDevice(SensorDevice::getInstance()),
-      mSensorFusion(SensorFusion::getInstance())
+      mSensorFusion(SensorFusion::getInstance()),
+      mMode(mode)
 {
 }
 
@@ -37,15 +38,15 @@ bool RotationVectorSensor::process(sensors_event_t* outEvent,
         const sensors_event_t& event)
 {
     if (event.type == SENSOR_TYPE_ACCELEROMETER) {
-        if (mSensorFusion.hasEstimate()) {
-            const vec4_t q(mSensorFusion.getAttitude());
+        if (mSensorFusion.hasEstimate(mMode)) {
+            const vec4_t q(mSensorFusion.getAttitude(mMode));
             *outEvent = event;
             outEvent->data[0] = q.x;
             outEvent->data[1] = q.y;
             outEvent->data[2] = q.z;
             outEvent->data[3] = q.w;
-            outEvent->sensor = '_rov';
-            outEvent->type = SENSOR_TYPE_ROTATION_VECTOR;
+            outEvent->sensor = getSensorToken();
+            outEvent->type = getSensorType();
             return true;
         }
     }
@@ -53,20 +54,20 @@ bool RotationVectorSensor::process(sensors_event_t* outEvent,
 }
 
 status_t RotationVectorSensor::activate(void* ident, bool enabled) {
-    return mSensorFusion.activate(ident, enabled);
+    return mSensorFusion.activate(mMode, ident, enabled);
 }
 
 status_t RotationVectorSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {
-    return mSensorFusion.setDelay(ident, ns);
+    return mSensorFusion.setDelay(mMode, ident, ns);
 }
 
 Sensor RotationVectorSensor::getSensor() const {
     sensor_t hwSensor;
-    hwSensor.name       = "Rotation Vector Sensor";
+    hwSensor.name       = getSensorName();
     hwSensor.vendor     = "AOSP";
     hwSensor.version    = 3;
-    hwSensor.handle     = '_rov';
-    hwSensor.type       = SENSOR_TYPE_ROTATION_VECTOR;
+    hwSensor.handle     = getSensorToken();
+    hwSensor.type       = getSensorType();
     hwSensor.maxRange   = 1;
     hwSensor.resolution = 1.0f / (1<<24);
     hwSensor.power      = mSensorFusion.getPowerUsage();
@@ -75,6 +76,48 @@ Sensor RotationVectorSensor::getSensor() const {
     return sensor;
 }
 
+int RotationVectorSensor::getSensorType() const {
+    switch(mMode) {
+        case FUSION_9AXIS:
+            return SENSOR_TYPE_ROTATION_VECTOR;
+        case FUSION_NOMAG:
+            return SENSOR_TYPE_GAME_ROTATION_VECTOR;
+        case FUSION_NOGYRO:
+            return SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR;
+        default:
+            assert(0);
+            return 0;
+    }
+}
+
+const char* RotationVectorSensor::getSensorName() const {
+    switch(mMode) {
+        case FUSION_9AXIS:
+            return "Rotation Vector Sensor";
+        case FUSION_NOMAG:
+            return "Game Rotation Vector Sensor";
+        case FUSION_NOGYRO:
+            return "GeoMag Rotation Vector Sensor";
+        default:
+            assert(0);
+            return NULL;
+    }
+}
+
+int RotationVectorSensor::getSensorToken() const {
+    switch(mMode) {
+        case FUSION_9AXIS:
+            return '_rov';
+        case FUSION_NOMAG:
+            return '_gar';
+        case FUSION_NOGYRO:
+            return '_geo';
+        default:
+            assert(0);
+            return 0;
+    }
+}
+
 // ---------------------------------------------------------------------------
 
 GyroDriftSensor::GyroDriftSensor()
@@ -102,11 +145,11 @@ bool GyroDriftSensor::process(sensors_event_t* outEvent,
 }
 
 status_t GyroDriftSensor::activate(void* ident, bool enabled) {
-    return mSensorFusion.activate(ident, enabled);
+    return mSensorFusion.activate(FUSION_9AXIS, ident, enabled);
 }
 
 status_t GyroDriftSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {
-    return mSensorFusion.setDelay(ident, ns);
+    return mSensorFusion.setDelay(FUSION_9AXIS, ident, ns);
 }
 
 Sensor GyroDriftSensor::getSensor() const {
index bb97fe1..1fc316b 100644 (file)
@@ -35,9 +35,14 @@ namespace android {
 class RotationVectorSensor : public SensorInterface {
     SensorDevice& mSensorDevice;
     SensorFusion& mSensorFusion;
+    int mMode;
+
+    int getSensorType() const;
+    const char* getSensorName() const ;
+    int getSensorToken() const ;
 
 public:
-    RotationVectorSensor();
+    RotationVectorSensor(int mode = FUSION_9AXIS);
     virtual bool process(sensors_event_t* outEvent,
             const sensors_event_t& event);
     virtual status_t activate(void* ident, bool enabled);
@@ -46,6 +51,16 @@ public:
     virtual bool isVirtual() const { return true; }
 };
 
+class GameRotationVectorSensor : public RotationVectorSensor {
+public:
+    GameRotationVectorSensor() : RotationVectorSensor(FUSION_NOMAG) {}
+};
+
+class GeoMagRotationVectorSensor : public RotationVectorSensor {
+public:
+    GeoMagRotationVectorSensor() : RotationVectorSensor(FUSION_NOGYRO) {}
+};
+
 class GyroDriftSensor : public SensorInterface {
     SensorDevice& mSensorDevice;
     SensorFusion& mSensorFusion;
index 6d93009..9863f62 100644 (file)
@@ -25,11 +25,17 @@ ANDROID_SINGLETON_STATIC_INSTANCE(SensorFusion)
 
 SensorFusion::SensorFusion()
     : mSensorDevice(SensorDevice::getInstance()),
-      mEnabled(false), mGyroTime(0)
+      mAttitude(mAttitudes[FUSION_9AXIS]),
+      mGyroTime(0), mAccTime(0)
 {
     sensor_t const* list;
     Sensor uncalibratedGyro;
     ssize_t count = mSensorDevice.getSensorList(&list);
+
+    mEnabled[FUSION_9AXIS] = false;
+    mEnabled[FUSION_NOMAG] = false;
+    mEnabled[FUSION_NOGYRO] = false;
+
     if (count > 0) {
         for (size_t i=0 ; i<size_t(count) ; i++) {
             if (list[i].type == SENSOR_TYPE_ACCELEROMETER) {
@@ -55,81 +61,121 @@ SensorFusion::SensorFusion()
         // and power/cpu usage.
         mEstimatedGyroRate = 200;
         mTargetDelayNs = 1000000000LL/mEstimatedGyroRate;
-        mFusion.init();
+
+        for (int i = 0; i<NUM_FUSION_MODE; ++i) {
+            mFusions[i].init(i);
+        }
     }
 }
 
 void SensorFusion::process(const sensors_event_t& event) {
+
     if (event.type == mGyro.getType()) {
-        if (mGyroTime != 0) {
-            const float dT = (event.timestamp - mGyroTime) / 1000000000.0f;
-            mFusion.handleGyro(vec3_t(event.data), dT);
+        float dT;
+        if ( event.timestamp - mGyroTime> 0 &&
+             event.timestamp - mGyroTime< (int64_t)(5e7) ) { //0.05sec
+
+            dT = (event.timestamp - mGyroTime) / 1000000000.0f;
             // here we estimate the gyro rate (useful for debugging)
             const float freq = 1 / dT;
             if (freq >= 100 && freq<1000) { // filter values obviously wrong
                 const float alpha = 1 / (1 + dT); // 1s time-constant
                 mEstimatedGyroRate = freq + (mEstimatedGyroRate - freq)*alpha;
             }
+
+            const vec3_t gyro(event.data);
+            for (int i = 0; i<NUM_FUSION_MODE; ++i) {
+                if (mEnabled[i]) {
+                    // fusion in no gyro mode will ignore
+                    mFusions[i].handleGyro(gyro, dT);
+                }
+            }
         }
         mGyroTime = event.timestamp;
     } else if (event.type == SENSOR_TYPE_MAGNETIC_FIELD) {
         const vec3_t mag(event.data);
-        mFusion.handleMag(mag);
+        for (int i = 0; i<NUM_FUSION_MODE; ++i) {
+            if (mEnabled[i]) {
+                mFusions[i].handleMag(mag);// fusion in no mag mode will ignore
+            }
+        }
     } else if (event.type == SENSOR_TYPE_ACCELEROMETER) {
-        const vec3_t acc(event.data);
-        mFusion.handleAcc(acc);
-        mAttitude = mFusion.getAttitude();
+        float dT;
+        if ( event.timestamp - mAccTime> 0 &&
+             event.timestamp - mAccTime< (int64_t)(1e8) ) { //0.1sec
+            dT = (event.timestamp - mAccTime) / 1000000000.0f;
+
+            const vec3_t acc(event.data);
+            for (int i = 0; i<NUM_FUSION_MODE; ++i) {
+                if (mEnabled[i]) {
+                    mFusions[i].handleAcc(acc, dT);
+                    mAttitudes[i] = mFusions[i].getAttitude();
+                }
+            }
+        }
+        mAccTime = event.timestamp;
     }
 }
 
 template <typename T> inline T min(T a, T b) { return a<b ? a : b; }
 template <typename T> inline T max(T a, T b) { return a>b ? a : b; }
 
-status_t SensorFusion::activate(void* ident, bool enabled) {
+status_t SensorFusion::activate(int mode, void* ident, bool enabled) {
 
     ALOGD_IF(DEBUG_CONNECTIONS,
-            "SensorFusion::activate(ident=%p, enabled=%d)",
-            ident, enabled);
+            "SensorFusion::activate(mode=%d, ident=%p, enabled=%d)",
+            mode, ident, enabled);
 
-    const ssize_t idx = mClients.indexOf(ident);
+    const ssize_t idx = mClients[mode].indexOf(ident);
     if (enabled) {
         if (idx < 0) {
-            mClients.add(ident);
+            mClients[mode].add(ident);
         }
     } else {
         if (idx >= 0) {
-            mClients.removeItemsAt(idx);
+            mClients[mode].removeItemsAt(idx);
         }
     }
 
-    mSensorDevice.activate(ident, mAcc.getHandle(), enabled);
-    mSensorDevice.activate(ident, mMag.getHandle(), enabled);
-    mSensorDevice.activate(ident, mGyro.getHandle(), enabled);
-
-    const bool newState = mClients.size() != 0;
-    if (newState != mEnabled) {
-        mEnabled = newState;
+    const bool newState = mClients[mode].size() != 0;
+    if (newState != mEnabled[mode]) {
+        mEnabled[mode] = newState;
         if (newState) {
-            mFusion.init();
-            mGyroTime = 0;
+            mFusions[mode].init(mode);
         }
     }
+
+    mSensorDevice.activate(ident, mAcc.getHandle(), enabled);
+    if (mode != FUSION_NOMAG) {
+        mSensorDevice.activate(ident, mMag.getHandle(), enabled);
+    }
+    if (mode != FUSION_NOGYRO) {
+        mSensorDevice.activate(ident, mGyro.getHandle(), enabled);
+    }
+
     return NO_ERROR;
 }
 
-status_t SensorFusion::setDelay(void* ident, int64_t ns) {
+status_t SensorFusion::setDelay(int mode, void* ident, int64_t ns) {
     // Call batch with timeout zero instead of setDelay().
+    if (ns > (int64_t)5e7) {
+        ns = (int64_t)(5e7);
+    }
     mSensorDevice.batch(ident, mAcc.getHandle(), 0, ns, 0);
-    mSensorDevice.batch(ident, mMag.getHandle(), 0, ms2ns(20), 0);
-    mSensorDevice.batch(ident, mGyro.getHandle(), 0, mTargetDelayNs, 0);
+    if (mode != FUSION_NOMAG) {
+        mSensorDevice.batch(ident, mMag.getHandle(), 0, ms2ns(20), 0);
+    }
+    if (mode != FUSION_NOGYRO) {
+        mSensorDevice.batch(ident, mGyro.getHandle(), 0, mTargetDelayNs, 0);
+    }
     return NO_ERROR;
 }
 
 
-float SensorFusion::getPowerUsage() const {
+float SensorFusion::getPowerUsage(int mode) const {
     float power =   mAcc.getPowerUsage() +
-                    mMag.getPowerUsage() +
-                    mGyro.getPowerUsage();
+                    ((mode != FUSION_NOMAG) ? mMag.getPowerUsage() : 0) +
+                    ((mode != FUSION_NOGYRO) ? mGyro.getPowerUsage() : 0);
     return power;
 }
 
@@ -138,21 +184,55 @@ int32_t SensorFusion::getMinDelay() const {
 }
 
 void SensorFusion::dump(String8& result) {
-    const Fusion& fusion(mFusion);
+    const Fusion& fusion_9axis(mFusions[FUSION_9AXIS]);
     result.appendFormat("9-axis fusion %s (%zd clients), gyro-rate=%7.2fHz, "
             "q=< %g, %g, %g, %g > (%g), "
             "b=< %g, %g, %g >\n",
-            mEnabled ? "enabled" : "disabled",
-            mClients.size(),
+            mEnabled[FUSION_9AXIS] ? "enabled" : "disabled",
+            mClients[FUSION_9AXIS].size(),
+            mEstimatedGyroRate,
+            fusion_9axis.getAttitude().x,
+            fusion_9axis.getAttitude().y,
+            fusion_9axis.getAttitude().z,
+            fusion_9axis.getAttitude().w,
+            length(fusion_9axis.getAttitude()),
+            fusion_9axis.getBias().x,
+            fusion_9axis.getBias().y,
+            fusion_9axis.getBias().z);
+
+    const Fusion& fusion_nomag(mFusions[FUSION_NOMAG]);
+    result.appendFormat("game fusion(no mag) %s (%zd clients), "
+            "gyro-rate=%7.2fHz, "
+            "q=< %g, %g, %g, %g > (%g), "
+            "b=< %g, %g, %g >\n",
+            mEnabled[FUSION_NOMAG] ? "enabled" : "disabled",
+            mClients[FUSION_NOMAG].size(),
+            mEstimatedGyroRate,
+            fusion_nomag.getAttitude().x,
+            fusion_nomag.getAttitude().y,
+            fusion_nomag.getAttitude().z,
+            fusion_nomag.getAttitude().w,
+            length(fusion_nomag.getAttitude()),
+            fusion_nomag.getBias().x,
+            fusion_nomag.getBias().y,
+            fusion_nomag.getBias().z);
+
+    const Fusion& fusion_nogyro(mFusions[FUSION_NOGYRO]);
+    result.appendFormat("geomag fusion (no gyro) %s (%zd clients), "
+            "gyro-rate=%7.2fHz, "
+            "q=< %g, %g, %g, %g > (%g), "
+            "b=< %g, %g, %g >\n",
+            mEnabled[FUSION_NOGYRO] ? "enabled" : "disabled",
+            mClients[FUSION_NOGYRO].size(),
             mEstimatedGyroRate,
-            fusion.getAttitude().x,
-            fusion.getAttitude().y,
-            fusion.getAttitude().z,
-            fusion.getAttitude().w,
-            length(fusion.getAttitude()),
-            fusion.getBias().x,
-            fusion.getBias().y,
-            fusion.getBias().z);
+            fusion_nogyro.getAttitude().x,
+            fusion_nogyro.getAttitude().y,
+            fusion_nogyro.getAttitude().z,
+            fusion_nogyro.getAttitude().w,
+            length(fusion_nogyro.getAttitude()),
+            fusion_nogyro.getBias().x,
+            fusion_nogyro.getBias().y,
+            fusion_nogyro.getBias().z);
 }
 
 // ---------------------------------------------------------------------------
index 432adbc..ad636d5 100644 (file)
@@ -42,30 +42,52 @@ class SensorFusion : public Singleton<SensorFusion> {
     Sensor mAcc;
     Sensor mMag;
     Sensor mGyro;
-    Fusion mFusion;
-    bool mEnabled;
+
+    Fusion mFusions[NUM_FUSION_MODE]; // normal, no_mag, no_gyro
+
+    bool mEnabled[NUM_FUSION_MODE];
+
+    vec4_t &mAttitude;
+    vec4_t mAttitudes[NUM_FUSION_MODE];
+
+    SortedVector<void*> mClients[3];
+
     float mEstimatedGyroRate;
     nsecs_t mTargetDelayNs;
+
     nsecs_t mGyroTime;
-    vec4_t mAttitude;
-    SortedVector<void*> mClients;
+    nsecs_t mAccTime;
 
     SensorFusion();
 
 public:
     void process(const sensors_event_t& event);
 
-    bool isEnabled() const { return mEnabled; }
-    bool hasEstimate() const { return mFusion.hasEstimate(); }
-    mat33_t getRotationMatrix() const { return mFusion.getRotationMatrix(); }
-    vec4_t getAttitude() const { return mAttitude; }
-    vec3_t getGyroBias() const { return mFusion.getBias(); }
+    bool isEnabled() const {
+        return mEnabled[FUSION_9AXIS] ||
+                mEnabled[FUSION_NOMAG] ||
+                mEnabled[FUSION_NOGYRO];
+    }
+
+    bool hasEstimate(int mode = FUSION_9AXIS) const {
+        return mFusions[mode].hasEstimate();
+    }
+
+    mat33_t getRotationMatrix(int mode = FUSION_9AXIS) const {
+        return mFusions[mode].getRotationMatrix();
+    }
+
+    vec4_t getAttitude(int mode = FUSION_9AXIS) const {
+        return mAttitudes[mode];
+    }
+
+    vec3_t getGyroBias() const { return mFusions[FUSION_9AXIS].getBias(); }
     float getEstimatedRate() const { return mEstimatedGyroRate; }
 
-    status_t activate(void* ident, bool enabled);
-    status_t setDelay(void* ident, int64_t ns);
+    status_t activate(int mode, void* ident, bool enabled);
+    status_t setDelay(int mode, void* ident, int64_t ns);
 
-    float getPowerUsage() const;
+    float getPowerUsage(int mode=FUSION_9AXIS) const;
     int32_t getMinDelay() const;
 
     void dump(String8& result);
index db4a4db..b6a5d66 100644 (file)
@@ -88,11 +88,14 @@ void SensorService::onFirstRef()
             uint32_t virtualSensorsNeeds =
                     (1<<SENSOR_TYPE_GRAVITY) |
                     (1<<SENSOR_TYPE_LINEAR_ACCELERATION) |
-                    (1<<SENSOR_TYPE_ROTATION_VECTOR);
+                    (1<<SENSOR_TYPE_ROTATION_VECTOR) |
+                    (1<<SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR) |
+                    (1<<SENSOR_TYPE_GAME_ROTATION_VECTOR);
 
             mLastEventSeen.setCapacity(count);
             for (ssize_t i=0 ; i<count ; i++) {
-                registerSensor( new HardwareSensor(list[i]) );
+                bool useThisSensor=true;
+
                 switch (list[i].type) {
                     case SENSOR_TYPE_ACCELEROMETER:
                         hasAccel = true;
@@ -110,9 +113,18 @@ void SensorService::onFirstRef()
                     case SENSOR_TYPE_GRAVITY:
                     case SENSOR_TYPE_LINEAR_ACCELERATION:
                     case SENSOR_TYPE_ROTATION_VECTOR:
-                        virtualSensorsNeeds &= ~(1<<list[i].type);
+                    case SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR:
+                    case SENSOR_TYPE_GAME_ROTATION_VECTOR:
+                        if (IGNORE_HARDWARE_FUSION) {
+                            useThisSensor = false;
+                        } else {
+                            virtualSensorsNeeds &= ~(1<<list[i].type);
+                        }
                         break;
                 }
+                if (useThisSensor) {
+                    registerSensor( new HardwareSensor(list[i]) );
+                }
             }
 
             // it's safe to instantiate the SensorFusion object here
@@ -124,26 +136,15 @@ void SensorService::onFirstRef()
             mUserSensorList = mSensorList;
 
             if (hasGyro && hasAccel && hasMag) {
-                Sensor aSensor;
-
                 // Add Android virtual sensors if they're not already
                 // available in the HAL
+                Sensor aSensor;
 
                 aSensor = registerVirtualSensor( new RotationVectorSensor() );
                 if (virtualSensorsNeeds & (1<<SENSOR_TYPE_ROTATION_VECTOR)) {
                     mUserSensorList.add(aSensor);
                 }
 
-                aSensor = registerVirtualSensor( new GravitySensor(list, count) );
-                if (virtualSensorsNeeds & (1<<SENSOR_TYPE_GRAVITY)) {
-                    mUserSensorList.add(aSensor);
-                }
-
-                aSensor = registerVirtualSensor( new LinearAccelerationSensor(list, count) );
-                if (virtualSensorsNeeds & (1<<SENSOR_TYPE_LINEAR_ACCELERATION)) {
-                    mUserSensorList.add(aSensor);
-                }
-
                 aSensor = registerVirtualSensor( new OrientationSensor() );
                 if (virtualSensorsNeeds & (1<<SENSOR_TYPE_ROTATION_VECTOR)) {
                     // if we are doing our own rotation-vector, also add
@@ -151,11 +152,46 @@ void SensorService::onFirstRef()
                     mUserSensorList.replaceAt(aSensor, orientationIndex);
                 }
 
+                aSensor = registerVirtualSensor(
+                                new LinearAccelerationSensor(list, count) );
+                if (virtualSensorsNeeds &
+                            (1<<SENSOR_TYPE_LINEAR_ACCELERATION)) {
+                    mUserSensorList.add(aSensor);
+                }
+
                 // virtual debugging sensors are not added to mUserSensorList
                 registerVirtualSensor( new CorrectedGyroSensor(list, count) );
                 registerVirtualSensor( new GyroDriftSensor() );
             }
 
+            if (hasAccel && hasGyro) {
+                Sensor aSensor;
+
+                aSensor = registerVirtualSensor(
+                                new GravitySensor(list, count) );
+                if (virtualSensorsNeeds & (1<<SENSOR_TYPE_GRAVITY)) {
+                    mUserSensorList.add(aSensor);
+                }
+
+                aSensor = registerVirtualSensor(
+                                new GameRotationVectorSensor() );
+                if (virtualSensorsNeeds &
+                            (1<<SENSOR_TYPE_GAME_ROTATION_VECTOR)) {
+                    mUserSensorList.add(aSensor);
+                }
+            }
+
+            if (hasAccel && hasMag) {
+                Sensor aSensor;
+
+                aSensor = registerVirtualSensor(
+                                new GeoMagRotationVectorSensor() );
+                if (virtualSensorsNeeds &
+                        (1<<SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR)) {
+                    mUserSensorList.add(aSensor);
+                }
+            }
+
             // debugging sensor list
             mUserSensorListDebug = mSensorList;
 
index 9a573ae..7d81d6e 100644 (file)
@@ -46,7 +46,7 @@
 #endif
 
 // ---------------------------------------------------------------------------
-
+#define IGNORE_HARDWARE_FUSION  false
 #define DEBUG_CONNECTIONS   false
 // Max size is 100 KB which is enough to accept a batch of about 1000 events.
 #define MAX_SOCKET_BUFFER_SIZE_BATCHED 100 * 1024
index 49389e0..2a025b8 100644 (file)
@@ -134,7 +134,7 @@ status_t Client::createSurface(
                 sp<IBinder>* handle,
                 sp<IGraphicBufferProducer>* gbp)
             : flinger(flinger), client(client),
-              handle(handle), gbp(gbp),
+              handle(handle), gbp(gbp), result(NO_ERROR),
               name(name), w(w), h(h), format(format), flags(flags) {
         }
         status_t getResult() const { return result; }
index 3738a55..e0d7339 100644 (file)
@@ -56,15 +56,17 @@ public:
             mStop(false),
             mPeriod(0),
             mPhase(0),
+            mReferenceTime(0),
             mWakeupLatency(0) {
     }
 
     virtual ~DispSyncThread() {}
 
-    void updateModel(nsecs_t period, nsecs_t phase) {
+    void updateModel(nsecs_t period, nsecs_t phase, nsecs_t referenceTime) {
         Mutex::Autolock lock(mMutex);
         mPeriod = period;
         mPhase = phase;
+        mReferenceTime = referenceTime;
         mCond.signal();
     }
 
@@ -246,7 +248,7 @@ private:
             ref = lastEventTime;
         }
 
-        nsecs_t phase = mPhase + listener.mPhase;
+        nsecs_t phase = mReferenceTime + mPhase + listener.mPhase;
         nsecs_t t = (((ref - phase) / mPeriod) + 1) * mPeriod + phase;
 
         if (t - listener.mLastEventTime < mPeriod / 2) {
@@ -266,6 +268,7 @@ private:
 
     nsecs_t mPeriod;
     nsecs_t mPhase;
+    nsecs_t mReferenceTime;
     nsecs_t mWakeupLatency;
 
     Vector<EventListener> mEventListeners;
@@ -313,9 +316,13 @@ DispSync::~DispSync() {}
 void DispSync::reset() {
     Mutex::Autolock lock(mMutex);
 
+    mPhase = 0;
+    mReferenceTime = 0;
+    mModelUpdated = false;
     mNumResyncSamples = 0;
     mFirstResyncSample = 0;
     mNumResyncSamplesSincePresent = 0;
+    mNumPresentWithoutResyncSamples = 0;
     resetErrorLocked();
 }
 
@@ -340,13 +347,24 @@ bool DispSync::addPresentFence(const sp<Fence>& fence) {
 
     updateErrorLocked();
 
-    return mPeriod == 0 || mError > kErrorThreshold;
+    // This is a workaround for b/25845510.
+    // If we have no resync samples after many presents, something is wrong with
+    // HW vsync. Tell SF to disable HW vsync now and re-enable it next time.
+    if (mNumResyncSamples == 0 &&
+        mNumPresentWithoutResyncSamples++ > MAX_PRESENT_WITHOUT_RESYNC_SAMPLES) {
+        mNumPresentWithoutResyncSamples = 0;
+        return false;
+    }
+
+    return !mModelUpdated || mError > kErrorThreshold;
 }
 
 void DispSync::beginResync() {
     Mutex::Autolock lock(mMutex);
 
+    mModelUpdated = false;
     mNumResyncSamples = 0;
+    mNumPresentWithoutResyncSamples = 0;
 }
 
 bool DispSync::addResyncSample(nsecs_t timestamp) {
@@ -354,6 +372,10 @@ bool DispSync::addResyncSample(nsecs_t timestamp) {
 
     size_t idx = (mFirstResyncSample + mNumResyncSamples) % MAX_RESYNC_SAMPLES;
     mResyncSamples[idx] = timestamp;
+    if (mNumResyncSamples == 0) {
+        mPhase = 0;
+        mReferenceTime = timestamp;
+    }
 
     if (mNumResyncSamples < MAX_RESYNC_SAMPLES) {
         mNumResyncSamples++;
@@ -376,7 +398,7 @@ bool DispSync::addResyncSample(nsecs_t timestamp) {
         return mThread->hasAnyEventListeners();
     }
 
-    return mPeriod == 0 || mError > kErrorThreshold;
+    return !mModelUpdated || mError > kErrorThreshold;
 }
 
 void DispSync::endResync() {
@@ -405,7 +427,8 @@ void DispSync::setPeriod(nsecs_t period) {
     Mutex::Autolock lock(mMutex);
     mPeriod = period;
     mPhase = 0;
-    mThread->updateModel(mPeriod, mPhase);
+    mReferenceTime = 0;
+    mThread->updateModel(mPeriod, mPhase, mReferenceTime);
 }
 
 nsecs_t DispSync::getPeriod() {
@@ -430,7 +453,7 @@ void DispSync::updateModelLocked() {
         double scale = 2.0 * M_PI / double(mPeriod);
         for (size_t i = 0; i < mNumResyncSamples; i++) {
             size_t idx = (mFirstResyncSample + i) % MAX_RESYNC_SAMPLES;
-            nsecs_t sample = mResyncSamples[idx];
+            nsecs_t sample = mResyncSamples[idx] - mReferenceTime;
             double samplePhase = double(sample % mPeriod) * scale;
             sampleAvgX += cos(samplePhase);
             sampleAvgY += sin(samplePhase);
@@ -453,12 +476,13 @@ void DispSync::updateModelLocked() {
         // Artificially inflate the period if requested.
         mPeriod += mPeriod * mRefreshSkipCount;
 
-        mThread->updateModel(mPeriod, mPhase);
+        mThread->updateModel(mPeriod, mPhase, mReferenceTime);
+        mModelUpdated = true;
     }
 }
 
 void DispSync::updateErrorLocked() {
-    if (mPeriod == 0) {
+    if (!mModelUpdated) {
         return;
     }
 
@@ -470,7 +494,7 @@ void DispSync::updateErrorLocked() {
     nsecs_t sqErrSum = 0;
 
     for (size_t i = 0; i < NUM_PRESENT_SAMPLES; i++) {
-        nsecs_t sample = mPresentTimes[i];
+        nsecs_t sample = mPresentTimes[i] - mReferenceTime;
         if (sample > mPhase) {
             nsecs_t sampleErr = (sample - mPhase) % period;
             if (sampleErr > period / 2) {
@@ -504,7 +528,8 @@ void DispSync::resetErrorLocked() {
 nsecs_t DispSync::computeNextRefresh(int periodOffset) const {
     Mutex::Autolock lock(mMutex);
     nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
-    return (((now - mPhase) / mPeriod) + periodOffset + 1) * mPeriod + mPhase;
+    nsecs_t phase = mReferenceTime + mPhase;
+    return (((now - phase) / mPeriod) + periodOffset + 1) * mPeriod + phase;
 }
 
 void DispSync::dump(String8& result) const {
index 67142b6..1ee0865 100644 (file)
@@ -140,6 +140,7 @@ private:
     enum { MIN_RESYNC_SAMPLES_FOR_UPDATE = 3 };
     enum { NUM_PRESENT_SAMPLES = 8 };
     enum { MAX_RESYNC_SAMPLES_WITHOUT_PRESENT = 4 };
+    enum { MAX_PRESENT_WITHOUT_RESYNC_SAMPLES = 8 };
 
     // mPeriod is the computed period of the modeled vsync events in
     // nanoseconds.
@@ -149,11 +150,18 @@ private:
     // number of nanoseconds from time 0 to the first vsync event.
     nsecs_t mPhase;
 
+    // mReferenceTime is the reference time of the modeled vsync events.
+    // It is the nanosecond timestamp of the first vsync event after a resync.
+    nsecs_t mReferenceTime;
+
     // mError is the computed model error.  It is based on the difference
     // between the estimated vsync event times and those observed in the
     // mPresentTimes array.
     nsecs_t mError;
 
+    // Whether we have updated the vsync event model since the last resync.
+    bool mModelUpdated;
+
     // These member variables are the state used during the resynchronization
     // process to store information about the hardware vsync event times used
     // to compute the model.
@@ -161,6 +169,7 @@ private:
     size_t mFirstResyncSample;
     size_t mNumResyncSamples;
     int mNumResyncSamplesSincePresent;
+    int mNumPresentWithoutResyncSamples;
 
     // These member variables store information about the present fences used
     // to validate the currently computed model.
index b08a951..3b75cc0 100644 (file)
@@ -29,7 +29,8 @@ public:
     float right;
     float bottom;
 
-    inline FloatRect() { }
+    inline FloatRect()
+        : left(0), top(0), right(0), bottom(0) { }
     inline FloatRect(const Rect& other)
         : left(other.left), top(other.top), right(other.right), bottom(other.bottom) { }
 
index 70af656..a6bc158 100644 (file)
@@ -66,7 +66,6 @@ FramebufferSurface::FramebufferSurface(HWComposer& hwc, int disp,
                                        GRALLOC_USAGE_HW_COMPOSER);
     mConsumer->setDefaultBufferFormat(mHwc.getFormat(disp));
     mConsumer->setDefaultBufferSize(mHwc.getWidth(disp),  mHwc.getHeight(disp));
-    mConsumer->setDefaultMaxBufferCount(NUM_FRAMEBUFFER_SURFACE_BUFFERS);
     mConsumer->setMaxAcquiredBufferCount(NUM_FRAMEBUFFER_SURFACE_BUFFERS - 1);
 }
 
@@ -107,7 +106,7 @@ status_t FramebufferSurface::nextBuffer(sp<GraphicBuffer>& outBuffer, sp<Fence>&
     // releaseBuffer call and we should be in the same state we'd be in if we
     // had released the old buffer first.
     if (mCurrentBufferSlot != BufferQueue::INVALID_BUFFER_SLOT &&
-        item.mBuf != mCurrentBufferSlot) {
+        item.mSlot != mCurrentBufferSlot) {
         // Release the previous buffer.
         err = releaseBufferLocked(mCurrentBufferSlot, mCurrentBuffer,
                 EGL_NO_DISPLAY, EGL_NO_SYNC_KHR);
@@ -116,7 +115,7 @@ status_t FramebufferSurface::nextBuffer(sp<GraphicBuffer>& outBuffer, sp<Fence>&
             return err;
         }
     }
-    mCurrentBufferSlot = item.mBuf;
+    mCurrentBufferSlot = item.mSlot;
     mCurrentBuffer = mSlots[mCurrentBufferSlot].mGraphicBuffer;
     outFence = item.mFence;
     outBuffer = mCurrentBuffer;
index ba4c198..f8fe8e1 100644 (file)
@@ -19,6 +19,7 @@
 #include "HWComposer.h"
 
 #include <gui/BufferItem.h>
+#include <gui/IProducerListener.h>
 
 // ---------------------------------------------------------------------------
 namespace android {
@@ -92,10 +93,13 @@ VirtualDisplaySurface::VirtualDisplaySurface(HWComposer& hwc, int32_t dispId,
     mConsumer->setConsumerName(ConsumerBase::mName);
     mConsumer->setConsumerUsageBits(GRALLOC_USAGE_HW_COMPOSER);
     mConsumer->setDefaultBufferSize(sinkWidth, sinkHeight);
-    mConsumer->setDefaultMaxBufferCount(2);
+    sink->setAsyncMode(true);
+    IGraphicBufferProducer::QueueBufferOutput output;
+    mSource[SOURCE_SCRATCH]->connect(NULL, NATIVE_WINDOW_API_EGL, false, &output);
 }
 
 VirtualDisplaySurface::~VirtualDisplaySurface() {
+    mSource[SOURCE_SCRATCH]->disconnect(NATIVE_WINDOW_API_EGL);
 }
 
 status_t VirtualDisplaySurface::beginFrame(bool mustRecompose) {
@@ -239,7 +243,6 @@ void VirtualDisplaySurface::onFrameCommitted() {
                         HAL_DATASPACE_UNKNOWN,
                         Rect(mSinkBufferWidth, mSinkBufferHeight),
                         NATIVE_WINDOW_SCALING_MODE_FREEZE, 0 /* transform */,
-                        true /* async*/,
                         outFence),
                     &qbo);
             if (result == NO_ERROR) {
@@ -282,17 +285,20 @@ status_t VirtualDisplaySurface::requestBuffer(int pslot,
     return NO_ERROR;
 }
 
-status_t VirtualDisplaySurface::setBufferCount(int bufferCount) {
-    return mSource[SOURCE_SINK]->setBufferCount(bufferCount);
+status_t VirtualDisplaySurface::setMaxDequeuedBufferCount(
+        int maxDequeuedBuffers) {
+    return mSource[SOURCE_SINK]->setMaxDequeuedBufferCount(maxDequeuedBuffers);
+}
+
+status_t VirtualDisplaySurface::setAsyncMode(bool async) {
+    return mSource[SOURCE_SINK]->setAsyncMode(async);
 }
 
 status_t VirtualDisplaySurface::dequeueBuffer(Source source,
         PixelFormat format, uint32_t usage, int* sslot, sp<Fence>* fence) {
     LOG_FATAL_IF(mDisplayId < 0, "mDisplayId=%d but should not be < 0.", mDisplayId);
-    // Don't let a slow consumer block us
-    bool async = (source == SOURCE_SINK);
 
-    status_t result = mSource[source]->dequeueBuffer(sslot, fence, async,
+    status_t result = mSource[source]->dequeueBuffer(sslot, fence,
             mSinkBufferWidth, mSinkBufferHeight, format, usage);
     if (result < 0)
         return result;
@@ -331,16 +337,15 @@ status_t VirtualDisplaySurface::dequeueBuffer(Source source,
     return result;
 }
 
-status_t VirtualDisplaySurface::dequeueBuffer(int* pslot, sp<Fence>* fence, bool async,
+status_t VirtualDisplaySurface::dequeueBuffer(int* pslot, sp<Fence>* fence,
         uint32_t w, uint32_t h, PixelFormat format, uint32_t usage) {
     if (mDisplayId < 0)
-        return mSource[SOURCE_SINK]->dequeueBuffer(pslot, fence, async, w, h, format, usage);
+        return mSource[SOURCE_SINK]->dequeueBuffer(pslot, fence, w, h, format, usage);
 
     VDS_LOGW_IF(mDbgState != DBG_STATE_PREPARED,
             "Unexpected dequeueBuffer() in %s state", dbgStateStr());
     mDbgState = DBG_STATE_GLES;
 
-    VDS_LOGW_IF(!async, "EGL called dequeueBuffer with !async despite eglSwapInterval(0)");
     VDS_LOGV("dequeueBuffer %dx%d fmt=%d usage=%#x", w, h, format, usage);
 
     status_t result = NO_ERROR;
@@ -442,11 +447,11 @@ status_t VirtualDisplaySurface::queueBuffer(int pslot,
         result = acquireBufferLocked(&item, 0);
         if (result != NO_ERROR)
             return result;
-        VDS_LOGW_IF(item.mBuf != sslot,
+        VDS_LOGW_IF(item.mSlot != sslot,
                 "queueBuffer: acquired sslot %d from SCRATCH after queueing sslot %d",
-                item.mBuf, sslot);
-        mFbProducerSlot = mapSource2ProducerSlot(SOURCE_SCRATCH, item.mBuf);
-        mFbFence = mSlots[item.mBuf].mFence;
+                item.mSlot, sslot);
+        mFbProducerSlot = mapSource2ProducerSlot(SOURCE_SCRATCH, item.mSlot);
+        mFbFence = mSlots[item.mSlot].mFence;
 
     } else {
         LOG_FATAL_IF(mCompositionType != COMPOSITION_GLES,
@@ -460,9 +465,8 @@ status_t VirtualDisplaySurface::queueBuffer(int pslot,
         Rect crop;
         int scalingMode;
         uint32_t transform;
-        bool async;
         input.deflate(&timestamp, &isAutoTimestamp, &dataSpace, &crop,
-                &scalingMode, &transform, &async, &mFbFence);
+                &scalingMode, &transform, &mFbFence);
 
         mFbProducerSlot = pslot;
         mOutputFence = mFbFence;
@@ -472,7 +476,8 @@ status_t VirtualDisplaySurface::queueBuffer(int pslot,
     return NO_ERROR;
 }
 
-void VirtualDisplaySurface::cancelBuffer(int pslot, const sp<Fence>& fence) {
+status_t VirtualDisplaySurface::cancelBuffer(int pslot,
+        const sp<Fence>& fence) {
     if (mDisplayId < 0)
         return mSource[SOURCE_SINK]->cancelBuffer(mapProducer2SourceSlot(SOURCE_SINK, pslot), fence);
 
@@ -520,9 +525,8 @@ status_t VirtualDisplaySurface::setSidebandStream(const sp<NativeHandle>& /*stre
     return INVALID_OPERATION;
 }
 
-void VirtualDisplaySurface::allocateBuffers(bool /* async */,
-        uint32_t /* width */, uint32_t /* height */, PixelFormat /* format */,
-        uint32_t /* usage */) {
+void VirtualDisplaySurface::allocateBuffers(uint32_t /* width */,
+        uint32_t /* height */, PixelFormat /* format */, uint32_t /* usage */) {
     // TODO: Should we actually allocate buffers for a virtual display?
 }
 
@@ -539,6 +543,14 @@ String8 VirtualDisplaySurface::getConsumerName() const {
     return String8("VirtualDisplaySurface");
 }
 
+uint64_t VirtualDisplaySurface::getNextFrameNumber() const {
+    return 0;
+}
+
+status_t VirtualDisplaySurface::setSingleBufferMode(bool singleBufferMode) {
+    return mSource[SOURCE_SINK]->setSingleBufferMode(singleBufferMode);
+}
+
 void VirtualDisplaySurface::updateQueueBufferOutput(
         const QueueBufferOutput& qbo) {
     uint32_t w, h, transformHint, numPendingBuffers;
index 6298751..bde7fcf 100644 (file)
@@ -98,26 +98,29 @@ private:
     // IGraphicBufferProducer interface, used by the GLES driver.
     //
     virtual status_t requestBuffer(int pslot, sp<GraphicBuffer>* outBuf);
-    virtual status_t setBufferCount(int bufferCount);
-    virtual status_t dequeueBuffer(int* pslot, sp<Fence>* fence, bool async,
-            uint32_t w, uint32_t h, PixelFormat format, uint32_t usage);
+    virtual status_t setMaxDequeuedBufferCount(int maxDequeuedBuffers);
+    virtual status_t setAsyncMode(bool async);
+    virtual status_t dequeueBuffer(int* pslot, sp<Fence>* fence, uint32_t w,
+            uint32_t h, PixelFormat format, uint32_t usage);
     virtual status_t detachBuffer(int slot);
     virtual status_t detachNextBuffer(sp<GraphicBuffer>* outBuffer,
             sp<Fence>* outFence);
     virtual status_t attachBuffer(int* slot, const sp<GraphicBuffer>& buffer);
     virtual status_t queueBuffer(int pslot,
             const QueueBufferInput& input, QueueBufferOutput* output);
-    virtual void cancelBuffer(int pslot, const sp<Fence>& fence);
+    virtual status_t cancelBuffer(int pslot, const sp<Fence>& fence);
     virtual int query(int what, int* value);
     virtual status_t connect(const sp<IProducerListener>& listener,
             int api, bool producerControlledByApp, QueueBufferOutput* output);
     virtual status_t disconnect(int api);
     virtual status_t setSidebandStream(const sp<NativeHandle>& stream);
-    virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
+    virtual void allocateBuffers(uint32_t width, uint32_t height,
             PixelFormat format, uint32_t usage);
     virtual status_t allowAllocation(bool allow);
     virtual status_t setGenerationNumber(uint32_t generationNumber);
     virtual String8 getConsumerName() const override;
+    virtual uint64_t getNextFrameNumber() const override;
+    virtual status_t setSingleBufferMode(bool singleBufferMode);
 
     //
     // Utility methods
index 791e0e4..6c851dd 100644 (file)
@@ -36,6 +36,7 @@
 # 60100 - 60199 reserved for surfaceflinger
 
 60100 sf_frame_dur (window|3),(dur0|1),(dur1|1),(dur2|1),(dur3|1),(dur4|1),(dur5|1),(dur6|1)
+60110 sf_stop_bootanim (time|2|3)
 
 # NOTE - the range 1000000-2000000 is reserved for partners and others who
 # want to define their own log tags without conflicting with the core platform.
index 5ff79a9..d484708 100644 (file)
@@ -66,6 +66,8 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client,
         mName("unnamed"),
         mFormat(PIXEL_FORMAT_NONE),
         mTransactionFlags(0),
+        mPendingStateMutex(),
+        mPendingStates(),
         mQueuedFrames(0),
         mSidebandStreamChanged(false),
         mCurrentTransform(0),
@@ -84,7 +86,8 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client,
         mQueueItemCondition(),
         mQueueItems(),
         mLastFrameNumberReceived(0),
-        mUpdateTexImageFailed(false)
+        mUpdateTexImageFailed(false),
+        mSingleBufferMode(false)
 {
     mCurrentCrop.makeInvalid();
     mFlinger->getRenderEngine().genTextures(1, &mTextureName);
@@ -135,9 +138,8 @@ void Layer::onFirstRef() {
 
 #ifdef TARGET_DISABLE_TRIPLE_BUFFERING
 #warning "disabling triple buffering"
-    mSurfaceFlingerConsumer->setDefaultMaxBufferCount(2);
 #else
-    mSurfaceFlingerConsumer->setDefaultMaxBufferCount(3);
+    mProducer->setMaxDequeuedBufferCount(2);
 #endif
 
     const sp<const DisplayDevice> hw(mFlinger->getDefaultDisplayDevice());
@@ -145,10 +147,6 @@ void Layer::onFirstRef() {
 }
 
 Layer::~Layer() {
-    sp<Client> c(mClientRef.promote());
-    if (c != 0) {
-        c->detachLayer(this);
-    }
     mFlinger->deleteTextureAsync(mTextureName);
     mFrameTracker.logAndResetStats(mName);
 }
@@ -165,6 +163,20 @@ void Layer::onLayerDisplayed(const sp<const DisplayDevice>& /* hw */,
     }
 }
 
+void Layer::markSyncPointsAvailable(const BufferItem& item) {
+    auto pointIter = mLocalSyncPoints.begin();
+    while (pointIter != mLocalSyncPoints.end()) {
+        if ((*pointIter)->getFrameNumber() == item.mFrameNumber) {
+            auto syncPoint = *pointIter;
+            pointIter = mLocalSyncPoints.erase(pointIter);
+            Mutex::Autolock lock(mAvailableFrameMutex);
+            mAvailableFrames.push_back(std::move(syncPoint));
+        } else {
+            ++pointIter;
+        }
+    }
+}
+
 void Layer::onFrameAvailable(const BufferItem& item) {
     // Add this buffer from our internal queue tracker
     { // Autolock scope
@@ -193,30 +205,36 @@ void Layer::onFrameAvailable(const BufferItem& item) {
         mQueueItemCondition.broadcast();
     }
 
+    markSyncPointsAvailable(item);
+
     mFlinger->signalLayerUpdate();
 }
 
 void Layer::onFrameReplaced(const BufferItem& item) {
-    Mutex::Autolock lock(mQueueItemLock);
+    { // Autolock scope
+        Mutex::Autolock lock(mQueueItemLock);
 
-    // Ensure that callbacks are handled in order
-    while (item.mFrameNumber != mLastFrameNumberReceived + 1) {
-        status_t result = mQueueItemCondition.waitRelative(mQueueItemLock,
-                ms2ns(500));
-        if (result != NO_ERROR) {
-            ALOGE("[%s] Timed out waiting on callback", mName.string());
+        // Ensure that callbacks are handled in order
+        while (item.mFrameNumber != mLastFrameNumberReceived + 1) {
+            status_t result = mQueueItemCondition.waitRelative(mQueueItemLock,
+                    ms2ns(500));
+            if (result != NO_ERROR) {
+                ALOGE("[%s] Timed out waiting on callback", mName.string());
+            }
         }
-    }
 
-    if (mQueueItems.empty()) {
-        ALOGE("Can't replace a frame on an empty queue");
-        return;
+        if (mQueueItems.empty()) {
+            ALOGE("Can't replace a frame on an empty queue");
+            return;
+        }
+        mQueueItems.editItemAt(0) = item;
+
+        // Wake up any pending callbacks
+        mLastFrameNumberReceived = item.mFrameNumber;
+        mQueueItemCondition.broadcast();
     }
-    mQueueItems.editItemAt(0) = item;
 
-    // Wake up any pending callbacks
-    mLastFrameNumberReceived = item.mFrameNumber;
-    mQueueItemCondition.broadcast();
+    markSyncPointsAvailable(item);
 }
 
 void Layer::onSidebandStreamChanged() {
@@ -230,6 +248,10 @@ void Layer::onSidebandStreamChanged() {
 // the layer has been remove from the current state list (and just before
 // it's removed from the drawing state list)
 void Layer::onRemoved() {
+    sp<Client> c(mClientRef.promote());
+    if (c != 0) {
+        c->detachLayer(this);
+    }
     mSurfaceFlingerConsumer->abandon();
 }
 
@@ -267,6 +289,22 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
     return NO_ERROR;
 }
 
+/*
+ * The layer handle is just a BBinder object passed to the client
+ * (remote process) -- we don't keep any reference on our side such that
+ * the dtor is called when the remote side let go of its reference.
+ *
+ * LayerCleaner ensures that mFlinger->onLayerDestroyed() is called for
+ * this layer when the handle is destroyed.
+ */
+class Layer::Handle : public BBinder, public LayerCleaner {
+    public:
+        Handle(const sp<SurfaceFlinger>& flinger, const sp<Layer>& layer)
+            : LayerCleaner(flinger, layer), owner(layer) {}
+
+        wp<Layer> owner;
+};
+
 sp<IBinder> Layer::getHandle() {
     Mutex::Autolock _l(mLock);
 
@@ -275,23 +313,6 @@ sp<IBinder> Layer::getHandle() {
 
     mHasSurface = true;
 
-    /*
-     * The layer handle is just a BBinder object passed to the client
-     * (remote process) -- we don't keep any reference on our side such that
-     * the dtor is called when the remote side let go of its reference.
-     *
-     * LayerCleaner ensures that mFlinger->onLayerDestroyed() is called for
-     * this layer when the handle is destroyed.
-     */
-
-    class Handle : public BBinder, public LayerCleaner {
-        wp<const Layer> mOwner;
-    public:
-        Handle(const sp<SurfaceFlinger>& flinger, const sp<Layer>& layer)
-            : LayerCleaner(flinger, layer), mOwner(layer) {
-        }
-    };
-
     return new Handle(mFlinger, this);
 }
 
@@ -782,6 +803,24 @@ uint32_t Layer::getProducerStickyTransform() const {
     return static_cast<uint32_t>(producerStickyTransform);
 }
 
+void Layer::addSyncPoint(std::shared_ptr<SyncPoint> point) {
+    uint64_t headFrameNumber = 0;
+    {
+        Mutex::Autolock lock(mQueueItemLock);
+        if (!mQueueItems.empty()) {
+            headFrameNumber = mQueueItems[0].mFrameNumber;
+        } else {
+            headFrameNumber = mLastFrameNumberReceived;
+        }
+    }
+
+    if (point->getFrameNumber() <= headFrameNumber) {
+        point->setFrameAvailable();
+    } else {
+        mLocalSyncPoints.push_back(std::move(point));
+    }
+}
+
 void Layer::setFiltering(bool filtering) {
     mFiltering = filtering;
 }
@@ -896,9 +935,104 @@ void Layer::setVisibleNonTransparentRegion(const Region&
 // transaction
 // ----------------------------------------------------------------------------
 
+void Layer::pushPendingState() {
+    if (!mCurrentState.modified) {
+        return;
+    }
+
+    Mutex::Autolock lock(mPendingStateMutex);
+
+    // If this transaction is waiting on the receipt of a frame, generate a sync
+    // point and send it to the remote layer.
+    if (mCurrentState.handle != nullptr) {
+        sp<Handle> handle = static_cast<Handle*>(mCurrentState.handle.get());
+        sp<Layer> handleLayer = handle->owner.promote();
+        if (handleLayer == nullptr) {
+            ALOGE("[%s] Unable to promote Layer handle", mName.string());
+            // If we can't promote the layer we are intended to wait on,
+            // then it is expired or otherwise invalid. Allow this transaction
+            // to be applied as per normal (no synchronization).
+            mCurrentState.handle = nullptr;
+        } else {
+            auto syncPoint = std::make_shared<SyncPoint>(
+                    mCurrentState.frameNumber);
+            handleLayer->addSyncPoint(syncPoint);
+            mRemoteSyncPoints.push_back(std::move(syncPoint));
+        }
+
+        // Wake us up to check if the frame has been received
+        setTransactionFlags(eTransactionNeeded);
+    }
+    mPendingStates.push_back(mCurrentState);
+}
+
+void Layer::popPendingState() {
+    auto oldFlags = mCurrentState.flags;
+    mCurrentState = mPendingStates[0];
+    mCurrentState.flags = (oldFlags & ~mCurrentState.mask) | 
+            (mCurrentState.flags & mCurrentState.mask);
+
+    mPendingStates.removeAt(0);
+}
+
+bool Layer::applyPendingStates() {
+    Mutex::Autolock lock(mPendingStateMutex);
+
+    bool stateUpdateAvailable = false;
+    while (!mPendingStates.empty()) {
+        if (mPendingStates[0].handle != nullptr) {
+            if (mRemoteSyncPoints.empty()) {
+                // If we don't have a sync point for this, apply it anyway. It
+                // will be visually wrong, but it should keep us from getting
+                // into too much trouble.
+                ALOGE("[%s] No local sync point found", mName.string());
+                popPendingState();
+                stateUpdateAvailable = true;
+                continue;
+            }
+
+            if (mRemoteSyncPoints.front()->frameIsAvailable()) {
+                // Apply the state update
+                popPendingState();
+                stateUpdateAvailable = true;
+
+                // Signal our end of the sync point and then dispose of it
+                mRemoteSyncPoints.front()->setTransactionApplied();
+                mRemoteSyncPoints.pop_front();
+            }
+            break;
+        } else {
+            popPendingState();
+            stateUpdateAvailable = true;
+        }
+    }
+
+    // If we still have pending updates, wake SurfaceFlinger back up and point
+    // it at this layer so we can process them
+    if (!mPendingStates.empty()) {
+        setTransactionFlags(eTransactionNeeded);
+        mFlinger->setTransactionFlags(eTraversalNeeded);
+    }
+
+    mCurrentState.modified = false;
+    return stateUpdateAvailable;
+}
+
+void Layer::notifyAvailableFrames() {
+    Mutex::Autolock lock(mAvailableFrameMutex);
+    for (auto frame : mAvailableFrames) {
+        frame->setFrameAvailable();
+    }
+}
+
 uint32_t Layer::doTransaction(uint32_t flags) {
     ATRACE_CALL();
 
+    pushPendingState();
+    if (!applyPendingStates()) {
+        return 0;
+    }
+
     const Layer::State& s(getDrawingState());
     const Layer::State& c(getCurrentState());
 
@@ -1018,6 +1152,7 @@ bool Layer::setPosition(float x, float y) {
         return false;
     mCurrentState.sequence++;
     mCurrentState.transform.set(x, y);
+    mCurrentState.modified = true;
     setTransactionFlags(eTransactionNeeded);
     return true;
 }
@@ -1026,6 +1161,7 @@ bool Layer::setLayer(uint32_t z) {
         return false;
     mCurrentState.sequence++;
     mCurrentState.z = z;
+    mCurrentState.modified = true;
     setTransactionFlags(eTransactionNeeded);
     return true;
 }
@@ -1034,6 +1170,7 @@ bool Layer::setSize(uint32_t w, uint32_t h) {
         return false;
     mCurrentState.requested.w = w;
     mCurrentState.requested.h = h;
+    mCurrentState.modified = true;
     setTransactionFlags(eTransactionNeeded);
     return true;
 }
@@ -1042,6 +1179,7 @@ bool Layer::setAlpha(uint8_t alpha) {
         return false;
     mCurrentState.sequence++;
     mCurrentState.alpha = alpha;
+    mCurrentState.modified = true;
     setTransactionFlags(eTransactionNeeded);
     return true;
 }
@@ -1049,11 +1187,13 @@ bool Layer::setMatrix(const layer_state_t::matrix22_t& matrix) {
     mCurrentState.sequence++;
     mCurrentState.transform.set(
             matrix.dsdx, matrix.dsdy, matrix.dtdx, matrix.dtdy);
+    mCurrentState.modified = true;
     setTransactionFlags(eTransactionNeeded);
     return true;
 }
 bool Layer::setTransparentRegionHint(const Region& transparent) {
     mCurrentState.requestedTransparentRegion = transparent;
+    mCurrentState.modified = true;
     setTransactionFlags(eTransactionNeeded);
     return true;
 }
@@ -1063,6 +1203,8 @@ bool Layer::setFlags(uint8_t flags, uint8_t mask) {
         return false;
     mCurrentState.sequence++;
     mCurrentState.flags = newFlags;
+    mCurrentState.mask = mask;
+    mCurrentState.modified = true;
     setTransactionFlags(eTransactionNeeded);
     return true;
 }
@@ -1071,6 +1213,7 @@ bool Layer::setCrop(const Rect& crop) {
         return false;
     mCurrentState.sequence++;
     mCurrentState.requested.crop = crop;
+    mCurrentState.modified = true;
     setTransactionFlags(eTransactionNeeded);
     return true;
 }
@@ -1080,10 +1223,22 @@ bool Layer::setLayerStack(uint32_t layerStack) {
         return false;
     mCurrentState.sequence++;
     mCurrentState.layerStack = layerStack;
+    mCurrentState.modified = true;
     setTransactionFlags(eTransactionNeeded);
     return true;
 }
 
+void Layer::deferTransactionUntil(const sp<IBinder>& handle,
+        uint64_t frameNumber) {
+    mCurrentState.handle = handle;
+    mCurrentState.frameNumber = frameNumber;
+    // We don't set eTransactionNeeded, because just receiving a deferral
+    // request without any other state updates shouldn't actually induce a delay
+    mCurrentState.modified = true;
+    pushPendingState();
+    mCurrentState.modified = false;
+}
+
 void Layer::useSurfaceDamage() {
     if (mFlinger->mForceFullDamage) {
         surfaceDamageRegion = Region::INVALID_REGION;
@@ -1101,7 +1256,7 @@ void Layer::useEmptyDamage() {
 // ----------------------------------------------------------------------------
 
 bool Layer::shouldPresentNow(const DispSync& dispSync) const {
-    if (mSidebandStreamChanged) {
+    if (mSidebandStreamChanged || mSingleBufferMode) {
         return true;
     }
 
@@ -1125,7 +1280,7 @@ bool Layer::shouldPresentNow(const DispSync& dispSync) const {
 
 bool Layer::onPreComposition() {
     mRefreshPending = false;
-    return mQueuedFrames > 0 || mSidebandStreamChanged;
+    return mQueuedFrames > 0 || mSidebandStreamChanged || mSingleBufferMode;
 }
 
 void Layer::onPostComposition() {
@@ -1182,7 +1337,7 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
     }
 
     Region outDirtyRegion;
-    if (mQueuedFrames > 0) {
+    if (mQueuedFrames > 0 || mSingleBufferMode) {
 
         // if we've already called updateTexImage() without going through
         // a composition step, we have to skip this layer at this point
@@ -1308,13 +1463,45 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
                 getProducerStickyTransform() != 0);
 
         uint64_t maxFrameNumber = 0;
+        uint64_t headFrameNumber = 0;
         {
             Mutex::Autolock lock(mQueueItemLock);
             maxFrameNumber = mLastFrameNumberReceived;
+            if (!mQueueItems.empty()) {
+                headFrameNumber = mQueueItems[0].mFrameNumber;
+            }
+        }
+
+        bool availableFramesEmpty = true;
+        {
+            Mutex::Autolock lock(mAvailableFrameMutex);
+            availableFramesEmpty = mAvailableFrames.empty();
+        }
+        if (!availableFramesEmpty) {
+            Mutex::Autolock lock(mAvailableFrameMutex);
+            bool matchingFramesFound = false;
+            bool allTransactionsApplied = true;
+            for (auto& frame : mAvailableFrames) {
+                if (headFrameNumber != frame->getFrameNumber()) {
+                    break;
+                }
+                matchingFramesFound = true;
+                allTransactionsApplied &= frame->transactionIsApplied();
+            }
+            if (matchingFramesFound && !allTransactionsApplied) {
+                mFlinger->signalLayerUpdate();
+                return outDirtyRegion;
+            }
         }
 
+        // This boolean is used to make sure that SurfaceFlinger's shadow copy
+        // of the buffer queue isn't modified when the buffer queue is returning
+        // BufferItem's that weren't actually queued. This can happen in single
+        // buffer mode.
+        bool queuedBuffer = false;
         status_t updateResult = mSurfaceFlingerConsumer->updateTexImage(&r,
-                mFlinger->mPrimaryDispSync, maxFrameNumber);
+                mFlinger->mPrimaryDispSync, &mSingleBufferMode, &queuedBuffer,
+                maxFrameNumber);
         if (updateResult == BufferQueue::PRESENT_LATER) {
             // Producer doesn't want buffer to be displayed yet.  Signal a
             // layer update so we check again at the next opportunity.
@@ -1323,16 +1510,18 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
         } else if (updateResult == SurfaceFlingerConsumer::BUFFER_REJECTED) {
             // If the buffer has been rejected, remove it from the shadow queue
             // and return early
-            Mutex::Autolock lock(mQueueItemLock);
-            mQueueItems.removeAt(0);
-            android_atomic_dec(&mQueuedFrames);
+            if (queuedBuffer) {
+                Mutex::Autolock lock(mQueueItemLock);
+                mQueueItems.removeAt(0);
+                android_atomic_dec(&mQueuedFrames);
+            }
             return outDirtyRegion;
         } else if (updateResult != NO_ERROR || mUpdateTexImageFailed) {
             // This can occur if something goes wrong when trying to create the
             // EGLImage for this buffer. If this happens, the buffer has already
             // been released, so we need to clean up the queue and bug out
             // early.
-            {
+            if (queuedBuffer) {
                 Mutex::Autolock lock(mQueueItemLock);
                 mQueueItems.clear();
                 android_atomic_and(0, &mQueuedFrames);
@@ -1347,7 +1536,8 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
             return outDirtyRegion;
         }
 
-        { // Autolock scope
+        if (queuedBuffer) {
+            // Autolock scope
             auto currentFrameNumber = mSurfaceFlingerConsumer->getFrameNumber();
 
             Mutex::Autolock lock(mQueueItemLock);
@@ -1365,10 +1555,20 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
 
         // Decrement the queued-frames count.  Signal another event if we
         // have more frames pending.
-        if (android_atomic_dec(&mQueuedFrames) > 1) {
+        if ((queuedBuffer && android_atomic_dec(&mQueuedFrames) > 1)
+                || mSingleBufferMode) {
             mFlinger->signalLayerUpdate();
         }
 
+        if (!availableFramesEmpty) {
+            Mutex::Autolock lock(mAvailableFrameMutex);
+            auto frameNumber = mSurfaceFlingerConsumer->getFrameNumber();
+            while (!mAvailableFrames.empty() &&
+                    frameNumber == mAvailableFrames.front()->getFrameNumber()) {
+                mAvailableFrames.pop_front();
+            }
+        }
+
         if (updateResult != NO_ERROR) {
             // something happened!
             recomputeVisibleRegions = true;
index c1e5e9f..9e3c4db 100644 (file)
@@ -36,6 +36,8 @@
 
 #include <private/gui/LayerState.h>
 
+#include <list>
+
 #include "FrameTracker.h"
 #include "Client.h"
 #include "MonitoredProducer.h"
@@ -107,9 +109,17 @@ public:
         uint32_t layerStack;
         uint8_t alpha;
         uint8_t flags;
+        uint8_t mask;
         uint8_t reserved[2];
         int32_t sequence; // changes when visible regions can change
         Transform transform;
+        bool modified;
+
+        // If set, defers this state update until the Layer identified by handle
+        // receives a frame with the given frameNumber
+        sp<IBinder> handle;
+        uint64_t frameNumber;
+
         // the transparentRegion hint is a bit special, it's latched only
         // when we receive a buffer -- this is because it's "content"
         // dependent.
@@ -137,6 +147,7 @@ public:
     bool setFlags(uint8_t flags, uint8_t mask);
     bool setCrop(const Rect& crop);
     bool setLayerStack(uint32_t layerStack);
+    void deferTransactionUntil(const sp<IBinder>& handle, uint64_t frameNumber);
 
     // If we have received a new buffer this frame, we will pass its surface
     // damage down to hardware composer. Otherwise, we must send a region with
@@ -152,6 +163,7 @@ public:
     Rect computeBounds(const Region& activeTransparentRegion) const;
     Rect computeBounds() const;
 
+    class Handle;
     sp<IBinder> getHandle();
     sp<IGraphicBufferProducer> getProducer() const;
     const String8& getName() const;
@@ -294,7 +306,8 @@ public:
     /*
      * Returns if a frame is queued.
      */
-    bool hasQueuedFrame() const { return mQueuedFrames > 0 || mSidebandStreamChanged; }
+    bool hasQueuedFrame() const { return mQueuedFrames > 0 ||
+            mSidebandStreamChanged || mSingleBufferMode; }
 
     // -----------------------------------------------------------------------
 
@@ -343,6 +356,10 @@ private:
     virtual void onFrameReplaced(const BufferItem& item) override;
     virtual void onSidebandStreamChanged() override;
 
+    // Move frames made available by item in to a list which will
+    // be signalled at the beginning of the next transaction
+    virtual void markSyncPointsAvailable(const BufferItem& item);
+
     void commitTransaction();
 
     // needsLinearFiltering - true if this surface's state requires filtering
@@ -362,6 +379,56 @@ private:
     // Temporary - Used only for LEGACY camera mode.
     uint32_t getProducerStickyTransform() const;
 
+    // -----------------------------------------------------------------------
+
+    class SyncPoint
+    {
+    public:
+        SyncPoint(uint64_t frameNumber) : mFrameNumber(frameNumber),
+                mFrameIsAvailable(false), mTransactionIsApplied(false) {}
+
+        uint64_t getFrameNumber() const {
+            return mFrameNumber;
+        }
+
+        bool frameIsAvailable() const {
+            return mFrameIsAvailable;
+        }
+
+        void setFrameAvailable() {
+            mFrameIsAvailable = true;
+        }
+
+        bool transactionIsApplied() const {
+            return mTransactionIsApplied;
+        }
+
+        void setTransactionApplied() {
+            mTransactionIsApplied = true;
+        }
+
+    private:
+        const uint64_t mFrameNumber;
+        std::atomic<bool> mFrameIsAvailable;
+        std::atomic<bool> mTransactionIsApplied;
+    };
+
+    std::list<std::shared_ptr<SyncPoint>> mLocalSyncPoints;
+
+    // Guarded by mPendingStateMutex
+    std::list<std::shared_ptr<SyncPoint>> mRemoteSyncPoints;
+
+    void addSyncPoint(std::shared_ptr<SyncPoint> point);
+
+    void pushPendingState();
+    void popPendingState();
+    bool applyPendingStates();
+
+    Mutex mAvailableFrameMutex;
+    std::list<std::shared_ptr<SyncPoint>> mAvailableFrames;
+public:
+    void notifyAvailableFrames();
+private:
 
     // -----------------------------------------------------------------------
 
@@ -378,6 +445,10 @@ private:
     State mDrawingState;
     volatile int32_t mTransactionFlags;
 
+    // Accessed from main thread and binder threads
+    Mutex mPendingStateMutex;
+    Vector<State> mPendingStates;
+
     // thread-safe
     volatile int32_t mQueuedFrames;
     volatile int32_t mSidebandStreamChanged; // used like an atomic boolean
@@ -419,6 +490,8 @@ private:
     Vector<BufferItem> mQueueItems;
     uint64_t mLastFrameNumberReceived;
     bool mUpdateTexImageFailed; // This is only modified from the main thread
+
+    bool mSingleBufferMode;
 };
 
 // ---------------------------------------------------------------------------
index 1ad86a6..99efd39 100644 (file)
@@ -119,6 +119,7 @@ void MessageQueue::waitMessage() {
                 continue;
             case Looper::POLL_ERROR:
                 ALOGE("Looper::POLL_ERROR");
+                continue;
             case Looper::POLL_TIMEOUT:
                 // timeout (should not happen)
                 continue;
index fb7af97..16879ca 100644 (file)
@@ -56,13 +56,18 @@ status_t MonitoredProducer::requestBuffer(int slot, sp<GraphicBuffer>* buf) {
     return mProducer->requestBuffer(slot, buf);
 }
 
-status_t MonitoredProducer::setBufferCount(int bufferCount) {
-    return mProducer->setBufferCount(bufferCount);
+status_t MonitoredProducer::setMaxDequeuedBufferCount(
+        int maxDequeuedBuffers) {
+    return mProducer->setMaxDequeuedBufferCount(maxDequeuedBuffers);
+}
+
+status_t MonitoredProducer::setAsyncMode(bool async) {
+    return mProducer->setAsyncMode(async);
 }
 
 status_t MonitoredProducer::dequeueBuffer(int* slot, sp<Fence>* fence,
-        bool async, uint32_t w, uint32_t h, PixelFormat format, uint32_t usage) {
-    return mProducer->dequeueBuffer(slot, fence, async, w, h, format, usage);
+        uint32_t w, uint32_t h, PixelFormat format, uint32_t usage) {
+    return mProducer->dequeueBuffer(slot, fence, w, h, format, usage);
 }
 
 status_t MonitoredProducer::detachBuffer(int slot) {
@@ -84,8 +89,8 @@ status_t MonitoredProducer::queueBuffer(int slot, const QueueBufferInput& input,
     return mProducer->queueBuffer(slot, input, output);
 }
 
-void MonitoredProducer::cancelBuffer(int slot, const sp<Fence>& fence) {
-    mProducer->cancelBuffer(slot, fence);
+status_t MonitoredProducer::cancelBuffer(int slot, const sp<Fence>& fence) {
+    return mProducer->cancelBuffer(slot, fence);
 }
 
 int MonitoredProducer::query(int what, int* value) {
@@ -105,9 +110,9 @@ status_t MonitoredProducer::setSidebandStream(const sp<NativeHandle>& stream) {
     return mProducer->setSidebandStream(stream);
 }
 
-void MonitoredProducer::allocateBuffers(bool async, uint32_t width,
-        uint32_t height, PixelFormat format, uint32_t usage) {
-    mProducer->allocateBuffers(async, width, height, format, usage);
+void MonitoredProducer::allocateBuffers(uint32_t width, uint32_t height,
+        PixelFormat format, uint32_t usage) {
+    mProducer->allocateBuffers(width, height, format, usage);
 }
 
 status_t MonitoredProducer::allowAllocation(bool allow) {
@@ -122,6 +127,14 @@ String8 MonitoredProducer::getConsumerName() const {
     return mProducer->getConsumerName();
 }
 
+uint64_t MonitoredProducer::getNextFrameNumber() const {
+    return mProducer->getNextFrameNumber();
+}
+
+status_t MonitoredProducer::setSingleBufferMode(bool singleBufferMode) {
+    return mProducer->setSingleBufferMode(singleBufferMode);
+}
+
 IBinder* MonitoredProducer::onAsBinder() {
     return IInterface::asBinder(mProducer).get();
 }
index da95766..c2b2e24 100644 (file)
@@ -35,9 +35,10 @@ public:
 
     // From IGraphicBufferProducer
     virtual status_t requestBuffer(int slot, sp<GraphicBuffer>* buf);
-    virtual status_t setBufferCount(int bufferCount);
-    virtual status_t dequeueBuffer(int* slot, sp<Fence>* fence, bool async,
-            uint32_t w, uint32_t h, PixelFormat format, uint32_t usage);
+    virtual status_t setMaxDequeuedBufferCount(int maxDequeuedBuffers);
+    virtual status_t setAsyncMode(bool async);
+    virtual status_t dequeueBuffer(int* slot, sp<Fence>* fence, uint32_t w,
+            uint32_t h, PixelFormat format, uint32_t usage);
     virtual status_t detachBuffer(int slot);
     virtual status_t detachNextBuffer(sp<GraphicBuffer>* outBuffer,
             sp<Fence>* outFence);
@@ -45,18 +46,20 @@ public:
             const sp<GraphicBuffer>& buffer);
     virtual status_t queueBuffer(int slot, const QueueBufferInput& input,
             QueueBufferOutput* output);
-    virtual void cancelBuffer(int slot, const sp<Fence>& fence);
+    virtual status_t cancelBuffer(int slot, const sp<Fence>& fence);
     virtual int query(int what, int* value);
     virtual status_t connect(const sp<IProducerListener>& token, int api,
             bool producerControlledByApp, QueueBufferOutput* output);
     virtual status_t disconnect(int api);
     virtual status_t setSidebandStream(const sp<NativeHandle>& stream);
-    virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
+    virtual void allocateBuffers(uint32_t width, uint32_t height,
             PixelFormat format, uint32_t usage);
     virtual status_t allowAllocation(bool allow);
     virtual status_t setGenerationNumber(uint32_t generationNumber);
     virtual String8 getConsumerName() const override;
+    virtual uint64_t getNextFrameNumber() const override;
     virtual IBinder* onAsBinder();
+    virtual status_t setSingleBufferMode(bool singleBufferMode);
 
 private:
     sp<IGraphicBufferProducer> mProducer;
index 7cd42e4..27357b9 100644 (file)
@@ -148,7 +148,7 @@ RenderEngine* RenderEngine::create(EGLDisplay display, int hwcFormat) {
     return engine;
 }
 
-RenderEngine::RenderEngine() : mEGLContext(EGL_NO_CONTEXT) {
+RenderEngine::RenderEngine() : mEGLConfig(NULL), mEGLContext(EGL_NO_CONTEXT) {
 }
 
 RenderEngine::~RenderEngine() {
@@ -316,7 +316,7 @@ class EGLAttributeVector {
     friend class Adder;
     KeyedVector<Attribute, EGLint> mList;
     struct Attribute {
-        Attribute() {};
+        Attribute() : v(0) {};
         Attribute(EGLint v) : v(v) { }
         EGLint v;
         bool operator < (const Attribute& other) const {
index fdc3650..1e33847 100644 (file)
@@ -52,6 +52,7 @@
 #include <utils/String8.h>
 #include <utils/String16.h>
 #include <utils/StopWatch.h>
+#include <utils/Timers.h>
 #include <utils/Trace.h>
 
 #include <private/android_filesystem_config.h>
@@ -235,9 +236,8 @@ sp<IBinder> SurfaceFlinger::createDisplay(const String8& displayName,
     sp<BBinder> token = new DisplayToken(this);
 
     Mutex::Autolock _l(mStateLock);
-    DisplayDeviceState info(DisplayDevice::DISPLAY_VIRTUAL);
+    DisplayDeviceState info(DisplayDevice::DISPLAY_VIRTUAL, secure);
     info.displayName = displayName;
-    info.isSecure = secure;
     mCurrentState.displays.add(token, info);
 
     return token;
@@ -266,9 +266,8 @@ void SurfaceFlinger::createBuiltinDisplayLocked(DisplayDevice::DisplayType type)
     ALOGW_IF(mBuiltinDisplays[type],
             "Overwriting display token for display type %d", type);
     mBuiltinDisplays[type] = new BBinder();
-    DisplayDeviceState info(type);
     // All non-virtual displays are currently considered secure.
-    info.isSecure = true;
+    DisplayDeviceState info(type, true);
     mCurrentState.displays.add(mBuiltinDisplays[type], info);
 }
 
@@ -304,6 +303,10 @@ void SurfaceFlinger::bootFinished()
     // formerly we would just kill the process, but we now ask it to exit so it
     // can choose where to stop the animation.
     property_set("service.bootanim.exit", "1");
+
+    const int LOGTAG_SF_STOP_BOOTANIM = 60110;
+    LOG_EVENT_LONG(LOGTAG_SF_STOP_BOOTANIM,
+                   ns2ms(systemTime(SYSTEM_TIME_MONOTONIC)));
 }
 
 void SurfaceFlinger::deleteTextureAsync(uint32_t texture) {
@@ -1323,6 +1326,11 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
     const LayerVector& currentLayers(mCurrentState.layersSortedByZ);
     const size_t count = currentLayers.size();
 
+    // Notify all layers of available frames
+    for (size_t i = 0; i < count; ++i) {
+        currentLayers[i]->notifyAvailableFrames();
+    }
+
     /*
      * Traversal of the children
      * (perform the transaction for each of them if needed)
@@ -2233,7 +2241,7 @@ uint32_t SurfaceFlinger::setClientStateLocked(
         if (what & layer_state_t::eLayerChanged) {
             // NOTE: index needs to be calculated before we update the state
             ssize_t idx = mCurrentState.layersSortedByZ.indexOf(layer);
-            if (layer->setLayer(s.z)) {
+            if (layer->setLayer(s.z) && idx >= 0) {
                 mCurrentState.layersSortedByZ.removeAt(idx);
                 mCurrentState.layersSortedByZ.add(layer);
                 // we need traversal (state changed)
@@ -2269,7 +2277,7 @@ uint32_t SurfaceFlinger::setClientStateLocked(
         if (what & layer_state_t::eLayerStackChanged) {
             // NOTE: index needs to be calculated before we update the state
             ssize_t idx = mCurrentState.layersSortedByZ.indexOf(layer);
-            if (layer->setLayerStack(s.layerStack)) {
+            if (layer->setLayerStack(s.layerStack) && idx >= 0) {
                 mCurrentState.layersSortedByZ.removeAt(idx);
                 mCurrentState.layersSortedByZ.add(layer);
                 // we need traversal (state changed)
@@ -2277,6 +2285,11 @@ uint32_t SurfaceFlinger::setClientStateLocked(
                 flags |= eTransactionNeeded|eTraversalNeeded;
             }
         }
+        if (what & layer_state_t::eDeferTransaction) {
+            layer->deferTransactionUntil(s.handle, s.frameNumber);
+            // We don't trigger a traversal here because if no other state is
+            // changed, we don't want this to cause any more work
+        }
     }
     return flags;
 }
@@ -3127,8 +3140,12 @@ public:
     GraphicProducerWrapper(const sp<IGraphicBufferProducer>& impl)
     :   impl(impl),
         looper(new Looper(true)),
+        result(NO_ERROR),
         exitPending(false),
-        exitRequested(false)
+        exitRequested(false),
+        code(0),
+        data(NULL),
+        reply(NULL)
     {}
 
     // Binder thread
@@ -3524,11 +3541,22 @@ int SurfaceFlinger::LayerVector::do_compare(const void* lhs,
 // ---------------------------------------------------------------------------
 
 SurfaceFlinger::DisplayDeviceState::DisplayDeviceState()
-    : type(DisplayDevice::DISPLAY_ID_INVALID), width(0), height(0) {
-}
-
-SurfaceFlinger::DisplayDeviceState::DisplayDeviceState(DisplayDevice::DisplayType type)
-    : type(type), layerStack(DisplayDevice::NO_LAYER_STACK), orientation(0), width(0), height(0) {
+    : type(DisplayDevice::DISPLAY_ID_INVALID),
+      layerStack(DisplayDevice::NO_LAYER_STACK),
+      orientation(0),
+      width(0),
+      height(0),
+      isSecure(false) {
+}
+
+SurfaceFlinger::DisplayDeviceState::DisplayDeviceState(
+    DisplayDevice::DisplayType type, bool isSecure)
+    : type(type),
+      layerStack(DisplayDevice::NO_LAYER_STACK),
+      orientation(0),
+      width(0),
+      height(0),
+      isSecure(isSecure) {
     viewport.makeInvalid();
     frame.makeInvalid();
 }
index b3baadd..4e0160a 100644 (file)
@@ -162,7 +162,7 @@ private:
 
     struct DisplayDeviceState {
         DisplayDeviceState();
-        DisplayDeviceState(DisplayDevice::DisplayType type);
+        DisplayDeviceState(DisplayDevice::DisplayType type, bool isSecure);
         bool isValid() const { return type >= 0; }
         bool isMainDisplay() const { return type == DisplayDevice::DISPLAY_PRIMARY; }
         bool isVirtualDisplay() const { return type >= DisplayDevice::DISPLAY_VIRTUAL; }
index ed1f31b..5722fb4 100644 (file)
@@ -32,7 +32,8 @@ namespace android {
 // ---------------------------------------------------------------------------
 
 status_t SurfaceFlingerConsumer::updateTexImage(BufferRejecter* rejecter,
-        const DispSync& dispSync, uint64_t maxFrameNumber)
+        const DispSync& dispSync, bool* singleBufferMode, bool* queuedBuffer,
+        uint64_t maxFrameNumber)
 {
     ATRACE_CALL();
     ALOGV("updateTexImage");
@@ -68,16 +69,23 @@ status_t SurfaceFlingerConsumer::updateTexImage(BufferRejecter* rejecter,
         return err;
     }
 
-
     // We call the rejecter here, in case the caller has a reason to
     // not accept this buffer.  This is used by SurfaceFlinger to
     // reject buffers which have the wrong size
-    int buf = item.mBuf;
-    if (rejecter && rejecter->reject(mSlots[buf].mGraphicBuffer, item)) {
-        releaseBufferLocked(buf, mSlots[buf].mGraphicBuffer, EGL_NO_SYNC_KHR);
+    int slot = item.mSlot;
+    if (rejecter && rejecter->reject(mSlots[slot].mGraphicBuffer, item)) {
+        releaseBufferLocked(slot, mSlots[slot].mGraphicBuffer, EGL_NO_SYNC_KHR);
         return BUFFER_REJECTED;
     }
 
+    if (singleBufferMode) {
+        *singleBufferMode = item.mSingleBufferMode;
+    }
+
+    if (queuedBuffer) {
+        *queuedBuffer = item.mQueuedBuffer;
+    }
+
     // Release the previous buffer.
     err = updateAndReleaseLocked(item);
     if (err != NO_ERROR) {
index 779e5b7..207c243 100644 (file)
@@ -57,6 +57,7 @@ public:
     // this does not guarantee that the buffer has been bound to the GL
     // texture.
     status_t updateTexImage(BufferRejecter* rejecter, const DispSync& dispSync,
+            bool* singleBufferMode, bool* queuedBuffer,
             uint64_t maxFrameNumber = 0);
 
     // See GLConsumer::bindTextureImageLocked().
index dcde512..ee4ad4e 100644 (file)
 #include <gui/Surface.h>
 #include <gui/SurfaceComposerClient.h>
 #include <private/gui/ComposerService.h>
+#include <private/gui/LayerState.h>
 
 #include <utils/String8.h>
 #include <ui/DisplayInfo.h>
 
+#include <math.h>
+
 namespace android {
 
 // Fill an RGBA_8888 formatted surface with a single color.
@@ -38,8 +41,8 @@ static void fillSurfaceRGBA8(const sp<SurfaceControl>& sc,
     ASSERT_TRUE(s != NULL);
     ASSERT_EQ(NO_ERROR, s->lock(&outBuffer, NULL));
     uint8_t* img = reinterpret_cast<uint8_t*>(outBuffer.bits);
-    for (uint32_t y = 0; y < outBuffer.height; y++) {
-        for (uint32_t x = 0; x < outBuffer.width; x++) {
+    for (int y = 0; y < outBuffer.height; y++) {
+        for (int x = 0; x < outBuffer.width; x++) {
             uint8_t* pixel = img + (4 * (y*outBuffer.stride + x));
             pixel[0] = r;
             pixel[1] = g;
@@ -76,7 +79,7 @@ public:
             String8 err(String8::format("pixel @ (%3d, %3d): "
                     "expected [%3d, %3d, %3d], got [%3d, %3d, %3d]",
                     x, y, r, g, b, pixel[0], pixel[1], pixel[2]));
-            EXPECT_EQ(String8(), err);
+            EXPECT_EQ(String8(), err) << err.string();
         }
     }
 
@@ -134,6 +137,8 @@ protected:
 
         SurfaceComposerClient::openGlobalTransaction();
 
+        mComposerClient->setDisplayLayerStack(display, 0);
+
         ASSERT_EQ(NO_ERROR, mBGSurfaceControl->setLayer(INT_MAX-2));
         ASSERT_EQ(NO_ERROR, mBGSurfaceControl->show());
 
@@ -249,4 +254,184 @@ TEST_F(LayerUpdateTest, LayerResizeWorks) {
     }
 }
 
+TEST_F(LayerUpdateTest, LayerCropWorks) {
+    sp<ScreenCapture> sc;
+    {
+        SCOPED_TRACE("before crop");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75, 195,  63,  63);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+
+    SurfaceComposerClient::openGlobalTransaction();
+    Rect cropRect(16, 16, 32, 32);
+    ASSERT_EQ(NO_ERROR, mFGSurfaceControl->setCrop(cropRect));
+    SurfaceComposerClient::closeGlobalTransaction(true);
+    {
+        // This should crop the foreground surface.
+        SCOPED_TRACE("after crop");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75,  63,  63, 195);
+        sc->checkPixel( 95,  80, 195,  63,  63);
+        sc->checkPixel( 80,  95, 195,  63,  63);
+        sc->checkPixel( 96,  96,  63,  63, 195);
+    }
+}
+
+TEST_F(LayerUpdateTest, LayerSetLayerWorks) {
+    sp<ScreenCapture> sc;
+    {
+        SCOPED_TRACE("before setLayer");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75, 195,  63,  63);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+
+    SurfaceComposerClient::openGlobalTransaction();
+    ASSERT_EQ(NO_ERROR, mFGSurfaceControl->setLayer(INT_MAX - 3));
+    SurfaceComposerClient::closeGlobalTransaction(true);
+    {
+        // This should hide the foreground surface beneath the background.
+        SCOPED_TRACE("after setLayer");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75,  63,  63, 195);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+}
+
+TEST_F(LayerUpdateTest, LayerShowHideWorks) {
+    sp<ScreenCapture> sc;
+    {
+        SCOPED_TRACE("before hide");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75, 195,  63,  63);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+
+    SurfaceComposerClient::openGlobalTransaction();
+    ASSERT_EQ(NO_ERROR, mFGSurfaceControl->hide());
+    SurfaceComposerClient::closeGlobalTransaction(true);
+    {
+        // This should hide the foreground surface.
+        SCOPED_TRACE("after hide, before show");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75,  63,  63, 195);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+
+    SurfaceComposerClient::openGlobalTransaction();
+    ASSERT_EQ(NO_ERROR, mFGSurfaceControl->show());
+    SurfaceComposerClient::closeGlobalTransaction(true);
+    {
+        // This should show the foreground surface.
+        SCOPED_TRACE("after show");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75, 195,  63,  63);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+}
+
+TEST_F(LayerUpdateTest, LayerSetAlphaWorks) {
+    sp<ScreenCapture> sc;
+    {
+        SCOPED_TRACE("before setAlpha");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75, 195,  63,  63);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+
+    SurfaceComposerClient::openGlobalTransaction();
+    ASSERT_EQ(NO_ERROR, mFGSurfaceControl->setAlpha(0.75f));
+    SurfaceComposerClient::closeGlobalTransaction(true);
+    {
+        // This should set foreground to be 75% opaque.
+        SCOPED_TRACE("after setAlpha");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75, 162,  63,  96);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+}
+
+TEST_F(LayerUpdateTest, LayerSetLayerStackWorks) {
+    sp<ScreenCapture> sc;
+    {
+        SCOPED_TRACE("before setLayerStack");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75, 195,  63,  63);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+
+    SurfaceComposerClient::openGlobalTransaction();
+    ASSERT_EQ(NO_ERROR, mFGSurfaceControl->setLayerStack(1));
+    SurfaceComposerClient::closeGlobalTransaction(true);
+    {
+        // This should hide the foreground surface since it goes to a different
+        // layer stack.
+        SCOPED_TRACE("after setLayerStack");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75,  63,  63, 195);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+}
+
+TEST_F(LayerUpdateTest, LayerSetFlagsWorks) {
+    sp<ScreenCapture> sc;
+    {
+        SCOPED_TRACE("before setFlags");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75, 195,  63,  63);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+
+    SurfaceComposerClient::openGlobalTransaction();
+    ASSERT_EQ(NO_ERROR, mFGSurfaceControl->setFlags(
+            layer_state_t::eLayerHidden, layer_state_t::eLayerHidden));
+    SurfaceComposerClient::closeGlobalTransaction(true);
+    {
+        // This should hide the foreground surface
+        SCOPED_TRACE("after setFlags");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 75,  75,  63,  63, 195);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+}
+
+TEST_F(LayerUpdateTest, LayerSetMatrixWorks) {
+    sp<ScreenCapture> sc;
+    {
+        SCOPED_TRACE("before setMatrix");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 91,  96, 195,  63,  63);
+        sc->checkPixel( 96, 101, 195,  63,  63);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+
+    SurfaceComposerClient::openGlobalTransaction();
+    ASSERT_EQ(NO_ERROR, mFGSurfaceControl->setMatrix(M_SQRT1_2, M_SQRT1_2,
+            -M_SQRT1_2, M_SQRT1_2));
+    SurfaceComposerClient::closeGlobalTransaction(true);
+    {
+        SCOPED_TRACE("after setMatrix");
+        ScreenCapture::captureScreen(&sc);
+        sc->checkPixel( 24,  24,  63,  63, 195);
+        sc->checkPixel( 91,  96, 195,  63,  63);
+        sc->checkPixel( 96,  91,  63,  63, 195);
+        sc->checkPixel(145, 145,  63,  63, 195);
+    }
+}
+
 }
diff --git a/services/surfaceflinger/tests/resize/Android.mk b/services/surfaceflinger/tests/resize/Android.mk
deleted file mode 100644 (file)
index d81679e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
-       resize.cpp
-
-LOCAL_SHARED_LIBRARIES := \
-       libcutils \
-       libutils \
-    libui \
-    libgui
-
-LOCAL_MODULE:= test-resize
-
-LOCAL_MODULE_TAGS := tests
-
-include $(BUILD_EXECUTABLE)
diff --git a/services/surfaceflinger/tests/resize/resize.cpp b/services/surfaceflinger/tests/resize/resize.cpp
deleted file mode 100644 (file)
index 8b051e8..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <cutils/memory.h>
-
-#include <utils/Log.h>
-
-#include <binder/IPCThreadState.h>
-#include <binder/ProcessState.h>
-#include <binder/IServiceManager.h>
-
-#include <gui/Surface.h>
-#include <gui/SurfaceComposerClient.h>
-
-using namespace android;
-
-namespace android {
-
-int main(int argc, char** argv)
-{
-    // set up the thread-pool
-    sp<ProcessState> proc(ProcessState::self());
-    ProcessState::self()->startThreadPool();
-
-    // create a client to surfaceflinger
-    sp<SurfaceComposerClient> client = new SurfaceComposerClient();
-    
-    sp<SurfaceControl> surfaceControl = client->createSurface(String8("resize"),
-            160, 240, PIXEL_FORMAT_RGB_565, 0);
-
-    sp<Surface> surface = surfaceControl->getSurface();
-
-    SurfaceComposerClient::openGlobalTransaction();
-    surfaceControl->setLayer(100000);
-    SurfaceComposerClient::closeGlobalTransaction();
-
-    ANativeWindow_Buffer outBuffer;
-    surface->lock(&outBuffer, NULL);
-    ssize_t bpr = outBuffer.stride * bytesPerPixel(outBuffer.format);
-    android_memset16((uint16_t*)outBuffer.bits, 0xF800, bpr*outBuffer.height);
-    surface->unlockAndPost();
-
-    surface->lock(&outBuffer);
-    android_memset16((uint16_t*)outBuffer.bits, 0x07E0, bpr*outBuffer.height);
-    surface->unlockAndPost();
-
-    SurfaceComposerClient::openGlobalTransaction();
-    surfaceControl->setSize(320, 240);
-    SurfaceComposerClient::closeGlobalTransaction();
-
-    
-    IPCThreadState::self()->joinThreadPool();
-    
-    return 0;
-}
diff --git a/services/surfaceflinger/tests/screencap/Android.mk b/services/surfaceflinger/tests/screencap/Android.mk
deleted file mode 100644 (file)
index 5cdd1a8..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
-       screencap.cpp
-
-LOCAL_SHARED_LIBRARIES := \
-       libcutils \
-       libutils \
-       libbinder \
-       libskia \
-    libui \
-    libgui
-
-LOCAL_MODULE:= test-screencap
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES += \
-       external/skia/include/core \
-       external/skia/include/effects \
-       external/skia/include/images \
-       external/skia/src/ports \
-       external/skia/include/utils
-
-include $(BUILD_EXECUTABLE)
diff --git a/services/surfaceflinger/tests/screencap/screencap.cpp b/services/surfaceflinger/tests/screencap/screencap.cpp
deleted file mode 100644 (file)
index f842fc3..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <utils/Log.h>
-
-#include <binder/IPCThreadState.h>
-#include <binder/ProcessState.h>
-#include <binder/IServiceManager.h>
-
-#include <binder/IMemory.h>
-#include <gui/ISurfaceComposer.h>
-
-#include <SkImageEncoder.h>
-#include <SkBitmap.h>
-
-using namespace android;
-
-int main(int argc, char** argv)
-{
-    if (argc != 2) {
-        printf("usage: %s path\n", argv[0]);
-        exit(0);
-    }
-
-    const String16 name("SurfaceFlinger");
-    sp<ISurfaceComposer> composer;
-    getService(name, &composer);
-
-    sp<IMemoryHeap> heap;
-    uint32_t w, h;
-    PixelFormat f;
-    sp<IBinder> display(composer->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain));
-    status_t err = composer->captureScreen(display, &heap, &w, &h, &f, 0, 0);
-    if (err != NO_ERROR) {
-        fprintf(stderr, "screen capture failed: %s\n", strerror(-err));
-        exit(0);
-    }
-
-    printf("screen capture success: w=%u, h=%u, pixels=%p\n",
-            w, h, heap->getBase());
-
-    printf("saving file as PNG in %s ...\n", argv[1]);
-
-    SkBitmap b;
-    b.setConfig(SkBitmap::kARGB_8888_Config, w, h);
-    b.setPixels(heap->getBase());
-    SkImageEncoder::EncodeFile(argv[1], b,
-            SkImageEncoder::kPNG_Type, SkImageEncoder::kDefaultQuality);
-
-    return 0;
-}
diff --git a/services/surfaceflinger/tests/transform/Android.mk b/services/surfaceflinger/tests/transform/Android.mk
deleted file mode 100644 (file)
index 6219dae..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
-       TransformTest.cpp \
-       ../../Transform.cpp
-
-LOCAL_SHARED_LIBRARIES := \
-       libcutils \
-       libutils \
-       libui \
-
-LOCAL_MODULE:= test-transform
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_C_INCLUDES += ../..
-
-include $(BUILD_EXECUTABLE)
diff --git a/services/surfaceflinger/tests/transform/TransformTest.cpp b/services/surfaceflinger/tests/transform/TransformTest.cpp
deleted file mode 100644 (file)
index e112c4e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <utils/Errors.h>
-#include "../../Transform.h"
-
-using namespace android;
-
-int main(int argc, char **argv)
-{
-    Transform tr90(Transform::ROT_90);
-    Transform trFH(Transform::FLIP_H);
-    Transform trFV(Transform::FLIP_V);
-
-    Transform tr90FH(Transform::ROT_90 | Transform::FLIP_H);
-    Transform tr90FV(Transform::ROT_90 | Transform::FLIP_V);
-
-    tr90.dump("tr90");
-    trFH.dump("trFH");
-    trFV.dump("trFV");
-
-    tr90FH.dump("tr90FH");
-    tr90FV.dump("tr90FV");
-
-    (trFH*tr90).dump("trFH*tr90");
-    (trFV*tr90).dump("trFV*tr90");
-
-    (tr90*trFH).dump("tr90*trFH");
-    (tr90*trFV).dump("tr90*trFV");
-
-    return 0;
-}