lkml.org 
[lkml]   [2021]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    Subject[PATCH v3 28/48] libperf: Use cpu not index for evsel mmap
    From
    Fix issue where evsel's CPU map index was being used as the mmap cpu.

    Signed-off-by: Ian Rogers <irogers@google.com>
    ---
    tools/lib/perf/evsel.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/tools/lib/perf/evsel.c b/tools/lib/perf/evsel.c
    index 8028b5a4da69..f1e1665ef4bd 100644
    --- a/tools/lib/perf/evsel.c
    +++ b/tools/lib/perf/evsel.c
    @@ -252,6 +252,7 @@ int perf_evsel__mmap(struct perf_evsel *evsel, int pages)
    for (thread = 0; thread < xyarray__max_y(evsel->fd); thread++) {
    int *fd = FD(evsel, idx, thread);
    struct perf_mmap *map;
    + int cpu = perf_cpu_map__cpu(evsel->cpus, idx);

    if (fd == NULL || *fd < 0)
    continue;
    @@ -259,7 +260,7 @@ int perf_evsel__mmap(struct perf_evsel *evsel, int pages)
    map = MMAP(evsel, idx, thread);
    perf_mmap__init(map, NULL, false, NULL);

    - ret = perf_mmap__mmap(map, &mp, *fd, idx);
    + ret = perf_mmap__mmap(map, &mp, *fd, cpu);
    if (ret) {
    perf_evsel__munmap(evsel);
    return ret;
    --
    2.34.1.448.ga2b2bfdf31-goog
    \
     
     \ /
      Last update: 2021-12-30 08:23    [W:4.055 / U:0.348 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site