Hi Ben, On Sun, Nov 10, 2019 at 10:01 PM Ben Hutchings <b...@decadent.org.uk> wrote: > > On Sun, 2019-11-10 at 21:29 +0000, Sudip Mukherjee wrote: > > On Fri, Nov 08, 2019 at 07:56:55PM +0000, Ben Hutchings wrote: > > > On Mon, 2019-11-04 at 21:44 +0000, Sudip Mukherjee wrote: > > > [...] > > > > The code for libtracevent lives in the kernel tree at > > > > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git in > > > > tools/lib/traceevent folder. > > > > And so, it will be great if kernel team will like to package and > > > > maintain it, if not, then I will > > > > be happy to do it. But, if I am doing it then I will need a sponsor to > > > > upload it. > > > > > > If kernel.org's kernel source repository is the canonical location for > > > this code, not just a convenience copy, then the binary package should > > > be built from src:linux and not a separate source package. > > > > > > I think src:linux already builds the library, but only as a static > > > library that's linked into perf. > > > > > > I don't know exactly what changes you would need to make, but they > > > should be roughly along these lines: > > > > > <snip> > > > 4. Generate the debian/libtraceevent<soversion>.symbols file recording > > > the shared library's exported symbols. > > > > Thanks for your reply Ben. > > I will try these steps and see how it goes. > > > > > 5. (Not sure if this is needed.) Modify > > > debian/rules.d/tools/perf/Makefile to make perf use the shared > > > library. Add libtraceevent<soversion> to the dependencies of > > > linux-perf-<version> in debian/templates/control.tools-versioned.in. > > > > This should not be needed as perf does not yet depend on libtraceevent. > > The libtraceevent that perf is creating is only having the plugins. > > I'm pretty sure it does; look for "libtraceevent.a" in > <https://buildd.debian.org/status/fetch.php?pkg=linux&arch=amd64&ver=5.3.9-1&stamp=1573349194&raw=1>.
iiuc, perf used tools/lib/traceevent to generate "libtraceevent.a" which is a static library and perf is building against that. It is also using the plugins generated by traceevent. But it is not using "libtraceevent.so" which is generated. So, as a result all the traceevent code is statically linked in perf when it builds. If I see the installation folder of perf I am only seeing "lib64/traceevent/plugins" and I am not seeing the dynamic library created by traceevent. Moreover if I do "ldd perf" it is not showing that it is linked to libtraceevent.so. But, in anycase, I will need to modify the rules as the plugins will be installed by traceevent which will be used by perf. I hope I was able to explain properly. But, let me make the changes and test first and then I can show you what I did. Thanks for your help. -- Regards Sudip