tools/trace.py: flush stdout for each event
diff --git a/tools/trace.py b/tools/trace.py
index 9afd672..8b2ca35 100755
--- a/tools/trace.py
+++ b/tools/trace.py
@@ -604,6 +604,7 @@
                 if Probe.max_events is not None and \
                    Probe.event_count >= Probe.max_events:
                         exit()
+                sys.stdout.flush()
 
         def attach(self, bpf, verbose):
                 if len(self.library) == 0:
@@ -843,6 +844,7 @@
                 print("%-7s %-7s %-15s %-16s %s" %
                       ("PID", "TID", "COMM", "FUNC",
                       "-" if not all_probes_trivial else ""))
+                sys.stdout.flush()
 
                 while True:
                         self.bpf.perf_buffer_poll()