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 <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38175 Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
This commit is contained in:
committed by
Daniel Carvalho
parent
275a6ecefe
commit
9388ec18a4
@@ -261,6 +261,15 @@ class ProbePointArg : public ProbePoint
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
||||
Reference in New Issue
Block a user