From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org,
Christian Borntraeger <borntraeger@de.ibm.com>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@kernel.org>, Mike Galbraith <efault@gmx.de>,
Namhyung Kim <namhyung.kim@lge.com>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 1/2] perf session: Add option to copy events when queueing
Date: Mon, 29 Sep 2014 15:33:57 -0300 [thread overview]
Message-ID: <20140929183357.GI3879@kernel.org> (raw)
In-Reply-To: <20140922070410.GA3108@krava.brq.redhat.com>
Em Mon, Sep 22, 2014 at 09:04:10AM +0200, Jiri Olsa escreveu:
> On Thu, Sep 18, 2014 at 09:07:38PM +0400, Alexander Yarygin wrote:
> > +++ b/tools/perf/util/session.c
> > @@ -542,7 +542,13 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event,
> > return -ENOMEM;
> > new->file_offset = file_offset;
> > - new->event = event;
> > + if (s->copy_on_queue) {
> > + new->event = malloc(event->header.size);
> > + memcpy(new->event, event, event->header.size);
> we have memdup, and you need to check for allocation failure
Right.
> hum.. how about allocation limits?
> Now have report.queue-size to keep track and limit the ordered_events
> memory size. I think we should add this allocation size under this
> limit as well.
Yup.
> > + } else
> > + new->event = event;
> > +
>
> also the copy_on_queue flag and the logic above feels more like
> it belongs to 'ordered_events' object to me
Agreed.
- Arnaldo
next prev parent reply other threads:[~2014-09-29 18:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-18 17:07 [PATCH 0/2] perf kvm stat live: Copy events Alexander Yarygin
2014-09-18 17:07 ` [PATCH 1/2] perf session: Add option to copy events when queueing Alexander Yarygin
2014-09-18 18:53 ` Arnaldo Carvalho de Melo
2014-09-18 20:21 ` David Ahern
2014-09-18 20:29 ` David Ahern
2014-09-19 8:48 ` Alexander Yarygin
2014-09-19 14:21 ` David Ahern
2014-09-19 16:25 ` Alexander Yarygin
2014-09-22 7:04 ` Jiri Olsa
2014-09-22 7:04 ` Jiri Olsa
2014-09-29 18:33 ` Arnaldo Carvalho de Melo [this message]
2014-09-18 17:07 ` [PATCH 2/2] perf kvm stat live: Enable events copying Alexander Yarygin
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=20140929183357.GI3879@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=borntraeger@de.ibm.com \
--cc=dsahern@gmail.com \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=paulus@samba.org \
--cc=yarygin@linux.vnet.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.