[strace/strace] tracing all children of an already started program. (#193)

Renaud Métrich rmetrich at redhat.com
Tue Nov 30 09:26:01 UTC 2021


Could be useful indeed.

Ideally the command should freeze the cgroup first (to avoid spawning 
new children).

Currently with $(cat /sys/fs/...) some children may be missed.

Renaud.

On 11/29/21 23:10, Masatake YAMATO wrote:
>> I personally use this:
>>
>> strace -p "$(cat
>> /sys/fs/cgroup/system.slice/httpd.service/{cgroup.procs,tasks})"
>>
>> Works for both cgroup versions.
> I wonder how useful if we have following option(s):
>
>    strace --cgroup=system.slice/httpd.service
>
> and/or
>
>    strace --systemd-unit=httpd.service
>
> .
>
>> On 11/24/21 09:34, Masatake YAMATO via Strace-devel wrote:
>>
>>>      Yep.. I was just saying it would be a nice feature to have in the
>>>      same program without using external ones.
>>>
>>> I agree with you if more than one program, pstree, pidof, grep and/or
>>> sed are needed.
>>> However, I think just one, pgrep (or pidof) is acceptable.
>>> If strace introduces an option implementing the feature requested
>>> here, the user must remember the option to enable the feature.
>>> |[tab]| key with a modern shell may help us but remembering the command
>>> |fragment, |-p "$(...)"| is not hard for me.
>>>
>>> I was directly taught this fragment by @ldv-alt
>>> <https://github.com/ldv-alt>, the maintainer of strace!
>>> https://lists.strace.io/pipermail/strace-devel/2018-March/007950.html
>>> https://lists.strace.io/pipermail/strace-devel/2018-March/007951.html
>>>
>>> The lesson was not free. I had to submit a patch to procps-ng as fee.
>>> https://gitlab.com/procps-ng/procps/-/merge_requests/58
>>>
>>>>>> You are receiving this because you are subscribed to this thread.
>>> Reply to this email directly, view it on GitHub
>>> <https://github.com/strace/strace/issues/193#issuecomment-977648655>,
>>> or unsubscribe
>>> <https://github.com/notifications/unsubscribe-auth/AOVBTR3SFUBKDHKP6Y65623UNSPSXANCNFSM5DM7G7EA>.
>>> Triage notifications on the go with GitHub Mobile for iOS
>>> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
>>> or Android
>>> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20211130/3b79f8c0/attachment.bin>


More information about the Strace-devel mailing list