Commit de24095c authored by yuri's avatar yuri
Browse files

New port: devel/apitrace: Tools for tracing OpenGL and other graphics APIs

PR:		223002
Submitted by:	Greg V <greg@unrelenting.technology>
Approved by:	tcberner (mentor)
Differential Revision:	https://reviews.freebsd.org/D13112
parent eac81982
......@@ -109,6 +109,7 @@
SUBDIR += aphpunit
SUBDIR += api-sanity-autotest
SUBDIR += apiextractor
SUBDIR += apitrace
SUBDIR += appstream-glib
SUBDIR += apr1
SUBDIR += apr2
......
# $FreeBSD$
PORTNAME= apitrace
DISTVERSION= 7.1-455
DISTVERSIONSUFFIX= -g7c76b90
CATEGORIES= devel
MAINTAINER= greg@unrelenting.technology
COMMENT= Tools for tracing OpenGL and other graphics APIs
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libpng16.so:graphics/png
USES= cmake:outsource compiler:c++11-lang pkgconfig python:2.7 shebangfix
USE_GITHUB= yes
USE_XORG= x11
SHEBANG_FILES= scripts/*.py
OPTIONS_DEFINE= QT5 DOCS
OPTIONS_DEFAULT= QT5
OPTIONS_SUB= yes
QT5_CMAKE_BOOL= ENABLE_GUI
QT5_USE= qt5=core,gui,network,widgets,buildtools_build,qmake_build
post-install:
${RM} ${STAGEDIR}${DOCSDIR}/LICENSE.txt
post-install-QT5-on:
${INSTALL_DATA} ${FILESDIR}/qapitrace.desktop ${STAGEDIR}${PREFIX}/share/applications
.include <bsd.port.mk>
TIMESTAMP = 1507984453
SHA256 (apitrace-apitrace-7.1-455-g7c76b90_GH0.tar.gz) = 235c5f402c1095bc7596073aa65bc4223b5fef3cc2ea54c000e92f735df5b825
SIZE (apitrace-apitrace-7.1-455-g7c76b90_GH0.tar.gz) = 3578137
--- dispatch/glproc_egl.cpp.orig 2017-10-13 17:18:18 UTC
+++ dispatch/glproc_egl.cpp
@@ -89,7 +89,7 @@ _getPublicProcAddress(const char *procNa
if (procName[0] == 'e' && procName[1] == 'g' && procName[2] == 'l') {
static void *libEGL = NULL;
if (!libEGL) {
- libEGL = _dlopen("libEGL.so", RTLD_LOCAL | RTLD_LAZY | RTLD_DEEPBIND);
+ libEGL = _dlopen("libEGL.so", RTLD_LOCAL | RTLD_LAZY);
if (!libEGL) {
return NULL;
}
@@ -132,7 +132,7 @@ _getPublicProcAddress(const char *procNa
static void *libGLESv2 = NULL;
if (!libGLESv2) {
- libGLESv2 = _dlopen("libGLESv2.so", RTLD_LOCAL | RTLD_LAZY | RTLD_DEEPBIND);
+ libGLESv2 = _dlopen("libGLESv2.so", RTLD_LOCAL | RTLD_LAZY);
}
if (libGLESv2) {
proc = dlsym(libGLESv2, procName);
@@ -143,7 +143,7 @@ _getPublicProcAddress(const char *procNa
static void *libGLESv1 = NULL;
if (!libGLESv1) {
- libGLESv1 = _dlopen("libGLESv1_CM.so", RTLD_LOCAL | RTLD_LAZY | RTLD_DEEPBIND);
+ libGLESv1 = _dlopen("libGLESv1_CM.so", RTLD_LOCAL | RTLD_LAZY);
}
if (libGLESv1) {
proc = dlsym(libGLESv1, procName);
--- dispatch/glproc_gl.cpp.orig 2017-10-13 17:18:18 UTC
+++ dispatch/glproc_gl.cpp
@@ -200,7 +200,7 @@ void * _libgl_sym(const char *symbol)
* exposes symbols to it.
*/
- _libGlHandle = _dlopen(libgl_filename, RTLD_GLOBAL | RTLD_LAZY | RTLD_DEEPBIND);
+ _libGlHandle = _dlopen(libgl_filename, RTLD_GLOBAL | RTLD_LAZY);
if (!_libGlHandle) {
os::log("apitrace: error: couldn't find libGL.so\n");
return NULL;
--- retrace/CMakeLists.txt.orig 2017-10-13 17:18:18 UTC
+++ retrace/CMakeLists.txt
@@ -123,6 +123,7 @@ if (WIN32 OR APPLE OR X11_FOUND)
retrace_common
glretrace_common
glhelpers
+ glproc
glproc_gl
)
@@ -169,6 +170,7 @@ if (ENABLE_EGL AND X11_FOUND AND NOT WIN
retrace_common
glretrace_common
glhelpers
+ glproc
glproc_egl
${X11_X11_LIB}
${CMAKE_THREAD_LIBS_INIT}
--- thirdparty/libbacktrace/dwarf.c.orig 2017-10-13 17:18:18 UTC
+++ thirdparty/libbacktrace/dwarf.c
@@ -768,21 +768,27 @@ read_attribute (enum dwarf_form form, st
version, addrsize, dwarf_str, dwarf_str_size,
val);
}
+#if defined(DW_FORM_sec_offset) // not defined on 10
case DW_FORM_sec_offset:
val->encoding = ATTR_VAL_REF_SECTION;
val->u.uint = read_offset (buf, is_dwarf64);
return 1;
+#endif
+#if defined(DW_FORM_exprloc) // not defined on 10
case DW_FORM_exprloc:
val->encoding = ATTR_VAL_EXPR;
return advance (buf, read_uleb128 (buf));
+#endif
case DW_FORM_flag_present:
val->encoding = ATTR_VAL_UINT;
val->u.uint = 1;
return 1;
+#if defined(DW_FORM_ref_sig8) // not defined on 10
case DW_FORM_ref_sig8:
val->encoding = ATTR_VAL_REF_TYPE;
val->u.uint = read_uint64 (buf);
return 1;
+#endif
case DW_FORM_GNU_addr_index:
val->encoding = ATTR_VAL_REF_SECTION;
val->u.uint = read_uleb128 (buf);
@@ -1314,7 +1320,7 @@ find_address_ranges (struct backtrace_st
highpc_is_relative = 1;
}
break;
-
+#if defined(DW_AT_ranges) // not defined on 10
case DW_AT_ranges:
if (val.encoding == ATTR_VAL_UINT
|| val.encoding == ATTR_VAL_REF_SECTION)
@@ -1323,7 +1329,7 @@ find_address_ranges (struct backtrace_st
have_ranges = 1;
}
break;
-
+#endif
case DW_AT_stmt_list:
if (abbrev->tag == DW_TAG_compile_unit
&& (val.encoding == ATTR_VAL_UINT
@@ -1851,10 +1857,6 @@ read_line_program (struct backtrace_stat
}
}
break;
- case DW_LNE_set_discriminator:
- /* We don't care about discriminators. */
- read_uleb128 (line_buf);
- break;
default:
if (!advance (line_buf, len - 1))
return 0;
@@ -2108,16 +2110,24 @@ read_referenced_name (struct dwarf_data
if (val.encoding == ATTR_VAL_STRING)
ret = val.u.string;
break;
-
+#if defined(DW_AT_linkage_name)
case DW_AT_linkage_name:
+#endif
+#if defined(DW_AT_MIPS_linkage_name)
case DW_AT_MIPS_linkage_name:
+#endif
+#if defined(DW_AT_linkage_name) || defined(DW_AT_MIPS_linkage_name)
if (val.encoding == ATTR_VAL_STRING)
return val.u.string;
break;
-
+#endif
case DW_AT_specification:
if (abbrev->attrs[i].form == DW_FORM_ref_addr
+#if defined(DW_FORM_ref_sig8) // not defined on 10
|| abbrev->attrs[i].form == DW_FORM_ref_sig8)
+#else
+ || 0) // not defined
+#endif
{
/* This refers to a specification defined in some other
compilation unit. We can handle this case if we
@@ -2325,6 +2335,7 @@ read_function_entry (struct backtrace_st
{
switch (abbrev->attrs[i].name)
{
+#if defined(DW_AT_call_file)
case DW_AT_call_file:
if (val.encoding == ATTR_VAL_UINT)
{
@@ -2344,16 +2355,21 @@ read_function_entry (struct backtrace_st
}
}
break;
-
+#endif
+#if defined(DW_AT_call_line)
case DW_AT_call_line:
if (val.encoding == ATTR_VAL_UINT)
function->caller_lineno = val.u.uint;
break;
-
+#endif
case DW_AT_abstract_origin:
case DW_AT_specification:
if (abbrev->attrs[i].form == DW_FORM_ref_addr
+#if defined(DW_FORM_ref_sig8) // not defined on 10
|| abbrev->attrs[i].form == DW_FORM_ref_sig8)
+#else
+ || 0) // not defined
+#endif
{
/* This refers to an abstract origin defined in
some other compilation unit. We can handle
@@ -2383,13 +2399,17 @@ read_function_entry (struct backtrace_st
function->name = val.u.string;
}
break;
-
+#if defined(DW_AT_linkage_name)
case DW_AT_linkage_name:
+#endif
+#if defined(DW_AT_MIPS_linkage_name)
case DW_AT_MIPS_linkage_name:
+#endif
+#if defined(DW_AT_linkage_name) || defined(DW_AT_MIPS_linkage_name)
if (val.encoding == ATTR_VAL_STRING)
function->name = val.u.string;
break;
-
+#endif
case DW_AT_low_pc:
if (val.encoding == ATTR_VAL_ADDRESS)
{
@@ -2411,7 +2431,7 @@ read_function_entry (struct backtrace_st
highpc_is_relative = 1;
}
break;
-
+#if defined(DW_AT_ranges) // not defined on 10
case DW_AT_ranges:
if (val.encoding == ATTR_VAL_UINT
|| val.encoding == ATTR_VAL_REF_SECTION)
@@ -2420,7 +2440,7 @@ read_function_entry (struct backtrace_st
have_ranges = 1;
}
break;
-
+#endif
default:
break;
}
--- wrappers/trace.py.orig 2017-10-13 17:18:18 UTC
+++ wrappers/trace.py
@@ -521,7 +521,7 @@ class Tracer:
print '# define alloca _alloca'
print '# endif'
print '#else'
- print '# include <alloca.h> // alloca'
+ print '# include <stdlib.h> // alloca'
print '#endif'
print
print
[Desktop Entry]
Name=QApiTrace
GenericName=Graphics API tracing tool
Comment=A set of tools to trace OpenGL and other graphics APIs
Exec=qapitrace
Terminal=false
Type=Application
Categories=Development;
Keywords=opengl;graphics;debugging;
apitrace is a set of tools to:
- trace OpenGL, OpenGL ES, Direct3D, and DirectDraw APIs calls to a file
- replay OpenGL and OpenGL ES calls from a file
- inspect OpenGL state at any call while retracing
- visualize and edit trace files
WWW: https://apitrace.github.io
bin/apitrace
bin/eglretrace
bin/glretrace
%%QT5%%bin/qapitrace
%%QT5%%share/applications/qapitrace.desktop
lib/apitrace/scripts/apitrace.PIXExp
lib/apitrace/scripts/convert.py
lib/apitrace/scripts/highlight.py
lib/apitrace/scripts/jsondiff.py
lib/apitrace/scripts/jsonextractimages.py
lib/apitrace/scripts/leaks.py
lib/apitrace/scripts/profileshader.py
lib/apitrace/scripts/retracediff.py
lib/apitrace/scripts/snapdiff.py
lib/apitrace/scripts/tracecheck.py
lib/apitrace/scripts/tracediff.py
lib/apitrace/scripts/unpickle.py
lib/apitrace/wrappers/egltrace.so
lib/apitrace/wrappers/glxtrace.so
%%PORTDOCS%%%%DOCSDIR%%/BUGS.markdown
%%PORTDOCS%%%%DOCSDIR%%/LICENSE-brotli.txt
%%PORTDOCS%%%%DOCSDIR%%/LICENSE-snappy.txt
%%PORTDOCS%%%%DOCSDIR%%/NEWS.markdown
%%PORTDOCS%%%%DOCSDIR%%/README.markdown
%%PORTDOCS%%%%DOCSDIR%%/USAGE.markdown
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment