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: <87sj1w7di4.fsf@sejong.aot.lge.com>
Date:	Thu, 09 May 2013 17:40:03 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	David Ahern <dsahern@...il.com>
Cc:	linux-kernel@...r.kernel.org, acme@...stprotocols.net,
	mingo@...nel.org, fweisbec@...il.com, peterz@...radead.org,
	jolsa@...hat.com, xiaoguangrong@...ux.vnet.ibm.com
Subject: Re: [PATCH 03/13] perf evlist: add initialzation function for tracepoints

Hi David,

On Wed,  8 May 2013 22:31:39 -0600, David Ahern wrote:
> Handles initializations typically done as part of processing the file
> header and HEADER_TRACING_DATA event.
>
[SNIP]
> +int perf_evlist__trace_init(struct perf_evlist *evlist,
> +			    struct perf_session *session)
> +{
> +	struct tracing_data *tdata;
> +	char temp_file[] = "/tmp/perf-XXXXXXXX";
> +	int fd;
> +
> +	fd = mkstemp(temp_file);
> +	if (fd < 0) {
> +		pr_err("mkstemp failed\n");
> +		return -1;
> +	}
> +	unlink(temp_file);
> +
> +	tdata = tracing_data_get(&evlist->entries, fd, false);
> +	if (!tdata)
> +		return -1;
> +
> +	lseek(fd, 0, SEEK_SET);
> +	(void) trace_report(fd, &session->pevent, false);
> +	tracing_data_put(tdata);

I guess you need to close the fd here.

> +
> +	return perf_evlist__prepare_tracepoint_events(evlist, session->pevent);
> +}

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ