]> git.itanic.dy.fi Git - scan-pagemap/commit
Break parsing if no processes are found
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 23 Jul 2010 12:38:59 +0000 (15:38 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 23 Jul 2010 12:38:59 +0000 (15:38 +0300)
commitbe25768cb39c9af0646eb2bd893af9d4f95ec372
tree3702a34e6a6eafc4dd760c5b508ea35dc2d245c0
parentcdb90d2246f78c99d2ef0ed8b1fbbdb41ae768f7
Break parsing if no processes are found

Scanning through all pids in the system can be a time consuming task,
especially with slower CPUs. Therefore, if the user gives a
nonexistent process argument it can tage significant amount of time
until the user gets the response that there will be no useful results
available.

This patch counts the number of processes that have been encoutered
during the prescan. If the count is zero, then it is no good to
proceed scanning all of the rest processes. As an extra benefit, the
number of prescanned processes can be used for something useful..

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
main.c
parse.c
parse.h