checkpoint-restore / checkpointctl

A tool for in-depth analysis of container checkpoints
Apache License 2.0
87 stars 15 forks source link

feat: display file descriptors #74

Closed snprajwal closed 12 months ago

snprajwal commented 1 year ago

The file descriptors opened by the processes in the checkpoint can now be viewed with the --fds flag. This currently displays the file type, FD, and the path.

An example output for a checkpoint of httpd container (provided by @rst0git):

test
├── Image: docker.io/library/httpd:2.4
├── ID: 41ddbcab288ab3d2d119896aa96187b474bbe3084640b6559b0edc0a41f12277
├── Runtime: crun
├── Created: 2023-07-06T09:08:34+01:00
├── Engine: Podman
├── Checkpoint Size: 5.2 MiB
├── Root Fs Diff Size: 2.0 KiB
└── Process tree
    └── [1]  httpd
        ├── [3]  httpd
        │   ├── [REG 0]  /dev/null
        │   ├── [PIPE 1]  pipe[793149]
        │   ├── [PIPE 2]  pipe[793150]
        │   ├── [INETSK 3]  INETSK.36
        │   ├── [INETSK 4]  INETSK.37
        │   ├── [PIPE 5]  pipe[794937]
        │   ├── [PIPE 6]  pipe[794937]
        │   ├── [PIPE 7]  pipe[793149]
        │   ├── [EVENTPOLL 8]  EVENTPOLL.44
        │   ├── [PIPE 9]  pipe[796833]
        │   ├── [PIPE 10]  pipe[796833]
        │   ├── [cwd]  /usr/local/apache2
        │   └── [root]  /
        ├── [4]  httpd
        │   ├── [REG 0]  /dev/null
        │   ├── [PIPE 1]  pipe[793149]
        │   ├── [PIPE 2]  pipe[793150]
        │   ├── [INETSK 3]  INETSK.36
        │   ├── [INETSK 4]  INETSK.37
        │   ├── [PIPE 5]  pipe[794937]
        │   ├── [PIPE 6]  pipe[794937]
        │   ├── [PIPE 7]  pipe[793149]
        │   ├── [EVENTPOLL 8]  EVENTPOLL.49
        │   ├── [PIPE 9]  pipe[789308]
        │   ├── [PIPE 10]  pipe[789308]
        │   ├── [cwd]  /usr/local/apache2
        │   └── [root]  /
        ├── [5]  httpd
        │   ├── [REG 0]  /dev/null
        │   ├── [PIPE 1]  pipe[793149]
        │   ├── [PIPE 2]  pipe[793150]
        │   ├── [INETSK 3]  INETSK.36
        │   ├── [INETSK 4]  INETSK.37
        │   ├── [PIPE 5]  pipe[794937]
        │   ├── [PIPE 6]  pipe[794937]
        │   ├── [PIPE 7]  pipe[793149]
        │   ├── [EVENTPOLL 8]  EVENTPOLL.54
        │   ├── [PIPE 9]  pipe[792449]
        │   ├── [PIPE 10]  pipe[792449]
        │   ├── [cwd]  /usr/local/apache2
        │   └── [root]  /
        ├── [REG 0]  /dev/null
        ├── [PIPE 1]  pipe[793149]
        ├── [PIPE 2]  pipe[793150]
        ├── [INETSK 3]  INETSK.36
        ├── [INETSK 4]  INETSK.37
        ├── [PIPE 5]  pipe[794937]
        ├── [PIPE 6]  pipe[794937]
        ├── [PIPE 7]  pipe[793149]
        ├── [cwd]  /usr/local/apache2
        └── [root]  /
codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 85.61% and project coverage change: +2.17 :tada:

Comparison is base (69a4966) 80.00% compared to head (6a534c5) 82.17%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #74 +/- ## ========================================== + Coverage 80.00% 82.17% +2.17% ========================================== Files 3 4 +1 Lines 435 533 +98 ========================================== + Hits 348 438 +90 - Misses 64 70 +6 - Partials 23 25 +2 ``` | [Impacted Files](https://app.codecov.io/gh/checkpoint-restore/checkpointctl/pull/74?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [container.go](https://app.codecov.io/gh/checkpoint-restore/checkpointctl/pull/74?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y29udGFpbmVyLmdv) | `76.19% <76.54%> (-4.04%)` | :arrow_down: | | [checkpointctl.go](https://app.codecov.io/gh/checkpoint-restore/checkpointctl/pull/74?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y2hlY2twb2ludGN0bC5nbw==) | `90.44% <88.28%> (+3.49%)` | :arrow_up: | | [tree.go](https://app.codecov.io/gh/checkpoint-restore/checkpointctl/pull/74?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-dHJlZS5nbw==) | `90.32% <90.32%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

github-actions[bot] commented 1 year ago

Test Results

36 tests  +3   36 :heavy_check_mark: +3   0s :stopwatch: ±0s   1 suites ±0     0 :zzz: ±0    1 files   ±0     0 :x: ±0 

Results for commit 064f017b. ± Comparison against base commit 5a00d397.

:recycle: This comment has been updated with latest results.

adrianreber commented 1 year ago

The binary size check does not seem to work any more. I just see one run of it. No comparison.

Can you add an example of what this looks like in the PR description?

snprajwal commented 1 year ago

The binary size workflow should be working now, I rebased this branch against main.

snprajwal commented 12 months ago

I forgot to do a nil pointer check while searching for the process node in the tree. Updated the commit with those changes now.