You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/04 08:18:39 UTC

[buildstream] 17/19: Add profile topic for subprocessed stream method

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

tvb pushed a commit to branch tpollard/temp
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit f6ac2ac1bd9cf962b0b8b58ff7f739537ce2201f
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 d640769..653f150 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -141,7 +141,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)))