iotop icon indicating copy to clipboard operation
iotop copied to clipboard

Monitor list of processes

Open lezsakdomi opened this issue 1 year ago • 2 comments

Possibility to specify -p multiple times would be really nice.

I see on https://github.com/Tomas-M/iotop/blob/dd2dbd1c1b62b29d6f3ee67c2958e64e8fb23794/src/main.c#L303, that it just stores the passed PID, and on https://github.com/Tomas-M/iotop/blob/dd2dbd1c1b62b29d6f3ee67c2958e64e8fb23794/src/views.c#L367 that it makes a single comparison.

I'd like if this tool would store all the occurrences of -p, and store it in a linked list or in an array, and walk that array/ll in the filter1 function.

lezsakdomi avatar Jun 17 '24 15:06 lezsakdomi

Thanks for the suggestion.

I have some doubts about how useful that would be compared to the complexity of the implementation.

Note that implementation wise, it would also require changes in the interactive process select dialog (hot key F)

BTW. Did you try to achieve your goal by the regexp search option?

bbonev avatar Jul 11 '24 23:07 bbonev

regexp search option?

I see no such option in the --batch mode.

A workaround might be to run multiple iotop -p instances, one for each TID, though that would tax the CPU.

ArtemGr avatar Sep 09 '24 04:09 ArtemGr

Yes, there isn't. The regex filter is only in interactive mode.

I will add that

bbonev avatar Dec 26 '24 13:12 bbonev

Regex on the command line is in 279adab, that also applies to batch mode.

You can do iotop --filter='^(pid1|pid2|pid3)$' the worst mismatch that can happen is to show some additional process(es) whose name(s) match some of the pids.

bbonev avatar Jan 09 '25 20:01 bbonev