forked from iovisor/bcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: don't mix print(end="") with printb()
While mixing print(end="") with printb(), some messages may miss due to the underlying buffer handling in python 3. For example: # python3 opensnoop.py PID COMM FD ERR PATH /proc/18849/cmdline 4109 tmux: server 67 0 /proc/18849/cmdline 4109 tmux: server 67 0 /proc/18849/cmdline 4109 tmux: server 67 0 /proc/18849/cmdline The PID, COMM, FD, and ERR are printed with print(end=""), and those of the first instance was eaten by printb() which outputs PATH. The following scripts mix print(end="") and printb() for the same line: tools/execsnoop.py tools/opensnoop.py tools/tcpaccept.py tools/tcpconnect.py Those scripts work fine with python 2 but some messages may miss while using python 3. This commit converts print(end="") to printb(nl="") to avoid the inconsistent outputs. Signed-off-by: Gary Lin <[email protected]>
- Loading branch information
1 parent
1bbfdb6
commit 6c79331
Showing
4 changed files
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters