mbox series

[0/4] move functions in trace_probe_tmpl.h to trace_probe.c

Message ID 1668601492-4242-1-git-send-email-chensong_2000@189.cn (mailing list archive)
Headers show
Series move functions in trace_probe_tmpl.h to trace_probe.c | expand

Message

Song Chen Nov. 16, 2022, 12:24 p.m. UTC
Below fucntions are defined and implemented in kprobe/eprobe/uprobe
respectively:

1. store_trace_args
2. print_probe_args
3. __get_data_size
4. process_fetch_insn
5. process_fetch_insn_bottom
6. fetch_store_*
7. probe_mem_*

...

They are either identical or similar, which means there is some space to
optimize code organization.

This patchset would like to move them into trace_probe.c as new APIs to
serve those probes and the differences will be merged at the same time.

It improves readability and avoid involving errors while adding a new
feature.

Song Chen (4):
  kernel/trace: Introduce new APIs to process probe arguments
  kernel/trace/kprobe: Use new APIs to process kprobe arguments
  kernel/trace/eprobe: Use new APIs to process eprobe arguments
  kernel/trace/uprobe: Use new APIs to process uprobe arguments

 kernel/trace/trace_eprobe.c       | 194 +------------------
 kernel/trace/trace_kprobe.c       | 125 +-----------
 kernel/trace/trace_probe.c        | 310 ++++++++++++++++++++++++++++++
 kernel/trace/trace_probe.h        |  11 ++
 kernel/trace/trace_probe_common.h |  69 +++++++
 kernel/trace/trace_probe_user.h   | 108 +++++++++++
 kernel/trace/trace_uprobe.c       | 177 +----------------
 7 files changed, 518 insertions(+), 476 deletions(-)
 create mode 100644 kernel/trace/trace_probe_common.h
 create mode 100644 kernel/trace/trace_probe_user.h