perf record: Add new -I option to sample interrupted machine state
[firefly-linux-kernel-4.4.55.git] / tools / perf / builtin-record.c
index 5091a27e6d28256628e14fc01b3a7ed5edfd693f..8648c6d3003ddb3d64c54142ece0f56b1e30e813 100644 (file)
@@ -200,6 +200,17 @@ static int process_buildids(struct record *rec)
        if (size == 0)
                return 0;
 
+       /*
+        * During this process, it'll load kernel map and replace the
+        * dso->long_name to a real pathname it found.  In this case
+        * we prefer the vmlinux path like
+        *   /lib/modules/3.16.4/build/vmlinux
+        *
+        * rather than build-id path (in debug directory).
+        *   $HOME/.debug/.build-id/f0/6e17aa50adf4d00b88925e03775de107611551
+        */
+       symbol_conf.ignore_vmlinux_buildid = true;
+
        return __perf_session__process_events(session, start,
                                              size - start,
                                              size, &build_id__mark_dso_hit_ops);
@@ -800,6 +811,8 @@ struct option __record_options[] = {
                    "sample transaction flags (special events only)"),
        OPT_BOOLEAN(0, "per-thread", &record.opts.target.per_thread,
                    "use per-thread mmaps"),
+       OPT_BOOLEAN('I', "intr-regs", &record.opts.sample_intr_regs,
+                   "Sample machine registers on interrupt"),
        OPT_END()
 };