lkml.org 
[lkml]   [2018]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/9] perf utils: add support for arch standard events
From
Date
On 08/02/2018 14:02, Alan Cox wrote:
> On Thu, 8 Feb 2018 14:54:23 +0100
> Jiri Olsa <jolsa@redhat.com> wrote:
>
>> On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
>>
>> SNIP
>>
>>> static void print_events_table_suffix(FILE *outfp)
>>> {
>>> fprintf(outfp, "{\n");
>>> @@ -407,6 +469,52 @@ static char *real_event(const char *name, char *event)
>>> return event;
>>> }
>>>
>>> +static void fixup_field(char *from, char **to)
>>> +{
>>> + *to = malloc(strlen(from));
>>> +
>>> + strcpy(*to, from);
>>> +}
>>
>> could you just call '*to = strdup(from)' in here?

Right

>
> And check for malloc returning NULL.
>

Right again,

> Alan
>

I should have concentrated on the coding as much as the feature being
added...

Thanks,
John
> .
>


\
 
 \ /
  Last update: 2018-02-08 16:32    [W:0.061 / U:9.708 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site