Only consider symbols in these comms. CSV that understands
        file://filename entries.  This option will affect the percentage of
        the overhead column.  See --percentage for more info.
+--pid=::
+        Only show events for given process ID (comma separated list).
+
+--tid=::
+        Only show events for given thread ID (comma separated list).
 -d::
 --dsos=::
        Only consider symbols in these dsos. CSV that understands
 
        Only display events for these comms. CSV that understands
        file://filename entries.
 
+--pid=::
+       Only show events for given process ID (comma separated list).
+
+--tid=::
+       Only show events for given thread ID (comma separated list).
+
 -I::
 --show-info::
        Display extended information about the perf.data file. This adds
 
                   "only consider symbols in these dsos"),
        OPT_STRING('c', "comms", &symbol_conf.comm_list_str, "comm[,comm...]",
                   "only consider symbols in these comms"),
+       OPT_STRING(0, "pid", &symbol_conf.pid_list_str, "pid[,pid...]",
+                  "only consider symbols in these pids"),
+       OPT_STRING(0, "tid", &symbol_conf.tid_list_str, "tid[,tid...]",
+                  "only consider symbols in these tids"),
        OPT_STRING('S', "symbols", &symbol_conf.sym_list_str, "symbol[,symbol...]",
                   "only consider these symbols"),
        OPT_STRING(0, "symbol-filter", &report.symbol_filter_str, "filter",
 
        OPT_STRING('C', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
        OPT_STRING('c', "comms", &symbol_conf.comm_list_str, "comm[,comm...]",
                   "only display events for these comms"),
+       OPT_STRING(0, "pid", &symbol_conf.pid_list_str, "pid[,pid...]",
+                  "only consider symbols in these pids"),
+       OPT_STRING(0, "tid", &symbol_conf.tid_list_str, "tid[,tid...]",
+                  "only consider symbols in these tids"),
        OPT_BOOLEAN('I', "show-info", &show_full_info,
                    "display extended information from perf.data file"),
        OPT_BOOLEAN('\0', "show-kernel-path", &symbol_conf.show_kernel_path,
 
 #include "machine.h"
 #include "symbol.h"
 #include "strlist.h"
+#include "intlist.h"
 #include "header.h"
 
 #include <elf.h>
        return 0;
 }
 
+int setup_intlist(struct intlist **list, const char *list_str,
+                 const char *list_name)
+{
+       if (list_str == NULL)
+               return 0;
+
+       *list = intlist__new(list_str);
+       if (!*list) {
+               pr_err("problems parsing %s list\n", list_name);
+               return -1;
+       }
+       return 0;
+}
+
 static bool symbol__read_kptr_restrict(void)
 {
        bool value = false;
                       symbol_conf.comm_list_str, "comm") < 0)
                goto out_free_dso_list;
 
+       if (setup_intlist(&symbol_conf.pid_list,
+                      symbol_conf.pid_list_str, "pid") < 0)
+               goto out_free_comm_list;
+
+       if (setup_intlist(&symbol_conf.tid_list,
+                      symbol_conf.tid_list_str, "tid") < 0)
+               goto out_free_pid_list;
+
        if (setup_list(&symbol_conf.sym_list,
                       symbol_conf.sym_list_str, "symbol") < 0)
-               goto out_free_comm_list;
+               goto out_free_tid_list;
 
        /*
         * A path to symbols of "/" is identical to ""
        symbol_conf.initialized = true;
        return 0;
 
+out_free_tid_list:
+       intlist__delete(symbol_conf.tid_list);
+out_free_pid_list:
+       intlist__delete(symbol_conf.pid_list);
 out_free_comm_list:
        strlist__delete(symbol_conf.comm_list);
 out_free_dso_list:
        strlist__delete(symbol_conf.sym_list);
        strlist__delete(symbol_conf.dso_list);
        strlist__delete(symbol_conf.comm_list);
+       intlist__delete(symbol_conf.tid_list);
+       intlist__delete(symbol_conf.pid_list);
        vmlinux_path__exit();
        symbol_conf.sym_list = symbol_conf.dso_list = symbol_conf.comm_list = NULL;
        symbol_conf.initialized = false;
 
 }
 
 struct strlist;
+struct intlist;
 
 struct symbol_conf {
        unsigned short  priv_size;
        const char      *guestmount;
        const char      *dso_list_str,
                        *comm_list_str,
+                       *pid_list_str,
+                       *tid_list_str,
                        *sym_list_str,
                        *col_width_list_str;
        struct strlist  *dso_list,
                        *dso_to_list,
                        *sym_from_list,
                        *sym_to_list;
+       struct intlist  *pid_list,
+                       *tid_list;
        const char      *symfs;
 };
 
 
 int setup_list(struct strlist **list, const char *list_str,
               const char *list_name);
+int setup_intlist(struct intlist **list, const char *list_str,
+                 const char *list_name);
 
 #endif /* __PERF_SYMBOL */
 
 #include <sys/types.h>
 #include "symbol.h"
 #include <strlist.h>
+#include <intlist.h>
 
 struct thread_stack;
 
                return true;
        }
 
+       if (symbol_conf.pid_list &&
+           !intlist__has_entry(symbol_conf.pid_list, thread->pid_)) {
+               return true;
+       }
+
+       if (symbol_conf.tid_list &&
+           !intlist__has_entry(symbol_conf.tid_list, thread->tid)) {
+               return true;
+       }
+
        return false;
 }