diff options
author | Riccardo Mancini <rickyman7@gmail.com> | 2021-08-21 12:19:29 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2021-08-31 22:50:34 +0300 |
commit | 91233d003b0906f146765fbef3572509c99d9386 (patch) | |
tree | 0bffb5f96161dcda71e24795a93689a7bbfdf7f7 /tools | |
parent | ebfb045a417415d8ac3f588e443f001b1278c01c (diff) | |
download | linux-91233d003b0906f146765fbef3572509c99d9386.tar.xz |
perf evsel: Move bpf_counter__install_pe() to success path in evsel__open_cpu()
I don't see why bpf_counter__install_pe() should get called even if
fd = -1, so I'm moving it to the success path.
This will be useful in following patches to separate the actual open and
the related operations from the fallback mechanisms.
Signed-off-by: Riccardo Mancini <rickyman7@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Link: http://lore.kernel.org/lkml/64f8a1b0a838a6e6049cd43c1beafd432999ae57.1629490974.git.rickyman7@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/evsel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 8dc70dd045f3..a576d985a7a7 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2009,8 +2009,6 @@ retry_open: FD(evsel, cpu, thread) = fd; - bpf_counter__install_pe(evsel, cpu, fd); - if (fd < 0) { err = -errno; @@ -2019,6 +2017,8 @@ retry_open: goto try_fallback; } + bpf_counter__install_pe(evsel, cpu, fd); + if (unlikely(test_attr__enabled)) { test_attr__open(&evsel->core.attr, pid, cpus->map[cpu], fd, group_fd, evsel->open_flags); |