lkml.org 
[lkml]   [2013]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 09/15] perf ftrace: Add 'record' sub-command
Date
On Wed, 15 May 2013 23:20:52 +0200, Jiri Olsa wrote:
> On Tue, May 14, 2013 at 07:13:53PM +0900, Namhyung Kim wrote:
>> + raw_data = synthesize_raw_data(evsel);
>> + if (raw_data == NULL) {
>> + pr_err("synthesizing raw sample failed\n");
>> + goto out_fra;
>> + }
>> +
>> + /*
>> + * start of raw data is the size of raw data excluding itself.
>> + */
>> + raw_size = sizeof(u32) + (*(u32 *) raw_data);
>> +
>> + orig_size = event.sample.header.size;
>> + event.sample.header.size += raw_size;
>> +
>> + err = write(perf_fd, &event.sample, orig_size);
>> + if (err != orig_size) {
>> + pr_err("write error occurred\n");
>> + goto out_fra;
>> + }
>> +
>> + err = write(perf_fd, raw_data, raw_size);
>> + if (err != (int)raw_size) {
>> + pr_err("write error occurred\n");
>> + goto out_fra;
>> + }
>
> missing free(raw_data) ?

Argh, right!

Thanks,
Namhyung


\
 
 \ /
  Last update: 2013-05-16 04:41    [W:0.084 / U:0.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site