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

Commit 538592ff authored by Ingo Molnar's avatar Ingo Molnar
Browse files

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

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

 into perf/core

Pull perf/core improvements and fixes from Arnaldo:

User visible:

  * Fixup header alignment in 'perf sched latency' output (Ramkumar Ramachandra)

  * Fix off-by-one error in 'perf timechart record' argv handling (Ramkumar Ramachandra)

  * Print the evsel name in the annotate stdio output, prep to fix support
    outputting annotation for multiple events, not just for the first one
    (Arnaldo Carvalho de Melo)

Internals:

  * Use tid in mmap/mmap2 events to find maps (Don Zickus)

  * Record the reason for filtering an address_location (Namhyung Kim)

  * Apply all filters to an addr_location (Namhyung Kim)

  * Merge al->filtered with hist_entry->filtered in report/hists (Namhyung Kim)

  * Fix memory leak when synthesizing thread records (Namhyung Kim)

  * Use ui__has_annotation() in 'report' (Namhyung Kim)

Cleanups:

  * Remove unused thread__find_map function (Jiri Olsa)

  * Remove unused simple_strtoul() function (Ramkumar Ramachandra)

Documentation:

  * Update function names in debug messages (Ramkumar Ramachandra)

  * Update some code references in design.txt (Ramkumar Ramachandra)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 0afd2d51 a51e87cb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ static int process_sample_event(struct perf_tool *tool,
		return -1;
	}

	if (al.filtered || (rep->hide_unresolved && al.sym == NULL))
	if (rep->hide_unresolved && al.sym == NULL)
		return 0;

	if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap))
@@ -928,7 +928,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
	 * so don't allocate extra space that won't be used in the stdio
	 * implementation.
	 */
	if (use_browser == 1 && sort__has_sym) {
	if (ui__has_annotation()) {
		symbol_conf.priv_size = sizeof(struct annotation);
		machines__set_symbol_filter(&session->machines,
					    symbol__annotate_init);
+5 −5
Original line number Diff line number Diff line
@@ -1124,7 +1124,7 @@ static void output_lat_thread(struct perf_sched *sched, struct work_atoms *work_

	avg = work_list->total_lat / work_list->nb_atoms;

	printf("|%11.3f ms |%9" PRIu64 " | avg:%9.3f ms | max:%9.3f ms | max at: %9.6f s\n",
	printf("|%11.3f ms |%9" PRIu64 " | avg:%9.3f ms | max:%9.3f ms | max at: %13.6f s\n",
	      (double)work_list->total_runtime / 1e6,
		 work_list->nb_atoms, (double)avg / 1e6,
		 (double)work_list->max_lat / 1e6,
@@ -1527,9 +1527,9 @@ static int perf_sched__lat(struct perf_sched *sched)

	perf_sched__sort_lat(sched);

	printf("\n ---------------------------------------------------------------------------------------------------------------\n");
	printf("\n -----------------------------------------------------------------------------------------------------------------\n");
	printf("  Task                  |   Runtime ms  | Switches | Average delay ms | Maximum delay ms | Maximum delay at       |\n");
	printf(" ---------------------------------------------------------------------------------------------------------------\n");
	printf(" -----------------------------------------------------------------------------------------------------------------\n");

	next = rb_first(&sched->sorted_atom_root);

@@ -1541,7 +1541,7 @@ static int perf_sched__lat(struct perf_sched *sched)
		next = rb_next(next);
	}

	printf(" -----------------------------------------------------------------------------------------\n");
	printf(" -----------------------------------------------------------------------------------------------------------------\n");
	printf("  TOTAL:                |%11.3f ms |%9" PRIu64 " |\n",
		(double)sched->all_runtime / 1e6, sched->all_count);

+2 −2
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ static const char *cat_backtrace(union perf_event *event,
			continue;
		}

		tal.filtered = false;
		tal.filtered = 0;
		thread__find_addr_location(al.thread, machine, cpumode,
					   MAP__FUNCTION, ip, &tal);

@@ -1238,7 +1238,7 @@ static int timechart__record(struct timechart *tchart, int argc, const char **ar
	for (i = 0; i < old_power_args_nr; i++)
		*p++ = strdup(old_power_args[i]);

	for (j = 1; j < (unsigned int)argc; j++)
	for (j = 0; j < (unsigned int)argc; j++)
		*p++ = argv[j];

	return cmd_record(rec_argc, rec_argv, NULL);
+6 −6
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ underlying hardware counters.
Performance counters are accessed via special file descriptors.
There's one file descriptor per virtual counter used.

The special file descriptor is opened via the perf_event_open()
The special file descriptor is opened via the sys_perf_event_open()
system call:

   int sys_perf_event_open(struct perf_event_attr *hw_event_uptr,
@@ -82,7 +82,7 @@ machine-specific.
If 'raw_type' is 0, then the 'type' field says what kind of counter
this is, with the following encoding:

enum perf_event_types {
enum perf_type_id {
	PERF_TYPE_HARDWARE		= 0,
	PERF_TYPE_SOFTWARE		= 1,
	PERF_TYPE_TRACEPOINT		= 2,
@@ -95,7 +95,7 @@ specified by 'event_id':
 * Generalized performance counter event types, used by the hw_event.event_id
 * parameter of the sys_perf_event_open() syscall:
 */
enum hw_event_ids {
enum perf_hw_id {
	/*
	 * Common hardware events, generalized by the kernel:
	 */
@@ -129,7 +129,7 @@ software events, selected by 'event_id':
 * physical and sw events of the kernel (and allow the profiling of them as
 * well):
 */
enum sw_event_ids {
enum perf_sw_ids {
	PERF_COUNT_SW_CPU_CLOCK		= 0,
	PERF_COUNT_SW_TASK_CLOCK	= 1,
	PERF_COUNT_SW_PAGE_FAULTS	= 2,
@@ -230,7 +230,7 @@ these events are recorded in the ring-buffer (see below).
The 'comm' bit allows tracking of process comm data on process creation.
This too is recorded in the ring-buffer (see below).

The 'pid' parameter to the perf_event_open() system call allows the
The 'pid' parameter to the sys_perf_event_open() system call allows the
counter to be specific to a task:

 pid == 0: if the pid parameter is zero, the counter is attached to the
@@ -260,7 +260,7 @@ The 'flags' parameter is currently unused and must be zero.

The 'group_fd' parameter allows counter "groups" to be set up.  A
counter group has one counter which is the group "leader".  The leader
is created first, with group_fd = -1 in the perf_event_open call
is created first, with group_fd = -1 in the sys_perf_event_open call
that creates it.  The rest of the group members are created
subsequently, with group_fd giving the fd of the group leader.
(A single counter on its own is created with group_fd = -1 and is
+1 −0
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ static struct machine *setup_fake_machine(struct machines *machines)
			.mmap = {
				.header = { .misc = PERF_RECORD_MISC_USER, },
				.pid = fake_mmap_info[i].pid,
				.tid = fake_mmap_info[i].pid,
				.start = fake_mmap_info[i].start,
				.len = 0x1000ULL,
				.pgoff = 0ULL,
Loading