Skip to content

Commit

Permalink
Improve trace.py print format
Browse files Browse the repository at this point in the history
  • Loading branch information
palmtenor committed Dec 16, 2017
1 parent 569461d commit 1a322d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,13 @@ def print_event(self, bpf, cpu, data, size):
range(0, len(self.values)))
msg = self._format_message(bpf, event.tgid, values)
if not Probe.print_time:
print("%-6d %-6d %-12s %-16s %s" %
print("%-7d %-7d %-15s %-16s %s" %
(event.tgid, event.pid, event.comm.decode(),
self._display_function(), msg))
else:
time = strftime("%H:%M:%S") if Probe.use_localtime else \
Probe._time_off_str(event.timestamp_ns)
print("%-8s %-6d %-6d %-12s %-16s %s" %
print("%-8s %-7d %-7d %-15s %-16s %s" %
(time[:8], event.tgid, event.pid,
event.comm.decode(), self._display_function(), msg))

Expand Down Expand Up @@ -685,11 +685,11 @@ def _main_loop(self):

# Print header
if self.args.timestamp or self.args.time:
print("%-8s %-6s %-6s %-12s %-16s %s" %
print("%-8s %-7s %-7s %-15s %-16s %s" %
("TIME", "PID", "TID", "COMM", "FUNC",
"-" if not all_probes_trivial else ""))
else:
print("%-6s %-6s %-12s %-16s %s" %
print("%-7s %-7s %-15s %-16s %s" %
("PID", "TID", "COMM", "FUNC",
"-" if not all_probes_trivial else ""))

Expand Down

0 comments on commit 1a322d5

Please sign in to comment.