Skip to content

Commit 3ec0ddc

Browse files
authored
Merge pull request #35551 from ahoppen/fix-process-stats-dir
[Stats] Fix a second/nanoseconds bug in process-stats-dir
2 parents 3cbf31c + 13dd22f commit 3ec0ddc

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

test/lit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,7 @@ config.substitutions.append(('%round-trip-syntax-test',
19651965
config.round_trip_syntax_test)))
19661966
config.substitutions.append(('%rth', '%s %s' % (shell_quote(sys.executable), config.rth)))
19671967
config.substitutions.append(('%scale-test',
1968-
'{} {} --swiftc-binary={} --tmpdir=%t'.format(
1968+
'{} {} --swiftc-binary={} --tmpdir=%t --exclude-timers'.format(
19691969
shell_quote(sys.executable), config.scale_test,
19701970
config.swiftc)))
19711971
config.substitutions.append(('%empty-directory\(([^)]+)\)',

utils/jobstats/jobstats.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,12 @@ def load_stats_dir(path, select_module=[], select_stat=[],
328328
for (k, v) in j.items():
329329
if sre.search(k) is None:
330330
continue
331+
if k.startswith('time.'):
332+
v = int(1000000.0 * float(v))
331333
if k.startswith('time.') and exclude_timers:
332334
continue
333335
tm = match_timerpat(k)
334336
if tm:
335-
v = int(1000000.0 * float(v))
336337
if tm['jobkind'] == jobkind and \
337338
tm['timerkind'] == 'wall':
338339
dur_usec = v

utils/scale-test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ def run_once_with_primary(args, ast, rng, primary_idx):
175175
if not args.save_temps:
176176
shutil.rmtree(d)
177177

178-
return {k: v for (k, v) in r.items() if args.select in k}
178+
return {k: v for (k, v) in r.items() if args.select in k and
179+
not (args.exclude_timers and k.startswith('time.'))}
179180

180181

181182
def run_once(args, ast, rng):
@@ -759,6 +760,10 @@ def main():
759760
parser.add_argument(
760761
'--select',
761762
default="", help='substring of counters/symbols to limit attention to')
763+
parser.add_argument(
764+
'--exclude-timers', action="store_true",
765+
default=False, help='Exclude timers (starting with \'time.\') from the '
766+
'analysis')
762767
parser.add_argument(
763768
'--debug', action='store_true',
764769
default=False, help='invoke lldb on each scale test')

0 commit comments

Comments
 (0)