oe-build-perf-report 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. #!/usr/bin/python3
  2. #
  3. # Examine build performance test results
  4. #
  5. # Copyright (c) 2017, Intel Corporation.
  6. #
  7. # This program is free software; you can redistribute it and/or modify it
  8. # under the terms and conditions of the GNU General Public License,
  9. # version 2, as published by the Free Software Foundation.
  10. #
  11. # This program is distributed in the hope it will be useful, but WITHOUT
  12. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. # more details.
  15. #
  16. import argparse
  17. import json
  18. import logging
  19. import os
  20. import re
  21. import sys
  22. from collections import namedtuple, OrderedDict
  23. from operator import attrgetter
  24. from xml.etree import ElementTree as ET
  25. # Import oe libs
  26. scripts_path = os.path.dirname(os.path.realpath(__file__))
  27. sys.path.append(os.path.join(scripts_path, 'lib'))
  28. import scriptpath
  29. from build_perf import print_table
  30. from build_perf.report import (metadata_xml_to_json, results_xml_to_json,
  31. aggregate_data, aggregate_metadata, measurement_stats)
  32. from build_perf import html
  33. scriptpath.add_oe_lib_path()
  34. from oeqa.utils.git import GitRepo, GitError
  35. # Setup logging
  36. logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
  37. log = logging.getLogger('oe-build-perf-report')
  38. # Container class for tester revisions
  39. TestedRev = namedtuple('TestedRev', 'commit commit_number tags')
  40. def get_test_runs(repo, tag_name, **kwargs):
  41. """Get a sorted list of test runs, matching given pattern"""
  42. # First, get field names from the tag name pattern
  43. field_names = [m.group(1) for m in re.finditer(r'{(\w+)}', tag_name)]
  44. undef_fields = [f for f in field_names if f not in kwargs.keys()]
  45. # Fields for formatting tag name pattern
  46. str_fields = dict([(f, '*') for f in field_names])
  47. str_fields.update(kwargs)
  48. # Get a list of all matching tags
  49. tag_pattern = tag_name.format(**str_fields)
  50. tags = repo.run_cmd(['tag', '-l', tag_pattern]).splitlines()
  51. log.debug("Found %d tags matching pattern '%s'", len(tags), tag_pattern)
  52. # Parse undefined fields from tag names
  53. str_fields = dict([(f, r'(?P<{}>[\w\-.()]+)'.format(f)) for f in field_names])
  54. str_fields['branch'] = r'(?P<branch>[\w\-.()/]+)'
  55. str_fields['commit'] = '(?P<commit>[0-9a-f]{7,40})'
  56. str_fields['commit_number'] = '(?P<commit_number>[0-9]{1,7})'
  57. str_fields['tag_number'] = '(?P<tag_number>[0-9]{1,5})'
  58. # escape parenthesis in fields in order to not messa up the regexp
  59. fixed_fields = dict([(k, v.replace('(', r'\(').replace(')', r'\)')) for k, v in kwargs.items()])
  60. str_fields.update(fixed_fields)
  61. tag_re = re.compile(tag_name.format(**str_fields))
  62. # Parse fields from tags
  63. revs = []
  64. for tag in tags:
  65. m = tag_re.match(tag)
  66. groups = m.groupdict()
  67. revs.append([groups[f] for f in undef_fields] + [tag])
  68. # Return field names and a sorted list of revs
  69. return undef_fields, sorted(revs)
  70. def list_test_revs(repo, tag_name, verbosity, **kwargs):
  71. """Get list of all tested revisions"""
  72. fields, revs = get_test_runs(repo, tag_name, **kwargs)
  73. ignore_fields = ['tag_number']
  74. if verbosity < 2:
  75. extra_fields = ['COMMITS', 'TEST RUNS']
  76. ignore_fields.extend(['commit_number', 'commit'])
  77. else:
  78. extra_fields = ['TEST RUNS']
  79. print_fields = [i for i, f in enumerate(fields) if f not in ignore_fields]
  80. # Sort revs
  81. rows = [[fields[i].upper() for i in print_fields] + extra_fields]
  82. prev = [''] * len(print_fields)
  83. prev_commit = None
  84. commit_cnt = 0
  85. commit_field = fields.index('commit')
  86. for rev in revs:
  87. # Only use fields that we want to print
  88. cols = [rev[i] for i in print_fields]
  89. if cols != prev:
  90. commit_cnt = 1
  91. test_run_cnt = 1
  92. new_row = [''] * (len(print_fields) + len(extra_fields))
  93. for i in print_fields:
  94. if cols[i] != prev[i]:
  95. break
  96. new_row[i:-len(extra_fields)] = cols[i:]
  97. rows.append(new_row)
  98. else:
  99. if rev[commit_field] != prev_commit:
  100. commit_cnt += 1
  101. test_run_cnt += 1
  102. if verbosity < 2:
  103. new_row[-2] = commit_cnt
  104. new_row[-1] = test_run_cnt
  105. prev = cols
  106. prev_commit = rev[commit_field]
  107. print_table(rows)
  108. def get_test_revs(repo, tag_name, **kwargs):
  109. """Get list of all tested revisions"""
  110. fields, runs = get_test_runs(repo, tag_name, **kwargs)
  111. revs = {}
  112. commit_i = fields.index('commit')
  113. commit_num_i = fields.index('commit_number')
  114. for run in runs:
  115. commit = run[commit_i]
  116. commit_num = run[commit_num_i]
  117. tag = run[-1]
  118. if not commit in revs:
  119. revs[commit] = TestedRev(commit, commit_num, [tag])
  120. else:
  121. assert commit_num == revs[commit].commit_number, "Commit numbers do not match"
  122. revs[commit].tags.append(tag)
  123. # Return in sorted table
  124. revs = sorted(revs.values(), key=attrgetter('commit_number'))
  125. log.debug("Found %d tested revisions:\n %s", len(revs),
  126. "\n ".join(['{} ({})'.format(rev.commit_number, rev.commit) for rev in revs]))
  127. return revs
  128. def rev_find(revs, attr, val):
  129. """Search from a list of TestedRev"""
  130. for i, rev in enumerate(revs):
  131. if getattr(rev, attr) == val:
  132. return i
  133. raise ValueError("Unable to find '{}' value '{}'".format(attr, val))
  134. def is_xml_format(repo, commit):
  135. """Check if the commit contains xml (or json) data"""
  136. if repo.rev_parse(commit + ':results.xml'):
  137. log.debug("Detected report in xml format in %s", commit)
  138. return True
  139. else:
  140. log.debug("No xml report in %s, assuming json formatted results", commit)
  141. return False
  142. def read_results(repo, tags, xml=True):
  143. """Read result files from repo"""
  144. def parse_xml_stream(data):
  145. """Parse multiple concatenated XML objects"""
  146. objs = []
  147. xml_d = ""
  148. for line in data.splitlines():
  149. if xml_d and line.startswith('<?xml version='):
  150. objs.append(ET.fromstring(xml_d))
  151. xml_d = line
  152. else:
  153. xml_d += line
  154. objs.append(ET.fromstring(xml_d))
  155. return objs
  156. def parse_json_stream(data):
  157. """Parse multiple concatenated JSON objects"""
  158. objs = []
  159. json_d = ""
  160. for line in data.splitlines():
  161. if line == '}{':
  162. json_d += '}'
  163. objs.append(json.loads(json_d, object_pairs_hook=OrderedDict))
  164. json_d = '{'
  165. else:
  166. json_d += line
  167. objs.append(json.loads(json_d, object_pairs_hook=OrderedDict))
  168. return objs
  169. num_revs = len(tags)
  170. # Optimize by reading all data with one git command
  171. log.debug("Loading raw result data from %d tags, %s...", num_revs, tags[0])
  172. if xml:
  173. git_objs = [tag + ':metadata.xml' for tag in tags] + [tag + ':results.xml' for tag in tags]
  174. data = parse_xml_stream(repo.run_cmd(['show'] + git_objs + ['--']))
  175. return ([metadata_xml_to_json(e) for e in data[0:num_revs]],
  176. [results_xml_to_json(e) for e in data[num_revs:]])
  177. else:
  178. git_objs = [tag + ':metadata.json' for tag in tags] + [tag + ':results.json' for tag in tags]
  179. data = parse_json_stream(repo.run_cmd(['show'] + git_objs + ['--']))
  180. return data[0:num_revs], data[num_revs:]
  181. def get_data_item(data, key):
  182. """Nested getitem lookup"""
  183. for k in key.split('.'):
  184. data = data[k]
  185. return data
  186. def metadata_diff(metadata_l, metadata_r):
  187. """Prepare a metadata diff for printing"""
  188. keys = [('Hostname', 'hostname', 'hostname'),
  189. ('Branch', 'branch', 'layers.meta.branch'),
  190. ('Commit number', 'commit_num', 'layers.meta.commit_count'),
  191. ('Commit', 'commit', 'layers.meta.commit'),
  192. ('Number of test runs', 'testrun_count', 'testrun_count')
  193. ]
  194. def _metadata_diff(key):
  195. """Diff metadata from two test reports"""
  196. try:
  197. val1 = get_data_item(metadata_l, key)
  198. except KeyError:
  199. val1 = '(N/A)'
  200. try:
  201. val2 = get_data_item(metadata_r, key)
  202. except KeyError:
  203. val2 = '(N/A)'
  204. return val1, val2
  205. metadata = OrderedDict()
  206. for title, key, key_json in keys:
  207. value_l, value_r = _metadata_diff(key_json)
  208. metadata[key] = {'title': title,
  209. 'value_old': value_l,
  210. 'value': value_r}
  211. return metadata
  212. def print_diff_report(metadata_l, data_l, metadata_r, data_r):
  213. """Print differences between two data sets"""
  214. # First, print general metadata
  215. print("\nTEST METADATA:\n==============")
  216. meta_diff = metadata_diff(metadata_l, metadata_r)
  217. rows = []
  218. row_fmt = ['{:{wid}} ', '{:<{wid}} ', '{:<{wid}}']
  219. rows = [['', 'CURRENT COMMIT', 'COMPARING WITH']]
  220. for key, val in meta_diff.items():
  221. # Shorten commit hashes
  222. if key == 'commit':
  223. rows.append([val['title'] + ':', val['value'][:20], val['value_old'][:20]])
  224. else:
  225. rows.append([val['title'] + ':', val['value'], val['value_old']])
  226. print_table(rows, row_fmt)
  227. # Print test results
  228. print("\nTEST RESULTS:\n=============")
  229. tests = list(data_l['tests'].keys())
  230. # Append tests that are only present in 'right' set
  231. tests += [t for t in list(data_r['tests'].keys()) if t not in tests]
  232. # Prepare data to be printed
  233. rows = []
  234. row_fmt = ['{:8}', '{:{wid}}', '{:{wid}}', ' {:>{wid}}', ' {:{wid}} ', '{:{wid}}',
  235. ' {:>{wid}}', ' {:>{wid}}']
  236. num_cols = len(row_fmt)
  237. for test in tests:
  238. test_l = data_l['tests'][test] if test in data_l['tests'] else None
  239. test_r = data_r['tests'][test] if test in data_r['tests'] else None
  240. pref = ' '
  241. if test_l is None:
  242. pref = '+'
  243. elif test_r is None:
  244. pref = '-'
  245. descr = test_l['description'] if test_l else test_r['description']
  246. heading = "{} {}: {}".format(pref, test, descr)
  247. rows.append([heading])
  248. # Generate the list of measurements
  249. meas_l = test_l['measurements'] if test_l else {}
  250. meas_r = test_r['measurements'] if test_r else {}
  251. measurements = list(meas_l.keys())
  252. measurements += [m for m in list(meas_r.keys()) if m not in measurements]
  253. for meas in measurements:
  254. m_pref = ' '
  255. if meas in meas_l:
  256. stats_l = measurement_stats(meas_l[meas], 'l.')
  257. else:
  258. stats_l = measurement_stats(None, 'l.')
  259. m_pref = '+'
  260. if meas in meas_r:
  261. stats_r = measurement_stats(meas_r[meas], 'r.')
  262. else:
  263. stats_r = measurement_stats(None, 'r.')
  264. m_pref = '-'
  265. stats = stats_l.copy()
  266. stats.update(stats_r)
  267. absdiff = stats['val_cls'](stats['r.mean'] - stats['l.mean'])
  268. reldiff = "{:+.1f} %".format(absdiff * 100 / stats['l.mean'])
  269. if stats['r.mean'] > stats['l.mean']:
  270. absdiff = '+' + str(absdiff)
  271. else:
  272. absdiff = str(absdiff)
  273. rows.append(['', m_pref, stats['name'] + ' ' + stats['quantity'],
  274. str(stats['l.mean']), '->', str(stats['r.mean']),
  275. absdiff, reldiff])
  276. rows.append([''] * num_cols)
  277. print_table(rows, row_fmt)
  278. print()
  279. def print_html_report(data, id_comp):
  280. """Print report in html format"""
  281. # Handle metadata
  282. metadata = {'branch': {'title': 'Branch', 'value': 'master'},
  283. 'hostname': {'title': 'Hostname', 'value': 'foobar'},
  284. 'commit': {'title': 'Commit', 'value': '1234'}
  285. }
  286. metadata = metadata_diff(data[id_comp][0], data[-1][0])
  287. # Generate list of tests
  288. tests = []
  289. for test in data[-1][1]['tests'].keys():
  290. test_r = data[-1][1]['tests'][test]
  291. new_test = {'name': test_r['name'],
  292. 'description': test_r['description'],
  293. 'status': test_r['status'],
  294. 'measurements': [],
  295. 'err_type': test_r.get('err_type'),
  296. }
  297. # Limit length of err output shown
  298. if 'message' in test_r:
  299. lines = test_r['message'].splitlines()
  300. if len(lines) > 20:
  301. new_test['message'] = '...\n' + '\n'.join(lines[-20:])
  302. else:
  303. new_test['message'] = test_r['message']
  304. # Generate the list of measurements
  305. for meas in test_r['measurements'].keys():
  306. meas_r = test_r['measurements'][meas]
  307. meas_type = 'time' if meas_r['type'] == 'sysres' else 'size'
  308. new_meas = {'name': meas_r['name'],
  309. 'legend': meas_r['legend'],
  310. 'description': meas_r['name'] + ' ' + meas_type,
  311. }
  312. samples = []
  313. # Run through all revisions in our data
  314. for meta, test_data in data:
  315. if (not test in test_data['tests'] or
  316. not meas in test_data['tests'][test]['measurements']):
  317. samples.append(measurement_stats(None))
  318. continue
  319. test_i = test_data['tests'][test]
  320. meas_i = test_i['measurements'][meas]
  321. commit_num = get_data_item(meta, 'layers.meta.commit_count')
  322. samples.append(measurement_stats(meas_i))
  323. samples[-1]['commit_num'] = commit_num
  324. absdiff = samples[-1]['val_cls'](samples[-1]['mean'] - samples[id_comp]['mean'])
  325. new_meas['absdiff'] = absdiff
  326. new_meas['absdiff_str'] = str(absdiff) if absdiff < 0 else '+' + str(absdiff)
  327. new_meas['reldiff'] = "{:+.1f} %".format(absdiff * 100 / samples[id_comp]['mean'])
  328. new_meas['samples'] = samples
  329. new_meas['value'] = samples[-1]
  330. new_meas['value_type'] = samples[-1]['val_cls']
  331. new_test['measurements'].append(new_meas)
  332. tests.append(new_test)
  333. # Chart options
  334. chart_opts = {'haxis': {'min': get_data_item(data[0][0], 'layers.meta.commit_count'),
  335. 'max': get_data_item(data[-1][0], 'layers.meta.commit_count')}
  336. }
  337. print(html.template.render(metadata=metadata, test_data=tests, chart_opts=chart_opts))
  338. def dump_buildstats(repo, outdir, notes_ref, revs):
  339. """Dump buildstats of test results"""
  340. full_ref = 'refs/notes/' + notes_ref
  341. if not repo.rev_parse(full_ref):
  342. log.error("No buildstats found, please try running "
  343. "'git fetch origin %s:%s' to fetch them from the remote",
  344. full_ref, full_ref)
  345. return
  346. missing = False
  347. log.info("Writing out buildstats from 'refs/notes/%s' into '%s'",
  348. notes_ref, outdir)
  349. for rev in revs:
  350. log.debug('Dumping buildstats for %s (%s)', rev.commit_number,
  351. rev.commit)
  352. for tag in rev.tags:
  353. log.debug(' %s', tag)
  354. try:
  355. bs_all = json.loads(repo.run_cmd(['notes', '--ref', notes_ref,
  356. 'show', tag + '^0']))
  357. except GitError:
  358. log.warning("Buildstats not found for %s", tag)
  359. missing = True
  360. for measurement, buildstats in bs_all.items():
  361. tag_base, run_id = tag.rsplit('/', 1)
  362. tag_base = tag_base.replace('/', '_')
  363. bs_dir = os.path.join(outdir, measurement, tag_base)
  364. if not os.path.exists(bs_dir):
  365. os.makedirs(bs_dir)
  366. with open(os.path.join(bs_dir, run_id + '.json'), 'w') as f:
  367. json.dump(buildstats, f, indent=2)
  368. if missing:
  369. log.info("Buildstats were missing for some test runs, please "
  370. "run 'git fetch origin %s:%s' and try again",
  371. full_ref, full_ref)
  372. def auto_args(repo, args):
  373. """Guess arguments, if not defined by the user"""
  374. # Get the latest commit in the repo
  375. log.debug("Guessing arguments from the latest commit")
  376. msg = repo.run_cmd(['log', '-1', '--branches', '--remotes', '--format=%b'])
  377. for line in msg.splitlines():
  378. split = line.split(':', 1)
  379. if len(split) != 2:
  380. continue
  381. key = split[0]
  382. val = split[1].strip()
  383. if key == 'hostname':
  384. log.debug("Using hostname %s", val)
  385. args.hostname = val
  386. elif key == 'branch':
  387. log.debug("Using branch %s", val)
  388. args.branch = val
  389. def parse_args(argv):
  390. """Parse command line arguments"""
  391. description = """
  392. Examine build performance test results from a Git repository"""
  393. parser = argparse.ArgumentParser(
  394. formatter_class=argparse.ArgumentDefaultsHelpFormatter,
  395. description=description)
  396. parser.add_argument('--debug', '-d', action='store_true',
  397. help="Verbose logging")
  398. parser.add_argument('--repo', '-r', required=True,
  399. help="Results repository (local git clone)")
  400. parser.add_argument('--list', '-l', action='count',
  401. help="List available test runs")
  402. parser.add_argument('--html', action='store_true',
  403. help="Generate report in html format")
  404. group = parser.add_argument_group('Tag and revision')
  405. group.add_argument('--tag-name', '-t',
  406. default='{hostname}/{branch}/{machine}/{commit_number}-g{commit}/{tag_number}',
  407. help="Tag name (pattern) for finding results")
  408. group.add_argument('--hostname', '-H')
  409. group.add_argument('--branch', '-B', default='master')
  410. group.add_argument('--machine', default='qemux86')
  411. group.add_argument('--history-length', default=25, type=int,
  412. help="Number of tested revisions to plot in html report")
  413. group.add_argument('--commit',
  414. help="Revision to search for")
  415. group.add_argument('--commit-number',
  416. help="Revision number to search for, redundant if "
  417. "--commit is specified")
  418. group.add_argument('--commit2',
  419. help="Revision to compare with")
  420. group.add_argument('--commit-number2',
  421. help="Revision number to compare with, redundant if "
  422. "--commit2 is specified")
  423. parser.add_argument('--dump-buildstats', nargs='?', const='.',
  424. help="Dump buildstats of the tests")
  425. return parser.parse_args(argv)
  426. def main(argv=None):
  427. """Script entry point"""
  428. args = parse_args(argv)
  429. if args.debug:
  430. log.setLevel(logging.DEBUG)
  431. repo = GitRepo(args.repo)
  432. if args.list:
  433. list_test_revs(repo, args.tag_name, args.list)
  434. return 0
  435. # Determine hostname which to use
  436. if not args.hostname:
  437. auto_args(repo, args)
  438. revs = get_test_revs(repo, args.tag_name, hostname=args.hostname,
  439. branch=args.branch, machine=args.machine)
  440. if len(revs) < 2:
  441. log.error("%d tester revisions found, unable to generate report",
  442. len(revs))
  443. return 1
  444. # Pick revisions
  445. if args.commit:
  446. if args.commit_number:
  447. log.warning("Ignoring --commit-number as --commit was specified")
  448. index1 = rev_find(revs, 'commit', args.commit)
  449. elif args.commit_number:
  450. index1 = rev_find(revs, 'commit_number', args.commit_number)
  451. else:
  452. index1 = len(revs) - 1
  453. if args.commit2:
  454. if args.commit_number2:
  455. log.warning("Ignoring --commit-number2 as --commit2 was specified")
  456. index2 = rev_find(revs, 'commit', args.commit2)
  457. elif args.commit_number2:
  458. index2 = rev_find(revs, 'commit_number', args.commit_number2)
  459. else:
  460. if index1 > 0:
  461. index2 = index1 - 1
  462. else:
  463. log.error("Unable to determine the other commit, use "
  464. "--commit2 or --commit-number2 to specify it")
  465. return 1
  466. index_l = min(index1, index2)
  467. index_r = max(index1, index2)
  468. rev_l = revs[index_l]
  469. rev_r = revs[index_r]
  470. log.debug("Using 'left' revision %s (%s), %s test runs:\n %s",
  471. rev_l.commit_number, rev_l.commit, len(rev_l.tags),
  472. '\n '.join(rev_l.tags))
  473. log.debug("Using 'right' revision %s (%s), %s test runs:\n %s",
  474. rev_r.commit_number, rev_r.commit, len(rev_r.tags),
  475. '\n '.join(rev_r.tags))
  476. # Check report format used in the repo (assume all reports in the same fmt)
  477. xml = is_xml_format(repo, revs[index_r].tags[-1])
  478. if args.html:
  479. index_0 = max(0, index_r - args.history_length)
  480. rev_range = range(index_0, index_r + 1)
  481. else:
  482. # We do not need range of commits for text report (no graphs)
  483. index_0 = index_l
  484. rev_range = (index_l, index_r)
  485. # Read raw data
  486. log.debug("Reading %d revisions, starting from %s (%s)",
  487. len(rev_range), revs[index_0].commit_number, revs[index_0].commit)
  488. raw_data = [read_results(repo, revs[i].tags, xml) for i in rev_range]
  489. data = []
  490. for raw_m, raw_d in raw_data:
  491. data.append((aggregate_metadata(raw_m), aggregate_data(raw_d)))
  492. # Re-map list indexes to the new table starting from index 0
  493. index_r = index_r - index_0
  494. index_l = index_l - index_0
  495. # Print report
  496. if not args.html:
  497. print_diff_report(data[index_l][0], data[index_l][1],
  498. data[index_r][0], data[index_r][1])
  499. else:
  500. print_html_report(data, index_l)
  501. # Dump buildstats
  502. if args.dump_buildstats:
  503. notes_ref = 'buildstats/{}/{}/{}'.format(args.hostname, args.branch,
  504. args.machine)
  505. dump_buildstats(repo, 'oe-build-perf-buildstats', notes_ref,
  506. [rev_l, rev_r])
  507. #revs_l.tags + revs_r.tags)
  508. return 0
  509. if __name__ == "__main__":
  510. sys.exit(main())