Wednesday, May 11, 2011

using apitrace to trace opengl api in !debian / !ubuntu

More about api trace here https://github.com/apitrace/apitrace
git clone https://github.com/apitrace/apitrace.git
cd apitrace
leafpad README &

It needs cmake, qt , qjson:
apt-get install cmake libqjson-dev libqt4-dev

cmake -H. -Bbuild
make -C build
LD_PRELOAD=build/glxtrace.so glxgears
build/tracedump glxgears | less -R


The logs are pretty detailed :)

you can use the nice build/qapitrace that does have opengl.org help links for the functions traced






0 glXChooseVisual(dpy = 0x1749010, screen = 0, attribList = {GLX_RGBA, GLX_RED_SIZE, GLX_USE_GL, GLX_GREEN_SIZE, GLX_USE_GL, GLX_BLUE_SIZE, GLX_USE_GL, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, GLX_
USE_GL, 0}) = &{visual = 0x1754b40, visualid = 297, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
1 glXCreateContext(dpy = 0x1749010, vis = &{visual = 0x1754b40, visualid = 297, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size =
 256, bits_per_rgb = 8}, shareList = NULL, direct = True) = 0x17b2b00
2 glXMakeCurrent(dpy = 0x1749010, drawable = 41943042, ctx = 0x17b2b00) = True
3 glXQueryExtensionsString(dpy = 0x1749010, screen = 0) = "GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_import_context GLX_EXT_visual_info GLX_EXT_visual_rating GLX_MESA_copy_sub_buf
fer GLX_MESA_swap_control GLX_OML_swap_method GLX_OML_sync_control GLX_SGI_make_current_read GLX_SGI_swap_control GLX_SGI_video_sync GLX_SGIS_multisample GLX_SGIX_fbconfig GLX_SGIX_pbuffer G
LX_SGIX_visual_select_group GLX_EXT_texture_from_pixmap GLX_INTEL_swap_event "
4 glXQueryExtensionsString(dpy = 0x1749010, screen = 0) = "GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_import_context GLX_EXT_visual_info GLX_EXT_visual_rating GLX_MESA_copy_sub_buf
fer GLX_MESA_swap_control GLX_OML_swap_method GLX_OML_sync_control GLX_SGI_make_current_read GLX_SGI_swap_control GLX_SGI_video_sync GLX_SGIS_multisample GLX_SGIX_fbconfig GLX_SGIX_pbuffer G
LX_SGIX_visual_select_group GLX_EXT_texture_from_pixmap GLX_INTEL_swap_event "
5 glXGetProcAddressARB(procName = "glXGetSwapIntervalMESA") = 0x7f4c952c53e0
6 glLightfv(light = GL_LIGHT0, pname = GL_POSITION, params = {5, 5, 10, 0})
7 glEnable(cap = GL_CULL_FACE)
8 glEnable(cap = GL_LIGHTING)
9 glEnable(cap = GL_LIGHT0)
10 glEnable(cap = GL_DEPTH_TEST)
11 glGenLists(range = 1) = 1
12 glNewList(list = 1, mode = GL_COMPILE)
13 glMaterialfv(face = GL_FRONT, pname = GL_AMBIENT_AND_DIFFUSE, params = {0.8, 0.1, 0, 1})
14 glShadeModel(mode = GL_FLAT)
15 glNormal3f(nx = 0, ny = 0, nz = 1)
16 glBegin(mode = GL_QUAD_STRIP)
17 glVertex3f(x = 1, y = 0, z = 0.5)
18 glVertex3f(x = 3.65, y = 0, z = 0.5)
19 glVertex3f(x = 1, y = 0, z = 0.5)
20 glVertex3f(x = 3.54915, y = 0.852076, z = 0.5)
21 glVertex3f(x = 0.951057, y = 0.309017, z = 0.5)
22 glVertex3f(x = 3.47136, y = 1.12791, z = 0.5)


No comments: