Package: qprof
Version: 0.5.1-3
Severity: important

qprof, as it is beeing packaged at this time, do not use libpfm{2,3}
when using hardware events for sampling. Actually, qprof print not
warning and fall back to the "timeout sampling".

In addition, when using the -s option, ld cannot find a symbol from
libunwind.

About perfmon:
- -DHW_EVENT_SUPPORT needs to be specified into CFLAGS when running
  configure
- qprof_utils_libpfm(2,3}.c needs to include headers from perfmon2 and
  perfmon3 and not perfmon
- these same files need to open libpfm2.so.2 and libpfm3.so.2 and not
  libpfm.so.2 and libpfm.so.3

About libunwind:
   libunwind provided by GCC do not exports all the symbols that are
   declared in libunwind.h and other files (but used by
   qprof_utils_libpfm{2,3}). You need to link agains the library provided 
   by the libunwind7 package. The correct LDFLAG at linking stage is 
   -lunwind-generic instead of -lunwind

The enclosed patch correct these errors and include the modification
from bug #294784. Thus you just have to apply this patch to correct
both bugs.

It would be interesting you follow up with the upstream authors to see
if it would be possible to modify the path to headers and library name via
configure instead of patching directly the sources.

Thanks,

Matthieu

*** patch
diff -Nru orig/debian/rules new/debian/rules
--- orig/debian/rules   2005-02-14 10:08:17.566657013 -0600
+++ new/debian/rules    2005-02-14 10:01:11.962170039 -0600
@@ -9,7 +9,7 @@
 
 
 INSTALL = install
-CFLAGS = -Wall -g
+CFLAGS = -Wall -g -DHW_EVENT_SUPPORT
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
@@ -24,7 +24,7 @@
 configure-stamp:
        dh_testdir
        # Add here commands to configure the package.
-       ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) 
--prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info 
--sysconfdir=/etc
+       ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) 
--prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info 
--sysconfdir=/etc CFLAGS="$(CFLAGS)"
        touch configure-stamp
 
 
diff -Nru orig/libtool new/libtool
--- orig/libtool        2005-02-14 10:07:59.707282232 -0600
+++ new/libtool 2005-02-14 10:03:45.281504099 -0600
@@ -6954,7 +6954,7 @@
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdeps="-lstdc++ -lunwind -lm -lgcc_s -lunwind -lc -lgcc_s -lunwind"
+postdeps="-lstdc++ -lunwind-generic -lm -lgcc_s -lunwind-generic -lc -lgcc_s 
-lunwind-generic"
 
 # The library search path used internally by the compiler when linking
 # a shared library.
diff -Nru orig/src/Makefile.am new/src/Makefile.am
--- orig/src/Makefile.am        2005-02-14 10:08:35.249273984 -0600
+++ new/src/Makefile.am 2005-02-14 10:01:57.555919481 -0600
@@ -4,7 +4,7 @@
 
 libqprof_utils_la_SOURCES=prof_utils.h q-lib.c crc32.c q-lib.h crc32.h
 if USE_LIBUNWIND
-libqprof_utils_la_LDFLAGS=-lunwind
+libqprof_utils_la_LDFLAGS=-lunwind-generic
 endif
 
 libqprof_libpfm2_la_SOURCES=prof_main.c prof_utils_libpfm2.c
diff -Nru orig/src/Makefile.in new/src/Makefile.in
--- orig/src/Makefile.in        2005-02-14 10:08:35.249273984 -0600
+++ new/src/Makefile.in 2005-02-14 10:01:57.555919481 -0600
@@ -137,7 +137,7 @@
 lib_LTLIBRARIES = libqprof_libpfm2.la libqprof_libpfm3.la libmalloc_trace.la
 
 libqprof_utils_la_SOURCES = prof_utils.h q-lib.c crc32.c q-lib.h crc32.h
[EMAIL PROTECTED]@libqprof_utils_la_LDFLAGS = -lunwind
[EMAIL PROTECTED]@libqprof_utils_la_LDFLAGS = -lunwind-generic
 
 libqprof_libpfm2_la_SOURCES = prof_main.c prof_utils_libpfm2.c
 libqprof_libpfm2_la_LIBADD = libqprof_utils.la
diff -Nru orig/src/prof_utils_libpfm2.c new/src/prof_utils_libpfm2.c
--- orig/src/prof_utils_libpfm2.c       2005-02-14 10:08:45.656500419 -0600
+++ new/src/prof_utils_libpfm2.c        2005-02-14 10:00:52.823498399 -0600
@@ -94,7 +94,7 @@
  */
 
 # include <errno.h>
-# include <perfmon/pfmlib.h>
+# include <perfmon2/pfmlib.h>
 # include <dlfcn.h>
 
 /* The following may be written repeatedly by different threads.       */
@@ -126,7 +126,7 @@
   typeof(pfm_dispatch_events) * my_pfm_dispatch_events;
 
   if (0 == event_string) return 0;
-  if ((pfm_handle = dlopen("libpfm.so.2", RTLD_LAZY)) == NULL)
+  if ((pfm_handle = dlopen("libpfm2.so.2", RTLD_LAZY)) == NULL)
     {
       QPROF_warn("Can't load libpfm: using timer instead.\n");
       return 0;
diff -Nru orig/src/prof_utils_libpfm3.c new/src/prof_utils_libpfm3.c
--- orig/src/prof_utils_libpfm3.c       2005-02-14 10:08:45.656500419 -0600
+++ new/src/prof_utils_libpfm3.c        2005-02-14 10:00:52.824474961 -0600
@@ -28,7 +28,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
  * SOFTWARE. 
  */
-
+#include "config.h"
 #include "prof_utils.h"
 #include "q-lib.h"
 
@@ -101,8 +101,8 @@
  */
 
 # include <errno.h>
-# include <perfmon/pfmlib.h>
-# include <perfmon/perfmon.h>
+# include <perfmon3/pfmlib.h>
+# include <perfmon3/perfmon.h>
 # include <dlfcn.h>
 # include <fcntl.h>
 # include <asm/unistd.h>
@@ -152,7 +152,7 @@
   typeof(pfm_dispatch_events) * my_pfm_dispatch_events;
 
   if (0 == event_string) return 0;
-  if ((pfm_handle = dlopen("libpfm.so.3", RTLD_LAZY)) == NULL)
+  if ((pfm_handle = dlopen("libpfm3.so.3", RTLD_LAZY)) == NULL)
     {
       QPROF_warn("Can't load libpfm: using timer instead.\n");
       return 0;


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: ia64
Kernel: Linux 2.6.8-1-mckinley-smp
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages qprof depends on:
ii  libc6.1                     2.3.2.ds1-20 GNU C Library: Shared libraries an
ii  libgcc1                     1:3.4.3-6    GCC support library
ii  libpfm2                     2.0-4        IA-64 Performance Monitor (PMU) --
ii  libpfm3                     3.0-3        IA-64 Performance Monitor (PMU) --
ii  libunwind7                  0.98.3-3     A library to determine the call-ch

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to