From 58a59c11f419bcda1d8b5852f11eb183848f3496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sat, 28 Aug 2021 17:57:39 +0200 Subject: linux: drop dead process field column DIRTY The field for dirty pages in /proc/[pid]/statm is always 0 since Linux 2.6 (see man:proc(5)). --- linux/LinuxProcess.c | 4 ---- linux/LinuxProcess.h | 1 - linux/LinuxProcessList.c | 4 ++-- linux/ProcessField.h | 1 - 4 files changed, 2 insertions(+), 8 deletions(-) (limited to 'linux') diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index 31da6e41..e5c5e83b 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -56,7 +56,6 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { [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, }, - [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, }, [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, }, @@ -210,7 +209,6 @@ static void LinuxProcess_writeField(const Process* this, RichString* str, Proces case CMINFLT: Process_printCount(str, lp->cminflt, coloring); return; case CMAJFLT: Process_printCount(str, lp->cmajflt, coloring); return; case M_DRS: Process_printBytes(str, lp->m_drs * pageSize, coloring); return; - case M_DT: Process_printBytes(str, lp->m_dt * pageSize, coloring); return; case M_LRS: if (lp->m_lrs) { Process_printBytes(str, lp->m_lrs * pageSize, coloring); @@ -330,8 +328,6 @@ static int LinuxProcess_compareByKey(const Process* v1, const Process* v2, Proce switch (key) { case M_DRS: return SPACESHIP_NUMBER(p1->m_drs, p2->m_drs); - case M_DT: - return SPACESHIP_NUMBER(p1->m_dt, p2->m_dt); case M_LRS: return SPACESHIP_NUMBER(p1->m_lrs, p2->m_lrs); case M_TRS: diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h index 9c4f27ea..20399d98 100644 --- a/linux/LinuxProcess.h +++ b/linux/LinuxProcess.h @@ -47,7 +47,6 @@ typedef struct LinuxProcess_ { long m_trs; long m_drs; long m_lrs; - long m_dt; /* Data read (in bytes) */ unsigned long long io_rchar; diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 5c5beedb..487a4dfa 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -678,7 +678,7 @@ static bool LinuxProcessList_readStatmFile(LinuxProcess* process, openat_arg_t p if (!statmfile) return false; - long int dummy; + long int dummy, dummy2; int r = fscanf(statmfile, "%ld %ld %ld %ld %ld %ld %ld", &process->super.m_virt, @@ -687,7 +687,7 @@ static bool LinuxProcessList_readStatmFile(LinuxProcess* process, openat_arg_t p &process->m_trs, &dummy, /* unused since Linux 2.6; always 0 */ &process->m_drs, - &process->m_dt); + &dummy2); /* unused since Linux 2.6; always 0 */ fclose(statmfile); if (r == 7) { diff --git a/linux/ProcessField.h b/linux/ProcessField.h index d109ff9d..69bdff0b 100644 --- a/linux/ProcessField.h +++ b/linux/ProcessField.h @@ -19,7 +19,6 @@ in the source distribution for its full text. M_TRS = 42, \ M_DRS = 43, \ M_LRS = 44, \ - M_DT = 45, \ CTID = 100, \ VPID = 101, \ VXID = 102, \ -- cgit v1.2.3