[PATCH v3 41/57] perf: Simplify __perf_event_output()
From: Peter Zijlstra
Date: Mon Jun 12 2023 - 06:00:23 EST
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
---
kernel/events/core.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7739,22 +7739,17 @@ __perf_event_output(struct perf_event *e
int err;
/* protect the callchain buffers */
- rcu_read_lock();
+ guard(rcu)();
perf_prepare_sample(data, event, regs);
perf_prepare_header(&header, data, event, regs);
-
err = output_begin(&handle, data, event, header.size);
if (err)
- goto exit;
-
+ return err;
perf_output_sample(&handle, &header, data, event);
-
perf_output_end(&handle);
-exit:
- rcu_read_unlock();
- return err;
+ return 0;
}
void