brendangregg / perf-tools

Performance analysis tools based on Linux perf_events (aka perf) and ftrace
GNU General Public License v2.0
9.88k stars 1.64k forks source link

mawk: line 19: syntax error at or near , #74

Open jibanes opened 6 years ago

jibanes commented 6 years ago

jibanes@wopr:~$ sudo ./opensnoop -d 1 omfg Tracing open()s for filenames containing "omfg" for 1 seconds (buffered)... COMM PID FD FILE mawk: line 19: syntax error at or near ,

Ending tracing...

jibanes commented 6 years ago

seems to work fine if using gawk, not mawk.

jamagin commented 5 years ago

I'm experiencing this too, it seems to be caused by https://github.com/brendangregg/perf-tools/commit/6f53237f12571161aad2a379941c7a6c17a67093 mawk only accepts a two-argument from of match()

remort commented 4 years ago

Still doesn't work either with mawk or awk: Using of -d seems to enable mawk in bash script.

opensnoop-perf -d 10 firefox
Tracing open()s for filenames containing "firefox" for 10 seconds (buffered)...
COMM             PID      FD FILE
mawk: line 19: syntax error at or near ,
^C
Ending tracing...

# opensnoop-perf firefox
Tracing open()s for filenames containing "firefox". Ctrl-C to end.
COMM             PID      FD FILE
awk: line 19: syntax error at or near ,

Ending tracing...

Ubuntu 2020, perf-tools-unstable/focal,focal,now 1.0.1~20200130+git49b8cdf-1ubuntu1 all [installed], Kernel: 5.4.0-52-generic

UPDATE: installing gawk via apt and hardcoding use=gawk in opensnoop-perf bash script seems to solve issue.