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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/