Merge lp:~cypressyew/checkbox/gpu_test_fix1321995 into lp:checkbox

Proposed by Po-Hsu Lin
Status: Merged
Approved by: Daniel Manrique
Approved revision: 3021
Merged at revision: 3022
Proposed branch: lp:~cypressyew/checkbox/gpu_test_fix1321995
Merge into: lp:checkbox
Diff against target: 19 lines (+4/-5)
1 file modified
providers/plainbox-provider-checkbox/bin/gpu_test (+4/-5)
To merge this branch: bzr merge lp:~cypressyew/checkbox/gpu_test_fix1321995
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+220566@code.launchpad.net

Description of the change

Parse the kernel output message from dmesg instead of the kern.log.
To make sure this GPU hung issue is happened during this session.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Looks OK to me, of course this won't work if the gpu hang causes the system to crash and the dmesg is lost, do you think we could do something in that case?

I'll approve this anyway as it sounds more accurate than parsing the whole historical log.

review: Approve
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

oh... indeed, I missed that spot.

It's pity that I didn't notice this issue when it happen.
Otherwise I could try to get some debugging information from it.
There is not much we can get from the submission itself:
https://certification.canonical.com/hardware/201208-11587/submission/98817/

This one is lucky enough to finish all tests after a GPU lockup.
From the Internet, I also found many people still able to get this GPU hung pattern from their dmesg output, so I think this tweak is okay for those non-crashing systems.

We need something else to deal with the crashed one.
(when it crashes, will it log the event to kern.log?)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'providers/plainbox-provider-checkbox/bin/gpu_test'
2--- providers/plainbox-provider-checkbox/bin/gpu_test 2014-04-07 16:42:01 +0000
3+++ providers/plainbox-provider-checkbox/bin/gpu_test 2014-05-22 06:14:10 +0000
4@@ -140,11 +140,10 @@
5
6 def check_gpu(log=None):
7 if not log:
8- log = '/var/log/kern.log'
9- with open(log, 'rb') as f:
10- if re.findall(r'gpu\s+hung', str(f.read()), flags=re.I):
11- print("GPU hung Detected")
12- return 1
13+ log = subprocess.check_output(['dmesg'], universal_newlines=True)
14+ if re.findall(r'gpu\s+hung', log, flags=re.I):
15+ print("GPU hung Detected")
16+ return 1
17
18
19 def main():

Subscribers

People subscribed via source and target branches