Package: qps
Version: 1.9.18.6-2.1
Severity: wishlist
Tags: patch
I have included a small patch that makes qps recognize the newer
scheduling priorities: batch, iso, and idle. I could not thing of good
2 letter abbreviations for them, so I went with 3 letters, which seems
to display just fine.
I also added the extra policies to the scheduling dialog popup.
diff -Nur qps-1.9.18.6.orig/proc_linux.cpp qps-1.9.18.6-2.1.ow/proc_linux.cpp
--- qps-1.9.18.6.orig/proc_linux.cpp 2006-08-29 14:03:21.000000000 -0700
+++ qps-1.9.18.6-2.1.ow/proc_linux.cpp 2008-03-20 13:50:26.000000000 -0700
@@ -27,6 +27,7 @@
#include "wchan.h"
#include "details.h"
#include "misc.h"
+#include "sched_extra.h"
#include <qmessagebox.h>
@@ -1215,6 +1216,12 @@
s = "RR"; break; // round-robin
case SCHED_OTHER:
s = "TS"; break; // time-sharing
+ case SCHED_BATCH:
+ s = "BAT"; break; // batch
+ case SCHED_ISO:
+ s = "ISO"; break; // iso
+ case SCHED_IDLE:
+ s = "IDL"; break; // idle
default:
s = "??"; break;
}
diff -Nur qps-1.9.18.6.orig/sched_extra.h qps-1.9.18.6-2.1.ow/sched_extra.h
--- qps-1.9.18.6.orig/sched_extra.h 1969-12-31 16:00:00.000000000 -0800
+++ qps-1.9.18.6-2.1.ow/sched_extra.h 2008-03-20 13:47:32.000000000 -0700
@@ -0,0 +1,17 @@
+// sched_extra.h
+//
+// This program is free software. See the file COPYING for details.
+// Author for this file: Omen Wild, 2008
+
+#ifndef SCHED_EXTRA_H
+#define SCHED_EXTRA_H
+
+#ifndef SCHED_ISO
+#define SCHED_ISO 4
+#endif
+
+#ifndef SCHED_IDLE
+#define SCHED_IDLE 5
+#endif
+
+#endif // SCHED_EXTRA_H
diff -Nur qps-1.9.18.6.orig/scheddlg.cpp qps-1.9.18.6-2.1.ow/scheddlg.cpp
--- qps-1.9.18.6.orig/scheddlg.cpp 2005-01-21 07:37:36.000000000 -0800
+++ qps-1.9.18.6-2.1.ow/scheddlg.cpp 2008-03-24 11:29:25.000000000 -0700
@@ -7,6 +7,7 @@
#include "scheddlg.h"
#include "dialogs.h"
+#include "sched_extra.h"
#include <qpushbutton.h>
#include <qaccel.h>
@@ -20,7 +21,7 @@
QPushButton *ok, *cancel;
ok = new QPushButton("OK", this);
- ok->setGeometry(70, 130, 64, 24);
+ ok->setGeometry(70, 205, 64, 24);
connect(ok, SIGNAL(clicked()), SLOT(done_dialog()));
cancel = new QPushButton("Cancel", this);
cancel->setGeometry(310, ok->y(), ok->width(), ok->height());
@@ -37,7 +38,16 @@
rb_rr = new QRadioButton("SCHED_RR (real-time)", bgrp);
rb_rr->setGeometry(rb_fifo->x(), rb_fifo->y() + 25,
rb_other->width(), rb_other->height());
- bgrp->setGeometry(10, 10, 240, 105);
+ rb_batch = new QRadioButton("SCHED_BATCH (batch processing)", bgrp);
+ rb_batch->setGeometry(rb_rr->x(), rb_rr->y() + 25,
+ rb_other->width(), rb_other->height());
+ rb_iso = new QRadioButton("SCHED_ISO (user real-time)", bgrp);
+ rb_iso->setGeometry(rb_batch->x(), rb_batch->y() + 25,
+ rb_other->width(), rb_other->height());
+ rb_idle = new QRadioButton("SCHED_IDLE (idle)", bgrp);
+ rb_idle->setGeometry(rb_iso->x(), rb_iso->y() + 25,
+ rb_other->width(), rb_other->height());
+ bgrp->setGeometry(10, 10, 240, 180);
connect(bgrp, SIGNAL(clicked(int)), SLOT(button_clicked(int)));
int active = 0;
@@ -48,6 +58,12 @@
active = 1; break;
case SCHED_RR:
active = 2; break;
+ case SCHED_BATCH:
+ active = 3; break;
+ case SCHED_ISO:
+ active = 4; break;
+ case SCHED_IDLE:
+ active = 5; break;
}
((QRadioButton *)(bgrp->find(active)))->setChecked(TRUE);
out_policy = policy;
@@ -84,12 +100,18 @@
out_policy = SCHED_RR;
else if(rb_fifo->isChecked())
out_policy = SCHED_FIFO;
+ else if(rb_batch->isChecked())
+ out_policy = SCHED_BATCH;
+ else if(rb_iso->isChecked())
+ out_policy = SCHED_ISO;
+ else if(rb_idle->isChecked())
+ out_policy = SCHED_IDLE;
else
out_policy = SCHED_OTHER;
QString s(lined->text());
bool ok;
out_prio = s.toInt(&ok);
- if(out_policy != SCHED_OTHER && (!ok || out_prio < 1 || out_prio > 99)) {
+ if((out_policy == SCHED_RR || out_policy == SCHED_FIFO) && (!ok ||
out_prio < 1 || out_prio > 99)) {
QMessageBox::warning(this, "Invalid Input",
"The priority must be in the range 1..99");
} else
@@ -98,7 +120,7 @@
void SchedDialog::button_clicked(int id)
{
- if(id == 0) {
+ if(id == 0 || id == 3 || id == 4 || id == 5) {
lbl->setEnabled(FALSE);
lined->setEnabled(FALSE);
} else {
diff -Nur qps-1.9.18.6.orig/scheddlg.h qps-1.9.18.6-2.1.ow/scheddlg.h
--- qps-1.9.18.6.orig/scheddlg.h 2005-01-17 16:22:32.000000000 -0800
+++ qps-1.9.18.6-2.1.ow/scheddlg.h 2008-03-20 13:48:11.000000000 -0700
@@ -26,7 +26,7 @@
private:
QButtonGroup *bgrp;
- QRadioButton *rb_other, *rb_fifo, *rb_rr;
+ QRadioButton *rb_other, *rb_fifo, *rb_rr, *rb_batch, *rb_iso, *rb_idle;
QLabel *lbl;
QLineEdit *lined;
};
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.22.6-ck1-1
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Versions of packages qps depends on:
ii libc6 2.7-9 GNU C Library: Shared libraries
ii libgcc1 1:4.3.0-1 GCC support library
ii libqt3-mt 3:3.3.8b-4 Qt GUI Library (Threaded runtime v
ii libstdc++6 4.3.0-1 The GNU Standard C++ Library v3
ii libx11-6 2:1.0.3-7 X11 client-side library
ii libxext6 2:1.0.4-1 X11 miscellaneous extension librar
qps recommends no packages.
-- no debconf information
--
Don't take life too seriously or you'll never get out of it alive.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]