Commit 2d57c32b authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf header: Remove repipe option

No longer used by `perf inject` the repipe_fd is always -1 and repipe
is always false. Remove the options and associated code knowing the
constant values of the removed variables.
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yanteng Si <siyanteng@loongson.cn>
Cc: Yicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/20240829150154.37929-8-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 89d64e72
...@@ -4113,13 +4113,8 @@ static int perf_file_section__process(struct perf_file_section *section, ...@@ -4113,13 +4113,8 @@ static int perf_file_section__process(struct perf_file_section *section,
static int perf_file_header__read_pipe(struct perf_pipe_file_header *header, static int perf_file_header__read_pipe(struct perf_pipe_file_header *header,
struct perf_header *ph, struct perf_header *ph,
struct perf_data* data, struct perf_data *data)
bool repipe, int repipe_fd)
{ {
struct feat_fd ff = {
.fd = repipe_fd,
.ph = ph,
};
ssize_t ret; ssize_t ret;
ret = perf_data__read(data, header, sizeof(*header)); ret = perf_data__read(data, header, sizeof(*header));
...@@ -4134,19 +4129,15 @@ static int perf_file_header__read_pipe(struct perf_pipe_file_header *header, ...@@ -4134,19 +4129,15 @@ static int perf_file_header__read_pipe(struct perf_pipe_file_header *header,
if (ph->needs_swap) if (ph->needs_swap)
header->size = bswap_64(header->size); header->size = bswap_64(header->size);
if (repipe && do_write(&ff, header, sizeof(*header)) < 0)
return -1;
return 0; return 0;
} }
static int perf_header__read_pipe(struct perf_session *session, int repipe_fd) static int perf_header__read_pipe(struct perf_session *session)
{ {
struct perf_header *header = &session->header; struct perf_header *header = &session->header;
struct perf_pipe_file_header f_header; struct perf_pipe_file_header f_header;
if (perf_file_header__read_pipe(&f_header, header, session->data, if (perf_file_header__read_pipe(&f_header, header, session->data) < 0) {
/*repipe=*/false, repipe_fd) < 0) {
pr_debug("incompatible file format\n"); pr_debug("incompatible file format\n");
return -EINVAL; return -EINVAL;
} }
...@@ -4246,7 +4237,7 @@ static int evlist__prepare_tracepoint_events(struct evlist *evlist, struct tep_h ...@@ -4246,7 +4237,7 @@ static int evlist__prepare_tracepoint_events(struct evlist *evlist, struct tep_h
} }
#endif #endif
int perf_session__read_header(struct perf_session *session, int repipe_fd) int perf_session__read_header(struct perf_session *session)
{ {
struct perf_data *data = session->data; struct perf_data *data = session->data;
struct perf_header *header = &session->header; struct perf_header *header = &session->header;
...@@ -4267,7 +4258,7 @@ int perf_session__read_header(struct perf_session *session, int repipe_fd) ...@@ -4267,7 +4258,7 @@ int perf_session__read_header(struct perf_session *session, int repipe_fd)
* We can read 'pipe' data event from regular file, * We can read 'pipe' data event from regular file,
* check for the pipe header regardless of source. * check for the pipe header regardless of source.
*/ */
err = perf_header__read_pipe(session, repipe_fd); err = perf_header__read_pipe(session);
if (!err || perf_data__is_pipe(data)) { if (!err || perf_data__is_pipe(data)) {
data->is_pipe = true; data->is_pipe = true;
return err; return err;
......
...@@ -131,7 +131,7 @@ union perf_event; ...@@ -131,7 +131,7 @@ union perf_event;
extern const char perf_version_string[]; extern const char perf_version_string[];
int perf_session__read_header(struct perf_session *session, int repipe_fd); int perf_session__read_header(struct perf_session *session);
int perf_session__write_header(struct perf_session *session, int perf_session__write_header(struct perf_session *session,
struct evlist *evlist, struct evlist *evlist,
int fd, bool at_exit); int fd, bool at_exit);
......
...@@ -45,11 +45,11 @@ static int perf_session__deliver_event(struct perf_session *session, ...@@ -45,11 +45,11 @@ static int perf_session__deliver_event(struct perf_session *session,
u64 file_offset, u64 file_offset,
const char *file_path); const char *file_path);
static int perf_session__open(struct perf_session *session, int repipe_fd) static int perf_session__open(struct perf_session *session)
{ {
struct perf_data *data = session->data; struct perf_data *data = session->data;
if (perf_session__read_header(session, repipe_fd) < 0) { if (perf_session__read_header(session) < 0) {
pr_err("incompatible file format (rerun with -v to learn more)\n"); pr_err("incompatible file format (rerun with -v to learn more)\n");
return -1; return -1;
} }
...@@ -162,7 +162,7 @@ struct perf_session *__perf_session__new(struct perf_data *data, ...@@ -162,7 +162,7 @@ struct perf_session *__perf_session__new(struct perf_data *data,
session->data = data; session->data = data;
if (perf_data__is_read(data)) { if (perf_data__is_read(data)) {
ret = perf_session__open(session, /*repipe_fd=*/-1); ret = perf_session__open(session);
if (ret < 0) if (ret < 0)
goto out_delete; goto out_delete;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment