Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
8705ec89
Unverified
Commit
8705ec89
authored
Nov 08, 2017
by
davidcunado-arm
Committed by
GitHub
Nov 08, 2017
Browse files
Merge pull request #1154 from soby-mathew/sm/fix_psci_stat
Fix PSCI STAT time stamp collection
parents
2904f84e
bfc87a8d
Changes
3
Show whitespace changes
Inline
Side-by-side
lib/psci/psci_common.c
View file @
8705ec89
...
...
@@ -767,12 +767,12 @@ void psci_warmboot_entrypoint(void)
psci_acquire_pwr_domain_locks
(
end_pwrlvl
,
cpu_idx
);
psci_get_target_local_pwr_states
(
end_pwrlvl
,
&
state_info
);
#if ENABLE_PSCI_STAT
plat_psci_stat_accounting_stop
(
&
state_info
);
#endif
psci_get_target_local_pwr_states
(
end_pwrlvl
,
&
state_info
);
/*
* This CPU could be resuming from suspend or it could have just been
* turned on. To distinguish between these 2 cases, we examine the
...
...
lib/psci/psci_suspend.c
View file @
8705ec89
...
...
@@ -37,6 +37,11 @@ static void psci_suspend_to_standby_finisher(unsigned int cpu_idx,
*/
psci_get_target_local_pwr_states
(
end_pwrlvl
,
&
state_info
);
#if ENABLE_PSCI_STAT
plat_psci_stat_accounting_stop
(
&
state_info
);
psci_stats_update_pwr_up
(
end_pwrlvl
,
&
state_info
);
#endif
/*
* Plat. management: Allow the platform to do operations
* on waking up from retention.
...
...
@@ -236,10 +241,6 @@ exit:
PMF_NO_CACHE_MAINT
);
#endif
#if ENABLE_PSCI_STAT
plat_psci_stat_accounting_start
(
state_info
);
#endif
/*
* We will reach here if only retention/standby states have been
* requested at multiple power levels. This means that the cpu
...
...
@@ -247,11 +248,6 @@ exit:
*/
wfi
();
#if ENABLE_PSCI_STAT
plat_psci_stat_accounting_stop
(
state_info
);
psci_stats_update_pwr_up
(
end_pwrlvl
,
state_info
);
#endif
#if ENABLE_RUNTIME_INSTRUMENTATION
PMF_CAPTURE_TIMESTAMP
(
rt_instr_svc
,
RT_INSTR_EXIT_HW_LOW_PWR
,
...
...
plat/common/plat_psci_common.c
View file @
8705ec89
...
...
@@ -18,6 +18,13 @@
/* Ticks elapsed in one second by a signal of 1 MHz */
#define MHZ_TICKS_PER_SEC 1000000
/* Maximum time-stamp value read from architectural counters */
#ifdef AARCH32
#define MAX_TS UINT32_MAX
#else
#define MAX_TS UINT64_MAX
#endif
/* Following are used as ID's to capture time-stamp */
#define PSCI_STAT_ID_ENTER_LOW_PWR 0
#define PSCI_STAT_ID_EXIT_LOW_PWR 1
...
...
@@ -45,7 +52,7 @@ static u_register_t calc_stat_residency(unsigned long long pwrupts,
assert
(
residency_div
);
if
(
pwrupts
<
pwrdnts
)
res
=
UINT64_
MAX
-
pwrdnts
+
pwrupts
;
res
=
MAX
_TS
-
pwrdnts
+
pwrupts
;
else
res
=
pwrupts
-
pwrdnts
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment