From: Jiri Olsa <jolsa@redhat.com>
To: Don Zickus <dzickus@redhat.com>
Cc: acme@redhat.com, jmario@redhat.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf: Speed up thread map generation
Date: Fri, 14 Mar 2014 14:17:35 +0100 [thread overview]
Message-ID: <20140314131734.GB5276@krava.redhat.com> (raw)
In-Reply-To: <1394745397-96149-1-git-send-email-dzickus@redhat.com>
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
next prev parent reply other threads:[~2014-03-14 13:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 21:16 Don Zickus
2014-03-14 13:17 ` Jiri Olsa [this message]
2014-03-14 13:40 ` Don Zickus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140314131734.GB5276@krava.redhat.com \
--to=jolsa@redhat.com \
--cc=acme@redhat.com \
--cc=dzickus@redhat.com \
--cc=jmario@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®