static int should_scan_process(struct parse_opts *opts, struct process *process)
{
+ struct pidlist *pid;
int match = 0;
char *name;
}
if (is_parse_option(opts, PARSE_PID)) {
- if (opts->pid == process->pid)
- match = 1;
+ list_for_each_entry(pid, &opts->pidlist, list) {
+ if (pid->pid == process->pid) {
+ match = 1;
+ break;
+ }
+ }
}
if (is_parse_option(opts, PARSE_MAP_NAME))
int scan_all_pids(struct pageframe *pf, struct process *process_list,
struct parse_opts *opts)
{
+ struct pidlist *pidlist;
DIR *dir = NULL;
int pid;
int count = 0;
dir = NULL;
}
- if (is_parse_option(opts, PARSE_PID))
- count = read_pageframe_with_threads(opts->pid, pf, process_list,
- opts);
+ if (is_parse_option(opts, PARSE_PID)) {
+ list_for_each_entry(pidlist, &opts->pidlist, list) {
+ count += read_pageframe_with_threads(pidlist->pid, pf,
+ process_list, opts);
+ }
+ }
if ((count == 0) && !(is_parse_option(opts, PARSE_MAP_NAME))) {
printf("Failed to find any matching processes "