lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190212130920.GL775@krava>
Date:   Tue, 12 Feb 2019 14:09:20 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Alexey Budankov <alexey.budankov@...ux.intel.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Andi Kleen <ak@...ux.intel.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 4/4] perf report: support record trace file
 decompression

On Mon, Feb 11, 2019 at 11:25:00PM +0300, Alexey Budankov wrote:

SNIP

> +static int perf_session__process_compressed_event(struct perf_session *session,
> +					union perf_event *event, u64 file_offset)
> +{
> +	void *src;
> +	size_t decomp_size, src_size;
> +	u64 decomp_last_rem = 0;
> +	size_t decomp_len = session->header.env.comp_mmap_len;
> +	struct decomp *decomp, *decomp_last = session->decomp_last;
> +
> +	decomp = mmap(NULL, sizeof(struct decomp) + decomp_len, PROT_READ|PROT_WRITE,
> +		      MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
> +	if (decomp == MAP_FAILED) {
> +		pr_err("Couldn't allocate memory for decompression\n");
> +		return -1;
> +	}
> +
> +	decomp->file_pos = file_offset;
> +	decomp->head = 0;
> +
> +	if (decomp_last) {
> +		decomp_last_rem = decomp_last->size - decomp_last->head;
> +		memcpy(decomp->data, &(decomp_last->data[decomp_last->head]), decomp_last_rem);
> +		decomp->size = decomp_last_rem;
> +	}
> +
> +	src = (void *)event + sizeof(struct compressed_event);
> +	src_size = event->pack.header.size - sizeof(struct compressed_event);
> +
> +	decomp_size = perf_session__zstd_decompress(session, src, src_size,
> +				&(decomp->data[decomp_last_rem]), decomp_len - decomp_last_rem);
> +	if (!decomp_size) {
> +		munmap(decomp, sizeof(struct decomp) + decomp_len);
> +		pr_err("Couldn't decompress data\n");
> +		return -1;
> +	}
> +
> +	decomp->size += decomp_size;
> +
> +	if (session->decomp == NULL) {
> +		session->decomp = decomp;
> +		session->decomp_last = decomp;
> +	} else {
> +		session->decomp_last->next = decomp;
> +		session->decomp_last = decomp;
> +	}

can this happen? can you process more compressed events
before you deliver them in __perf_session__process_decomp_events?

I think I asked similar question in my other email..

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ