From f56c8014f7b3aa5f6b5591b5433d8a0b22d55ba4 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 5 Apr 2007 20:13:32 +0000 Subject: [PATCH] Apply patches by Matthias Lederhofer adding extra memory status fields --- ChangeLog | 8 ++++++++ Process.c | 16 ++++++++++++++++ ProcessList.c | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c1652a32..92ba2914 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +What's new in version 0.6.6 + +* Added display of DRS, DT, LRS and TRS + (thanks to Matthias Lederhofer) +* BUGFIX: LRS and DRS memory values were flipped + (thanks to Matthias Lederhofer) +* BUGFIX: Don't crash on very high UIDs + (thanks to Egmont Koblinger) What's new in version 0.6.5 diff --git a/Process.c b/Process.c index 6bfd2de9..a10c6ae0 100644 --- a/Process.c +++ b/Process.c @@ -316,6 +316,10 @@ void Process_writeField(Process* this, RichString* str, ProcessField field) { : attr; break; } + case M_DRS: Process_printLargeNumber(this, str, this->m_drs * PAGE_SIZE); return; + case M_DT: Process_printLargeNumber(this, str, this->m_dt * PAGE_SIZE); return; + case M_LRS: Process_printLargeNumber(this, str, this->m_lrs * PAGE_SIZE); return; + case M_TRS: Process_printLargeNumber(this, str, this->m_trs * PAGE_SIZE); return; case M_SIZE: Process_printLargeNumber(this, str, this->m_size * PAGE_SIZE); return; case M_RESIDENT: Process_printLargeNumber(this, str, this->m_resident * PAGE_SIZE); return; case M_SHARE: Process_printLargeNumber(this, str, this->m_share * PAGE_SIZE); return; @@ -391,6 +395,14 @@ int Process_compare(const void* v1, const void* v2) { return (p1->state - p2->state); case NICE: return (p1->nice - p2->nice); + case M_DRS: + return (p2->m_drs - p1->m_drs); + case M_DT: + return (p2->m_dt - p1->m_dt); + case M_LRS: + return (p2->m_lrs - p1->m_lrs); + case M_TRS: + return (p2->m_trs - p1->m_trs); case M_SIZE: return (p2->m_size - p1->m_size); case M_RESIDENT: @@ -427,6 +439,10 @@ char* Process_printField(ProcessField field) { case STATE: return "S "; case PRIORITY: return "PRI "; case NICE: return " NI "; + case M_DRS: return " DATA "; + case M_DT: return " DIRTY "; + case M_LRS: return " LIB "; + case M_TRS: return " CODE "; case M_SIZE: return " VIRT "; case M_RESIDENT: return " RES "; case M_SHARE: return " SHR "; diff --git a/ProcessList.c b/ProcessList.c index 281d9df0..aa359f03 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -555,7 +555,7 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl } int num = ProcessList_fread(this, status, "%d %d %d %d %d %d %d", &process->m_size, &process->m_resident, &process->m_share, - &process->m_trs, &process->m_drs, &process->m_lrs, + &process->m_trs, &process->m_lrs, &process->m_drs, &process->m_dt); fclose(status);