Several issues need to be addressed:
1. Use of the TSC is preferred, but is not mandatory. Select whichever
timer you want to use, that is appropriate for your platform, in the
[LibraryClasses] section of the DSC file. Make sure that the same type timer
is used for all measurements and also used for the DP utility. Right now, the
TSC timer can only be used on Intel IA32 and X64 based PC platforms.
2. The firmware must be built and instrumented for performance
measurements, otherwise there won't be any data gathered for the DP utility to
process. If you instrument your driver, and have correctly specified the
instances of DxePerformanceLib and TimerLib that you want to use, then you
should be able to profile your driver (assuming that it is module type
DXE_DRIVER or UEFI_DRIVER).
3. There are also several PCD entries that need to be set:
PcdPerformanceLibraryPropertyMask and PcdProfileLibraryPropertyMask must both
be set to 1 in order to enable the tracing and profiling capabilities.
Chapters 5 and 6 of the Performance Optimization 1.0 document provide details
on this.
Daryl McDaniel
SSG/SSD/PTAC/Platform Software Infrastructure
+1 503-712-4670
"In the pun, two strings of thought are tangled into one acoustic knot."
-- Arthur Koestler
From: Andrew Fish [mailto:af...@apple.com]
Sent: Monday, January 28, 2013 9:05 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Working with PerformancePkg and DP tool
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
<a...@mellanox.com<mailto:a...@mellanox.com>> 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<http://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
edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
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
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel