[gem5-dev] Change in gem5/gem5[develop]: sim: Add a listener checker to probes

2020-12-16 Thread Daniel Carvalho (Gerrit) via gem5-dev
Daniel Carvalho has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/38175 )


Change subject: sim: Add a listener checker to probes
..

sim: Add a listener checker to probes

Add a function to check if a probe has listeners. This can be
used to avoid performing costly tasks when no one is listening.

Change-Id: I8996a0ea298cb7cf97ac8aa9e627331a22bea26e
Signed-off-by: Daniel R. Carvalho 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38175
Maintainer: Jason Lowe-Power 
Tested-by: kokoro 
Reviewed-by: Jason Lowe-Power 
Reviewed-by: Nikos Nikoleris 
---
M src/sim/probe/probe.hh
1 file changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Nikos Nikoleris: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/sim/probe/probe.hh b/src/sim/probe/probe.hh
index 57132fc..5becc26 100644
--- a/src/sim/probe/probe.hh
+++ b/src/sim/probe/probe.hh
@@ -262,6 +262,15 @@
 }

 /**
+ * Informs whether any listeners are attached to this probe. This can
+ * be used to avoid performing costly tasks needed by the probe when
+ * nobody is listening.
+ *
+ * @return Whether this probe has any listener.
+ */
+bool hasListeners() const { return listeners.size() > 0; }
+
+/**
  * @brief adds a ProbeListener to this ProbePoints notify list.
  * @param l the ProbeListener to add to the notify list.
  */

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/38175
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8996a0ea298cb7cf97ac8aa9e627331a22bea26e
Gerrit-Change-Number: 38175
Gerrit-PatchSet: 5
Gerrit-Owner: Daniel Carvalho 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: sim: Add a listener checker to probes

2020-12-01 Thread Daniel Carvalho (Gerrit) via gem5-dev
Daniel Carvalho has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/38175 )



Change subject: sim: Add a listener checker to probes
..

sim: Add a listener checker to probes

Add a function to check if a probe has listeners. This can be
used to avoid performing costly tasks when no one is listening.

Change-Id: I8996a0ea298cb7cf97ac8aa9e627331a22bea26e
Signed-off-by: Daniel R. Carvalho 
---
M src/sim/probe/probe.hh
1 file changed, 9 insertions(+), 0 deletions(-)



diff --git a/src/sim/probe/probe.hh b/src/sim/probe/probe.hh
index 57132fc..5becc26 100644
--- a/src/sim/probe/probe.hh
+++ b/src/sim/probe/probe.hh
@@ -262,6 +262,15 @@
 }

 /**
+ * Informs whether any listeners are attached to this probe. This can
+ * be used to avoid performing costly tasks needed by the probe when
+ * nobody is listening.
+ *
+ * @return Whether this probe has any listener.
+ */
+bool hasListeners() const { return listeners.size() > 0; }
+
+/**
  * @brief adds a ProbeListener to this ProbePoints notify list.
  * @param l the ProbeListener to add to the notify list.
  */

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/38175
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8996a0ea298cb7cf97ac8aa9e627331a22bea26e
Gerrit-Change-Number: 38175
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s