@@ -3865,10 +3865,10 @@ static int perf_file_section__process(struct perf_file_section *section,
38653865static int perf_file_header__read_pipe (struct perf_pipe_file_header * header ,
38663866 struct perf_header * ph ,
38673867 struct perf_data * data ,
3868- bool repipe )
3868+ bool repipe , int repipe_fd )
38693869{
38703870 struct feat_fd ff = {
3871- .fd = STDOUT_FILENO ,
3871+ .fd = repipe_fd ,
38723872 .ph = ph ,
38733873 };
38743874 ssize_t ret ;
@@ -3891,13 +3891,13 @@ static int perf_file_header__read_pipe(struct perf_pipe_file_header *header,
38913891 return 0 ;
38923892}
38933893
3894- static int perf_header__read_pipe (struct perf_session * session )
3894+ static int perf_header__read_pipe (struct perf_session * session , int repipe_fd )
38953895{
38963896 struct perf_header * header = & session -> header ;
38973897 struct perf_pipe_file_header f_header ;
38983898
38993899 if (perf_file_header__read_pipe (& f_header , header , session -> data ,
3900- session -> repipe ) < 0 ) {
3900+ session -> repipe , repipe_fd ) < 0 ) {
39013901 pr_debug ("incompatible file format\n" );
39023902 return - EINVAL ;
39033903 }
@@ -3995,7 +3995,7 @@ static int evlist__prepare_tracepoint_events(struct evlist *evlist, struct tep_h
39953995 return 0 ;
39963996}
39973997
3998- int perf_session__read_header (struct perf_session * session )
3998+ int perf_session__read_header (struct perf_session * session , int repipe_fd )
39993999{
40004000 struct perf_data * data = session -> data ;
40014001 struct perf_header * header = & session -> header ;
@@ -4016,7 +4016,7 @@ int perf_session__read_header(struct perf_session *session)
40164016 * We can read 'pipe' data event from regular file,
40174017 * check for the pipe header regardless of source.
40184018 */
4019- err = perf_header__read_pipe (session );
4019+ err = perf_header__read_pipe (session , repipe_fd );
40204020 if (!err || perf_data__is_pipe (data )) {
40214021 data -> is_pipe = true;
40224022 return err ;
0 commit comments