Skip to content

Commit

Permalink
Fix double printing of first arg
Browse files Browse the repository at this point in the history
  • Loading branch information
yanivagman committed Aug 5, 2020
1 parent 4795a63 commit 6df40c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ Here is how the output looks:

```
TIME(s) UID COMM PID TID RET EVENT ARGS
176751.746515 1000 zsh 14726 14726 0 execve pathname: /usr/bin/ls, pathname: /usr/bin/ls, argv: [ls]
176751.746772 1000 zsh 14726 14726 0 security_bprm_check pathname: /usr/bin/ls, pathname: /usr/bin/ls, dev: 8388610, inode: 777
176751.747044 1000 ls 14726 14726 -2 access pathname: /etc/ld.so.preload, pathname: /etc/ld.so.preload, mode: R_OK
176751.747077 1000 ls 14726 14726 0 security_file_open pathname: /etc/ld.so.cache, pathname: /etc/ld.so.cache, flags: O_RDONLY|O_LARGEFILE, dev: 8388610, inode: 533737
176751.746515 1000 zsh 14726 14726 0 execve pathname: /usr/bin/ls, argv: [ls]
176751.746772 1000 zsh 14726 14726 0 security_bprm_check pathname: /usr/bin/ls, dev: 8388610, inode: 777
176751.747044 1000 ls 14726 14726 -2 access pathname: /etc/ld.so.preload, mode: R_OK
176751.747077 1000 ls 14726 14726 0 security_file_open pathname: /etc/ld.so.cache, flags: O_RDONLY|O_LARGEFILE, dev: 8388610, inode: 533737
...
```

Expand Down
3 changes: 2 additions & 1 deletion tracee/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ func (p tableEventPrinter) Print(event Event) {
for i, arg := range event.Args {
if i == 0 {
fmt.Fprintf(p.out, "%s: %v", arg.Name, arg.Value)
} else {
fmt.Fprintf(p.out, ", %s: %v", arg.Name, arg.Value)
}
fmt.Fprintf(p.out, ", %s: %v", arg.Name, arg.Value)
}
fmt.Fprintln(p.out)
}
Expand Down

0 comments on commit 6df40c6

Please sign in to comment.