mirror of https://gitee.com/openkylin/linux.git
perf tools: Use AsciiDoc formatting for --control option documentation
The --control option does not display well in man pages unless AsciiDoc formatting is used. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Alexey Budankov <alexey.budankov@linux.intel.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lore.kernel.org/lkml/20200901093758.32293-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
40db8ff59e
commit
1f4390d825
|
@ -631,43 +631,43 @@ option. The -e option and this one can be mixed and matched. Events
|
||||||
can be grouped using the {} notation.
|
can be grouped using the {} notation.
|
||||||
endif::HAVE_LIBPFM[]
|
endif::HAVE_LIBPFM[]
|
||||||
|
|
||||||
--control fd:ctl-fd[,ack-fd]
|
--control=fd:ctl-fd[,ack-fd]::
|
||||||
Listen on ctl-fd descriptor for command to control measurement ('enable': enable events,
|
Listen on ctl-fd descriptor for command to control measurement ('enable': enable events,
|
||||||
'disable': disable events). Measurements can be started with events disabled using
|
'disable': disable events). Measurements can be started with events disabled using
|
||||||
--delay=-1 option. Optionally send control command completion ('ack\n') to ack-fd descriptor
|
--delay=-1 option. Optionally send control command completion ('ack\n') to ack-fd descriptor
|
||||||
to synchronize with the controlling process. Example of bash shell script to enable and
|
to synchronize with the controlling process. Example of bash shell script to enable and
|
||||||
disable events during measurements:
|
disable events during measurements:
|
||||||
|
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ctl_dir=/tmp/
|
ctl_dir=/tmp/
|
||||||
|
|
||||||
ctl_fifo=${ctl_dir}perf_ctl.fifo
|
ctl_fifo=${ctl_dir}perf_ctl.fifo
|
||||||
test -p ${ctl_fifo} && unlink ${ctl_fifo}
|
test -p ${ctl_fifo} && unlink ${ctl_fifo}
|
||||||
mkfifo ${ctl_fifo}
|
mkfifo ${ctl_fifo}
|
||||||
exec {ctl_fd}<>${ctl_fifo}
|
exec {ctl_fd}<>${ctl_fifo}
|
||||||
|
|
||||||
ctl_ack_fifo=${ctl_dir}perf_ctl_ack.fifo
|
ctl_ack_fifo=${ctl_dir}perf_ctl_ack.fifo
|
||||||
test -p ${ctl_ack_fifo} && unlink ${ctl_ack_fifo}
|
test -p ${ctl_ack_fifo} && unlink ${ctl_ack_fifo}
|
||||||
mkfifo ${ctl_ack_fifo}
|
mkfifo ${ctl_ack_fifo}
|
||||||
exec {ctl_fd_ack}<>${ctl_ack_fifo}
|
exec {ctl_fd_ack}<>${ctl_ack_fifo}
|
||||||
|
|
||||||
perf record -D -1 -e cpu-cycles -a \
|
perf record -D -1 -e cpu-cycles -a \
|
||||||
--control fd:${ctl_fd},${ctl_fd_ack} \
|
--control fd:${ctl_fd},${ctl_fd_ack} \
|
||||||
-- sleep 30 &
|
-- sleep 30 &
|
||||||
perf_pid=$!
|
perf_pid=$!
|
||||||
|
|
||||||
sleep 5 && echo 'enable' >&${ctl_fd} && read -u ${ctl_fd_ack} e1 && echo "enabled(${e1})"
|
sleep 5 && echo 'enable' >&${ctl_fd} && read -u ${ctl_fd_ack} e1 && echo "enabled(${e1})"
|
||||||
sleep 10 && echo 'disable' >&${ctl_fd} && read -u ${ctl_fd_ack} d1 && echo "disabled(${d1})"
|
sleep 10 && echo 'disable' >&${ctl_fd} && read -u ${ctl_fd_ack} d1 && echo "disabled(${d1})"
|
||||||
|
|
||||||
exec {ctl_fd_ack}>&-
|
exec {ctl_fd_ack}>&-
|
||||||
unlink ${ctl_ack_fifo}
|
unlink ${ctl_ack_fifo}
|
||||||
|
|
||||||
exec {ctl_fd}>&-
|
exec {ctl_fd}>&-
|
||||||
unlink ${ctl_fifo}
|
unlink ${ctl_fifo}
|
||||||
|
|
||||||
wait -n ${perf_pid}
|
wait -n ${perf_pid}
|
||||||
exit $?
|
exit $?
|
||||||
|
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
|
|
|
@ -180,43 +180,43 @@ with it. --append may be used here. Examples:
|
||||||
3>results perf stat --log-fd 3 -- $cmd
|
3>results perf stat --log-fd 3 -- $cmd
|
||||||
3>>results perf stat --log-fd 3 --append -- $cmd
|
3>>results perf stat --log-fd 3 --append -- $cmd
|
||||||
|
|
||||||
--control fd:ctl-fd[,ack-fd]
|
--control=fd:ctl-fd[,ack-fd]::
|
||||||
Listen on ctl-fd descriptor for command to control measurement ('enable': enable events,
|
Listen on ctl-fd descriptor for command to control measurement ('enable': enable events,
|
||||||
'disable': disable events). Measurements can be started with events disabled using
|
'disable': disable events). Measurements can be started with events disabled using
|
||||||
--delay=-1 option. Optionally send control command completion ('ack\n') to ack-fd descriptor
|
--delay=-1 option. Optionally send control command completion ('ack\n') to ack-fd descriptor
|
||||||
to synchronize with the controlling process. Example of bash shell script to enable and
|
to synchronize with the controlling process. Example of bash shell script to enable and
|
||||||
disable events during measurements:
|
disable events during measurements:
|
||||||
|
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ctl_dir=/tmp/
|
ctl_dir=/tmp/
|
||||||
|
|
||||||
ctl_fifo=${ctl_dir}perf_ctl.fifo
|
ctl_fifo=${ctl_dir}perf_ctl.fifo
|
||||||
test -p ${ctl_fifo} && unlink ${ctl_fifo}
|
test -p ${ctl_fifo} && unlink ${ctl_fifo}
|
||||||
mkfifo ${ctl_fifo}
|
mkfifo ${ctl_fifo}
|
||||||
exec {ctl_fd}<>${ctl_fifo}
|
exec {ctl_fd}<>${ctl_fifo}
|
||||||
|
|
||||||
ctl_ack_fifo=${ctl_dir}perf_ctl_ack.fifo
|
ctl_ack_fifo=${ctl_dir}perf_ctl_ack.fifo
|
||||||
test -p ${ctl_ack_fifo} && unlink ${ctl_ack_fifo}
|
test -p ${ctl_ack_fifo} && unlink ${ctl_ack_fifo}
|
||||||
mkfifo ${ctl_ack_fifo}
|
mkfifo ${ctl_ack_fifo}
|
||||||
exec {ctl_fd_ack}<>${ctl_ack_fifo}
|
exec {ctl_fd_ack}<>${ctl_ack_fifo}
|
||||||
|
|
||||||
perf stat -D -1 -e cpu-cycles -a -I 1000 \
|
perf stat -D -1 -e cpu-cycles -a -I 1000 \
|
||||||
--control fd:${ctl_fd},${ctl_fd_ack} \
|
--control fd:${ctl_fd},${ctl_fd_ack} \
|
||||||
-- sleep 30 &
|
-- sleep 30 &
|
||||||
perf_pid=$!
|
perf_pid=$!
|
||||||
|
|
||||||
sleep 5 && echo 'enable' >&${ctl_fd} && read -u ${ctl_fd_ack} e1 && echo "enabled(${e1})"
|
sleep 5 && echo 'enable' >&${ctl_fd} && read -u ${ctl_fd_ack} e1 && echo "enabled(${e1})"
|
||||||
sleep 10 && echo 'disable' >&${ctl_fd} && read -u ${ctl_fd_ack} d1 && echo "disabled(${d1})"
|
sleep 10 && echo 'disable' >&${ctl_fd} && read -u ${ctl_fd_ack} d1 && echo "disabled(${d1})"
|
||||||
|
|
||||||
exec {ctl_fd_ack}>&-
|
exec {ctl_fd_ack}>&-
|
||||||
unlink ${ctl_ack_fifo}
|
unlink ${ctl_ack_fifo}
|
||||||
|
|
||||||
exec {ctl_fd}>&-
|
exec {ctl_fd}>&-
|
||||||
unlink ${ctl_fifo}
|
unlink ${ctl_fifo}
|
||||||
|
|
||||||
wait -n ${perf_pid}
|
wait -n ${perf_pid}
|
||||||
exit $?
|
exit $?
|
||||||
|
|
||||||
|
|
||||||
--pre::
|
--pre::
|
||||||
|
|
Loading…
Reference in New Issue