mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 20:24:12 +08:00
perf data: Allow to use given fd in data->file.fd
When in PIPE mode, allow to use fd dynamically opened and asigned to data->file.fd instead of STDIN_FILENO or STDOUT_FILENO. Reviewed-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Weilin Wang <weilin.wang@intel.com> Acked-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Caleb Biggers <caleb.biggers@intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Perry Taylor <perry.taylor@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Samantha Alt <samantha.alt@intel.com> Link: https://lore.kernel.org/r/20240720062102.444578-3-weilin.wang@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
807746b9bd
commit
a9a4ca5767
@ -204,7 +204,12 @@ static bool check_pipe(struct perf_data *data)
|
||||
data->file.fd = fd;
|
||||
data->use_stdio = false;
|
||||
}
|
||||
} else {
|
||||
|
||||
/*
|
||||
* When is_pipe and data->file.fd is given, use given fd
|
||||
* instead of STDIN_FILENO or STDOUT_FILENO
|
||||
*/
|
||||
} else if (data->file.fd <= 0) {
|
||||
data->file.fd = fd;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user