[Mesa-dev] [PATCH 02/22] intel/tools: define BatchbufferLogger application interface

kevin.rogovin at intel.com kevin.rogovin at intel.com
Mon Sep 25 10:34:02 UTC 2017


From: Kevin Rogovin <kevin.rogovin at intel.com>

Define the application interface to BatchbufferLogger. The
BatchbufferLogger needs from the application when a GL/GLES
API call is issues and returns. It will use this information
to correctly correlate batchbuffer additions to GL/GLES API
calls.

In addition, because the BatchbufferLogger will be intercepting
drmIoctl, an application does NOT link against it. Instead, one
needs to LD_PRELOAD the .so.

Signed-off-by: Kevin Rogovin <kevin.rogovin at intel.com>
---
 src/intel/tools/i965_batchbuffer_logger_app.h | 84 +++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 src/intel/tools/i965_batchbuffer_logger_app.h

diff --git a/src/intel/tools/i965_batchbuffer_logger_app.h b/src/intel/tools/i965_batchbuffer_logger_app.h
new file mode 100644
index 0000000..76e4b24
--- /dev/null
+++ b/src/intel/tools/i965_batchbuffer_logger_app.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright © 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef I965_BATCHBUFFER_LOGGER_APP_H
+#define I965_BATCHBUFFER_LOGGER_APP_H
+
+#include <stdint.h>
+#include <stdarg.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * An i965_batchbuffer_logger_app represents the hooking
+ * of an application into an i965_batchbuffer_logger
+ */
+struct i965_batchbuffer_logger_app {
+  /**
+   * To be called by the app before a GL/GLES or GLX/EGL call
+   */
+  void (*pre_call)(struct i965_batchbuffer_logger_app*,
+                   unsigned int call_id, const char *call_detailed,
+                   const char *fcn_name);
+
+  /**
+   * To be called by the app after a GL/GLES or GLX/EGL call
+   */
+  void (*post_call)(struct i965_batchbuffer_logger_app*,
+                    unsigned int call_id);
+
+  /**
+   * To be called by the app to start/resume dumping data
+   */
+  void (*begin_logging)(struct i965_batchbuffer_logger_app*,
+                        const char *fileprefix);
+
+  /**
+   * To be called by the app to stop/pause dumping data
+   */
+  void (*end_logging)(struct i965_batchbuffer_logger_app*);
+
+  /**
+   * To be called by the app to release the i965_batchbuffer_logger_app
+   */
+  void (*release_app)(struct i965_batchbuffer_logger_app*);
+};
+
+/**
+ * The function pointer type for i965_batchbuffer_logger_app_acquire,
+ * An appliction should use dlsym to find the symbol
+ * i965_batchbuffer_logger_app_acquire and use it to acquire an
+ * i965_batchbuffer_logger_app object.
+ */
+typedef struct i965_batchbuffer_logger_app*
+(*i965_batchbuffer_logger_app_acquire_fcn)(void);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
-- 
2.7.4



More information about the mesa-dev mailing list