name: trace open
description: trace open files
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
  open:
    mapName: events
    structName: event
structs:
  event:
    fields:
    - name: timestamp
      attributes:
        template: timestamp
    - name: pid
      attributes:
        template: pid
    - name: comm
      attributes:
        template: comm
    - name: uid
      attributes:
        template: uid
    - name: gid
      attributes:
        template: uid
    - name: flags
      attributes:
        width: 5
        hidden: true
    - name: mode
      description: File access mode
      attributes:
        width: 16
        alignment: left
        hidden: true
        ellipsis: end
    - name: err
      description: Error code
      attributes:
        width: 3
        alignment: right
    - name: fd
      description: File descriptor. 0 in case of error
      attributes:
        minWidth: 2
        maxWidth: 3
    - name: fname
      attributes:
        width: 32
        minWidth: 24
    - name: mntns_id
      description: Mount namespace inode id
      attributes:
        template: ns
ebpfParams:
  targ_failed:
    key: failed
    defaultValue: "false"
    description: Show only failed events
  targ_tgid:
    key: pid
    defaultValue: ""
    description: Show only events generated by processes with this pid
  targ_uid:
    key: uid
    defaultValue: ""
    description: Show only events generated by processes with this uid
