catalinux / pwatch (public) (License: GPLv3) (since 2016-03-01) (hash sha1)
Set of tools to analyze what a process is doing. 'io' command is used to see who is doing I/O.
List of commits:
Subject Hash Author Date (UTC)
Fixed signed/unsigned comparations. d2f4ec58a496a2b2bd9fa1d9e2c7b3018e86a843 Catalin(ux) M. BOIE 2008-05-23 13:09:40
Bump up version to 0.0.2. 9c4880a7e9667b9778796762ae062c8c92128b49 Catalin(ux) M. BOIE 2008-05-23 13:08:57
Replaced racy /proc IO statistics with netlink ones. 8efe54ca3a337a8a3a8e616ae9a07b10f09dd2d3 Catalin(ux) M. BOIE 2008-05-23 12:56:17
Because duilder has support to submit a package for compile, use it. c479890bdb1cadf233038c566543676c156f24ff Catalin(ux) M. BOIE 2008-05-23 12:53:33
Corrected a typo in my name. Yuck! 1ea855aaf23c2dd8106d7a519dfa966a066b14af Catalin(ux) M. BOIE 2008-05-23 12:52:55
Added some and removed some items on the list. 336d4af78cd7d1620cf596c4777a6094b36ddc89 Catalin(ux) M. BOIE 2008-05-23 12:51:56
Made updates to duilder. 4513f326da39ea907ea1cf9d9c80827231da878f Catalin(ux) M. BOIE 2008-05-23 12:50:46
Added -Wextra, so we get more warnings from the compiler. 5cbd93bc6f61d80ed89f2b2e0e2102ec728a5be9 Catalin(ux) M. BOIE 2008-05-23 12:50:00
Ignore Changelog in git. 2309b007547912e3598f69dcb6eb9f629597b791 Catalin(ux) M. BOIE 2008-05-23 12:49:34
Added posibility to show also TB sizes. ea2d2ad8a5e48a6825bd22aaa2635de4ee774cbf Catalin(ux) M. BOIE 2008-05-21 13:56:09
Improved speed of scrolling. c6760d76d067556b58e289a38558efe44f8ccfce Catalin(ux) M. BOIE 2008-01-08 22:45:36
Resizing current screen will trigger a redraw. 75bad458e75c422fb98f407ef634d3b22c5ca0e5 Catalin(ux) M. BOIE 2008-01-08 22:45:15
Now pressing END will go to the last page _and_ to the last line. 1788e9fc6e972ff5ef6323a4a8165f151856c6f4 Catalin(ux) M. BOIE 2008-01-08 22:44:58
Fixed the code so only some keys triggers a redraw of the screen. 0d79d715e92420d8db68772366387a202f9dfc89 Catalin(ux) M. BOIE 2008-01-08 22:44:42
Fixed positioning at the end of list. bfedb7fbce206af12cf5cd03ddf88f670982ea1f Catalin(ux) M. BOIE 2008-01-08 22:44:20
Because name iotop is already taken, renamed iotop to io. a4fc9285d5b4079c98e63363859781451e38d076 Catalin(ux) M. BOIE 2008-01-08 22:43:36
More stuff added to TODO. a01548b432cd10a3792f18dd3bbf2b2f3a8a6c57 Catalin(ux) M. BOIE 2007-11-01 23:44:17
Give warnings instead of exit if some info is not available. 6317c98dd69f6f8177e3bde1409b934b17d53ef9 Catalin(ux) M. BOIE 2007-11-01 23:35:31
Renamed pwatch_counters_avail to pwatch_fdinfo_avail. 44efae853dca6b1f5c50dfdf56cfd0be5bb19792 Catalin(ux) M. BOIE 2007-11-01 23:05:55
Impoved a little the description from spec file. d367b069e3f51be7e159758fc8d9e9a0ef8078bb Catalin(ux) M. BOIE 2007-10-30 09:55:24
Commit d2f4ec58a496a2b2bd9fa1d9e2c7b3018e86a843 - Fixed signed/unsigned comparations.
Author: Catalin(ux) M. BOIE
Author date (UTC): 2008-05-23 13:09
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2008-05-23 13:09
Parent(s): 9c4880a7e9667b9778796762ae062c8c92128b49
Signer:
Signing key:
Signing status: N
Tree: 6eed436074609c6b6803e17015947edc240919c3
File Lines added Lines deleted
src/io.c 26 14
File src/io.c changed (mode: 100644) (index 7f299a8..6dad447)
... ... enum {
32 32 static int max_line_len; static int max_line_len;
33 33 static struct pwatch_proc *head; static struct pwatch_proc *head;
34 34 static unsigned int view = VIEW_NORMAL; static unsigned int view = VIEW_NORMAL;
35 static unsigned int cells = 0;
36 static unsigned int selected_line = 0, last_line = 0, useful_lines = 0;
37 static unsigned int max_pages = 1, page = 0;
35 static int cells = 0;
36 static int selected_line = 0, last_line = 0, useful_lines = 0;
37 static int max_pages = 1, page = 0;
38 38 static pid_t selected_pid = 0; static pid_t selected_pid = 0;
39 39
40 40
 
... ... static void usage(void)
53 53 static void iotop_show_help(void) static void iotop_show_help(void)
54 54 { {
55 55 char buf[256]; char buf[256];
56 int ch, max;
56 int buf_len;
57 int ch;
58 int max;
59
60 buf_len = sizeof(buf);
57 61
58 62 max = max_line_len; max = max_line_len;
59 if (max > sizeof(buf))
60 max = sizeof(buf);
63 if (max > buf_len)
64 max = buf_len;
61 65
62 66 /* wait for a key when calling getch */ /* wait for a key when calling getch */
63 67 nodelay(stdscr, FALSE); nodelay(stdscr, FALSE);
 
... ... static void iotop_show_cells(const unsigned int page,
118 122 { {
119 123 struct pwatch_proc *p; struct pwatch_proc *p;
120 124 char buf[256]; char buf[256];
121 int max, line, skip;
125 int buf_len;
126 int line, skip, max;
122 127 char rb[16], wb[16]; char rb[16], wb[16];
123 128 char rs[16], ws[16]; char rs[16], ws[16];
124 129
130 buf_len = sizeof(buf);
131
125 132 max = max_line_len; max = max_line_len;
126 if (max > sizeof(buf))
127 max = sizeof(buf);
133 if (max > buf_len)
134 max = buf_len;
128 135
129 136 /* skip is the number of entries we have to skip */ /* skip is the number of entries we have to skip */
130 137 skip = useful_lines * page; skip = useful_lines * page;
 
... ... static void iotop_show_cells(const unsigned int page,
176 183 static void iotop_show_process(void) static void iotop_show_process(void)
177 184 { {
178 185 struct pwatch_fd *ifd; struct pwatch_fd *ifd;
179 unsigned int lines_per_page, line, max;
186 int lines_per_page, line, max;
180 187 char buf[4096], flags[32]; char buf[4096], flags[32];
188 int buf_len;
181 189 struct pwatch_proc *proc; struct pwatch_proc *proc;
182 190
191 buf_len = sizeof(buf);
192
183 193 max = max_line_len; max = max_line_len;
184 if (max > sizeof(buf))
185 max = sizeof(buf);
194 if (max > buf_len)
195 max = buf_len;
186 196
187 197 proc = pwatch_proc_get(head, selected_pid); proc = pwatch_proc_get(head, selected_pid);
188 198 if (!proc) { if (!proc) {
 
... ... int main(int argc, char *argv[])
291 301 unsigned int re_sort = 0, force_sort; unsigned int re_sort = 0, force_sort;
292 302 char s_sort[256]; char s_sort[256];
293 303 char status[256]; char status[256];
304 int status_len;
294 305 int c; int c;
295 306 unsigned long refresh_rate = 1; unsigned long refresh_rate = 1;
296 307 unsigned int refresh_count = 0, refresh_steps; unsigned int refresh_count = 0, refresh_steps;
 
... ... int main(int argc, char *argv[])
342 353 strcpy(error, ""); strcpy(error, "");
343 354 errcode = 0; errcode = 0;
344 355
356 status_len = sizeof(status);
345 357 while (1) { while (1) {
346 358 max_line_len = COLS + 1; max_line_len = COLS + 1;
347 if (max_line_len > sizeof(status))
348 max_line_len = sizeof(status);
359 if (max_line_len > status_len)
360 max_line_len = status_len;
349 361
350 362 if ((ch = getch()) != ERR) { if ((ch = getch()) != ERR) {
351 363 re_sort = 0; re_sort = 0;
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/pwatch

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/pwatch

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/pwatch

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main