| 1 | """ | 
| 2 | plugin.py - test Python 3 plugin for uftrace | 
| 3 | """ | 
| 4 | |
| 5 | import collections | 
| 6 | import os | 
| 7 | import sys | 
| 8 | |
| 9 | |
| 10 | def log(msg, *args): | 
| 11 | if args: | 
| 12 | msg = msg % args | 
| 13 | print(msg, file=sys.stderr) | 
| 14 | |
| 15 | |
| 16 | def uftrace_begin(ctx): | 
| 17 | log('script begin %s', ctx) | 
| 18 | |
| 19 | |
| 20 | def uftrace_entry(ctx): | 
| 21 | log('function entry %s', ctx) | 
| 22 | |
| 23 | |
| 24 | def uftrace_exit(ctx): | 
| 25 | log('function exit %s', ctx) | 
| 26 | |
| 27 | |
| 28 | def uftrace_end(ctx): | 
| 29 | log('script end %s', ctx) |