Skip to content

Commit 04cc75f

Browse files
committed
Add profiling for ASR generation.
1 parent 21d0007 commit 04cc75f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

tools/onlpm.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -432,13 +432,14 @@ def copy_str_or_file(src, dst):
432432
command = command + "--after-remove %s " % OnlPackageAfterRemoveScript(self.pkg['init'], dir=workdir).name
433433

434434
if self.pkg.get('asr', True):
435-
# Generate the ASR documentation for this package.
436-
sys.path.append("%s/sm/infra/tools" % os.getenv('ONL'))
437-
import asr
438-
asro = asr.AimSyslogReference()
439-
asro.extract(workdir)
440-
asro.format(os.path.join(docpath, asr.AimSyslogReference.ASR_NAME), 'json')
441-
435+
with onlu.Profiler() as profiler:
436+
# Generate the ASR documentation for this package.
437+
sys.path.append("%s/sm/infra/tools" % os.getenv('ONL'))
438+
import asr
439+
asro = asr.AimSyslogReference()
440+
asro.extract(workdir)
441+
asro.format(os.path.join(docpath, asr.AimSyslogReference.ASR_NAME), 'json')
442+
profiler.log("ASR generation for %(name)s" % self.pkg)
442443
############################################################
443444

444445
if logger.level < logging.INFO:
@@ -1234,14 +1235,15 @@ def defaultPm():
12341235
if ops.list_all:
12351236
print pm
12361237

1238+
if ops.pmake:
1239+
pm.pmake()
1240+
1241+
12371242
pm.filter(subdir = ops.subdir, arches=ops.arches)
12381243

12391244
if ops.list:
12401245
print pm
12411246

1242-
if ops.pmake:
1243-
pm.pmake()
1244-
12451247
if ops.pkg_info:
12461248
print pm.pkg_info()
12471249

0 commit comments

Comments
 (0)