Giter Site home page Giter Site logo

qps's Introduction

Qt Process Manager

Qps

Custom fields

Building

Requirements:

License

Qps is licensed under the terms of the GPLv2 or any later version.

Binary packages

Official binary packages are provided by most major Linux and BSD distributions. Just use your package manager to search for string qps.

Translation

Translations can be done in LXQt-Weblate

Translation status

qps's People

Contributors

agaida avatar atalanttore avatar eltonfabricio10 avatar fastcat avatar fasthyun avatar iamthesenate1 avatar luis-pereira avatar lxqtbot avatar mbouzada avatar micrococo avatar milotype avatar nerdv2 avatar nico202 avatar oliverburkardt avatar p-bo avatar paulolieuthier avatar rbuj avatar roxfr avatar scootergrisen avatar shlyakpavel avatar smarquespt avatar snagcu avatar stefonarch avatar toni-estevez avatar tsimonq2 avatar tsujan avatar vili1 avatar welaq avatar yarons avatar zextorbg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qps's Issues

lxqt-build-tools minimum version requirement is a bit too strict

Since 1.10.19, qps's build requires lxqt-build-tools. CMakeLists.txt enforces a minimum version of 0.6.0. Tests show that 0.5.0 is sufficient for building.

Expected Behavior

Build successfully with lxqt-build-tools 0.5.0.

Current Behavior

Refuses to build with lxqt-build-tools before 0.6.0.

Possible Solution

In CMakeLists.txt, change the setting of LXQTBT_MINIMUM_VERSION from 0.6.0 to 0.5.0. (Sorry, to banal for a PR.)

Steps to Reproduce (for bugs)
Context

I couldn't build on Fedora F29, which provides lxqt-build-tools 0.5.0. 0.6.0 was only released a few days ago, and many distributions will be behind.

(Fedora F28 still provides 0.3.2 for some reason. Spoiler: 0.3.2 isn't sufficient for building.)

I haven't actually tested the resulting binary yet, but I assume lxqt-build-tools only affects the build process.

System Information
  • Distribution & Version: Fedora F29
  • Kernel: irrelevant
  • Qt Version:
  • Package version: 1.10.19

add desktop entry file

Currently there's no desktop entry file.

Proposal regarding the file itself

[Desktop Entry]
Type=Application
Name=qps
GenericName=Qt process manager
Comment=Qt application to display and manage running processes
Icon=qps
Categories=System;
TryExec=qps
Exec=qps
Terminal=false
StartupNotify=false

Adding this file would obviously involve that an icon is added as well. In my opinion the most suitable choice would be to copy icon/icon.xpm to /usr/share/icons/hicolor/48x48/apps/qps.xpm.

XPM files aren't recommended any longer but still supported by the Specification. In the long rung substitution with a more suitable file type and / or even another icon as a whole is probably something worth considering.
Different story, of course.

Not an issue: The About dialog could be cleaner

The same texts are repeated in it, above the scroll view and inside it. The title (above the scroll view) can just be "Qps VERSION" and, maybe, its icon -- as if there's nothing more important to fix ;)

Russian translation

@agaida this is probably a comment for you
This project has two Russian translations on weblate: ru_RU and ru
ru is 100% complete and nice
ru_RU is almost nothing
However, qt loads ru_RU by default so the translation is broken. Could you please delete ru_RU and keep only ru?

Colors of `TableBody::paintCell` are a joke

At the time Qps was created, they might seem serious. I found the problem only with a special Kvantum theme -- Kvantum is good at revealing incorrect style codes.

Will correct it soon.

Security issue

qps/src/proc.cpp

Lines 234 to 262 in c78b406

int proc_pid_fd(const int pid)
{
char path[256];
char buffer[256], fname[256];
DIR *d;
int fdnum;
int len, path_len;
sprintf(path, "/proc/%d/fd", pid);
path_len = strlen(path);
d = opendir(path);
if (!d)
{
// this happend when the process died already or Zombie process
// printf("Qps : read fail !! /proc/%d/fd !!! kernel bug ?
// \n",pid);
return false;
}
struct dirent *e;
while ((e = readdir(d)) != 0)
{
if (e->d_name[0] == '.')
continue; // skip "." and ".."
path[path_len] = '/';
path[path_len + 1] = 0;

Path > 256 chars can cause overflow. I am afraid it can be used to rewrite stack return address and cause privilege escalation for some process.
The function returns true anyway. So the proposal is either to get rid of the code or to switch it to use QString instead to these creepy char arrays.
Any ideas here?

Part of code I need help with

qps/src/wchan.cpp

Lines 99 to 100 in 2034ade

mmap(sysmap + ((sysmap_size + ps - 1) & ~(ps - 1)), ps,
PROT_READ, MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);

This call has obviously no sense but to leak resources. However, I do not understand the code logic. Would should the function above do? I really hope some of you guys can understand it better and give me a clue or fix it.

misnaming of binary qps

Due to a regression in 56d9096 the actual binary gets named Project instead of qps.

E. g. running

cmake <path to sources> -DCMAKE_INSTALL_PREFIX=/usr
make
make install

from a suitable build dir yields /usr/bin/Project instead of /usr/bin/qps.

faulty alignment of PIDs in tree view, column width

By default the alignment of PIDs in tree view is frequently faulty in levels ≥ 3 like in this screenshot

qps_pid-alignment

The problem doesn't seem to exist right after launching qps but affects the majority of the said PIDs once the view was updated automatically several times.

Maybe it's due to column PID not being wide enough and could be fixed by making the columns' width adjustable.
This could probably best be achieved by making the spacer between the headers draggable, e. g. between PID and TTY, TTY and USER and so on when Basic Fields is chosen from menu Field. A feature like is desirable independent from this issue anyway.

But attempts to avoid an alignment as shown in the screenshot should be made whether or not it's related to the columns' width.

Qps is a mess with RTL layout

Steps to Reproduce (for bugs)

Use qps -reverse to run Qps and you'll see something whose description would need thousands of words.

Summary - not really a bug

I have changed some things in the last week that was long overdue:

  • Licenses and license headers
  • Removed any not UTF 8 encoding from any file - so we can open the project in KDevelop or the Qt IDE again without hangs or crashes
  • Removed some empty and not used files
  • Removed a generated not used ressource file

TODO

  • Remove some dead code
  • Some kind of code cleanup - code style, trailing whitespaces and so on

That will not change nothing in the functionality nor solve any bugs but might make the code more maintainable.

No unsorted table

An unsorted table doesn't make sense. Although the CPU column is sorted on the first run now, It's still possible to make the table unsorted. It should be prevented.

Will fix it after #177

Sort CPU column at first startup

Although distro maintainer can now do it in their global config files, the sort indicator may show users that they can click other columns and sort them.

Sorting the CPU column by default can also show the update interval on the fist run.

miniHistory time

Hello, I made a patch for display the time in the qps miniHistory (very useful for timing the duration of the "peaks" of processor/IO that a program can generate), I've been trying for a few hours and so far it seems work well. Here I leave the content of this:

--- qps-1.10.16/infobar-original.cpp    2011-07-17 08:20:06.000000000 -0300
+++ qps-1.10.16/infobar.cpp 2015-12-18 03:13:46.378411055 -0300
@@ -7,6 +7,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <time.h>
+#include <string>

 #include "infobar.h"
 #include "proc.h"
@@ -44,6 +45,16 @@
 };
 VCursor vcursor;

+// Convert epoch time to HH:mm:ss
+const std::string formatTime(time_t epoch_seconds) {
+    struct tm  tstruct;
+    char       buf[9];
+    tstruct = *localtime(&epoch_seconds);
+    strftime(buf, sizeof(buf), "%T", &tstruct);
+
+    return buf;
+}
+
 //DEL
 void Infobar::hideEvent( QHideEvent * event ) 
 {
@@ -759,7 +770,7 @@
 } */


-// TODO: 1.sort 2. time(?) 
+// TODO: 1.sort
 QString doHistory(SysHistory *sysh)
 {
    QString str;
@@ -768,7 +779,8 @@

    char buf[128];
    //sprintf(buf,"miniHistory /* %.02f%%",sysh->load_cpu*100);
-   sprintf(buf,"miniHistory CPU");
+   const std::string saved_time = formatTime(sysh->time);
+   sprintf(buf,"miniHistory CPU [%s]", saved_time.c_str());
    str+=QString::fromAscii(buf);

    foreach(p,sysh->procs)
@@ -849,7 +861,7 @@
    update(p.x()-5 -rel_x,0,p.x()+5 -rel_x,height()); // only Vcursor update
 }

-// TODO: 1.sort 2. time 
+// TODO: 1.sort
 QString IO_Graph::doHistoryTXT(SysHistory *sysh)
 {
    QString str;
@@ -858,7 +870,8 @@

    char buf[64],mem_str[64];
    //sprintf(buf,"miniHistory /* %.02f%%",sysh->load_cpu*100);
-   sprintf(buf,"miniHistory IO");
+   const std::string saved_time = formatTime(sysh->time);
+   sprintf(buf,"miniHistory IO [%s]", saved_time.c_str());
    str+=QString::fromAscii(buf);

    foreach(p,sysh->procs)

The patch is for QT4 version because I do not have QT5 due to it being not quite stable in my distribution but it should not be difficult to adapt the code to your fork of the program.
By the way, my knowledge of C and C++ are quite limited so do not rule out that there are more "clean" ways to do the same.
PS: If you need to clarify, the patch is released under public domain. ;-)

Memory leak on some desktop environments

In less than 19 minutes it can take more memory than gnome shell
image
#149 helped a little, but there is still a huge leak left somewhere else.
My proposal is to track everything regarding the leaks here.

Tree mode is a mess

To see the mess, just enable the tree mode. I'll fix it alongside #170 because it's related to cell painting.

Why is this report so short ? See #171

fix licensing

The code lacks reasonable information regarding licensing.
An informational file in the root directory doesn't exist, the headers of the actual source files only refer to a file like that.

SWAP size is different

Expected Behavior

I want to watch Swap size.

Current Behavior

SWAP size is very large.
SWAP of Qps and SWAP of Top are different.

Screenshot:
SWAP_screen-A

Possible Solution

https://github.com/lxqt/qps/blob/master/src/proc_linux.cpp#L804
https://github.com/lxqt/qps/blob/master/src/proc_common.cpp#L216

&size:     669587×4096/1024=2678348 kB  (VmSize)
&resident: 102843×4096/1024=411372 kB   (VmRSS)
sizeK:     2678348-411372=2266976 kB    # SWAP field

I think that "&size" is not total memory but virtual memory(VmSize).
So I don't think that value of "sizeK" is Swap size.
I checked it and found it here.

Screenshot:
VmSize_screen-A

Steps to Reproduce (for bugs)
  1. Add SWAP field
  2. Run many appilications
Context

My PC have 2GB memory. Therefore, my PC requires SWAP. I want to watch Swap size.
However, many recent PCs have a lot of memory. SWAP may not be required.
This issue is not important.

System Information
  • Distribution & Version: Ubuntu 18.04.3 LTS (i686)
  • Kernel: 4.15.0-65-generic
  • Qt Version: 5.9.5
  • lxqt-build-tools Version: Build from source
  • Package version: Build from source

Table width and horizontal scrollbar position can be wrong

You may encounter it in special circumstances. For example, when you type a filter that can't be matched (like "blahblah"), the horizontal scrollbar doesn't disappear, although it isn't needed. There are worse scenarios too. In short, the table width and its horizontal scrollbar position may not be updated correctly.

The reason is a few lines of bad code in qttableview.cpp and htable.cpp. I'll fix them after #174 is merged (because of conflicts).

Use a standard config file

Expected Behavior

The config file should be (like) ~/.config/qps/qps.conf and other standard locations should be supported too..

Current Behavior

It's ~/.qpsrc. That's old-fashioned. No app should do it anymore.

Possible Solution

Very easy to implement.

Header DND code has a bug

By design:

(1) The PID field should always be the first section when the tree is shown; and

(2) The command filed should always be the last section.

Because of a mistake in the code, (2) can be contradicted.

I'll fix that alongside two related problems: (a) if a field is added from the context menu, it'll be placed after the command field, which contradicts (2); and (b) the PID and command fields can be dragged but they shouldn't because of (1) and (2).

Sort indicator may be wrong on adding fields

Steps to Reproduce (for bugs)
  1. Sort a column other than the first one.
  2. Add a field by right clicking a header section to the left of the sorted column.

Then, the sort indicator will be moved to the left, while the sorted column is at its right.

System Information
  • Package version: Latest git

Make code history more complete

The good thing is - we have the code now in git, the bad thing is - we have no history, so i will re-build a partly history with old releases.

Font setting is totally wrong

I'll fix it alongside #170 (because it's related to cell painting) but I don't have time to explain it. Just set the font size to 20 in Qps's Preferences and you'll see it (although no one uses 20, it shows a deeper problem).

Sorry for the bad report! I need these reports like a TODO list.

Header isn't painted correctly

In "modern" Qt GUIs (for 10 years, at least), the sorting header section has a sort indicator and isn't sunken. 3 images are worth 3 thousand words. The correct painting is:

With Kvantum:

kvantum

With Fusion:

fusion

With Breeze:

breeze

And so on with any other widget style...

In these images, whose code will be included in a PR, there's no false assumption about header sizes: all sizes are taken from the active widget style.

The result of column DND isn't so predictable

Expected Behavior

The dragged section (column) should be dropped exactly at the cursor position.

Current Behavior

That doesn't happen. Sometimes it's positioned as the next/previous column, sometimes it isn't moved at all.

Possible Solution

The fix is easy. I'll make a PR after #165 is merged.

Sorting issues latest git

Expected Behavior

As a matter of fact - the latest changes were big and great - with a bit of a but.
Process sorting is much better now, but still a bit crappy sometimes - sorry, has to be blunt and straight. I want the visual output of qps reproducible and deterministic, right now it isn't

Current Behavior

Process sorting is not predictable right now fully - we should change it, the current state is not really a 2.0, but very close.

Possible Solution

fixing it

Steps to Reproduce (for bugs)

I have some problems to write up steps to reproduce reliable, because when changing the views filters/sorting are not fully set/reset/applied - so the only thing i can bring are several screenshots:

  • first start in my working machine, does the testing on a laptop - not rigid enough. Still great, but not so easy to interpret - tree view is marked, no sorting indicator visible - no discussions, might be the expected output

the output i would expect first hand:

Reason - it would look a bit irritating otherwise:

(like this)

As i wrote, great work, but a little fine tuning is still needed. To be honest - we can release as 2.0 without a problem, but if it would be easy to solve as a fast shot i would prefer it :D

SEGFAULT with valgrind

Expected Behavior

QPS is running and valgrind is checking it

Current Behavior

segfault on qps->show();

Steps to Reproduce (for bugs)
  1. Build QPS
  2. run valgrind --tool=memcheck --leak-check=yes ./build/src/qps
  3. Get segfault
Context

I was trying to work on memory leaks (the app leaks approximately one megabyte per second on my machine)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.