Re: [RFC PATCH v3 13/14] perf metricgroup: remove duped metric group events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  static struct evsel *find_evsel_group(struct evlist *perf_evlist,
>  				      struct expr_parse_ctx *pctx,
> +				      bool has_constraint,
>  				      struct evsel **metric_events,
>  				      unsigned long *evlist_used)
>  {
> -	struct evsel *ev;
> -	bool leader_found;
> -	const size_t idnum = hashmap__size(&pctx->ids);
> -	size_t i = 0;
> -	int j = 0;
> +	struct evsel *ev, *current_leader = NULL;
>  	double *val_ptr;
> +	int i = 0, matched_events = 0, events_to_match;
> +	const int idnum = (int)hashmap__size(&pctx->ids);

BTW standard perf data structure would be a rblist or strlist

I think it would be really better to do the deduping in a separate
pass than trying to add it to find_evsel_group. This leads
to very complicated logic.

This will likely make it easier to implement more sophisticated
algorithms too.

-Andi




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux