mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
perf tools: Use perf_data_file__fd() consistently
Do not reference file->fd directly since we want hide the implementation details from outside for possible future changes. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1422518843-25818-8-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
0b064f4300
commit
42aa276f40
2 changed files with 10 additions and 9 deletions
|
@ -343,6 +343,7 @@ static int __cmd_inject(struct perf_inject *inject)
|
|||
int ret = -EINVAL;
|
||||
struct perf_session *session = inject->session;
|
||||
struct perf_data_file *file_out = &inject->output;
|
||||
int fd = perf_data_file__fd(file_out);
|
||||
|
||||
signal(SIGINT, sig_handler);
|
||||
|
||||
|
@ -376,7 +377,7 @@ static int __cmd_inject(struct perf_inject *inject)
|
|||
}
|
||||
|
||||
if (!file_out->is_pipe)
|
||||
lseek(file_out->fd, session->header.data_offset, SEEK_SET);
|
||||
lseek(fd, session->header.data_offset, SEEK_SET);
|
||||
|
||||
ret = perf_session__process_events(session, &inject->tool);
|
||||
|
||||
|
@ -385,7 +386,7 @@ static int __cmd_inject(struct perf_inject *inject)
|
|||
perf_header__set_feat(&session->header,
|
||||
HEADER_BUILD_ID);
|
||||
session->header.data_size = inject->bytes_written;
|
||||
perf_session__write_header(session, session->evlist, file_out->fd, true);
|
||||
perf_session__write_header(session, session->evlist, fd, true);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue