[perfmon2] exposing syscall base number in /sys
Status: Beta
Brought to you by:
seranian
From: stephane e. <er...@go...> - 2008-05-22 08:01:03
|
Hello, Last week, I pushed a patch to expose the perfmon base syscall number in /sys/kernel/perfmon/syscall. This is a temporary measure to work around the issue that with each new kernel release the perfmon syscall numbers change because new syscalls are added. Libpfm (CVS) has been modified to look in this file if it exists, otherwise it defaults to hardcoded constants for each kernel version (starting with 2.6.24). Phil Mucci pointed out that 64-bit kernels often also support running 32-bit native binaries, i.e., a 32-bit ABI. On those kernels, the perfmon interface is also supported for 32-bit binaries. This is the case on X86, where an i386 binary using perfmon can run unmodified. Oftentimes, though, the syscall numbers for 32 vs. 64 bit ABI are different, this is true on X86 for instance. Thus, there is a problem for exporting the number via a single entry in /sys. I have now just pushed a patch which makes the content of /sys/kernel/perfmon/syscall dependent on the ABI of the process which reads the file. Thus, with a single entry in /sys we can service any kind of binary. On SPARC and PPC, it seems the same syscall numbers are used, so there should not be any difficulty. On IA-64, there is no native 32-bit ABI, so the problem does not exist. On X86, the kernel detects the ABI of the process (via existing TIF flags) and returns the corresponding syscall base number. The only architecture for which we do not have yet the full solution is MIPS where they support 3 ABIs. Of those, two 32-bit ABI which are not easy to distinguish. I am hopeful we will have a solution in the next few days. Nevertheless, I have decided to release this patch so that you could start testing it on your architecture and report any problems. Note that you will need to use the libpfm from CVS. Thanks. |