[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230112214015.1014857-7-namhyung@kernel.org>
Date: Thu, 12 Jan 2023 13:40:13 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, Song Liu <song@...nel.org>
Subject: [PATCH 6/8] perf/core: Do not pass header for sample id init
The only thing it does for header in __perf_event_header__init_id() is
to update the header size with event->id_header_size. We can do this
outside and get rid of the argument for the later change.
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
kernel/events/core.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 7c5555051662..127dddd20f93 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7061,13 +7061,11 @@ static void perf_aux_sample_output(struct perf_event *event,
PERF_SAMPLE_CPU | PERF_SAMPLE_ID | \
PERF_SAMPLE_IDENTIFIER | PERF_SAMPLE_STREAM_ID)
-static void __perf_event_header__init_id(struct perf_event_header *header,
- struct perf_sample_data *data,
+static void __perf_event_header__init_id(struct perf_sample_data *data,
struct perf_event *event,
u64 sample_type)
{
data->type = event->attr.sample_type;
- header->size += event->id_header_size;
if (sample_type & PERF_SAMPLE_TID) {
/* namespace issues */
@@ -7094,8 +7092,10 @@ void perf_event_header__init_id(struct perf_event_header *header,
struct perf_sample_data *data,
struct perf_event *event)
{
- if (event->attr.sample_id_all)
- __perf_event_header__init_id(header, data, event, event->attr.sample_type);
+ if (event->attr.sample_id_all) {
+ header->size += event->id_header_size;
+ __perf_event_header__init_id(data, event, event->attr.sample_type);
+ }
}
static void __perf_event__output_id_sample(struct perf_output_handle *handle,
@@ -7583,7 +7583,7 @@ void perf_prepare_sample(struct perf_event_header *header,
u64 filtered_sample_type;
header->type = PERF_RECORD_SAMPLE;
- header->size = sizeof(*header) + event->header_size;
+ header->size = sizeof(*header) + event->header_size + event->id_header_size;
header->misc = 0;
header->misc |= perf_misc_flags(regs);
@@ -7601,7 +7601,7 @@ void perf_prepare_sample(struct perf_event_header *header,
PERF_SAMPLE_REGS_USER);
filtered_sample_type &= ~data->sample_flags;
- __perf_event_header__init_id(header, data, event, filtered_sample_type);
+ __perf_event_header__init_id(data, event, filtered_sample_type);
data->sample_flags |= sample_type & PERF_SAMPLE_ID_ALL;
if (filtered_sample_type & PERF_SAMPLE_IP) {
--
2.39.0.314.g84b9a713c41-goog
Powered by blists - more mailing lists