projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da7c3b4
)
perf evsel: Move test_attr__open() to success path in evsel__open_cpu()
author
Riccardo Mancini
<rickyman7@gmail.com>
Sat, 21 Aug 2021 09:19:28 +0000
(11:19 +0200)
committer
Arnaldo Carvalho de Melo
<acme@redhat.com>
Tue, 31 Aug 2021 19:45:30 +0000
(16:45 -0300)
test_attr__open() ignores the fd if -1, therefore it is safe to move it to
the success path (fd >= 0).
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>
Link:
http://lore.kernel.org/lkml/b3baf11360ca96541c9631730614fd7d217496fc.1629490974.git.rickyman7@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evsel.c
patch
|
blob
|
blame
|
history
diff --git
a/tools/perf/util/evsel.c
b/tools/perf/util/evsel.c
index f691f9ee30ea0d56cae6630da019857d5d5995ba..8dc70dd045f33b067a36960b36ab404748dde6f3 100644
(file)
--- a/
tools/perf/util/evsel.c
+++ b/
tools/perf/util/evsel.c
@@
-2011,11
+2011,6
@@
retry_open:
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);
- }
-
if (fd < 0) {
err = -errno;
@@
-2024,6
+2019,11
@@
retry_open:
goto try_fallback;
}
+ if (unlikely(test_attr__enabled)) {
+ test_attr__open(&evsel->core.attr, pid, cpus->map[cpu],
+ fd, group_fd, evsel->open_flags);
+ }
+
pr_debug2_peo(" = %d\n", fd);
if (evsel->bpf_fd >= 0) {