TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Difficulties of Tracking Running Processes on Linux

39 pointsby nyellinalmost 5 years ago

5 comments

kazinatoralmost 5 years ago
Is <i>process accounting</i> so obviously unsuitable to the article author&#x27;s requirements, that it needs no mention at all?<p><a href="https:&#x2F;&#x2F;unix.stackexchange.com&#x2F;questions&#x2F;468909&#x2F;what-does-process-accounting-mean-in-linux" rel="nofollow">https:&#x2F;&#x2F;unix.stackexchange.com&#x2F;questions&#x2F;468909&#x2F;what-does-pr...</a>
评论 #24102630 未加载
peter_d_shermanalmost 5 years ago
To really capture any new process, on an x86 chip at least, you&#x27;d need to implement some kind of hardware callback to the OS whenever a new Task State Segment (TSS) was created in the GDT.<p>Note however, that this wouldn&#x27;t capture new threads that are created inside of existing tasks&#x2F;processes, nor those inside of software emulated virtual machines, and the capture of those, additionally, for logging purposes, might be desirable...<p>But, for future hardware designers out there -- if you&#x27;re going to create a new CPU, then I think a hardware callback for anytime a new task is created -- would be a great addition for your new CPU...<p>Perhaps such a callback could be done in microcode...<p>Also, this callback should work in all nested VM&#x2F;protection levels, from the highest level hypervisor, down to the lowest level OS...<p>Anyway, just thinking aloud...
IvyMikealmost 5 years ago
Worth mentioning the Microsoft(!) Process Monitor for Linux, as well. <a href="https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;ProcMon-for-Linux" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;ProcMon-for-Linux</a><p>The windows procmon is very powerful, but the linux one is still in preview so YMMV.
评论 #24106940 未加载
thedraclealmost 5 years ago
I wrote an eBPF security monitoring tool for an endpoint protection solution that is surprisingly similar to your proposed solution of walking the dentry tree for obtaining the command path.<p>It basically takes a block of memory, and splits it in a static array of arrays, and then walks the dentry tree, copying each portion of the path into it.<p>It then follows and decodes the mount path in a similar way, and it&#x27;s fully recomposed in user space into a single path.<p>I could have done the mount path in userspace too probably by just passing some identifier.
de6u99eralmost 5 years ago
Nice!<p>I find it ways more difficult debugging networking on Linux. It&#x27;s easy to see which ports are in use but finding out which process is using a port is a nightmare to me.
评论 #24110986 未加载
评论 #24106500 未加载