Re: [PATCH v5 06/21] perf arm-spe: Refactor printing string to buffer

2020-10-29 Thread Leo Yan
On Thu, Oct 29, 2020 at 10:54:37AM +, André Przywara wrote: > On 29/10/2020 10:51, Leo Yan wrote: > > Hi Andre, > > > > On Thu, Oct 29, 2020 at 10:23:39AM +, Andr� Przywara wrote: > > > > [...] > > > >>> +static int arm_spe_pkt_snprintf(int *err, char **buf_p, size_t *blen, > >>> +

Re: [PATCH v5 06/21] perf arm-spe: Refactor printing string to buffer

2020-10-29 Thread André Przywara
On 29/10/2020 10:51, Leo Yan wrote: > Hi Andre, > > On Thu, Oct 29, 2020 at 10:23:39AM +, Andr� Przywara wrote: > > [...] > >>> +static int arm_spe_pkt_snprintf(int *err, char **buf_p, size_t *blen, >>> + const char *fmt, ...) >>> +{ >>> + va_list ap; >>> + in

Re: [PATCH v5 06/21] perf arm-spe: Refactor printing string to buffer

2020-10-29 Thread Leo Yan
Hi Andre, On Thu, Oct 29, 2020 at 10:23:39AM +, André Przywara wrote: [...] > > +static int arm_spe_pkt_snprintf(int *err, char **buf_p, size_t *blen, > > + const char *fmt, ...) > > +{ > > + va_list ap; > > + int ret; > > + > > + va_start(ap, fmt); > > + re

Re: [PATCH v5 06/21] perf arm-spe: Refactor printing string to buffer

2020-10-29 Thread André Przywara
On 29/10/2020 07:19, Leo Yan wrote: Hi, > When outputs strings to the decoding buffer with function snprintf(), > SPE decoder needs to detects if any error returns from snprintf() and if > so needs to directly bail out. If snprintf() returns success, it needs > to update buffer pointer and reduc