From: Andreas K. <kr...@li...> - 2011-11-23 08:46:37
|
On 11/22/2011 06:57 PM, Robert Richter wrote: > From my current view on it the above wouldn't change much in the > latest post of the kernel implementation for s390 basic mode sampling > (cpumf). Basically only the event selection must be dropped for cpumf > mode. For basic timer mode functionality we only need: > > /dev/oprofile/timer/enabled > > All remaining files for timer mode could be added later. > > We need locking to only allow either timer or cpumf mode to be > enabled. Since the intention is to support this on all oprofile platforms anyway wouldn't this belong into the oprofile common code so that the platform kernel modules don't have to care about it? This probably would mean that there has to be an interface for preventing other counters from being enabled while timer/enabled is '1'. Perhaps we could chose the semantics of the enabled attributes clever to reduce the necessary synchronization to a minimum: 1.) An enabled hardware counter always overrules the timer mode. So the enabled attribute of a hardware counter could be '1' while timer/enabled is '1' as well. But the hw counter will always win in that case. Using timer mode would then require to write '0' to all hw counter enabled attributes and write '1' to timer/enabled 2.) Modifying the enabled attributes could also modify other enabled attributes. Writing to an enabled attribute of a hw counter could set timer/enabled to '0' and setting timer/enabled to '1' would set all enabled attributes of hw counter to '0'. What do you think? Bye, -Andreas- > > We need locking to only allow either timer or cpumf mode to be > enabled. > > I admit the above requires some more changes in the daemon, but I > think the effort spent is worth the changes in favour of a clean > interface that other archs can benefit too. > > To summarize the proposed file layout for cpufm, it would look like > the following: > > /dev/oprofile/0/enabled # enable cpumf, timer must be 0 to enable > /dev/oprofile/0/event # 0 > /dev/oprofile/0/count # sample period > /dev/oprofile/0/unit_mask # 0 > /dev/oprofile/0/kernel # exclude kernel samples > /dev/oprofile/0/user # exclude user samples > /dev/oproifle/timer/enabled # enable timer, cpumf must be 0 to enable > /dev/oproifle/cpu_type # report s390/{z10,z196} > /dev/oprofile/... # existing standard files (unchanged) > > If cpumf does not exist on the system /dev/oprofile/0/ also would not > exist or fall back to /dev/oproifle/cpu_type=timer. > > Sounds resonable. > > Unfortunatly Maynard may not give us his opinion here before end of > November. But I would start going that direction anyway. > > -Robert > |