Re: [PATCH v14 4/8] perf record: Introduce rec->overwrite_evlist for overwritable events

From: Jiri Olsa
Date: Fri Jul 08 2016 - 10:48:49 EST


On Thu, Jul 07, 2016 at 05:34:45AM +0000, Wang Nan wrote:

SNIP

> @@ -373,7 +402,23 @@ static int record__mmap_evlist(struct record *rec,
>
> static int record__mmap(struct record *rec)
> {
> - return record__mmap_evlist(rec, rec->evlist);
> + int err;
> +
> + err = record__create_overwrite_evlist(rec);
> + if (err)
> + return err;
> +
> + err = record__mmap_evlist(rec, rec->evlist, false);
> + if (err)
> + return err;
> +
> + if (!rec->overwrite_evlist)
> + return 0;
> +
> + err = record__mmap_evlist(rec, rec->overwrite_evlist, true);
> + if (err)
> + return err;
> + return 0;

same here:
return record__mmap_evlist(rec, rec->overwrite_evlist, true);

jirka