10 void read_args(int argc, char *argv[], struct parse_opts *opts)
13 static struct option long_options[] = {
14 { .val = 'p', .name = "pid", .has_arg = 1, },
16 char short_options[] = "p:";
19 c = getopt_long(argc, argv, short_options, long_options,
25 printf("%c: %s\n", c, optarg);
28 opts->pid = atoi(optarg);
29 opts->parse_mask = PARSE_PID;
35 int main(int argc, char *argv[])
38 struct process *process_list = NULL;
39 struct parse_opts opts;
42 printf("A pid needs to be given as an argument\n");
46 read_args(argc, argv, &opts);
48 memset(&pf, 0, sizeof(pf));
50 scan_all_pids(&pf, &process_list, &opts);
51 print_pid_stats(&pf, process_list);
52 print_page_stats(&pf);