Commit c5b5b30c authored by Gary Lin's avatar Gary Lin

tools/cachetop: match bpf.ksym() with bytes arrays

bpf.ksym() now returns a bytes array, and python3 would issue TypeError
when matching the string.
Signed-off-by: default avatarGary Lin <glin@suse.com>
parent 76bec4d5
......@@ -88,16 +88,16 @@ def get_processes_stats(
whits = 0
for k, v in count.items():
if re.match('mark_page_accessed', bpf.ksym(k)) is not None:
if re.match(b'mark_page_accessed', bpf.ksym(k)) is not None:
mpa = max(0, v)
if re.match('mark_buffer_dirty', bpf.ksym(k)) is not None:
if re.match(b'mark_buffer_dirty', bpf.ksym(k)) is not None:
mbd = max(0, v)
if re.match('add_to_page_cache_lru', bpf.ksym(k)) is not None:
if re.match(b'add_to_page_cache_lru', bpf.ksym(k)) is not None:
apcl = max(0, v)
if re.match('account_page_dirtied', bpf.ksym(k)) is not None:
if re.match(b'account_page_dirtied', bpf.ksym(k)) is not None:
apd = max(0, v)
# access = total cache access incl. reads(mpa) and writes(mbd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment