<p></p>
<p>When you are tracing multiple different processes (with <code>-f -ff</code> options) when trying to understand what a system does, it is difficult later to understand what log file belongs to what process. There could be an option for automatic renaming the logs based on <code>argv[0]</code> supplied to <code>execve</code> syscall. I.e. with the proposed options you would get logs named like:</p>
<ul>
<li>bash-1234.log</li>
<li>cp-1235.log</li>
</ul>
<p>To make it possible, strace needs to:</p>
<ol>
<li>read executable name at the time of attaching to some PID,</li>
<li>on the forking and cloning inherit that name,</li>
<li>but rename a file on <code>execve</code>.</li>
</ol>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/strace/strace/issues/153">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AOVBTR646WWEIDVQNCXFH23SET6E5ANCNFSM4Q6O3NMA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AOVBTRYQAB7WCJQ754VW2QLSET6E5A5CNFSM4Q6O3NMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KLQLAVA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/strace/strace/issues/153",
"url": "https://github.com/strace/strace/issues/153",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>