Phil, You cannot really do version detection in the header because you may compile once but run on multiple different kernels.
The patch is not in CVS yet. I want to make sure you remove the compilation errors first. On Thu, Apr 3, 2008 at 5:20 PM, Philip Mucci <[EMAIL PROTECTED]> wrote: > Hooray! > > We've need this one for a long time. Thanks Stefane. Note below that if we > can detect revisions in the header, we can also adjust prototypes for the > API for different kernel revs. I'll take a crack at that on the SiCortex > machine. Is the below in CVS? > > Phil > > > > On Apr 3, 2008, at 10:12 AM, stephane eranian wrote: > > > > > > > > > > Hello, > > > > I got tired of having to maintain different revisions for libpfm, one > > each time the perfmon syscalls > > change. Sometimes back ward compatibility is not possible because the > > perfmon API/ABI changed. > > But nowadays, changes are happening inside the kernel not so much at > > the user level. > > > > There have been several new system calls in recent kernels. Those push > > the perfmon syscalls up > > on every architectures. > > > > Libpfm provides the syscall stubs to call the kernel perfmon API. > > Those stubs will eventually migrate > > into libc. The syscall numbers were kept in include/perfmon/perfmon.h > > and had to be updated for each > > new kernel version. The problem is that backward compatibility > > (whenever possible) was not provided. > > > > I have created the attached patch to address this problem. The same > > libpfm can now be used between > > kernel revisions as long as the perfmon API does not change. This is, > > for instance, the case between > > 2.6.24 and 2.6.25 for instance. The trick is to have the code > > autodetect the kernel version and adjust > > the syscall accordingly. Another solution would have been to have the > > kernel export the base syscall > > number via, let's say, /sys/kernel/perfmon/syscall. > > > > I am still hoping we will be in mainline soon, or at least that we > > will get a fixed block of syscalls soon, > > at which point, all of this will not be needed anymore, except for > > special platforms such as Cray. > > > > I have tested the attached patch on 2.6.25 on X86-64, i386. Please > > test it on your platforms and > > report any problem. > > > > Thanks. > > > <libpfm-syscall.diff>------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace_______________________________________________ > > perfmon2-devel mailing list > > perfmon2-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/perfmon2-devel > > > > ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ perfmon2-devel mailing list perfmon2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perfmon2-devel