On Wed, Jan 16, 2019 at 12:23:05PM +0300, Alexey Budankov wrote:

SNIP

>  static int record__mmap_read_evlist(struct record *rec, struct perf_evlist 
> *evlist,
>                                   bool overwrite)
>  {
> @@ -755,6 +768,7 @@ static int record__mmap_read_evlist(struct record *rec, 
> struct perf_evlist *evli
>               struct perf_mmap *map = &maps[i];
>  
>               if (map->base) {
> +                     record__adjust_affinity(rec, map);
>                       if (!record__aio_enabled(rec)) {
>                               if (perf_mmap__push(map, rec, record__pushfn) 
> != 0) {
>                                       rc = -1;
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index 08cedb643ea6..178d3280ba62 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -1032,7 +1032,11 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, 
> unsigned int pages,
>        * Its value is decided by evsel's write_backward.
>        * So &mp should not be passed through const pointer.
>        */
> -     struct mmap_params mp = { .nr_cblocks = nr_cblocks, .affinity = 
> affinity };
> +     struct mmap_params mp = {
> +             .nr_cblocks     = nr_cblocks,
> +             .affinity       = affinity,
> +             .cpu_map        = cpu_map__new(NULL) /* from 
> /sys/devices/system/cpu/online */
> +     };

cpu_map won't get released.. if there's no better solution,
at least we could have it as static in build_node_mask..
this way it will be created only once

jirka

Reply via email to