]> git.cworth.org Git - apitrace-tests/commitdiff
Test trimming.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 19 May 2012 19:53:37 +0000 (20:53 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 19 May 2012 19:53:37 +0000 (20:53 +0100)
tool_driver.py
traces/.gitignore
traces/dump-thread-ids.script [new file with mode: 0644]
traces/glthreads.trace [new file with mode: 0644]
traces/trim-identity.script [new file with mode: 0644]
traces/trim-range.script [new file with mode: 0644]
traces/trim-thread.script [new file with mode: 0644]

index 962db1e09b32baf3cfa106e4bfd96e2b85acff62..60ad5d9903052a4ae5b137a8360e223db2e8006b 100755 (executable)
@@ -58,7 +58,7 @@ class AsciiComparer:
             try:
                 refLine = refLines[lineNo]
             except IndexError:
             try:
                 refLine = refLines[lineNo]
             except IndexError:
-                fail('unexpected junk: %r' % self.srcLines[lineNo])
+                fail('unexpected junk: %r' % srcLines[lineNo])
 
             try:
                 srcLine = srcLines[lineNo]
 
             try:
                 srcLine = srcLines[lineNo]
@@ -77,10 +77,20 @@ class ToolDriver(Driver):
         some reason.'''
 
         refStream = open(refScript, 'rt')
         some reason.'''
 
         refStream = open(refScript, 'rt')
-
-        args = refStream.readline().split()
-        cmd = [self.options.apitrace] + args
         cwd = os.path.dirname(os.path.abspath(refScript))
         cwd = os.path.dirname(os.path.abspath(refScript))
+
+        while True:
+            args = refStream.readline().split()
+            cmd = [self.options.apitrace] + args
+
+            if args[0] == 'dump':
+                break
+
+            p = popen(cmd, cwd=cwd, universal_newlines=True)
+            p.wait()
+            if p.returncode != 0:
+                fail('`apitrace %s` returned code %i' % (args[0], p.returncode))
+            
         p = popen(cmd, cwd=cwd, stdout=subprocess.PIPE, universal_newlines=True)
 
         comparer = AsciiComparer(p.stdout, refStream, self.options.verbose)
         p = popen(cmd, cwd=cwd, stdout=subprocess.PIPE, universal_newlines=True)
 
         comparer = AsciiComparer(p.stdout, refStream, self.options.verbose)
@@ -88,7 +98,7 @@ class ToolDriver(Driver):
 
         p.wait()
         if p.returncode != 0:
 
         p.wait()
         if p.returncode != 0:
-            fail('tool returned code %i' % p.returncode)
+            fail('`apitrace %s` returned code %i' % (args[0], p.returncode))
     
     def run(self):
         self.parseOptions()
     
     def run(self):
         self.parseOptions()
index 6ef65c17d791dd3bdce5349dcffafc89d0740f00..a0f8a412a65e7885fd2ed233b15664720d5d7322 100644 (file)
@@ -1 +1,2 @@
 !*.trace
 !*.trace
+*.src.trace
diff --git a/traces/dump-thread-ids.script b/traces/dump-thread-ids.script
new file mode 100644 (file)
index 0000000..6f8f584
--- /dev/null
@@ -0,0 +1,242 @@
+dump --thread-ids glthreads.trace
+0 0 glXChooseVisual(dpy = 0x751280, screen = 0, attribList = {GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_DEPTH_SIZE, 1, GLX_DOUBLEBUFFER, 0}) = &{visual = 0x75c010, visualid = 151, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
+0 1 glXCreateContext(dpy = 0x751280, vis = &{visual = 0x75c010, visualid = 151, 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) = 0x75e3e0
+0 2 glXChooseVisual(dpy = 0x751280, screen = 0, attribList = {GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_DEPTH_SIZE, 1, GLX_DOUBLEBUFFER, 0}) = &{visual = 0x75c010, visualid = 151, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
+0 3 glXCreateContext(dpy = 0x751280, vis = &{visual = 0x75c010, visualid = 151, 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) = 0xa99be0
+1 4 glXMakeCurrent(dpy = 0x751280, drawable = 62914565, ctx = 0xa99be0) = True
+1 7 glEnable(cap = GL_DEPTH_TEST)
+1 8 glViewport(x = 0, y = 0, width = 160, height = 160)
+1 9 glMatrixMode(mode = GL_PROJECTION)
+1 10 glLoadIdentity()
+1 11 glFrustum(left = -1, right = 1, bottom = -1, top = 1, zNear = 1.5, zFar = 10)
+1 12 glMatrixMode(mode = GL_MODELVIEW)
+1 13 glLoadIdentity()
+1 14 glTranslatef(x = 0, y = 0, z = -2.5)
+2 6 glXMakeCurrent(dpy = 0x751280, drawable = 62914562, ctx = 0x75e3e0) = True
+2 17 glEnable(cap = GL_DEPTH_TEST)
+2 18 glViewport(x = 0, y = 0, width = 160, height = 160)
+2 19 glMatrixMode(mode = GL_PROJECTION)
+2 20 glLoadIdentity()
+2 21 glFrustum(left = -1, right = 1, bottom = -1, top = 1, zNear = 1.5, zFar = 10)
+2 22 glMatrixMode(mode = GL_MODELVIEW)
+2 23 glLoadIdentity()
+2 24 glTranslatef(x = 0, y = 0, z = -2.5)
+1 15 glClear(mask = GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT)
+1 26 glPushMatrix()
+1 27 glRotatef(angle = 0, x = 0, y = 1, z = 0)
+1 28 glRotatef(angle = 0, x = 1, y = 0, z = 0)
+1 29 glScalef(x = 0.7, y = 0.7, z = 0.7)
+1 30 glPushMatrix()
+1 31 glScalef(x = 0.75, y = 0.75, z = 0.75)
+1 32 glColor3f(red = 1, green = 0, blue = 0)
+1 33 glDisable(cap = GL_TEXTURE_2D)
+1 34 glBegin(mode = GL_QUADS)
+1 35 glColor3f(red = 0, green = 1, blue = 1)
+1 36 glTexCoord2f(s = 0, t = 0)
+1 37 glVertex3f(x = -1, y = -1, z = -1)
+1 38 glTexCoord2f(s = 1, t = 0)
+1 39 glVertex3f(x = -1, y = 1, z = -1)
+1 40 glTexCoord2f(s = 1, t = 1)
+1 41 glVertex3f(x = -1, y = 1, z = 1)
+1 42 glTexCoord2f(s = 0, t = 1)
+1 43 glVertex3f(x = -1, y = -1, z = 1)
+1 44 glColor3f(red = 1, green = 0, blue = 0)
+1 45 glTexCoord2f(s = 0, t = 0)
+1 46 glVertex3f(x = 1, y = -1, z = -1)
+1 47 glTexCoord2f(s = 1, t = 0)
+1 48 glVertex3f(x = 1, y = 1, z = -1)
+1 49 glTexCoord2f(s = 1, t = 1)
+1 50 glVertex3f(x = 1, y = 1, z = 1)
+1 51 glTexCoord2f(s = 0, t = 1)
+1 52 glVertex3f(x = 1, y = -1, z = 1)
+1 53 glColor3f(red = 1, green = 0, blue = 1)
+1 54 glTexCoord2f(s = 0, t = 0)
+1 55 glVertex3f(x = -1, y = -1, z = -1)
+1 56 glTexCoord2f(s = 1, t = 0)
+1 57 glVertex3f(x = 1, y = -1, z = -1)
+1 58 glTexCoord2f(s = 1, t = 1)
+1 59 glVertex3f(x = 1, y = -1, z = 1)
+1 60 glTexCoord2f(s = 0, t = 1)
+1 61 glVertex3f(x = -1, y = -1, z = 1)
+1 62 glColor3f(red = 0, green = 1, blue = 0)
+1 63 glTexCoord2f(s = 0, t = 0)
+1 64 glVertex3f(x = -1, y = 1, z = -1)
+1 65 glTexCoord2f(s = 1, t = 0)
+1 66 glVertex3f(x = 1, y = 1, z = -1)
+1 67 glTexCoord2f(s = 1, t = 1)
+1 68 glVertex3f(x = 1, y = 1, z = 1)
+1 69 glTexCoord2f(s = 0, t = 1)
+1 70 glVertex3f(x = -1, y = 1, z = 1)
+1 71 glColor3f(red = 1, green = 1, blue = 0)
+1 72 glTexCoord2f(s = 0, t = 0)
+1 73 glVertex3f(x = -1, y = -1, z = -1)
+1 74 glTexCoord2f(s = 1, t = 0)
+1 75 glVertex3f(x = 1, y = -1, z = -1)
+1 76 glTexCoord2f(s = 1, t = 1)
+1 77 glVertex3f(x = 1, y = 1, z = -1)
+1 78 glTexCoord2f(s = 0, t = 1)
+1 79 glVertex3f(x = -1, y = 1, z = -1)
+1 80 glColor3f(red = 0, green = 0, blue = 1)
+1 81 glTexCoord2f(s = 0, t = 0)
+1 82 glVertex3f(x = -1, y = -1, z = 1)
+1 83 glTexCoord2f(s = 1, t = 0)
+1 84 glVertex3f(x = 1, y = -1, z = 1)
+1 85 glTexCoord2f(s = 1, t = 1)
+1 86 glVertex3f(x = 1, y = 1, z = 1)
+1 87 glTexCoord2f(s = 0, t = 1)
+1 88 glVertex3f(x = -1, y = 1, z = 1)
+1 89 glEnd()
+1 90 glPopMatrix()
+1 91 glPopMatrix()
+2 25 glClear(mask = GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT)
+2 93 glPushMatrix()
+2 94 glRotatef(angle = 0, x = 0, y = 1, z = 0)
+2 95 glRotatef(angle = 0, x = 1, y = 0, z = 0)
+2 96 glScalef(x = 0.7, y = 0.7, z = 0.7)
+2 97 glPushMatrix()
+2 98 glScalef(x = 0.75, y = 0.75, z = 0.75)
+2 99 glColor3f(red = 1, green = 0, blue = 0)
+2 100 glDisable(cap = GL_TEXTURE_2D)
+2 101 glBegin(mode = GL_QUADS)
+2 102 glColor3f(red = 0, green = 1, blue = 1)
+2 103 glTexCoord2f(s = 0, t = 0)
+2 104 glVertex3f(x = -1, y = -1, z = -1)
+2 105 glTexCoord2f(s = 1, t = 0)
+2 106 glVertex3f(x = -1, y = 1, z = -1)
+2 107 glTexCoord2f(s = 1, t = 1)
+2 108 glVertex3f(x = -1, y = 1, z = 1)
+2 109 glTexCoord2f(s = 0, t = 1)
+2 110 glVertex3f(x = -1, y = -1, z = 1)
+2 111 glColor3f(red = 1, green = 0, blue = 0)
+2 112 glTexCoord2f(s = 0, t = 0)
+2 113 glVertex3f(x = 1, y = -1, z = -1)
+2 114 glTexCoord2f(s = 1, t = 0)
+2 115 glVertex3f(x = 1, y = 1, z = -1)
+2 116 glTexCoord2f(s = 1, t = 1)
+2 117 glVertex3f(x = 1, y = 1, z = 1)
+2 118 glTexCoord2f(s = 0, t = 1)
+2 119 glVertex3f(x = 1, y = -1, z = 1)
+2 120 glColor3f(red = 1, green = 0, blue = 1)
+2 121 glTexCoord2f(s = 0, t = 0)
+2 122 glVertex3f(x = -1, y = -1, z = -1)
+2 123 glTexCoord2f(s = 1, t = 0)
+2 124 glVertex3f(x = 1, y = -1, z = -1)
+2 125 glTexCoord2f(s = 1, t = 1)
+2 126 glVertex3f(x = 1, y = -1, z = 1)
+2 127 glTexCoord2f(s = 0, t = 1)
+2 128 glVertex3f(x = -1, y = -1, z = 1)
+2 129 glColor3f(red = 0, green = 1, blue = 0)
+2 130 glTexCoord2f(s = 0, t = 0)
+2 131 glVertex3f(x = -1, y = 1, z = -1)
+2 132 glTexCoord2f(s = 1, t = 0)
+2 133 glVertex3f(x = 1, y = 1, z = -1)
+2 134 glTexCoord2f(s = 1, t = 1)
+2 135 glVertex3f(x = 1, y = 1, z = 1)
+2 136 glTexCoord2f(s = 0, t = 1)
+2 137 glVertex3f(x = -1, y = 1, z = 1)
+2 138 glColor3f(red = 1, green = 1, blue = 0)
+2 139 glTexCoord2f(s = 0, t = 0)
+2 140 glVertex3f(x = -1, y = -1, z = -1)
+2 141 glTexCoord2f(s = 1, t = 0)
+2 142 glVertex3f(x = 1, y = -1, z = -1)
+2 143 glTexCoord2f(s = 1, t = 1)
+2 144 glVertex3f(x = 1, y = 1, z = -1)
+2 145 glTexCoord2f(s = 0, t = 1)
+2 146 glVertex3f(x = -1, y = 1, z = -1)
+2 147 glColor3f(red = 0, green = 0, blue = 1)
+2 148 glTexCoord2f(s = 0, t = 0)
+2 149 glVertex3f(x = -1, y = -1, z = 1)
+2 150 glTexCoord2f(s = 1, t = 0)
+2 151 glVertex3f(x = 1, y = -1, z = 1)
+2 152 glTexCoord2f(s = 1, t = 1)
+2 153 glVertex3f(x = 1, y = 1, z = 1)
+2 154 glTexCoord2f(s = 0, t = 1)
+2 155 glVertex3f(x = -1, y = 1, z = 1)
+2 156 glEnd()
+2 157 glPopMatrix()
+2 158 glPopMatrix()
+1 92 glXSwapBuffers(dpy = 0x751280, drawable = 62914565)
+
+2 159 glXSwapBuffers(dpy = 0x751280, drawable = 62914562)
+
+2 160 glXMakeCurrent(dpy = 0x751280, drawable = 62914562, ctx = 0x75e3e0) = True
+2 161 glEnable(cap = GL_DEPTH_TEST)
+1 163 glXMakeCurrent(dpy = 0x751280, drawable = 62914565, ctx = 0xa99be0) = True
+1 164 glEnable(cap = GL_DEPTH_TEST)
+1 165 glViewport(x = 0, y = 0, width = 160, height = 160)
+1 166 glMatrixMode(mode = GL_PROJECTION)
+1 167 glLoadIdentity()
+1 168 glFrustum(left = -1, right = 1, bottom = -1, top = 1, zNear = 1.5, zFar = 10)
+1 169 glMatrixMode(mode = GL_MODELVIEW)
+1 170 glLoadIdentity()
+1 171 glTranslatef(x = 0, y = 0, z = -2.5)
+2 162 glClear(mask = GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT)
+2 173 glPushMatrix()
+2 174 glRotatef(angle = 1, x = 0, y = 1, z = 0)
+2 175 glRotatef(angle = 1, x = 1, y = 0, z = 0)
+2 176 glScalef(x = 0.7, y = 0.7, z = 0.7)
+2 177 glPushMatrix()
+2 178 glScalef(x = 0.75, y = 0.75, z = 0.75)
+2 179 glColor3f(red = 1, green = 0, blue = 0)
+2 180 glDisable(cap = GL_TEXTURE_2D)
+2 181 glBegin(mode = GL_QUADS)
+2 182 glColor3f(red = 0, green = 1, blue = 1)
+2 183 glTexCoord2f(s = 0, t = 0)
+2 184 glVertex3f(x = -1, y = -1, z = -1)
+2 185 glTexCoord2f(s = 1, t = 0)
+2 186 glVertex3f(x = -1, y = 1, z = -1)
+2 187 glTexCoord2f(s = 1, t = 1)
+2 188 glVertex3f(x = -1, y = 1, z = 1)
+2 189 glTexCoord2f(s = 0, t = 1)
+2 190 glVertex3f(x = -1, y = -1, z = 1)
+2 191 glColor3f(red = 1, green = 0, blue = 0)
+2 192 glTexCoord2f(s = 0, t = 0)
+2 193 glVertex3f(x = 1, y = -1, z = -1)
+2 194 glTexCoord2f(s = 1, t = 0)
+2 195 glVertex3f(x = 1, y = 1, z = -1)
+2 196 glTexCoord2f(s = 1, t = 1)
+2 197 glVertex3f(x = 1, y = 1, z = 1)
+2 198 glTexCoord2f(s = 0, t = 1)
+2 199 glVertex3f(x = 1, y = -1, z = 1)
+2 200 glColor3f(red = 1, green = 0, blue = 1)
+2 201 glTexCoord2f(s = 0, t = 0)
+2 202 glVertex3f(x = -1, y = -1, z = -1)
+2 203 glTexCoord2f(s = 1, t = 0)
+2 204 glVertex3f(x = 1, y = -1, z = -1)
+2 205 glTexCoord2f(s = 1, t = 1)
+2 206 glVertex3f(x = 1, y = -1, z = 1)
+2 207 glTexCoord2f(s = 0, t = 1)
+2 208 glVertex3f(x = -1, y = -1, z = 1)
+2 209 glColor3f(red = 0, green = 1, blue = 0)
+2 210 glTexCoord2f(s = 0, t = 0)
+2 211 glVertex3f(x = -1, y = 1, z = -1)
+2 212 glTexCoord2f(s = 1, t = 0)
+2 213 glVertex3f(x = 1, y = 1, z = -1)
+2 214 glTexCoord2f(s = 1, t = 1)
+2 215 glVertex3f(x = 1, y = 1, z = 1)
+2 216 glTexCoord2f(s = 0, t = 1)
+2 217 glVertex3f(x = -1, y = 1, z = 1)
+2 218 glColor3f(red = 1, green = 1, blue = 0)
+2 219 glTexCoord2f(s = 0, t = 0)
+2 220 glVertex3f(x = -1, y = -1, z = -1)
+2 221 glTexCoord2f(s = 1, t = 0)
+2 222 glVertex3f(x = 1, y = -1, z = -1)
+2 223 glTexCoord2f(s = 1, t = 1)
+2 224 glVertex3f(x = 1, y = 1, z = -1)
+2 225 glTexCoord2f(s = 0, t = 1)
+2 226 glVertex3f(x = -1, y = 1, z = -1)
+2 227 glColor3f(red = 0, green = 0, blue = 1)
+2 228 glTexCoord2f(s = 0, t = 0)
+2 229 glVertex3f(x = -1, y = -1, z = 1)
+2 230 glTexCoord2f(s = 1, t = 0)
+2 231 glVertex3f(x = 1, y = -1, z = 1)
+2 232 glTexCoord2f(s = 1, t = 1)
+2 233 glVertex3f(x = 1, y = 1, z = 1)
+2 234 glTexCoord2f(s = 0, t = 1)
+2 235 glVertex3f(x = -1, y = 1, z = 1)
+2 236 glEnd()
+2 237 glPopMatrix()
+2 238 glPopMatrix()
+1 172 glClear(mask = GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT) // incomplete
+2 239 glXSwapBuffers(dpy = 0x751280, drawable = 62914562) // incomplete
+
diff --git a/traces/glthreads.trace b/traces/glthreads.trace
new file mode 100644 (file)
index 0000000..3dbc534
Binary files /dev/null and b/traces/glthreads.trace differ
diff --git a/traces/trim-identity.script b/traces/trim-identity.script
new file mode 100644 (file)
index 0000000..4370211
--- /dev/null
@@ -0,0 +1,36 @@
+trim -o trim-identity.src.trace tri.trace
+dump --verbose trim-identity.src.trace
+0 glXQueryExtension(dpy = 0xfc52b0, errorb = NULL, event = NULL) = True
+1 glXChooseFBConfig(dpy = 0xfc52b0, screen = 0, attribList = {GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_ALPHA_SIZE, 1, GLX_DOUBLEBUFFER, 1, 0}, nitems = &12) = {0xfe3620, 0xfe3710, 0xfe53e0, 0xfe54d0, 0xfe38f0, 0xfe39e0, 0xfe3e90, 0xfe56b0, 0xfe57a0, 0xfe5c50, 0xfe3f80, 0xfe5d40}
+2 glXGetVisualFromFBConfig(dpy = 0xfc52b0, config = 0xfe3620) = &{visual = 0xfd00e8, visualid = 154, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
+3 glXCreateNewContext(dpy = 0xfc52b0, config = 0xfe3620, renderType = GLX_RGBA_TYPE, shareList = NULL, direct = True) = 0xfdd650
+4 glXIsDirect(dpy = 0xfc52b0, ctx = 0xfdd650) = True
+5 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+6 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+7 glGetString(name = GL_RENDERER) = "Mesa DRI Mobile Intel\2\556 GM45 Express Chipset "
+8 glGetString(name = GL_VERSION) = "2.1 Mesa 7.11.2"
+9 glGetString(name = GL_VENDOR) = "Tungsten Graphics, Inc"
+10 glClearColor(red = 0.3, green = 0.1, blue = 0.3, alpha = 0)
+11 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+12 glViewport(x = 0, y = 0, width = 250, height = 250)
+13 glMatrixMode(mode = GL_PROJECTION)
+14 glLoadIdentity()
+15 glOrtho(left = -1, right = 1, bottom = -1, top = 1, zNear = -0.5, zFar = 1000)
+16 glMatrixMode(mode = GL_MODELVIEW)
+17 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+18 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+19 glClear(mask = GL_COLOR_BUFFER_BIT)
+20 glBegin(mode = GL_TRIANGLES)
+21 glColor3f(red = 0.8, green = 0, blue = 0)
+22 glVertex3f(x = -0.9, y = -0.9, z = -30)
+23 glColor3f(red = 0, green = 0.9, blue = 0)
+24 glVertex3f(x = 0.9, y = -0.9, z = -30)
+25 glColor3f(red = 0, green = 0, blue = 0.7)
+26 glVertex3f(x = 0, y = 0.9, z = -30)
+27 glEnd()
+28 glFlush()
+29 glFlush()
+30 glXSwapBuffers(dpy = 0xfc52b0, drawable = 44040194)
+
+31 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+32 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
diff --git a/traces/trim-range.script b/traces/trim-range.script
new file mode 100644 (file)
index 0000000..a511eda
--- /dev/null
@@ -0,0 +1,8 @@
+trim -o trim-range.src.trace --calls=2-7 tri.trace
+dump --verbose trim-range.src.trace
+0 glXGetVisualFromFBConfig(dpy = 0xfc52b0, config = 0xfe3620) = &{visual = 0xfd00e8, visualid = 154, screen = 0, depth = 24, c_class = 4, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
+1 glXCreateNewContext(dpy = 0xfc52b0, config = 0xfe3620, renderType = GLX_RGBA_TYPE, shareList = NULL, direct = True) = 0xfdd650
+2 glXIsDirect(dpy = 0xfc52b0, ctx = 0xfdd650) = True
+3 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+4 glXMakeContextCurrent(dpy = 0xfc52b0, draw = 44040194, read = 44040194, ctx = 0xfdd650) = True
+5 glGetString(name = GL_RENDERER) = "Mesa DRI Mobile Intel\2\556 GM45 Express Chipset "
diff --git a/traces/trim-thread.script b/traces/trim-thread.script
new file mode 100644 (file)
index 0000000..0d33ab1
--- /dev/null
@@ -0,0 +1,91 @@
+trim -o trim-thread.src.trace --thread=1 glthreads.trace
+dump --verbose --thread-ids --call-nos=no trim-thread.src.trace
+1 glXMakeCurrent(dpy = 0x751280, drawable = 62914565, ctx = 0xa99be0) = True
+1 glGetString(name = GL_RENDERER) = "Mesa DRI Mobile Intel\2\556 GM45 Express Chipset "
+1 glEnable(cap = GL_DEPTH_TEST)
+1 glViewport(x = 0, y = 0, width = 160, height = 160)
+1 glMatrixMode(mode = GL_PROJECTION)
+1 glLoadIdentity()
+1 glFrustum(left = -1, right = 1, bottom = -1, top = 1, zNear = 1.5, zFar = 10)
+1 glMatrixMode(mode = GL_MODELVIEW)
+1 glLoadIdentity()
+1 glTranslatef(x = 0, y = 0, z = -2.5)
+1 glClear(mask = GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT)
+1 glPushMatrix()
+1 glRotatef(angle = 0, x = 0, y = 1, z = 0)
+1 glRotatef(angle = 0, x = 1, y = 0, z = 0)
+1 glScalef(x = 0.7, y = 0.7, z = 0.7)
+1 glPushMatrix()
+1 glScalef(x = 0.75, y = 0.75, z = 0.75)
+1 glColor3f(red = 1, green = 0, blue = 0)
+1 glDisable(cap = GL_TEXTURE_2D)
+1 glBegin(mode = GL_QUADS)
+1 glColor3f(red = 0, green = 1, blue = 1)
+1 glTexCoord2f(s = 0, t = 0)
+1 glVertex3f(x = -1, y = -1, z = -1)
+1 glTexCoord2f(s = 1, t = 0)
+1 glVertex3f(x = -1, y = 1, z = -1)
+1 glTexCoord2f(s = 1, t = 1)
+1 glVertex3f(x = -1, y = 1, z = 1)
+1 glTexCoord2f(s = 0, t = 1)
+1 glVertex3f(x = -1, y = -1, z = 1)
+1 glColor3f(red = 1, green = 0, blue = 0)
+1 glTexCoord2f(s = 0, t = 0)
+1 glVertex3f(x = 1, y = -1, z = -1)
+1 glTexCoord2f(s = 1, t = 0)
+1 glVertex3f(x = 1, y = 1, z = -1)
+1 glTexCoord2f(s = 1, t = 1)
+1 glVertex3f(x = 1, y = 1, z = 1)
+1 glTexCoord2f(s = 0, t = 1)
+1 glVertex3f(x = 1, y = -1, z = 1)
+1 glColor3f(red = 1, green = 0, blue = 1)
+1 glTexCoord2f(s = 0, t = 0)
+1 glVertex3f(x = -1, y = -1, z = -1)
+1 glTexCoord2f(s = 1, t = 0)
+1 glVertex3f(x = 1, y = -1, z = -1)
+1 glTexCoord2f(s = 1, t = 1)
+1 glVertex3f(x = 1, y = -1, z = 1)
+1 glTexCoord2f(s = 0, t = 1)
+1 glVertex3f(x = -1, y = -1, z = 1)
+1 glColor3f(red = 0, green = 1, blue = 0)
+1 glTexCoord2f(s = 0, t = 0)
+1 glVertex3f(x = -1, y = 1, z = -1)
+1 glTexCoord2f(s = 1, t = 0)
+1 glVertex3f(x = 1, y = 1, z = -1)
+1 glTexCoord2f(s = 1, t = 1)
+1 glVertex3f(x = 1, y = 1, z = 1)
+1 glTexCoord2f(s = 0, t = 1)
+1 glVertex3f(x = -1, y = 1, z = 1)
+1 glColor3f(red = 1, green = 1, blue = 0)
+1 glTexCoord2f(s = 0, t = 0)
+1 glVertex3f(x = -1, y = -1, z = -1)
+1 glTexCoord2f(s = 1, t = 0)
+1 glVertex3f(x = 1, y = -1, z = -1)
+1 glTexCoord2f(s = 1, t = 1)
+1 glVertex3f(x = 1, y = 1, z = -1)
+1 glTexCoord2f(s = 0, t = 1)
+1 glVertex3f(x = -1, y = 1, z = -1)
+1 glColor3f(red = 0, green = 0, blue = 1)
+1 glTexCoord2f(s = 0, t = 0)
+1 glVertex3f(x = -1, y = -1, z = 1)
+1 glTexCoord2f(s = 1, t = 0)
+1 glVertex3f(x = 1, y = -1, z = 1)
+1 glTexCoord2f(s = 1, t = 1)
+1 glVertex3f(x = 1, y = 1, z = 1)
+1 glTexCoord2f(s = 0, t = 1)
+1 glVertex3f(x = -1, y = 1, z = 1)
+1 glEnd()
+1 glPopMatrix()
+1 glPopMatrix()
+1 glXSwapBuffers(dpy = 0x751280, drawable = 62914565)
+
+1 glXMakeCurrent(dpy = 0x751280, drawable = 62914565, ctx = 0xa99be0) = True
+1 glEnable(cap = GL_DEPTH_TEST)
+1 glViewport(x = 0, y = 0, width = 160, height = 160)
+1 glMatrixMode(mode = GL_PROJECTION)
+1 glLoadIdentity()
+1 glFrustum(left = -1, right = 1, bottom = -1, top = 1, zNear = 1.5, zFar = 10)
+1 glMatrixMode(mode = GL_MODELVIEW)
+1 glLoadIdentity()
+1 glTranslatef(x = 0, y = 0, z = -2.5)
+1 glClear(mask = GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT)