Skip to content

Commit

Permalink
Left align
Browse files Browse the repository at this point in the history
Signed-off-by: gray <gray.liang@isovalent.com>
  • Loading branch information
jschwinger233 authored and brb committed May 28, 2024
1 parent e3b2c66 commit ceaeb5e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/pwru/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ func (o *output) Close() {

func (o *output) PrintHeader() {
if o.flags.OutputTS == "absolute" {
fmt.Fprintf(o.writer, "%12s ", "TIME")
fmt.Fprintf(o.writer, "%-12s ", "TIME")
}
fmt.Fprintf(o.writer, "%18s %6s %16s", "SKB", "CPU", "PROCESS")
fmt.Fprintf(o.writer, "%-18s %-6s %-16s", "SKB", "CPU", "PROCESS")
if o.flags.OutputTS != "none" {
fmt.Fprintf(o.writer, " %16s", "TIMESTAMP")
fmt.Fprintf(o.writer, " %-16s", "TIMESTAMP")
}
if o.flags.OutputMeta {
fmt.Fprintf(o.writer, " %s %s %s %s %s %s", "NETNS", "MARK", "IFACE", "PROTO", "MTU", "LEN")
Expand Down Expand Up @@ -330,7 +330,7 @@ func getOutFuncName(o *output, event *Event, addr uint64) string {

func (o *output) Print(event *Event) {
if o.flags.OutputTS == "absolute" {
fmt.Fprintf(o.writer, "%12s ", getAbsoluteTs())
fmt.Fprintf(o.writer, "%-12s ", getAbsoluteTs())
}

execName := getExecName(int(event.PID))
Expand All @@ -345,10 +345,10 @@ func (o *output) Print(event *Event) {

outFuncName := getOutFuncName(o, event, addr)

fmt.Fprintf(o.writer, "%18s %6s %16s", fmt.Sprintf("%#x", event.SAddr),
fmt.Fprintf(o.writer, "%-18s %-6s %-16s", fmt.Sprintf("%#x", event.SAddr),
fmt.Sprintf("%d", event.CPU), fmt.Sprintf("[%s]", execName))
if o.flags.OutputTS != "none" {
fmt.Fprintf(o.writer, " %16d", ts)
fmt.Fprintf(o.writer, " %-16d", ts)
}
o.lastSeenSkb[event.SAddr] = event.Timestamp

Expand Down

0 comments on commit ceaeb5e

Please sign in to comment.