From 08207d77be79afc6f75d1611726b92bdf622717f Mon Sep 17 00:00:00 2001 From: We-unite <3205135446@qq.com> Date: Mon, 2 Sep 2024 16:45:07 +0800 Subject: Show filt result in tree&json, fix sth in listener In the listener, I change the order coroutines are started to avoid 'send on a closed channel'. Besides, the method to get syscall names and numbers are not so universial, so let's go back to check unistd.h. In the filter, the output is set to be written to ./log dir. Pid tree are shown in logs/tree.log, and detail info in pids.log, while file info in the logs/files.log. tree.log shows a tree just like `tree` command, the other two files are written in json. What's more, the flags while opening files are also checked ans showed in files.log. --- filter/logs/tree.log | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 filter/logs/tree.log (limited to 'filter/logs/tree.log') diff --git a/filter/logs/tree.log b/filter/logs/tree.log new file mode 100644 index 0000000..c9d7e34 --- /dev/null +++ b/filter/logs/tree.log @@ -0,0 +1,26 @@ +└── 18009: + ├── 29634: /usr/bin/containerd + │ └── 29643: /usr/bin/containerd-shim-runc-v2 -namespace moby -id 15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19 -address /run/containerd/containerd.sock + │ ├── 29680: /usr/bin/containerd-shim-runc-v2 -namespace moby -id 15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19 -address /run/containerd/containerd.sock + │ ├── 29742: /usr/bin/containerd-shim-runc-v2 -namespace moby -id 15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19 -address /run/containerd/containerd.sock + │ ├── 29655: /usr/bin/containerd-shim-runc-v2 -namespace moby -id 15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19 -address /run/containerd/containerd.sock + │ │ ├── 29662: runc --root /var/run/docker/runtime-runc/moby --log /run/containerd/io.containerd.runtime.v2.task/moby/15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19/log.json --log-format json create --bundle /run/containerd/io.containerd.runtime.v2.task/moby/15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19 --pid-file /run/containerd/io.containerd.runtime.v2.task/moby/15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19/init.pid --console-socket /tmp/pty347635701/pty.sock 15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19 + │ │ ├── 29663: runc init + │ │ ├── 29664: runc init + │ │ │ ├── 29686: /bin/bash + │ │ │ │ └── 29687: + │ │ │ └── 29688: /bin/bash + │ │ │ └── 29689: dircolors -b + │ │ └── 29670: runc --root /var/run/docker/runtime-runc/moby --log /run/containerd/io.containerd.runtime.v2.task/moby/15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19/log.json --log-format json create --bundle /run/containerd/io.containerd.runtime.v2.task/moby/15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19 --pid-file /run/containerd/io.containerd.runtime.v2.task/moby/15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19/init.pid --console-socket /tmp/pty347635701/pty.sock 15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19 + │ ├── 29698: + │ │ ├── 29705: runc init + │ │ ├── 29707: runc init + │ │ └── 29709: runc init + │ │ ├── 29715: bash + │ │ │ └── 29716: bash + │ │ ├── 29717: bash + │ │ │ └── 29718: bash + │ │ └── 29723: bash + │ └── 29749: /usr/bin/containerd-shim-runc-v2 -namespace moby -id 15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19 -address /run/containerd/containerd.sock + └── 29758: /usr/bin/containerd + └── 29765: /usr/bin/containerd-shim-runc-v2 -namespace moby -address /run/containerd/containerd.sock -publish-binary /usr/bin/containerd -id 15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19 -bundle /run/containerd/io.containerd.runtime.v2.task/moby/15dbc96260a73fe3b7cae2ccefb70f6982f291429a9664fb95f44a6833468f19 delete -- cgit v1.2.3-70-g09d2