• kmjohansen's avatar
    bcc container improvements (#1051) · 4b87af0c
    kmjohansen authored
    * Bcc should look at mountns during symbol resolution.
    
    Allow bcc to resolve symbols in processes that have mappings in a
    different mount namespace.  This allows us to obtain stack traces from
    the host when our target resides in a container.  With this change it's
    possible to get stacks from targets that used to show up as unknown.
    
    * When searching for perf-map files look in container, and then host.
    
    Allow perf-map files to exist either in the container under the pid
    that's specific to the container's pid namespace, or in the host
    container using the pid that's specific to the initial pid namespace.
    This lets us store the perf-map either in the continer or on the host,
    depending upon which is easier for the person performing the debugging.
    
    * Allow bcc to place uprobes and USDT probes in containers.
    
    The uprobe/usdt mechanism uses the target's inode in order to determine
    where to place the probe.  The inode lookup occurs at the time the file
    path is written to uprobe_events.  If bpf_attach_uprobe() has been
    passed a pid, and that pid is in a different mount namespace from the
    caller, attempt to switch to the victim's mount namespace so that we can
    select the correct inode for the probe.
    
    * Add unit tests for the container improvements code.
    4b87af0c
bcc_proc.c 11.3 KB