Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06466212 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo-20160224' of...

Merge tag 'perf-core-for-mingo-20160224' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

 into perf/core

Pull perf/core improvements from Arnaldo Carvalho de Melo:

User visible changes:

  - Hierarchy histogram mode for 'perf top' and 'perf report', showing multiple
    levels, one per --sort entry: (Namhyung Kim)

    On a mostly idle system:

    # perf top --hierarchy -s comm,dso

    Then expand some levels and use 'P' to take a snapshot:

    # cat perf.hist.0
    -  92.32%         perf
          58.20%         perf
          22.29%         libc-2.22.so
           5.97%         [kernel]
           4.18%         libelf-0.165.so
           1.69%         [unknown]
    -   4.71%         qemu-system-x86
           3.10%         [kernel]
           1.60%         qemu-system-x86_64 (deleted)
    +   2.97%         swapper
    #

  - Check availability of memory events in 'perf mem': (Jiri Olsa)

    On a Intel Broadwell machine:

    # perf mem record -e list
    ldlat-loads : available
    ldlat-stores: available
    #

  - Decode data_src values (e.g. perf.data files generated by 'perf mem record')
    in 'perf script': (Jiri Olsa)

    # perf script
      perf 693 [1] 4.088652: 1 cpu/mem-loads,ldlat=30/P: ffff88007d0b0f40 68100142 L1 hit|SNP None|TLB L1 or L2 hit|LCK No <SNIP>
                                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  - Print bpf-output events in 'perf script': (Wang Nan).

    # perf record -e bpf-output/no-inherit,name=evt/ -e ./test_bpf_output_3.c/map:channel.event=evt/ usleep 1000
    # perf script
       usleep  4882 21384.532523:   evt:  ffffffff810e97d1 sys_nanosleep ([kernel.kallsyms])
        BPF output: 0000: 52 61 69 73 65 20 61 20  Raise a
                    0008: 42 50 46 20 65 76 65 6e  BPF even
                    0010: 74 21 00 00              t!..
        BPF string: "Raise a BPF event!"
    #

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents c2b8d8c5 c92fcfde
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -401,6 +401,9 @@ include::itrace.txt[]
--raw-trace::
--raw-trace::
	When displaying traceevent output, do not use print fmt or plugins.
	When displaying traceevent output, do not use print fmt or plugins.


--hierarchy::
	Enable hierarchical output.

include::callchain-overhead-calculation.txt[]
include::callchain-overhead-calculation.txt[]


SEE ALSO
SEE ALSO
+3 −0
Original line number Original line Diff line number Diff line
@@ -233,6 +233,9 @@ Default is to monitor all CPUS.
--raw-trace::
--raw-trace::
	When displaying traceevent output, do not use print fmt or plugins.
	When displaying traceevent output, do not use print fmt or plugins.


--hierarchy::
	Enable hierarchy output.

INTERACTIVE PROMPTING KEYS
INTERACTIVE PROMPTING KEYS
--------------------------
--------------------------


+1 −0
Original line number Original line Diff line number Diff line
@@ -27,3 +27,4 @@ Skip collecing build-id when recording: perf record -B
To change sampling frequency to 100 Hz: perf record -F 100
To change sampling frequency to 100 Hz: perf record -F 100
See assembly instructions with percentage: perf annotate <symbol>
See assembly instructions with percentage: perf annotate <symbol>
If you prefer Intel style assembly, try: perf annotate -M intel
If you prefer Intel style assembly, try: perf annotate -M intel
For hierarchical output, try: perf report --hierarchy
+17 −5
Original line number Original line Diff line number Diff line
@@ -40,10 +40,11 @@ static int parse_record_events(const struct option *opt,
	for (j = 0; j < PERF_MEM_EVENTS__MAX; j++) {
	for (j = 0; j < PERF_MEM_EVENTS__MAX; j++) {
		struct perf_mem_event *e = &perf_mem_events[j];
		struct perf_mem_event *e = &perf_mem_events[j];


		fprintf(stderr, "%-20s%s",
		fprintf(stderr, "%-13s%-*s%s\n",
			e->tag, verbose ? "" : "\n");
			e->tag,
		if (verbose)
			verbose ? 25 : 0,
			fprintf(stderr, " [%s]\n", e->name);
			verbose ? perf_mem_events__name(j) : "",
			e->supported ? ": available" : "");
	}
	}
	exit(0);
	exit(0);
}
}
@@ -92,8 +93,14 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)
		if (!perf_mem_events[j].record)
		if (!perf_mem_events[j].record)
			continue;
			continue;


		if (!perf_mem_events[j].supported) {
			pr_err("failed: event '%s' not supported\n",
			       perf_mem_events__name(j));
			return -1;
		}

		rec_argv[i++] = "-e";
		rec_argv[i++] = "-e";
		rec_argv[i++] = perf_mem_events[j].name;
		rec_argv[i++] = perf_mem_events__name(j);
	};
	};


	for (j = 0; j < argc; j++, i++)
	for (j = 0; j < argc; j++, i++)
@@ -355,6 +362,11 @@ int cmd_mem(int argc, const char **argv, const char *prefix __maybe_unused)
		NULL
		NULL
	};
	};


	if (perf_mem_events__init()) {
		pr_err("failed: memory events not supported\n");
		return -1;
	}

	argc = parse_options_subcommand(argc, argv, mem_options, mem_subcommands,
	argc = parse_options_subcommand(argc, argv, mem_options, mem_subcommands,
					mem_usage, PARSE_OPT_STOP_AT_NON_OPTION);
					mem_usage, PARSE_OPT_STOP_AT_NON_OPTION);


+17 −0
Original line number Original line Diff line number Diff line
@@ -811,6 +811,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
		    "only show processor socket that match with this filter"),
		    "only show processor socket that match with this filter"),
	OPT_BOOLEAN(0, "raw-trace", &symbol_conf.raw_trace,
	OPT_BOOLEAN(0, "raw-trace", &symbol_conf.raw_trace,
		    "Show raw trace event output (do not use print fmt or plugins)"),
		    "Show raw trace event output (do not use print fmt or plugins)"),
	OPT_BOOLEAN(0, "hierarchy", &symbol_conf.report_hierarchy,
		    "Show entries in a hierarchy"),
	OPT_END()
	OPT_END()
	};
	};
	struct perf_data_file file = {
	struct perf_data_file file = {
@@ -920,6 +922,21 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
		symbol_conf.cumulate_callchain = false;
		symbol_conf.cumulate_callchain = false;
	}
	}


	if (symbol_conf.report_hierarchy) {
		/* disable incompatible options */
		symbol_conf.event_group = false;
		symbol_conf.cumulate_callchain = false;

		if (field_order) {
			pr_err("Error: --hierarchy and --fields options cannot be used together\n");
			parse_options_usage(report_usage, options, "F", 1);
			parse_options_usage(NULL, options, "hierarchy", 0);
			goto error;
		}

		sort__need_collapse = true;
	}

	/* Force tty output for header output and per-thread stat. */
	/* Force tty output for header output and per-thread stat. */
	if (report.header || report.header_only || report.show_threads)
	if (report.header || report.header_only || report.show_threads)
		use_browser = 0;
		use_browser = 0;
Loading