Skip to content

Commit

Permalink
debug runtime
Browse files Browse the repository at this point in the history
Signed-off-by: André Martins <andre@cilium.io>
  • Loading branch information
aanm committed Jun 23, 2021
1 parent a6112f9 commit 4e4db06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/bpf/bpffs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ func checkOrMountDefaultLocations(printWarning bool) error {
// If /sys/fs/bpf is not mounted at all, we should mount
// BPFFS there.
if !mounted {
log.Warning("POSSIBLE BUG: AANM, mounting")
if err := mountFS(printWarning); err != nil {
return err
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/mountinfo/mountinfo_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package mountinfo

import (
"errors"
"fmt"
"os"
"path/filepath"

Expand All @@ -42,17 +43,21 @@ func IsMountFS(mntType int64, path string) (bool, bool, error) {
if err != nil {
if errors.Is(err, unix.ENOENT) {
// non-existent path can't be a mount point
fmt.Printf("AANM No existent mount point: %s\n", path)
return false, false, nil
}
fmt.Printf("AANM lstat %s error: %s\n", path, err)
return false, false, &os.PathError{Op: "lstat", Path: path, Err: err}
}

parent := filepath.Dir(path)
err = unix.Lstat(parent, &pst)
if err != nil {
fmt.Printf("AANM lstat %s error: %s\n", path, err)
return false, false, &os.PathError{Op: "lstat", Path: parent, Err: err}
}
if st.Dev == pst.Dev {
fmt.Printf("AANM parent has the same dev -- not a mount point st.Dev(%d) == pst.Dev(%d)\n", st.Dev, pst.Dev)
// parent has the same dev -- not a mount point
return false, false, nil
}
Expand Down

0 comments on commit 4e4db06

Please sign in to comment.