llcstat: fix TypeError on python3
authorRafael Fonseca <rdossant@redhat.com>
Wed, 15 Feb 2017 14:20:52 +0000 (15:20 +0100)
committerRafael Fonseca <rdossant@redhat.com>
Wed, 15 Feb 2017 14:20:52 +0000 (15:20 +0100)
commitf2e6b8d2114cf275099d35f343a23420d4da90a0
tree6c21cca07dc5a5ac97f63105ca8bc875362a3304
parent63c9d94d8ed2cdd3e0d946f5e588e35dc6fa1af8
llcstat: fix TypeError on python3

The bytes object has no __format__ method of its own, inheriting it from
object, so an exception is thrown in python3 when it's passed to a
formatted string since formatting instructions are type specific.

$: ./llcstat
Running for 10 seconds or hit Ctrl-C to end.
PID      NAME             CPU     REFERENCE         MISS    HIT%
Traceback (most recent call last):
  File "./llcstat", line 108, in <module>
    (float(hit) / float(v.value)) * 100.0))
TypeError: non-empty format string passed to object.__format__
tools/llcstat.py