Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

chudSetPMCModes




Hi,

Last fall I wrote a program using chudSetPMCModes to allow me to do a basic clock cycle count. The basic outline is listed below. The problem is, this code is giving me warnings when I try to call chudSetPMCModes. I do this in 3 places:

chudSetPMCModes(chudCPU1Dev, useArray);
chudSetPMCModes(chudMCDev, useArray);
chudSetPMCModes(chudOSDev, useArray);

where useArray is defined as

int useArray[8] = {chudCounter, chudCounter, chudUnused, chudUnused, chudUnused, chudUnused, chudUnused, chudUnused};


I get the warnings:

call_combine.c: In function `call_combine':
call_combine.c:63: warning: passing arg 2 of `chudSetPMCModes' from incompatible pointer type
call_combine.c:67: warning: passing arg 2 of `chudSetPMCModes' from incompatible pointer type
call_combine.c:68: warning: passing arg 2 of `chudSetPMCModes' from incompatible pointer type


The code compiles and runs on my G4 Ti powerbook, and G3 ibook. But fails to compile on G5 machines after giving the same warnings. As I recall, when I wrote this I didn't receive these error messages when I compiled. Has the chudSetPMCModes function changed inside of CHUD since last fall? Where can I go about finding out about this function so I can get my code working on G5's?

Thanks,

Aaron






chudInitialize(); chudAcquireSamplingFacility(CHUD_NONBLOCKING); chudSetSamplingDevice(chudUserDev);

chudMarkCurrentThread(TRUE);
chudSetMarkFilter(chudCPU1Dev, chudFmodeOnlyMarked);
chudSetPrivilegeFilter(chudCPU1Dev, chudFmodeOnlyUser);

//set up the counters (on each CPU) to count cycles

chudSetPMCEvent(chudCPU1Dev, PMC_1, 1); //event #1 is CPU cycles
chudSetPMCEvent(chudCPU1Dev, PMC_2, 2); //event #2 is Instructions

chudMarkCurrentThread(TRUE);
chudSetMarkFilter(chudCPU1Dev, chudFmodeOnlyMarked);
chudSetPrivilegeFilter(chudCPU1Dev, chudFmodeOnlyUser);
chudSetPMCModes(chudCPU1Dev, useArray);
useArray[PMC_1]=chudUnused;
useArray[PMC_2]=chudUnused;
chudSetPMCModes(chudMCDev, useArray);
chudSetPMCModes(chudOSDev, useArray);

chudClearPMCs();
chudStartPMCs();

    combine1(vec, dest ); //function I want to test the clock cycles of

chudStopPMCs();

pmcSampleCt[0]= chudGetSingleSamplePMCCounts(chudCPU1Dev, &npmcs[0]);

//Actual count - Latency of pmcSampleCt
count1=pmcSampleCt[0][PMC_1]-ctrlCycles[0];
icount1=pmcSampleCt[0][PMC_2]-ctrlInstrs[0];




email@hidden http://www.lcv.umd.edu/~palott LCV: CSS 4364A 301.405.4865 Office: CSS 4364E 301.405.8735 Fax: 301.314.0827

P. Aaron Lott
4364E Computer and Space Sciences Building
University of Maryland
College Park, MD 20742-4015


_______________________________________________ Do not post admin requests to the list. They will be ignored. PerfOptimization-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.