summaryrefslogtreecommitdiff
path: root/buildstream/_project.py
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-19 09:24:22 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-29 11:19:49 +0000
commitc38f26cc8c8c65379a1b145bd99429a7cc1e68e1 (patch)
tree4c656ba064049f7083cce1e14c2da823ef0483aa /buildstream/_project.py
parent83c56d548b9a7827399888189a828be3c7c7dfd2 (diff)
downloadbuildstream-c38f26cc8c8c65379a1b145bd99429a7cc1e68e1.tar.gz
Rework profiler to act as a context manager
Diffstat (limited to 'buildstream/_project.py')
-rw-r--r--buildstream/_project.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py
index f5da960cf..7a1734a25 100644
--- a/buildstream/_project.py
+++ b/buildstream/_project.py
@@ -30,7 +30,7 @@ from . import _cachekey
from . import _site
from . import _yaml
from ._artifactelement import ArtifactElement
-from ._profile import Topics, profile_start, profile_end
+from ._profile import Topics, PROFILER
from ._exceptions import LoadError, LoadErrorReason
from ._options import OptionPool
from ._artifactcache import ArtifactCache
@@ -156,9 +156,8 @@ class Project():
self._fully_loaded = False
self._project_includes = None
- profile_start(Topics.LOAD_PROJECT, self.directory.replace(os.sep, '-'))
- self._load(parent_loader=parent_loader)
- profile_end(Topics.LOAD_PROJECT, self.directory.replace(os.sep, '-'))
+ with PROFILER.profile(Topics.LOAD_PROJECT, self.directory.replace(os.sep, '-')):
+ self._load(parent_loader=parent_loader)
self._partially_loaded = True