On Mon, 28 Oct 2024 12:22:47 +0000 Metin Kaya <metin.kaya@xxxxxxx> wrote: > Building trace-cmd statically fails because of duplicated symbols for > strstrip() function which is also implemented in libtracefs. The > __hidden attribute does not resolve these conflicts for static builds > due to the lack of namespacing support in C. Refer to the associated > Bugzilla page [1] for further details. > > Although only strstrip() breaks the static build as of now, we should > fix the underlying issue comprehensively across the libtraceevent, > libtracefs, and trace-cmd packages. The recommendation on [1] is > prepending package name (e.g., "tracecmd_") to private functions (tagged > with __hidden attribute). > > Thus: > 1. Retain private functions which already start with "tracecmd_". > 2. If a private function starts with "trace_", then just change its > prefix to "tracecmd_". > 3. If prepending "tracecmd_" prefix to a private function's name clashes > with an existing one, rename one of the functions per its context > (e.g., rename trace_load_plugins() to > tracecmd_load_plugins_from_handle() and trace_append_options() to > tracecmd_append_options_to_file()). > 4. Prepend "tracecmd_" prefix to all remaining "__hidden" functions. > > Future __hidden functions should follow this prefixing schemed to avoid > new naming conflicts. I'm not against the change to make the hidden functions with a unique name, but I rather come up with something other than "tracecmd_". That prefix was to be used for functions that will eventually become public. Would "tcmd_" work? Same goes for the other libraries. The "tracefs_" is for functions that should be exported. Perhaps rename it to "tfs_"? As for libtraceevent, it doesn't need a separate prefix for local variables compared to exported ones, but that prefix is "tep_" and not "traceevent_". -- Steve