make btt scripts python3-ready

Many distributions are moving to python3 by default.  Here's
an attempt to make the python scripts in blktrace python3-ready.

Most of this was done with automated tools.  I hand fixed some
space-vs tab issues, and cast an array index to integer.  It
passes rudimentary testing when run under python2.7 as well
as python3.

This doesn't do anything with the shebangs, it leaves them both
invoking whatever "env python" coughs up on the system.

Signed-off-by: Eric Sandeen <>
Signed-off-by: Jens Axboe <>
2 files changed