Re: [PATCH v15 16/18] trace-cmd: Basic infrastructure for host - guest timestamp synchronization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH v15 16/18] trace-cmd: Basic infrastructure for host - guest timestamp synchronization
- From: Tzvetomir Stoyanov <tz.stoyanov@xxxxxxxxx>
- Date: Thu, 28 Nov 2019 17:27:40 +0200
- Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>, linux-trace-devel@xxxxxxxxxxxxxxx
- In-reply-to: <CAE0o1Nv33cEQGGX92XDCW7Y_E8CZ2uZ-ZKV=-_TkMeh3LB02DQ@mail.gmail.com>
- References: <20191128085409.289684-1-tz.stoyanov@gmail.com> <20191128085409.289684-17-tz.stoyanov@gmail.com> <CAE0o1Nv33cEQGGX92XDCW7Y_E8CZ2uZ-ZKV=-_TkMeh3LB02DQ@mail.gmail.com>
On Thu, Nov 28, 2019 at 5:08 PM Slavomir Kaslev
<slavomir.kaslev@xxxxxxxxx> wrote:
>
...
> > + if (buf_size && payload && payload_size) {
> > + if (*payload_size) {
> > + if (*payload_size != buf_size || *payload == NULL) {
> > + ret = -ENOMEM;
>
> Returning ENOMEM in this case is confusing. If this case is intended
> make it so that we don't allocate on each tracecmd_msg_recv_time_sync,
> maybe do realloc() here instead?
>
The main use case is to avoid the memory allocation at all, if the
payload is with known size. The user can pass a buffer with given
size, and the error should handle the case when the payload size is
not the one, expected by the user.
> --
> Slavomir Kaslev
Thanks !
--
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center
[Index of Archives]
[Linux USB Development]
[Linux USB Development]
[Linux Audio Users]
[Yosemite Hiking]
[Linux Kernel]
[Linux SCSI]