Skip to content

Commit

Permalink
tools/cachestat: fix python 3 str/bytes type error (iovisor#2287)
Browse files Browse the repository at this point in the history
TypeError: argument should be integer or bytes-like object, not 'str'

Signed-off-by: Adrian Ratiu <[email protected]>
  • Loading branch information
10ne1 authored and yonghong-song committed Mar 26, 2019
1 parent 12bd958 commit 0267b48
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/cachestat.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ def get_meminfo():
for k, v in sorted(counts.items(), key=lambda counts: counts[1].value):
func = b.ksym(k.ip)
# partial string matches in case of .isra (necessary?)
if func.find("mark_page_accessed") == 0:
if func.find(b"mark_page_accessed") == 0:
mpa = max(0, v.value)
if func.find("mark_buffer_dirty") == 0:
if func.find(b"mark_buffer_dirty") == 0:
mbd = max(0, v.value)
if func.find("add_to_page_cache_lru") == 0:
if func.find(b"add_to_page_cache_lru") == 0:
apcl = max(0, v.value)
if func.find("account_page_dirtied") == 0:
if func.find(b"account_page_dirtied") == 0:
apd = max(0, v.value)

# total = total cache accesses without counting dirties
Expand Down

0 comments on commit 0267b48

Please sign in to comment.