public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* TimerLib - usable library on X64?
@ 2018-11-06 12:13 Knop, Ryszard
  2018-11-06 15:52 ` Andrew Fish
  0 siblings, 1 reply; 2+ messages in thread
From: Knop, Ryszard @ 2018-11-06 12:13 UTC (permalink / raw)
  To: edk2-devel@lists.01.org

Hi everyone,
I'm trying to use TimerLib to precisely measure time elapsed between specific functions, and I'm having some issues trying to get it to work. On X64 platforms all I get is (depending on the TimerLib impl I use) either zeroes from QueryPerformanceCounter (QueryPerformanceCounterProperties returns zeroes for all the counters, except the frequency which is always reported as 100Hz), or the platform hangs. I've tried a few TimerLib implementations and I'm a bit out of ideas by now. Am I doing something wrong in the code itself, or is there any concrete implementation that is known to work well?

Sources I'm using: https://gist.github.com/DragoonAethis/7df6d8fb35c4f1932ec42bacbcbf73a8

Thanks, Richard.
--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: TimerLib - usable library on X64?
  2018-11-06 12:13 TimerLib - usable library on X64? Knop, Ryszard
@ 2018-11-06 15:52 ` Andrew Fish
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Fish @ 2018-11-06 15:52 UTC (permalink / raw)
  To: Knop, Ryszard; +Cc: edk2-devel@lists.01.org

Ryszard,

The different libraries mix timers, and TSC (for x86). 

For some of the timer libs there may be some PCD settings that need to get mapped to your platform. You can look in the timer libs INF to see what it depends on.

PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf

[Pcd]
  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciBusNumber             ## CONSUMES
  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciDeviceNumber          ## CONSUMES
  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciFunctionNumber        ## CONSUMES
  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciEnableRegisterOffset  ## CONSUMES
  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoBarEnableMask            ## CONSUMES
  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciBarRegisterOffset     ## CONSUMES
  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddress          ## CONSUMES
  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiPm1TmrOffset               ## CONSUMES
  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddressMask      ## CONSUMES

Thanks,

Andrew Fish

> On Nov 6, 2018, at 6:13 AM, Knop, Ryszard <ryszard.knop@intel.com> wrote:
> 
> Hi everyone,
> I'm trying to use TimerLib to precisely measure time elapsed between specific functions, and I'm having some issues trying to get it to work. On X64 platforms all I get is (depending on the TimerLib impl I use) either zeroes from QueryPerformanceCounter (QueryPerformanceCounterProperties returns zeroes for all the counters, except the frequency which is always reported as 100Hz), or the platform hangs. I've tried a few TimerLib implementations and I'm a bit out of ideas by now. Am I doing something wrong in the code itself, or is there any concrete implementation that is known to work well?
> 
> Sources I'm using: https://gist.github.com/DragoonAethis/7df6d8fb35c4f1932ec42bacbcbf73a8
> 
> Thanks, Richard.
> --------------------------------------------------------------------
> 
> Intel Technology Poland sp. z o.o.
> ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
> 
> Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
> przegladanie lub rozpowszechnianie jest zabronione.
> This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by
> others is strictly prohibited.
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-06 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-06 12:13 TimerLib - usable library on X64? Knop, Ryszard
2018-11-06 15:52 ` Andrew Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox