hello, I experienced the same issue and Support from SideFX was of great help,
I quote their advice, but I don't know if it can be implemented with TOPs (can you use the hou.session in Top?)
Note: "START_" and "END_" are 2 python sop nodes the wraps the network block I wanted to profile.
In the "START_perf_profile" node, you could do:
"""
node = hou.pwd()
iteration = node.evalParm("iteration")
if not hasattr(hou.session, "profiles"):
hou.session.profiles = {}
profile = hou.perfMon.startProfile("profile for iteration " + str(iteration))
hou.session.profiles[profile.id()] = profile
"""
And in the "END_perf_profile" node, you could do:
node = hou.pwd()
id = node.evalParm("get_id")
profile = hou.session.profiles[id]
profile.stop()
In the future, we probably should add a new `
hou.perfMon.getProfile(id)` to HOM but we'll need to do an investigation first. I vaguely recall that we chose not to add such a function but I can't recall exactly why.