Re: [perfmon2] Question about the example task_smpl

2009-01-08 Thread stephane eranian
Corey, On Thu, Jan 8, 2009 at 2:16 AM, Corey J Ashford wrote: > atomic_long_t is defined from atomic64_t which on power is defined as > struct { long counter }. > > As an experiment, I tried changing perfmon_file.c to use atomic_long_read > instead of atomic_read, and that fixed the problem. See

Re: [perfmon2] Question about the example task_smpl

2009-01-07 Thread Corey J Ashford
atomic_long_t is defined from atomic64_t which on power is defined as struct { long counter }. As an experiment, I tried changing perfmon_file.c to use atomic_long_read instead of atomic_read, and that fixed the problem. Seeing how Power is a big endian machine, it makes a lot of sense why ato

Re: [perfmon2] Question about the example task_smpl

2009-01-07 Thread stephane eranian
On Thu, Jan 8, 2009 at 12:56 AM, Corey J Ashford wrote: > It's a 64-bit kernel App is 64-bits also, but I don't think that matters. > Could you verify that sizeof(atomic_t) = sizeof(atomic_long_t) on your system? > "stephane eranian" wrote on 01/07/2009 03:54:51 > PM: > >> Corey, >> >> On Thu

Re: [perfmon2] Question about the example task_smpl

2009-01-07 Thread Corey J Ashford
It's a 64-bit kernel App is 64-bits also, but I don't think that matters. "stephane eranian" wrote on 01/07/2009 03:54:51 PM: > Corey, > > On Thu, Jan 8, 2009 at 12:49 AM, Corey J Ashford wrote: > > > > Yes, I didn't notice it before, but I am getting that warning. > > > > Before I received

Re: [perfmon2] Question about the example task_smpl

2009-01-07 Thread stephane eranian
Corey, On Thu, Jan 8, 2009 at 12:49 AM, Corey J Ashford wrote: > > Yes, I didn't notice it before, but I am getting that warning. > > Before I received your email, I added some instrumentation to the callback > pfm_buf_map_close() which is the function that sets ctx->flags.mmap_nlock to > 1, and

Re: [perfmon2] Question about the example task_smpl

2009-01-07 Thread Corey J Ashford
Yes, I didn't notice it before, but I am getting that warning. Before I received your email, I added some instrumentation to the callback pfm_buf_map_close() which is the function that sets ctx->flags.mmap_nlock to 1, and I see that file->f_count == 0.   This would cause that flag not to be set,

Re: [perfmon2] Question about the example task_smpl

2009-01-07 Thread stephane eranian
Corey, Are you getting: perfmon/perfmon_file.c: In function 'pfm_buf_map_close': perfmon/perfmon_file.c:137: warning: passing argument 1 of 'atomic_read' from incompatible pointer type When compiling your kernel? This needs to be investigated some more because this is on a test which sets a

Re: [perfmon2] Question about the example task_smpl

2009-01-07 Thread stephane eranian
Corey, Let me take a look at this. This is some nasty code in there. But it is also old and we may be able simplify it. I don't think it has to be that complicated. Problem is that the issue does not show up on x86. On Thu, Jan 8, 2009 at 12:10 AM, Corey J Ashford wrote: > Ok, I have some more

Re: [perfmon2] Question about the example task_smpl

2009-01-07 Thread Corey J Ashford
Ok, I have some more data about this lock-up problem. I turned on perfmon debugging and saw that the last thing that perfmon did was to call down_write() from pfm_smp_buf_space_release.212. That code attempts to acquire a lock, so I decided to turn on lock debugging in the kernel, and got thi

Re: [perfmon2] Question about the example task_smpl

2009-01-07 Thread Corey J Ashford
Yes, I was rather hoping this test case would cause a hang, because then I could send it off to the Power Linux maintainer ;-) - Corey "stephane eranian" wrote on 01/07/2009 12:03:24 PM: > Corey, > > I was expecting success with the program below if /tmp/foo exists. > > The perfmon code tha

Re: [perfmon2] Question about the example task_smpl

2009-01-07 Thread stephane eranian
Corey, I was expecting success with the program below if /tmp/foo exists. The perfmon code that handles all of this is generic, so there must be a race condition somewhere which is only exposed on Power. On Wed, Jan 7, 2009 at 8:02 PM, Corey J Ashford wrote: > Thanks for the reply, Stephane. I

Re: [perfmon2] Question about the example task_smpl

2009-01-07 Thread Corey J Ashford
Thanks for the reply, Stephane. I tried the test case you suggested: main() { int fd; void *addr; fd = open ("/tmp/foo", O_RDONLY); printf("fd = %d\n", fd); addr = mmap(NULL, 10, PROT_READ, MAP_PRIVATE, fd, 0); printf("addr = %p\n", addr); if (close(fd)) { printf("clos

Re: [perfmon2] Question about the example task_smpl

2009-01-06 Thread stephane eranian
Corey, On Wed, Jan 7, 2009 at 3:24 AM, Corey J Ashford wrote: > > Hello, > > I'd appreciate it if someone on this mailing list could try out the libpfm > example: task_smpl and see if it runs correctly for you on any other > architecture besides Power. > > When I run it on my Power5-based machine

[perfmon2] Question about the example task_smpl

2009-01-06 Thread Corey J Ashford
Hello, I'd appreciate it if someone on this mailing list could try out the libpfm example: task_smpl and see if it runs correctly for you on any other architecture besides Power. When I run it on my Power5-based machine here, I get a system hang that occurs when the munmap call is made.  Looking