Merge branch 'x86/cpu' into perf/core, to pick up dependent changes
[linux-2.6-microblaze.git] / tools / perf / builtin-top.c
index fbbb0da..12b6b15 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * builtin-top.c
  *
@@ -14,8 +15,6 @@
  *   Wu Fengguang <fengguang.wu@intel.com>
  *   Mike Galbraith <efault@gmx.de>
  *   Paul Mackerras <paulus@samba.org>
- *
- * Released under the GPL v2. (and only v2, not any later version)
  */
 #include "builtin.h"
 
@@ -1208,11 +1207,14 @@ static int __cmd_top(struct perf_top *top)
 
        init_process_thread(top);
 
+       if (opts->record_namespaces)
+               top->tool.namespace_events = true;
+
        ret = perf_event__synthesize_bpf_events(top->session, perf_event__process,
                                                &top->session->machines.host,
                                                &top->record_opts);
        if (ret < 0)
-               pr_warning("Couldn't synthesize bpf events.\n");
+               pr_debug("Couldn't synthesize BPF events: Pre-existing BPF programs won't have symbols resolved.\n");
 
        machine__synthesize_threads(&top->session->machines.host, &opts->target,
                                    top->evlist->threads, false,
@@ -1500,6 +1502,8 @@ int cmd_top(int argc, const char **argv)
        OPT_BOOLEAN(0, "force", &symbol_conf.force, "don't complain, do it"),
        OPT_UINTEGER(0, "num-thread-synthesize", &top.nr_threads_synthesize,
                        "number of thread to run event synthesize"),
+       OPT_BOOLEAN(0, "namespaces", &opts->record_namespaces,
+                   "Record namespaces events"),
        OPT_END()
        };
        struct perf_evlist *sb_evlist = NULL;