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

Merge tag 'perf-urgent-for-mingo-5.3-20190723' of...

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

 into perf/urgent

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

perf.data:

  Alexey Budankov:

  - Fix loading of compressed data split across adjacent records

  Jiri Olsa:

  - Fix buffer size setting for processing CPU topology perf.data header.

perf stat:

  Jiri Olsa:

  - Fix segfault for event group in repeat mode

  Cong Wang:

  - Always separate "stalled cycles per insn" line, it was being appended to
    the "instructions" line.

perf script:

  Andi Kleen:

  - Fix --max-blocks man page description.

  - Improve man page description of metrics.

  - Fix off by one in brstackinsn IPC computation.

perf probe:

  Arnaldo Carvalho de Melo:

  - Avoid calling freeing routine multiple times for same pointer.

perf build:

  - Do not use -Wshadow on gcc < 4.8, avoiding too strict warnings
    treated as errors, breaking the build.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 7b5cf701 39e7317e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -228,11 +228,11 @@ OPTIONS

	With the metric option perf script can compute metrics for
	sampling periods, similar to perf stat. This requires
	specifying a group with multiple metrics with the :S option
	specifying a group with multiple events defining metrics with the :S option
	for perf record. perf will sample on the first event, and
	compute metrics for all the events in the group. Please note
	print computed metrics for all the events in the group. Please note
	that the metric computed is averaged over the whole sampling
	period, not just for the sample point.
	period (since the last sample), not just for the sample point.

	For sample events it's possible to display misc field with -F +misc option,
	following letters are displayed for each bit:
@@ -384,7 +384,7 @@ include::itrace.txt[]
	perf script --time 0%-10%,30%-40%

--max-blocks::
	Set the maximum number of program blocks to print with brstackasm for
	Set the maximum number of program blocks to print with brstackinsn for
	each sample.

--reltime::
+10 −0
Original line number Diff line number Diff line
@@ -698,6 +698,16 @@ __cmd_probe(int argc, const char **argv)

		ret = perf_add_probe_events(params.events, params.nevents);
		if (ret < 0) {

			/*
			 * When perf_add_probe_events() fails it calls
			 * cleanup_perf_probe_events(pevs, npevs), i.e.
			 * cleanup_perf_probe_events(params.events, params.nevents), which
			 * will call clear_perf_probe_event(), so set nevents to zero
			 * to avoid cleanup_params() to call clear_perf_probe_event() again
			 * on the same pevs.
			 */
			params.nevents = 0;
			pr_err_with_code("  Error: Failed to add events.", ret);
			return ret;
		}
+1 −1
Original line number Diff line number Diff line
@@ -1059,7 +1059,7 @@ static int perf_sample__fprintf_brstackinsn(struct perf_sample *sample,

			printed += ip__fprintf_sym(ip, thread, x.cpumode, x.cpu, &lastsym, attr, fp);
			if (ip == end) {
				printed += ip__fprintf_jump(ip, &br->entries[i], &x, buffer + off, len - off, insn, fp,
				printed += ip__fprintf_jump(ip, &br->entries[i], &x, buffer + off, len - off, ++insn, fp,
							    &total_cycles);
				if (PRINT_FIELD(SRCCODE))
					printed += print_srccode(thread, x.cpumode, ip);
+8 −1
Original line number Diff line number Diff line
@@ -607,6 +607,12 @@ try_again:
	 * group leaders.
	 */
	read_counters(&(struct timespec) { .tv_nsec = t1-t0 });

	/*
	 * We need to keep evsel_list alive, because it's processed
	 * later the evsel_list will be closed after.
	 */
	if (!STAT_RECORD)
		perf_evlist__close(evsel_list);

	return WEXITSTATUS(status);
@@ -1997,6 +2003,7 @@ int cmd_stat(int argc, const char **argv)
			perf_session__write_header(perf_stat.session, evsel_list, fd, true);
		}

		perf_evlist__close(evsel_list);
		perf_session__delete(perf_stat.session);
	}

+2 −0
Original line number Diff line number Diff line
@@ -1291,6 +1291,7 @@ static void perf_evsel__free_id(struct perf_evsel *evsel)
	xyarray__delete(evsel->sample_id);
	evsel->sample_id = NULL;
	zfree(&evsel->id);
	evsel->ids = 0;
}

static void perf_evsel__free_config_terms(struct perf_evsel *evsel)
@@ -2077,6 +2078,7 @@ void perf_evsel__close(struct perf_evsel *evsel)

	perf_evsel__close_fd(evsel);
	perf_evsel__free_fd(evsel);
	perf_evsel__free_id(evsel);
}

int perf_evsel__open_per_cpu(struct perf_evsel *evsel,
Loading