Skip to content

Commit 2000244

Browse files
committed
[test-suite] litsupport/modules/perf.py: store profile filename in context.profilefile
Summary: This 1. Removes duplication 2. Provides that filename to be potentially used by other modules (see D60337) Reviewers: MatzeB, hfinkel, homerdin, fhahn Reviewed By: fhahn Subscribers: fhahn, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60336 llvm-svn: 358085
1 parent 9628c59 commit 2000244

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

litsupport/modules/perf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66

77

88
def _mutateCommandLine(context, commandline):
9-
profilefile = context.tmpBase + ".perf_data"
9+
context.profilefile = context.tmpBase + ".perf_data"
10+
# Storing profile file in context allows other modules to be aware of it.
1011
cmd = shellcommand.parse(commandline)
1112
cmd.wrap('perf', [
1213
'record',
1314
'-e', context.config.perf_profile_events,
14-
'-o', profilefile,
15+
'-o', context.profilefile,
1516
'--'
1617
])
1718
if cmd.stdout is None:
@@ -33,4 +34,4 @@ def mutatePlan(context, plan):
3334
script = testplan.mutateScript(context, script, _mutateCommandLine)
3435
plan.profilescript += script
3536
plan.metric_collectors.append(
36-
lambda context: {'profile': context.tmpBase + '.perf_data'})
37+
lambda context: {'profile': context.profilefile})

0 commit comments

Comments
 (0)