]> git.itanic.dy.fi Git - scan-pagemap/blobdiff - parse.c
Scan threads only when requested
[scan-pagemap] / parse.c
diff --git a/parse.c b/parse.c
index dfbcba6e8f60276d1f52dce26509d2ac4628cf63..d5962c86cd91944182e1ca70681a3cc9fe4b6915 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -368,12 +368,18 @@ static void read_pageframe_with_threads(int pid,
        int tid;
 
        while (1) {
-               tid = get_next_tid(pid, &dir);
+               if (opts->with_threads)
+                       tid = get_next_tid(pid, &dir);
+               else
+                       tid = pid;
 
                if (tid <= 0)
                        return;
 
-               read_pageframe(pid, pid, pageframe, process_list, opts);
+               read_pageframe(pid, tid, pageframe, process_list, opts);
+
+               if (!opts->with_threads)
+                       break;
        }
 }