perf-probe.txt 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. perf-probe(1)
  2. =============
  3. NAME
  4. ----
  5. perf-probe - Define new dynamic tracepoints
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'perf probe' [options] --add='PROBE' [...]
  10. or
  11. 'perf probe' [options] PROBE
  12. or
  13. 'perf probe' [options] --del='[GROUP:]EVENT' [...]
  14. or
  15. 'perf probe' --list
  16. or
  17. 'perf probe' --line='FUNC[:RLN[+NUM|:RLN2]]|SRC:ALN[+NUM|:ALN2]'
  18. DESCRIPTION
  19. -----------
  20. This command defines dynamic tracepoint events, by symbol and registers
  21. without debuginfo, or by C expressions (C line numbers, C function names,
  22. and C local variables) with debuginfo.
  23. OPTIONS
  24. -------
  25. -k::
  26. --vmlinux=PATH::
  27. Specify vmlinux path which has debuginfo (Dwarf binary).
  28. -v::
  29. --verbose::
  30. Be more verbose (show parsed arguments, etc).
  31. -a::
  32. --add=::
  33. Define a probe event (see PROBE SYNTAX for detail).
  34. -d::
  35. --del=::
  36. Delete a probe event.
  37. -l::
  38. --list::
  39. List up current probe events.
  40. -L::
  41. --line=::
  42. Show source code lines which can be probed. This needs an argument
  43. which specifies a range of the source code.
  44. PROBE SYNTAX
  45. ------------
  46. Probe points are defined by following syntax.
  47. "[EVENT=]FUNC[+OFFS|:RLN|%return][@SRC]|SRC:ALN [ARG ...]"
  48. 'EVENT' specifies the name of new event, if omitted, it will be set the name of the probed function. Currently, event group name is set as 'probe'.
  49. 'FUNC' specifies a probed function name, and it may have one of the following options; '+OFFS' is the offset from function entry address in bytes, 'RLN' is the relative-line number from function entry line, and '%return' means that it probes function return. In addition, 'SRC' specifies a source file which has that function.
  50. It is also possible to specify a probe point by the source line number by using 'SRC:ALN' syntax, where 'SRC' is the source file path and 'ALN' is the line number.
  51. 'ARG' specifies the arguments of this probe point. You can use the name of local variable, or kprobe-tracer argument format (e.g. $retval, %ax, etc).
  52. LINE SYNTAX
  53. -----------
  54. Line range is descripted by following syntax.
  55. "FUNC[:RLN[+NUM|:RLN2]]|SRC:ALN[+NUM|:ALN2]"
  56. FUNC specifies the function name of showing lines. 'RLN' is the start line
  57. number from function entry line, and 'RLN2' is the end line number. As same as
  58. probe syntax, 'SRC' means the source file path, 'ALN' is start line number,
  59. and 'ALN2' is end line number in the file. It is also possible to specify how
  60. many lines to show by using 'NUM'.
  61. So, "source.c:100-120" shows lines between 100th to l20th in source.c file. And "func:10+20" shows 20 lines from 10th line of func function.
  62. SEE ALSO
  63. --------
  64. linkperf:perf-trace[1], linkperf:perf-record[1]