]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
parser: Avoid parsing pids completely when not necessary
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 8 Sep 2010 18:35:00 +0000 (21:35 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 8 Sep 2010 18:35:00 +0000 (21:35 +0300)
If user has decided to scan only given mapping name for the processes,
it doesn't make sense to scan the entire process list too.

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

diff --git a/parse.c b/parse.c
index 2c493742371b01a1b2b652b81572fee2812de092..be38f2fd067fffc523a34fc8ca19c18640553563 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -381,7 +381,8 @@ int scan_all_pids(struct pageframe *pf, struct process *process_list,
        if (is_parse_option(opts, PARSE_DUMP))
                return 0;
 
-       if (is_parse_option(opts, PARSE_MAP_NAME)) {
+       if (is_parse_option(opts, PARSE_MAP_NAME) &&
+               !is_parse_option(opts, PARSE_PID)) {
                while (1) {
                        pid = get_next_pid(&dir);
                        if (pid <= 0)