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

Commit 89e3bbd5 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/tools improvements and fixes from Arnaldo Carvalho de Melo:

  * Honour -m option in 'trace', the tool was offering the option to
    set the mmap size, but wasn't using it when doing the actual mmap
    on the events file descriptors, fix from Jiri Olsa.

  * Correct the message in feature-libnuma checking, swowing the right
    devel package names for various distros, from Dongsheng Yang.

  * Polish 'readn' function and introduce its counterpart, 'writen', from
    Jiri Olsa.

  * Start moving timechart state from global variables to a 'perf_tool' derived
    'timechart' struct.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 0ed1e0be f885037e
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ struct perf_record {
	long			samples;
};

static int do_write_output(struct perf_record *rec, void *buf, size_t size)
static int perf_record__write(struct perf_record *rec, void *buf, size_t size)
{
	struct perf_data_file *file = &rec->file;

@@ -97,21 +97,13 @@ static int do_write_output(struct perf_record *rec, void *buf, size_t size)
	return 0;
}

static int write_output(struct perf_record *rec, void *buf, size_t size)
{
	return do_write_output(rec, buf, size);
}

static int process_synthesized_event(struct perf_tool *tool,
				     union perf_event *event,
				     struct perf_sample *sample __maybe_unused,
				     struct machine *machine __maybe_unused)
{
	struct perf_record *rec = container_of(tool, struct perf_record, tool);
	if (write_output(rec, event, event->header.size) < 0)
		return -1;

	return 0;
	return perf_record__write(rec, event, event->header.size);
}

static int perf_record__mmap_read(struct perf_record *rec,
@@ -136,7 +128,7 @@ static int perf_record__mmap_read(struct perf_record *rec,
		size = md->mask + 1 - (old & md->mask);
		old += size;

		if (write_output(rec, buf, size) < 0) {
		if (perf_record__write(rec, buf, size) < 0) {
			rc = -1;
			goto out;
		}
@@ -146,7 +138,7 @@ static int perf_record__mmap_read(struct perf_record *rec,
	size = head - old;
	old += size;

	if (write_output(rec, buf, size) < 0) {
	if (perf_record__write(rec, buf, size) < 0) {
		rc = -1;
		goto out;
	}
@@ -335,7 +327,7 @@ static int perf_record__mmap_read_all(struct perf_record *rec)
	}

	if (perf_header__has_feat(&rec->session->header, HEADER_TRACING_DATA))
		rc = write_output(rec, &finished_round_event,
		rc = perf_record__write(rec, &finished_round_event,
					sizeof(finished_round_event));

out:
+191 −173

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+5 −0

File changed.

Preview size limit exceeded, changes collapsed.

Loading