Hi all,

I'm using one of the perfmon's example codes, mont_dear.c, to test the
accessed memory positions on a Itanium2 Montvale. Basically, what I do is to
modify the do_test() function to store in a file the accessed memory
positions. Later, I compare them with the sampled addresses given by the
Event Address Registers (EARs). Surprisingly, all the sampled addresses are
always lower than the ones accessed in the do_test() function. Am I doing
something wrong? This is the modified function I use:

long do_test(unsigned long size)
{
    int i, sum  = 0;
    int *array;
    int *addr;

    FILE *fd;
    fd = fopen("addresses.dat","w");

    printf("array size %.1fKB\n", (size*sizeof(int))/1024.0);
    array = (int *)malloc(size * sizeof(int));

    if (array == NULL ) {
        printf("line = %d No memory available!\n", __LINE__);
        exit(1);
    }

    for(i=0; i<size; i++) {
        array[i]=1;
        addr = array+i;
        fprintf(fd,"%p array[%d]: %d\n",addr,i,array[i]);

    }

    fclose(fd);
    return sum;
}


Thanks in advance for all the comments you can provide,
Juan
------------------------------------------------------------------------------
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to