libproc could use standard lists
libproc has its own implementation of a doubly-linked list and even has macros for the common
list_prev() names. While working on #13925 I wanted to be able to share some improvements to the string tab generation between both the kernel and libproc so gcore and the kernel had the same implementation, which was going to involve the list_t. As such, I decided to try and clean things up so we no longer have a bespoke implementation and use the common one.
Because the list walking logic was involved in the libproc dmod, I made a more common list dmod and made sure that it would generally be loaded in userland as a bunch of things emed the list_t but don't always have a way of making sure a dmod is loaded (which is currently the only thing in libcmdutils). As this is generally hidden in its own .o (something to change at some point), I ended up going and just forcing this to load whenever libc loads.
To test this, I've gone through and focused on the three things we used lists for:
1. File list tracking
2. core lwp tracking
3. fd tracking
For fd tracking, I used
pfiles against 32-bit and 64-bit cores and live processes and made sure that all the file information didn't change. I made sure to use processes and cores that had socket information and made sure that all of the socket IP address, door links, etc. were all here in both.
For lwp tracking, I generally used
pflags as a way to visualize this and bits of mdb. Here I verified that output didn't change across 32-bit and 64-bit cores and processes. I also grabbed a linux core and verified that we still see the thread in it as well. I tested against both single-threaded and multi-threaded processes, including processes with gaps in their thread id space due to doors.
- Loaded up mdb on 32/64-bit cores/processes and verified that
::nmwas exactly the same (no sorting)
- Compared pldd, pmap, and pmap
x on 32/64-bit processes ad cores.
- Used mdb tab completion (recorded via script) to get a dump of ctf types (e.g.
Updated by Electric Monk over 2 years ago
- Status changed from New to Closed
- % Done changed from 50 to 100
commit 50d4d24e9f62b588d2123e06f654ecb230e4857c Author: Robert Mustacchi <email@example.com> Date: 2021-08-17T16:03:20.000Z 13987 libproc could use standard lists Reviewed by: Toomas Soome <firstname.lastname@example.org> Reviewed by: Patrick Mooney <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>