While most Unix-like systems use 16-bit user IDs,
Linux supports 32-bit UIDs since version 2.6.
UIDs above 65535 are used for UID namespacing of containers,
where a container has its own set of 16-bit user IDs.
Processes in such containers will have (much) larger UIDs than 65535.
Because the current format strings for `ST_UID` and `USER`
are `%5d` and `%9d` respectively, processes with such UIDs
lead to misaligned columns.
Dynamically scale the `ST_UID` column and increase the size of `USER`
to 10 characters (length of UINT32_MAX) to ensure that the user ID always fits.
Additionally: clean up how the titlebuffer size calculation and ensure
the PID column has a minimum size of 5.
[PROCESSOR]={.name="PROCESSOR",.title="CPU ",.description="Id of the CPU the process last executed on",.flags=0,},
[M_VIRT]={.name="M_VIRT",.title=" VIRT ",.description="Total program size in virtual memory",.flags=0,.defaultSortDesc=true,},
[M_RESIDENT]={.name="M_RESIDENT",.title=" RES ",.description="Resident set size, size of the text and data sections, plus stack usage",.flags=0,.defaultSortDesc=true,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[PERCENT_CPU]={.name="PERCENT_CPU",.title="CPU% ",.description="Percentage of the CPU time the process used in the last sampling",.flags=0,.defaultSortDesc=true,},
[PERCENT_NORM_CPU]={.name="PERCENT_NORM_CPU",.title="NCPU%",.description="Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)",.flags=0,.defaultSortDesc=true,},
[PERCENT_MEM]={.name="PERCENT_MEM",.title="MEM% ",.description="Percentage of the memory the process is using, based on resident memory size",.flags=0,.defaultSortDesc=true,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[TIME]={.name="TIME",.title=" TIME+ ",.description="Total time the process has spent in user and system time",.flags=0,.defaultSortDesc=true,},
[NLWP]={.name="NLWP",.title="NLWP ",.description="Number of threads in the process",.flags=0,},
[TGID]={.name="TGID",.title="TGID",.description="Thread group ID (i.e. process ID)",.flags=0,.pidColumn=true,},
[PROCESSOR]={.name="PROCESSOR",.title="CPU ",.description="Id of the CPU the process last executed on",.flags=0,},
[M_VIRT]={.name="M_VIRT",.title=" VIRT ",.description="Total program size in virtual memory",.flags=0,.defaultSortDesc=true,},
[M_RESIDENT]={.name="M_RESIDENT",.title=" RES ",.description="Resident set size, size of the text and data sections, plus stack usage",.flags=0,.defaultSortDesc=true,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[PERCENT_CPU]={.name="PERCENT_CPU",.title="CPU% ",.description="Percentage of the CPU time the process used in the last sampling",.flags=0,.defaultSortDesc=true,},
[PERCENT_NORM_CPU]={.name="PERCENT_NORM_CPU",.title="NCPU%",.description="Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)",.flags=0,.defaultSortDesc=true,},
[PERCENT_MEM]={.name="PERCENT_MEM",.title="MEM% ",.description="Percentage of the memory the process is using, based on resident memory size",.flags=0,.defaultSortDesc=true,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[TIME]={.name="TIME",.title=" TIME+ ",.description="Total time the process has spent in user and system time",.flags=0,.defaultSortDesc=true,},
[NLWP]={.name="NLWP",.title="NLWP ",.description="Number of threads in the process",.flags=0,},
[TGID]={.name="TGID",.title="TGID",.description="Thread group ID (i.e. process ID)",.flags=0,.pidColumn=true,},
[PROCESSOR]={.name="PROCESSOR",.title="CPU ",.description="Id of the CPU the process last executed on",.flags=0,},
[M_VIRT]={.name="M_VIRT",.title=" VIRT ",.description="Total program size in virtual memory",.flags=0,.defaultSortDesc=true,},
[M_RESIDENT]={.name="M_RESIDENT",.title=" RES ",.description="Resident set size, size of the text and data sections, plus stack usage",.flags=0,.defaultSortDesc=true,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[PERCENT_CPU]={.name="PERCENT_CPU",.title="CPU% ",.description="Percentage of the CPU time the process used in the last sampling",.flags=0,.defaultSortDesc=true,},
[PERCENT_NORM_CPU]={.name="PERCENT_NORM_CPU",.title="NCPU%",.description="Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)",.flags=0,.defaultSortDesc=true,},
[PERCENT_MEM]={.name="PERCENT_MEM",.title="MEM% ",.description="Percentage of the memory the process is using, based on resident memory size",.flags=0,.defaultSortDesc=true,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[TIME]={.name="TIME",.title=" TIME+ ",.description="Total time the process has spent in user and system time",.flags=0,.defaultSortDesc=true,},
[NLWP]={.name="NLWP",.title="NLWP ",.description="Number of threads in the process",.flags=0,.defaultSortDesc=true,},
[TGID]={.name="TGID",.title="TGID",.description="Thread group ID (i.e. process ID)",.flags=0,.pidColumn=true,},
[M_TRS]={.name="M_TRS",.title=" CODE ",.description="Size of the text segment of the process",.flags=0,.defaultSortDesc=true,},
[M_DRS]={.name="M_DRS",.title=" DATA ",.description="Size of the data segment plus stack usage of the process",.flags=0,.defaultSortDesc=true,},
[M_LRS]={.name="M_LRS",.title=" LIB ",.description="The library size of the process (calculated from memory maps)",.flags=PROCESS_FLAG_LINUX_LRS_FIX,.defaultSortDesc=true,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[PERCENT_CPU]={.name="PERCENT_CPU",.title="CPU% ",.description="Percentage of the CPU time the process used in the last sampling",.flags=0,.defaultSortDesc=true,},
[PERCENT_NORM_CPU]={.name="PERCENT_NORM_CPU",.title="NCPU%",.description="Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)",.flags=0,.defaultSortDesc=true,},
[PERCENT_MEM]={.name="PERCENT_MEM",.title="MEM% ",.description="Percentage of the memory the process is using, based on resident memory size",.flags=0,.defaultSortDesc=true,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[TIME]={.name="TIME",.title=" TIME+ ",.description="Total time the process has spent in user and system time",.flags=0,.defaultSortDesc=true,},
[NLWP]={.name="NLWP",.title="NLWP ",.description="Number of threads in the process",.flags=0,.defaultSortDesc=true,},
[TGID]={.name="TGID",.title="TGID",.description="Thread group ID (i.e. process ID)",.flags=0,.pidColumn=true,},
[M_DRS]={.name="M_DRS",.title=" DATA ",.description="Size of the data segment plus stack usage of the process",.flags=0,.defaultSortDesc=true,},
[M_LRS]={.name="M_LRS",.title=" LIB ",.description="The library size of the process (unused since Linux 2.6; always 0)",.flags=0,.defaultSortDesc=true,},
[M_DT]={.name="M_DT",.title=" DIRTY ",.description="Size of the dirty pages of the process (unused since Linux 2.6; always 0)",.flags=0,.defaultSortDesc=true,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[PERCENT_CPU]={.name="PERCENT_CPU",.title="CPU% ",.description="Percentage of the CPU time the process used in the last sampling",.flags=0,.defaultSortDesc=true,},
[PERCENT_NORM_CPU]={.name="PERCENT_NORM_CPU",.title="NCPU%",.description="Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)",.flags=0,.defaultSortDesc=true,},
[PERCENT_MEM]={.name="PERCENT_MEM",.title="MEM% ",.description="Percentage of the memory the process is using, based on resident memory size",.flags=0,.defaultSortDesc=true,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[TIME]={.name="TIME",.title=" TIME+ ",.description="Total time the process has spent in user and system time",.flags=0,.defaultSortDesc=true,},
[NLWP]={.name="NLWP",.title="NLWP ",.description="Number of threads in the process",.flags=0,.defaultSortDesc=true,},
[TGID]={.name="TGID",.title="TGID",.description="Thread group ID (i.e. process ID)",.flags=0,},
[PROCESSOR]={.name="PROCESSOR",.title="CPU ",.description="Id of the CPU the process last executed on",.flags=0,},
[M_VIRT]={.name="M_VIRT",.title=" VIRT ",.description="Total program size in virtual memory",.flags=0,.defaultSortDesc=true,},
[M_RESIDENT]={.name="M_RESIDENT",.title=" RES ",.description="Resident set size, size of the text and data sections, plus stack usage",.flags=0,.defaultSortDesc=true,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[PERCENT_CPU]={.name="PERCENT_CPU",.title="CPU% ",.description="Percentage of the CPU time the process used in the last sampling",.flags=0,.defaultSortDesc=true,},
[PERCENT_NORM_CPU]={.name="PERCENT_NORM_CPU",.title="NCPU%",.description="Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)",.flags=0,.defaultSortDesc=true,},
[PERCENT_MEM]={.name="PERCENT_MEM",.title="MEM% ",.description="Percentage of the memory the process is using, based on resident memory size",.flags=0,.defaultSortDesc=true,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[TIME]={.name="TIME",.title=" TIME+ ",.description="Total time the process has spent in user and system time",.flags=0,.defaultSortDesc=true,},
[NLWP]={.name="NLWP",.title="NLWP ",.description="Number of threads in the process",.flags=0,},
[TGID]={.name="TGID",.title="TGID",.description="Thread group ID (i.e. process ID)",.flags=0,.pidColumn=true,},
[PROCESSOR]={.name="PROCESSOR",.title="CPU ",.description="Id of the CPU the process last executed on",.flags=0,},
[M_VIRT]={.name="M_VIRT",.title=" VIRT ",.description="Total program size in virtual memory",.flags=0,.defaultSortDesc=true,},
[M_RESIDENT]={.name="M_RESIDENT",.title=" RES ",.description="Resident set size, size of the text and data sections, plus stack usage",.flags=0,.defaultSortDesc=true,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[ST_UID]={.name="ST_UID",.title="UID",.description="User ID of the process owner",.flags=0,},
[PERCENT_CPU]={.name="PERCENT_CPU",.title="CPU% ",.description="Percentage of the CPU time the process used in the last sampling",.flags=0,.defaultSortDesc=true,},
[PERCENT_NORM_CPU]={.name="PERCENT_NORM_CPU",.title="NCPU%",.description="Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)",.flags=0,.defaultSortDesc=true,},
[PERCENT_MEM]={.name="PERCENT_MEM",.title="MEM% ",.description="Percentage of the memory the process is using, based on resident memory size",.flags=0,.defaultSortDesc=true,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[USER]={.name="USER",.title="USER ",.description="Username of the process owner (or user ID if name cannot be determined)",.flags=0,},
[TIME]={.name="TIME",.title=" TIME+ ",.description="Total time the process has spent in user and system time",.flags=0,.defaultSortDesc=true,},
[NLWP]={.name="NLWP",.title="NLWP ",.description="Number of threads in the process",.flags=0,},
[TGID]={.name="TGID",.title="TGID",.description="Thread group ID (i.e. process ID)",.flags=0,.pidColumn=true,},