Add PMF instrumentation points in TF
authordp-arm <dimitris.papastamos@arm.com>
Mon, 19 Sep 2016 10:18:44 +0000 (11:18 +0100)
committerdp-arm <dimitris.papastamos@arm.com>
Wed, 12 Oct 2016 14:36:49 +0000 (15:36 +0100)
commit872be88a2916f45d3de38120ede8c8b199b7498f
treec3cb92eeef9b70c1d8b7a34a95a2396d1dbc4d27
parentf10796a0686ee361fde54b887da05dd25e0ed2cf
Add PMF instrumentation points in TF

In order to quantify the overall time spent in the PSCI software
implementation, an initial collection of PMF instrumentation points
has been added.

Instrumentation has been added to the following code paths:

- Entry to PSCI SMC handler.  The timestamp is captured as early
  as possible during the runtime exception and stored in memory
  before entering the PSCI SMC handler.

- Exit from PSCI SMC handler.  The timestamp is captured after
  normal return from the PSCI SMC handler or if a low power state
  was requested it is captured in the bl31 warm boot path before
  return to normal world.

- Entry to low power state.  The timestamp is captured before entry
  to a low power state which implies either standby or power down.
  As these power states are mutually exclusive, only one timestamp
  is defined to describe both.  It is possible to differentiate between
  the two power states using the PSCI STAT interface.

- Exit from low power state.  The timestamp is captured after a standby
  or power up operation has completed.

To calculate the number of cycles spent running code in Trusted Firmware
one can perform the following calculation:

(exit_psci - enter_psci) - (exit_low_pwr - enter_low_pwr).

The resulting number of cycles can be converted to time given the
frequency of the counter.

Change-Id: Ie3b8f3d16409b6703747093b3a2d5c7429ad0166
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
12 files changed:
Makefile
bl31/aarch64/bl31_entrypoint.S
bl31/aarch64/runtime_exceptions.S
bl31/bl31_main.c
include/lib/el3_runtime/cpu_data.h
include/lib/pmf/pmf.h
include/lib/pmf/pmf_helpers.h
include/lib/runtime_instr.h [new file with mode: 0644]
lib/psci/psci_main.c
lib/psci/psci_off.c
lib/psci/psci_suspend.c
services/std_svc/std_svc_setup.c