Skip to content

Commit

Permalink
Fix 'tools/syscount' from using incorrect fallback values
Browse files Browse the repository at this point in the history
This prevents 'tools/syscount' from using incorrect system
call descriptions if the 'ausyscall' command is not found.
In this case, it uses a lookup table as a fallback. This,
however, is compliant with x86_64 only.

For now, we fix this by raising an exception and exiting if
the 'ausyscall' executable is not available for non-x86_64
systems instead of having additional lookup tables for other
architectures.

Signed-off-by: Sandipan Das <[email protected]>
  • Loading branch information
sandip4n committed Oct 10, 2017
1 parent 54a5b4d commit a068a03
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/syscount.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import itertools
import subprocess
import sys
import platform

if sys.version_info.major < 3:
izip_longest = itertools.izip_longest
Expand Down Expand Up @@ -362,7 +363,10 @@ def parse_syscall(line):
out = subprocess.check_output('ausyscall --dump | tail -n +2', shell=True)
syscalls = dict(map(parse_syscall, out.strip().split('\n')))
except Exception as e:
pass
if platform.machine() == "x86_64":
pass
else:
raise Exception("ausyscall: command not found")

parser = argparse.ArgumentParser(
description="Summarize syscall counts and latencies.")
Expand Down

0 comments on commit a068a03

Please sign in to comment.