Re: [RFC] perf/jevents: Add new structure to pass json fields.

From: kajoljain
Date: Wed Aug 26 2020 - 07:31:07 EST




On 8/26/20 4:27 PM, Jiri Olsa wrote:
> On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote:
>
> SNIP
>
>> diff --git a/tools/perf/pmu-events/jevents.h b/tools/perf/pmu-events/jevents.h
>> index 2afc8304529e..e696edf70e9a 100644
>> --- a/tools/perf/pmu-events/jevents.h
>> +++ b/tools/perf/pmu-events/jevents.h
>> @@ -2,14 +2,28 @@
>> #ifndef JEVENTS_H
>> #define JEVENTS_H 1
>>
>> +#include "pmu-events.h"
>> +
>> +struct json_event {
>> + char *name;
>> + char *event;
>> + char *desc;
>> + char *topic;
>> + char *long_desc;
>> + char *pmu;
>> + char *unit;
>> + char *perpkg;
>> + char *metric_expr;
>> + char *metric_name;
>> + char *metric_group;
>> + char *deprecated;
>> + char *metric_constraint;
>> +};
>> +
>> int json_events(const char *fn,
>> - int (*func)(void *data, char *name, char *event, char *desc,
>> - char *long_desc,
>> - char *pmu,
>> - char *unit, char *perpkg, char *metric_expr,
>> - char *metric_name, char *metric_group,
>> - char *deprecated, char *metric_constraint),
>> - void *data);
>> + int (*func)(void *data, struct json_event *je),
>> + void *data);
>
> please also add typedef for the function,
> it's used in other places as well

Ok I will add that part.

Thanks,
Kajol Jain
>
> thanks,
> jirka
>