commit | 7b2c114a8049196aa52281f55929cf51c363cc77 | [log] [tgz] |
---|---|---|
author | xingfeng2510 <xingfeng25100@163.com> | Thu Mar 24 10:51:26 2022 +0800 |
committer | yonghong-song <ys114321@gmail.com> | Wed Mar 23 23:19:06 2022 -0700 |
tree | 57e4de56bf9f2036b30240e9ee7700fba263744d | |
parent | 43fec8b8eddaf3dd8805ff0cfcf4bd031db60f38 [diff] [blame] |
tools: Flush stdout explicitly in event loop
diff --git a/tools/hardirqs.py b/tools/hardirqs.py index 239d813..3bcf649 100755 --- a/tools/hardirqs.py +++ b/tools/hardirqs.py
@@ -19,6 +19,7 @@ from bcc import BPF from time import sleep, strftime import argparse +import sys # arguments examples = """examples: @@ -248,6 +249,8 @@ print("%-26s %11d" % (k.name.decode('utf-8', 'replace'), v.value / factor)) dist.clear() + sys.stdout.flush() + countdown -= 1 if exiting or countdown == 0: exit()