summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.com>2019-01-18 17:20:42 +0000
committerJames Ennis <james.ennis@codethink.com>2019-01-25 16:35:21 +0000
commit56a3954c30bd4a7a60ce3511a5f1cc815b50c7b3 (patch)
tree4a093beaef5a22cd2f9be0779ffc9a516ba9be42
parentd584746223faa23eb96f48b9bde2a054b3ce016b (diff)
downloadbuildstream-56a3954c30bd4a7a60ce3511a5f1cc815b50c7b3.tar.gz
_profile.py: Added a new profiling topic, load-selection
profile_start() and profile_end() calls have been added to Stream.load_selection()
-rw-r--r--buildstream/_profile.py1
-rw-r--r--buildstream/_stream.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/buildstream/_profile.py b/buildstream/_profile.py
index b293c342b..d977c5da2 100644
--- a/buildstream/_profile.py
+++ b/buildstream/_profile.py
@@ -46,6 +46,7 @@ class Topics():
LOAD_CONTEXT = 'load-context'
LOAD_PROJECT = 'load-project'
LOAD_PIPELINE = 'load-pipeline'
+ LOAD_SELECTION = 'load-selection'
SCHEDULER = 'scheduler'
SHOW = 'show'
ARTIFACT_RECEIVE = 'artifact-receive'
diff --git a/buildstream/_stream.py b/buildstream/_stream.py
index 36b496e77..e77a19891 100644
--- a/buildstream/_stream.py
+++ b/buildstream/_stream.py
@@ -32,6 +32,7 @@ from ._exceptions import StreamError, ImplError, BstError, set_last_task_error
from ._message import Message, MessageType
from ._scheduler import Scheduler, SchedStatus, TrackQueue, FetchQueue, BuildQueue, PullQueue, PushQueue
from ._pipeline import Pipeline, PipelineSelection
+from ._profile import Topics, profile_start, profile_end
from . import utils, _yaml, _site
from . import Scope, Consistency
@@ -106,10 +107,16 @@ class Stream():
def load_selection(self, targets, *,
selection=PipelineSelection.NONE,
except_targets=()):
+
+ profile_start(Topics.LOAD_SELECTION, "_".join(t.replace(os.sep, '-') for t in targets))
+
elements, _ = self._load(targets, (),
selection=selection,
except_targets=except_targets,
fetch_subprojects=False)
+
+ profile_end(Topics.LOAD_SELECTION, "_".join(t.replace(os.sep, '-') for t in targets))
+
return elements
# shell()