summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Pollard <tom.pollard@codethink.co.uk>2019-11-07 17:10:33 +0000
committerTom Pollard <tom.pollard@codethink.co.uk>2019-11-28 16:56:50 +0000
commit506f97117743f3835d0a9a0e1306097d8e960b9e (patch)
tree93c2c605f68ade84819927d2f35c6db0c432a693
parent03bc9ef7f68dbdbe9e65e3a0322d14c19f9c699a (diff)
downloadbuildstream-506f97117743f3835d0a9a0e1306097d8e960b9e.tar.gz
Add profile topic for subprocessed stream method
-rw-r--r--src/buildstream/_profile.py1
-rw-r--r--src/buildstream/_stream.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/buildstream/_profile.py b/src/buildstream/_profile.py
index fdde04ab7..68750b40a 100644
--- a/src/buildstream/_profile.py
+++ b/src/buildstream/_profile.py
@@ -48,6 +48,7 @@ class Topics:
LOAD_PIPELINE = "load-pipeline"
LOAD_SELECTION = "load-selection"
SCHEDULER = "scheduler"
+ SUBPROCESS = "subprocess"
ALL = "all"
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index 77821f1c0..eb3a345d8 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -142,7 +142,8 @@ class Stream:
pickling_support.install()
with _signals.blocked([signal.SIGINT, signal.SIGTERM, signal.SIGTSTP], ignore=True):
try:
- func(*args, **kwargs)
+ with PROFILER.profile(Topics.SUBPROCESS, "stream"):
+ func(*args, **kwargs)
except Exception as e: # pylint: disable=broad-except
notify.put(Notification(NotificationType.EXCEPTION, exception=SubprocessException(e)))