Merge lp:~bladernr/checkbox/764376 into lp:checkbox

Proposed by Jeff Lane 
Status: Merged
Merged at revision: 1806
Proposed branch: lp:~bladernr/checkbox/764376
Merge into: lp:checkbox
Diff against target: 175 lines (+2/-147)
3 files modified
debian/changelog (+2/-0)
jobs/graphics.txt.in (+0/-7)
scripts/xorg_memory_test (+0/-140)
To merge this branch: bzr merge lp:~bladernr/checkbox/764376
Reviewer Review Type Date Requested Status
Marc Tardif (community) Approve
Review via email: mp+132577@code.launchpad.net

Description of the change

Removed the script xorg_memory_test and the job graphics/xorg-memory. The test always genearted a failure, and after some discussion with bryce and alberto, it was decided that the test really produces 0 benefit.

To post a comment you must log in.
Revision history for this message
Marc Tardif (cr3) wrote :

Thanks for initiating that discussion!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-10-29 21:43:57 +0000
3+++ debian/changelog 2012-11-01 15:50:32 +0000
4@@ -111,6 +111,8 @@
5 to the expresscard test
6 setup.cfg - modified the list of job files since I renamed pcmcia-pcix.txt
7 po/POTFILES.in - changed the pcmcia-pcix.txt.in pointer to expresscard.txt.in
8+ * removed xorg_memory_test and graphics/xorg-memory as the test produces no
9+ real benefit and fails about 100% of the time. (LP: #764376)
10
11 -- Jeff Lane <jeff@ubuntu.com> Fri, 26 Oct 2012 16:36:21 -0400
12
13
14=== modified file 'jobs/graphics.txt.in'
15--- jobs/graphics.txt.in 2012-10-29 21:43:57 +0000
16+++ jobs/graphics.txt.in 2012-11-01 15:50:32 +0000
17@@ -36,13 +36,6 @@
18 command: ! test -e /var/log/Xorg.failsafe.log
19 _description: Test that the X is not running in failsafe mode.
20
21-plugin: shell
22-name: graphics/xorg-memory
23-requires: package.name == 'xorg' and device.driver == 'i915'
24-user: root
25-command: xorg_memory_test xeyes
26-_description: Test that X does not leak memory when running programs on systems with intel based graphics.
27-
28 plugin: user-verify
29 name: graphics/resolution
30 requires:
31
32=== removed file 'scripts/xorg_memory_test'
33--- scripts/xorg_memory_test 2012-06-22 07:15:06 +0000
34+++ scripts/xorg_memory_test 1970-01-01 00:00:00 +0000
35@@ -1,140 +0,0 @@
36-#!/usr/bin/env python3
37-
38-import subprocess
39-import os
40-import time
41-import sys
42-
43-from argparse import ArgumentParser
44-from signal import SIGKILL
45-
46-#globals
47-DEFAULT_MARGIN = 0.1
48-DEFAULT_PROCESSES = 100
49-DEFAULT_SAMPLES = 3
50-DEFAULT_SLEEP = 30
51-
52-
53-#process memory usage function
54-def mem_usage(process, samples=1):
55- usage_sum = 0
56-
57- for n in range(1, samples + 1):
58- pid = subprocess.getoutput("pidof %s" % process)
59- output = subprocess.getoutput("pmap -d %s" % pid)
60- if not output:
61- raise Exception("%s process not found" % process)
62-
63- # mapped: 0K writeable/private: 0K shared: 0K
64- lastline = output.splitlines()[-1]
65- values = lastline.split()
66- # use the mapped memory counter, remove trailing K.
67- usage = int(values[1][:-1])
68- usage_sum += usage
69-
70- if n < samples:
71- time.sleep(3)
72-
73- return usage_sum / samples
74-
75-
76-def get_gem_objects():
77- dri = subprocess.getoutput("xdriinfo")
78- if not dri.startswith('Screen'):
79- print("xdriinfo fail : %s" % (dri), file=sys.stderr)
80- sys.exit(1)
81- screen = dri.split()[1][:-1]
82- path = os.path.join("/sys/kernel/debug/dri/", screen, "i915_gem_objects")
83-
84- # 2432 objects, 173256704 bytes
85- try:
86- output = open(path, 'r')
87- except IOError:
88- print("File %s doesn't exist" % (path), file=sys.stderr)
89- sys.exit(1)
90- objects_label, bytes_label = output.readline().split(", ")
91- objects, label = objects_label.split(" ")
92- return int(objects)
93-
94-
95-#compare pre-test and post-test video card mem values function
96-#there is a 10% margin
97-def compare_mem_results(orig, new, margin=0.1):
98- return new < (orig + (orig * margin)) and new > (orig - (orig * margin))
99-
100-
101-def compare_gem_results(orig, new, margin=0.1):
102- return new < (orig * (1 + margin)) and new > (orig * (1 - margin))
103-
104-
105-def start_processes(name, number=1):
106- pids = []
107- for n in range(number):
108- pid = subprocess.Popen(name).pid
109- pids.append(pid)
110-
111- return pids
112-
113-
114-def stop_processes(pids, signal=SIGKILL):
115- for pid in pids:
116- os.kill(pid, signal)
117-
118-
119-def main():
120- #Parse options
121- parser = ArgumentParser()
122- parser.add_argument("program",
123- nargs=1,
124- help="Specify an X program to create memory load with.")
125- parser.add_argument("-m", "--margin",
126- default=DEFAULT_MARGIN,
127- type=float,
128- help="Margin of error for memory usage [Default: %(default)s]")
129- parser.add_argument("-p", "--processes",
130- default=DEFAULT_PROCESSES,
131- type=int,
132- help="Number of processes to start and stop [Default: %(default)s]")
133- parser.add_argument("--samples",
134- default=DEFAULT_SAMPLES,
135- type=int,
136- help="Number of samples to get the memory usage [Default: %(default)s]")
137- parser.add_argument("--sleep",
138- default=DEFAULT_SLEEP,
139- type=int,
140- help=("Seconds to sleep between starting and stopping processes [Default: %(default)s]"))
141- args = parser.parse_args()
142-
143- #Check current video card driver memory usage
144- begin_mem_usage = mem_usage("X", args.samples)
145-
146- #Check current GEM object usage
147- begin_gem_obj = get_gem_objects()
148-
149- #Open windows and let the system come upto speed
150- pids = start_processes(args.program, args.processes)
151- time.sleep(args.sleep)
152-
153- #Close windows
154- stop_processes(pids)
155- time.sleep(args.sleep)
156-
157- #Check video card driver's memory usage again to see if it returned to
158- #value found previously (give system time to normalize)
159- end_mem_usage = mem_usage("X", args.samples)
160-
161- #Check GEM object usage again, for state after running processes
162- end_gem_obj = get_gem_objects()
163-
164- #compare new memory value to old memory value
165- if not compare_mem_results(begin_mem_usage, end_mem_usage, args.margin):
166- return "Xorg memory leak detected, before %d and after %d" \
167- % (begin_mem_usage, end_mem_usage)
168- if not compare_gem_results(begin_gem_obj, end_gem_obj, args.margin):
169- return "DRI GEM objects leak detected, before %d and after %d" \
170- % (begin_gem_obj, end_gem_obj)
171-
172- return 0
173-
174-if __name__ == "__main__":
175- sys.exit(main())

Subscribers

People subscribed via source and target branches