From 6df40c66a5a9bb02c84cb77db2d2da46158f3a40 Mon Sep 17 00:00:00 2001 From: yanivagman Date: Wed, 5 Aug 2020 18:23:10 +0300 Subject: [PATCH] Fix double printing of first arg --- README.md | 8 ++++---- tracee/printer.go | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f7e5dd305b04..7f22a6e9d794 100644 --- a/README.md +++ b/README.md @@ -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 ... ``` diff --git a/tracee/printer.go b/tracee/printer.go index 8acd8e61d02d..d4bfe6a54ff3 100644 --- a/tracee/printer.go +++ b/tracee/printer.go @@ -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) }