lkml.org 
[lkml]   [2014]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf: Speed up thread map generation
On Thu, Mar 13, 2014 at 05:16:37PM -0400, Don Zickus wrote:

SNIP

> + event->fork.ptid = tgid;
> + event->fork.pid = tgid;
> + event->fork.tid = pid;
> + event->fork.header.type = PERF_RECORD_FORK;
> +
> + event->fork.header.size = (sizeof(event->fork) + machine->id_hdr_size);
> +
> + if (process(tool, event, &synth_sample, machine) != 0)
> + return -1;
> +
> + return 0;
> +}
> +
> int perf_event__synthesize_mmap_events(struct perf_tool *tool,
> union perf_event *event,
> pid_t pid, pid_t tgid,
> @@ -287,6 +309,11 @@ static int __event__synthesize_thread(union perf_event *comm_event,
> DIR *tasks;
> struct dirent dirent, *next;
> pid_t tgid;
> + union perf_event *fork_event;
> +
> + fork_event = malloc(sizeof(fork_event->fork) + machine->id_hdr_size);
> + if (fork_event == NULL)
> + return -1;

need to be freed

maybe we could move the allocation one level up,
same as for mmap_event and comm_event

otherwise I think the logic with FORK event is correct

jirka


\
 
 \ /
  Last update: 2014-03-14 15:21    [W:0.058 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site