Skip to content

Commit

Permalink
Merge pull request brendangregg#84 from jamagin/fix-81
Browse files Browse the repository at this point in the history
Fixes brendangregg#81 - When the kernel informs us of LOST EVENTS, clear lastfile
  • Loading branch information
brendangregg committed Jan 14, 2020
2 parents e87bac3 + f801597 commit a70d715
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion opensnoop
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ fi ) | $awk -v o=$offset -v opt_name=$opt_name -v name=$name \
# sys_open() / sys_openat()
$1 != "#" && ($(4+o) == "sys_open" || $(4+o) == "sys_openat") {
filename = lastfile[pid]
if (!filename)
next
delete lastfile[pid]
if (opt_file && filename !~ file)
next
Expand All @@ -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
}
$0 ~ /LOST.*EVENTS/ { print "WARNING: " $0 > "/dev/stderr" }
$0 ~ /LOST.*EVENTS/ {
delete lastfile
print "WARNING: " $0 > "/dev/stderr" }
'

### end tracing
Expand Down

0 comments on commit a70d715

Please sign in to comment.