You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:47:06 UTC

[buildstream] 16/18: Add profile topic for subprocessed stream method

This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a commit to branch tpollard/subrebase
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 506f97117743f3835d0a9a0e1306097d8e960b9e
Author: Tom Pollard <to...@codethink.co.uk>
AuthorDate: Thu Nov 7 17:10:33 2019 +0000

    Add profile topic for subprocessed stream method
---
 src/buildstream/_profile.py | 1 +
 src/buildstream/_stream.py  | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/buildstream/_profile.py b/src/buildstream/_profile.py
index fdde04a..68750b4 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 77821f1..eb3a345 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)))