lkml.org 
[lkml]   [2006]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [perfmon] 2.6.19-rc6-git10 new perfmon code base + libpfm + pfmon
Stephane Eranian wrote:
> Hello,
>
> I have released another version of the perfmon new code base package.
> This version of the kernel patch is relative to 2.6.19-rc6-git10.
>
> This is a major update because it completes the changes requested
> during the code review on LKML. As a consequence, the kernel interface
> is NOT backward compatible with previous v2.2 versions. This release has
> the v2.3 version number. Backward compatibility with v2.0 is maintained
> on Itanium processors.

Hi Stephane,

I have built the kernel with the new patches and tried things out on x86_64 an
x88_64 machine with Fedora Core 4. I attempted use the new libpfm and pfmon to
update the source RPMs and I noticed that there were some return values from
read() and write() being ignored. When pfmon is being built as an RPM ignoring
the read and write return values cause the rpmbuild to fail. Attached is a
simple patch that stuffs the return values into dummy variable to avoid the
warnings. This patch allows libpfm and pfmon the source RPMs to compile on FC4
and Fedora Core rawhide.

-Will
--- pfmon-3.2-061127/pfmon/pfmon_util.c.fortify 2006-11-27 05:22:40.000000000 -0500
+++ pfmon-3.2-061127/pfmon/pfmon_util.c 2006-11-27 13:38:43.000000000 -0500
@@ -1031,6 +1031,7 @@
int fd;
size_t max, used;
char number[32];
+ ssize_t dummy;

if (options.opt_is22 == 0)
return (size_t)-1;
@@ -1042,7 +1043,7 @@
if (fd == -1)
return (size_t)-1;
memset(number, 0, sizeof(number));
- read(fd, number, sizeof(number));
+ dummy = read(fd, number, sizeof(number));

close(fd);

@@ -1055,7 +1056,7 @@
if (fd == -1)
return (size_t)-1;
memset(number, 0, sizeof(number));
- read(fd, number, sizeof(number));
+ dummy = read(fd, number, sizeof(number));
close(fd);

max = strtoul(number, NULL, 0);
--- pfmon-3.2-061127/pfmon/pfmon_task.c.fortify 2006-11-27 13:39:16.000000000 -0500
+++ pfmon-3.2-061127/pfmon/pfmon_task.c 2006-11-27 13:39:57.000000000 -0500
@@ -1675,6 +1675,7 @@
int ctrl_fd;
int max_fd;
int ndesc, msg_type;
+ ssize_t dummy;

/*
* POSIX threads:
@@ -1811,7 +1812,7 @@
/*
* ack the removal
*/
- write(workers[mycpu].from_worker[1], &msg, sizeof(msg));
+ dummy = write(workers[mycpu].from_worker[1], &msg, sizeof(msg));
break;

case PFMON_TASK_MSG_QUIT:
\
 
 \ /
  Last update: 2006-11-27 20:11    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site