The libtracefs logic that works with ftrace dynamic events is unified and capsulated into a new set of dynamic events APIs. This change makes the code more consistent and reusable. Also, adding future libtracefs support for uprobes and eprobes dynamic events is simplified. The existing library APIs for kprobes and synthetic events are reimplemented using the new dynamic events helpers. This patch sets depends on "[PATCH v2 0/4] Modifications of some 'hist' APIs": https://lore.kernel.org/linux-trace-devel/20210924095702.151826-1-y.karadz@xxxxxxxxx/ Suggested-by: Yordan Karadzhov (VMware) <y.karadz@xxxxxxxxx> v6 changes: - Removed "instance" parameter from synthetic event APIs, default instance is used. - Fixed "make doc_clean" to not remove the sources of sqlhist man page. - Coding style fixes. v5 changes: - Improved parsing of dynamic events files - added ' \t' as delimiter. - Added TRACEFS_DYNEVENT_UNKNOWN in dynamic events enum, which is used as error return by the APIsi. - Renamed and moved tracefs_kprobe_info() to tracefs_dynevent_info(), as the API is more generic and not kprobe specific. - Added unit tests for synthetic events APIs. - Fixed bugs in synthetic events APIs, related to dynamic events. - Coding style fixes. - Man pages clean ups. v4 changes: - Redefined the dynamic events enum, so the items can be used in a bitmask. - Reimplement the logic for parsing dynamic event strings from ftrace files. - Coding style fixes. - Added more comments. v3 changes: - Exposed dynamic events API as official tracefs APIs. - Removed kprobe specific APIs, that duplicate corresponding dynamic events APIs. - Updated unit tests and man pages with the new dynamic events APIs. - Fixed typos, found by Yordan. v2 changes: - Removed triple pointer from the APIs. - Reimplement dynamic events parsing using strtok_r instead of strchr. - Coding style fixes. Tzvetomir Stoyanov (VMware) (12): libtracefs: New APIs for dynamic events libtracefs: New APIs for kprobe allocation libtracefs: Remove redundant kprobes APIs libtracefs: Reimplement kprobe raw APIs libtracefs: Extend kprobes unit test libtracefs: Rename tracefs_synth_init API libtracefs: Use the internal dynamic events API when creating synthetic events libtracefs: Remove instance parameter from synthetic events APIs libtracefs: Add unit test for synthetic events libtracefs: Update kprobes man pages libtracefs: Document dynamic events APIs libtracefs: Do not clean sqlhist man page source Documentation/Makefile | 3 +- Documentation/libtracefs-dynevents.txt | 266 +++++++++ Documentation/libtracefs-kprobes.txt | 94 ++-- Documentation/libtracefs-sql.txt | 4 +- Documentation/libtracefs-synth.txt | 26 +- Documentation/libtracefs-synth2.txt | 40 +- Documentation/libtracefs.txt | 17 + include/tracefs-local.h | 18 + include/tracefs.h | 64 ++- src/Makefile | 1 + src/tracefs-dynevents.c | 720 +++++++++++++++++++++++++ src/tracefs-hist.c | 163 +++--- src/tracefs-kprobes.c | 508 ++++------------- src/tracefs-sqlhist.c | 6 +- utest/tracefs-utest.c | 528 ++++++++++++------ 15 files changed, 1676 insertions(+), 782 deletions(-) create mode 100644 Documentation/libtracefs-dynevents.txt create mode 100644 src/tracefs-dynevents.c -- 2.31.1