]> granicus.if.org Git - zfs/commitdiff
arcstat: flush stdout / outfile after each line
authorFabian-Gruenbichler <f.gruenbichler@proxmox.com>
Thu, 26 Oct 2017 19:18:49 +0000 (21:18 +0200)
committerTony Hutter <hutter2@llnl.gov>
Mon, 20 Nov 2017 22:19:23 +0000 (16:19 -0600)
Otherwise, if arcstat gets interrupted before the desired number of
iterations is reached, the output file will be empty (both if set via
'-o' or via shell redirection).

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Closes #6775

cmd/arcstat/arcstat.py

index d969da8d4e48bb87fe5d654654f341228b5e1625..aa54ee87a75d56030517a32410c0bda4cbb5256d 100755 (executable)
@@ -219,6 +219,7 @@ def print_values():
             sep
         ))
     sys.stdout.write("\n")
+    sys.stdout.flush()
 
 
 def print_header():