I'm not sure what the current state is but from a quick look at the code:
TSC (Time Stamp Counter) frequency can be passed up in the EFI System Table via
the gEfiTscFrequencyGuid GUID. If this GUID does not exist then the library
calls InernalCalculateTscFrequenc and this code seems to assume an ICH chip at
a magic PCI address
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/PerformancePkg/Library/TscTimerLib/DxeTscTimerLib.c
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/PerformancePkg/Library/TscTimerLib/TscTimerLibShare.c
/// IchPciAddressing PCI Bus Address for ICH.
///@{
#define PCI_BUS_NUMBER_ICH 0x00 ///< ICH is on PCI Bus 0.
#define PCI_DEVICE_NUMBER_ICH_LPC 31 ///< ICH is Device 31.
#define PCI_FUNCTION_NUMBER_ICH_LPC 0 ///< ICH is Function 0.
So it looks to me if the platform does not produce gEfiTscFrequencyGuid then
very dangerous assumptions are made about the chipset that you are using. It
almost looks like some one hard coded to the platform they tested on.
I would think from an user interface point of view it would have been better to
have an argument to dp comand to set the TSC value for the platform if it was
not possible to discover it.
If you know platform TSC value you could install the gEfiTscFrequencyGuid GUID
with the TSC value. DxeTscTimerLibConstructor() has an example of how to do
this. You need to do this before launching the dp tool since the library makes
a gEfiTscFrequencyGuid by assuming an ICH at a magic location.
You could also implement an instance of the TimerLib that abstracts the TSC for
your platform and point to that int he TSC file.
Andrew Fish
On Jan 28, 2013, at 2:35 AM, Ari Zigler <[email protected]> wrote:
> Hi,
>
> I was trying to use profiling macros in a driver I’m working on lately and
> have encountered difficulties working with it:
> 1. Can DP tool be used on an independent vendor’s platform? Meaning:
> can I run the DP tool on an environment that I didn’t build?
> 2. If so, I’ve must probably done something wrong while building the DP
> tool as while trying to load it on a real platform, the tool printed the 2
> following lines:
> i. Build
> version 0.0
> ii.
> Frequency (0) Ghz.
> And crashes…
> Can anyone imply on what shall I do in order to profile my driver on a real
> environment?
> I’ve already read the Performance Optimizations document on the Tianocore
> site but got hard time to figure out how to make it done from the document…
>
> Thanks,
>
> Ari.
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnnow-d2d_______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel