master.py: added --events parameter
perftool.py: minor cleanups and improvements