Merge pull request #84 from jamagin/fix-81

Fixes #81 - When the kernel informs us of LOST EVENTS, clear lastfile
This commit is contained in:
Brendan Gregg
2020-01-14 14:22:15 -08:00
committed by GitHub

View File

@@ -252,6 +252,8 @@ fi ) | $awk -v o=$offset -v opt_name=$opt_name -v name=$name \
# sys_open() / sys_openat() # sys_open() / sys_openat()
$1 != "#" && ($(4+o) == "sys_open" || $(4+o) == "sys_openat") { $1 != "#" && ($(4+o) == "sys_open" || $(4+o) == "sys_openat") {
filename = lastfile[pid] filename = lastfile[pid]
if (!filename)
next
delete lastfile[pid] delete lastfile[pid]
if (opt_file && filename !~ file) if (opt_file && filename !~ file)
next next
@@ -269,7 +271,9 @@ fi ) | $awk -v o=$offset -v opt_name=$opt_name -v name=$name \
printf "%-16.16s %-6s %4s %s\n", comm, pid, rval, filename printf "%-16.16s %-6s %4s %s\n", comm, pid, rval, filename
} }
$0 ~ /LOST.*EVENTS/ { print "WARNING: " $0 > "/dev/stderr" } $0 ~ /LOST.*EVENTS/ {
delete lastfile
print "WARNING: " $0 > "/dev/stderr" }
' '
### end tracing ### end tracing