Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Commit

Permalink
reorder some stuff to make the JIT happier
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Mar 4, 2012
1 parent 195c56e commit ce47961
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/tracebin/recorder.py
Expand Up @@ -149,16 +149,17 @@ def on_abort(self, jitdriver_name, greenkey, reason):
self.log.warning("[abort] Unhandled jitdriver: %s" % jitdriver_name)

def on_profile(self, frame, event, arg):
timestamp = time.time()
if event == "call" or event == "c_call":
event_id = CALL_EVENT
if event == "call":
target = frame.f_code.co_name
elif event == "c_call":
target = arg.__name__
content = struct.pack("=BBdL", PROFILE_IDENTIFIER, event_id, time.time(), len(target)) + target
content = struct.pack("=BBdL", PROFILE_IDENTIFIER, event_id, timestamp, len(target)) + target
elif event == "return" or event == "c_return":
event_id = RETURN_EVENT
content = struct.pack("=BBd", PROFILE_IDENTIFIER, event_id, time.time())
content = struct.pack("=BBd", PROFILE_IDENTIFIER, event_id, timestamp)
elif event == "exception" or event == "c_exception":
return
else:
Expand Down

0 comments on commit ce47961

Please sign in to comment.