Skip to content

Commit

Permalink
Move FUNC to the last column
Browse files Browse the repository at this point in the history
Because it has variant length.

Signed-off-by: gray <gray.liang@isovalent.com>
  • Loading branch information
jschwinger233 authored and brb committed May 28, 2024
1 parent 90d8c4c commit e3b2c66
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/pwru/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (o *output) PrintHeader() {
if o.flags.OutputTS == "absolute" {
fmt.Fprintf(o.writer, "%12s ", "TIME")
}
fmt.Fprintf(o.writer, "%18s %6s %16s %24s", "SKB", "CPU", "PROCESS", "FUNC")
fmt.Fprintf(o.writer, "%18s %6s %16s", "SKB", "CPU", "PROCESS")
if o.flags.OutputTS != "none" {
fmt.Fprintf(o.writer, " %16s", "TIMESTAMP")
}
Expand All @@ -129,6 +129,7 @@ func (o *output) PrintHeader() {
if o.flags.OutputTuple {
fmt.Fprintf(o.writer, " %s", "TUPLE")
}
fmt.Fprintf(o.writer, " %s", "FUNC")
fmt.Fprintf(o.writer, "\n")
}

Expand Down Expand Up @@ -344,8 +345,8 @@ func (o *output) Print(event *Event) {

outFuncName := getOutFuncName(o, event, addr)

fmt.Fprintf(o.writer, "%18s %6s %16s %24s", fmt.Sprintf("%#x", event.SAddr),
fmt.Sprintf("%d", event.CPU), fmt.Sprintf("[%s]", execName), outFuncName)
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)
}
Expand All @@ -359,6 +360,8 @@ func (o *output) Print(event *Event) {
fmt.Fprintf(o.writer, " %s", getTupleData(event))
}

fmt.Fprintf(o.writer, " %s", outFuncName)

if o.flags.OutputStack && event.PrintStackId > 0 {
fmt.Fprintf(o.writer, "%s", getStackData(event, o))
}
Expand Down

0 comments on commit e3b2c66

Please sign in to comment.