File libpfm-3.52.diff of Package libpfm
--- examples/Makefile
+++ examples/Makefile
@@ -43,7 +43,7 @@ ifeq ($(CONFIG_PFMLIB_ARCH_CRAYXT),y)
CFLAGS += -DCONFIG_PFMLIB_ARCH_CRAYXT
endif
-CFLAGS+= -I. -D_GNU_SOURCE
+CFLAGS+= -I. -D_GNU_SOURCE -Wno-error
LIBS += -lm
ifeq ($(SYS),Linux)
--- lib/pfmlib_itanium2.c
+++ lib/pfmlib_itanium2.c
@@ -240,7 +240,8 @@ check_inst_retired_events(pfmlib_input_p
for(i=0; i < count; i++) {
pfm_get_event_code(inp->pfp_events[i].event, &c);
if (c == code) {
- pfm_ita2_get_event_umask(inp->pfp_events[i].event, &umask);
+ if (pfm_ita2_get_event_umask(inp->pfp_events[i].event, &umask) != PFMLIB_SUCCESS)
+ continue;
switch(umask) {
case 0: mask |= 1;
break;
--- lib/pfmlib_os_linux.c
+++ lib/pfmlib_os_linux.c
@@ -390,16 +390,18 @@ static int
pfm_init_syscalls_sysfs(void)
{
FILE *fp;
+ int ret = 0;
fp = fopen("/sys/kernel/perfmon/syscall", "r");
if (!fp)
return -1;
- fscanf(fp, "%d", &sys_base);
+ if (fscanf(fp, "%d", &sys_base) != 1)
+ ret = -1;
fclose(fp);
- return 0;
+ return ret;
}
void