From 0bff18974d3c8a899d6915a36367e9e7d4b5e288 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 8 Sep 2010 21:35:00 +0300 Subject: [PATCH] parser: Avoid parsing pids completely when not necessary 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 --- parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parse.c b/parse.c index 2c49374..be38f2f 100644 --- 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) -- 2.44.0