Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: server/site_server_job.py

Issue 6557003: Modify autotest to support preserving minidumps generated during tests. (Closed) Base URL: http://git.chromium.org/git/autotest.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« server/server_job.py ('K') | « server/server_job.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import logging
6 import os
7 from autotest_lib.client.common_lib import utils as client_utils
8 from autotest_lib.server import utils
9 from autotest_lib.server.server_job import base_server_job
10
11
12 class site_server_job(base_server_job):
kmixter1 2011/02/23 02:00:39 Will this be used by all server tests automaticall
thieule 2011/03/03 01:27:41 Yes.
13
14 def _generate_minidump_stacktrace(self, minidump_path):
15 symbol_dir = '%s/../../../lib/debug' % utils.get_server_dir()
kmixter1 2011/02/23 02:00:39 I guess this only works for tests autotests run wi
thieule 2011/03/03 01:27:41 Done.
16 logging.info('symbol_dir: %s' % symbol_dir)
17 result = client_utils.run('minidump_stackwalk %s %s > %s.txt' %
18 (minidump_path, symbol_dir, minidump_path))
19 return result.exit_status
20
21
22 def _find_and_generate_minidump_stacktraces(self):
23 for dir, subdirs, files in os.walk(self.resultdir):
24 for file in files:
25 if not file.endswith('.dmp'):
26 continue
27 minidump = os.path.join(dir, file)
28 rc = self._generate_minidump_stacktrace(minidump)
29 if (rc == 0):
kmixter1 2011/02/23 02:00:39 extra parens?
thieule 2011/03/03 01:27:41 Done.
30 logging.info('Generated stack trace for dump %s' %
31 minidump)
32 else:
33 logging.error('Failed to generate stack trace for ' \
34 'dump %s (rc=%d)' % (minidump, rc))
35
36
37 def run(self, cleanup=False, install_before=False, install_after=False,
38 collect_crashdumps=True, namespace={}, control=None,
39 control_file_dir=None, only_collect_crashinfo=False):
40 """
41 Site specific implementation of base_server_job.run().
42
43 Override the base class implementation so we can perform some
44 of our own operations when the server job is completed.
45
46 See base_server_job.run() for more info.
47 """
48 try:
49 base_server_job.run(self, cleanup, install_before, install_after,
50 collect_crashdumps, namespace, control,
51 control_file_dir, only_collect_crashinfo)
52 finally:
53 self._find_and_generate_minidump_stacktraces()
ericli 2011/02/23 04:49:34 There is already a try/finally block inside base_s
thieule 2011/03/03 01:27:41 Done. I've moved the minidump generation to site_
OLDNEW
« server/server_job.py ('K') | « server/server_job.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698