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
5d93484a
Commit
5d93484a
authored
Dec 19, 2016
by
danh-arm
Committed by
GitHub
Dec 19, 2016
Browse files
Merge pull request #779 from dp-arm/dp/rtinstr-cache
Add two timestamps to measure PSCI cache flush overhead
parents
78b4c5b0
7941816a
Changes
3
Show whitespace changes
Inline
Side-by-side
include/lib/runtime_instr.h
View file @
5d93484a
...
@@ -31,11 +31,13 @@
...
@@ -31,11 +31,13 @@
#ifndef __RUNTIME_INSTR_H__
#ifndef __RUNTIME_INSTR_H__
#define __RUNTIME_INSTR_H__
#define __RUNTIME_INSTR_H__
#define RT_INSTR_TOTAL_IDS 4
#define RT_INSTR_ENTER_PSCI 0
#define RT_INSTR_ENTER_PSCI 0
#define RT_INSTR_EXIT_PSCI 1
#define RT_INSTR_EXIT_PSCI 1
#define RT_INSTR_ENTER_HW_LOW_PWR 2
#define RT_INSTR_ENTER_HW_LOW_PWR 2
#define RT_INSTR_EXIT_HW_LOW_PWR 3
#define RT_INSTR_EXIT_HW_LOW_PWR 3
#define RT_INSTR_ENTER_CFLUSH 4
#define RT_INSTR_EXIT_CFLUSH 5
#define RT_INSTR_TOTAL_IDS 6
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLY__
PMF_DECLARE_CAPTURE_TIMESTAMP
(
rt_instr_svc
)
PMF_DECLARE_CAPTURE_TIMESTAMP
(
rt_instr_svc
)
...
...
lib/psci/psci_off.c
View file @
5d93484a
...
@@ -107,12 +107,29 @@ int psci_do_cpu_off(unsigned int end_pwrlvl)
...
@@ -107,12 +107,29 @@ int psci_do_cpu_off(unsigned int end_pwrlvl)
psci_stats_update_pwr_down
(
end_pwrlvl
,
&
state_info
);
psci_stats_update_pwr_down
(
end_pwrlvl
,
&
state_info
);
#endif
#endif
#if ENABLE_RUNTIME_INSTRUMENTATION
/*
* Flush cache line so that even if CPU power down happens
* the timestamp update is reflected in memory.
*/
PMF_CAPTURE_TIMESTAMP
(
rt_instr_svc
,
RT_INSTR_ENTER_CFLUSH
,
PMF_CACHE_MAINT
);
#endif
/*
/*
* Arch. management. Perform the necessary steps to flush all
* Arch. management. Perform the necessary steps to flush all
* cpu caches.
* cpu caches.
*/
*/
psci_do_pwrdown_cache_maintenance
(
psci_find_max_off_lvl
(
&
state_info
));
psci_do_pwrdown_cache_maintenance
(
psci_find_max_off_lvl
(
&
state_info
));
#if ENABLE_RUNTIME_INSTRUMENTATION
PMF_CAPTURE_TIMESTAMP
(
rt_instr_svc
,
RT_INSTR_EXIT_CFLUSH
,
PMF_NO_CACHE_MAINT
);
#endif
/*
/*
* Plat. management: Perform platform specific actions to turn this
* Plat. management: Perform platform specific actions to turn this
* cpu off e.g. exit cpu coherency, program the power controller etc.
* cpu off e.g. exit cpu coherency, program the power controller etc.
...
...
lib/psci/psci_suspend.c
View file @
5d93484a
...
@@ -109,6 +109,17 @@ static void psci_suspend_to_pwrdown_start(unsigned int end_pwrlvl,
...
@@ -109,6 +109,17 @@ static void psci_suspend_to_pwrdown_start(unsigned int end_pwrlvl,
*/
*/
cm_init_my_context
(
ep
);
cm_init_my_context
(
ep
);
#if ENABLE_RUNTIME_INSTRUMENTATION
/*
* Flush cache line so that even if CPU power down happens
* the timestamp update is reflected in memory.
*/
PMF_CAPTURE_TIMESTAMP
(
rt_instr_svc
,
RT_INSTR_ENTER_CFLUSH
,
PMF_CACHE_MAINT
);
#endif
/*
/*
* Arch. management. Perform the necessary steps to flush all
* Arch. management. Perform the necessary steps to flush all
* cpu caches. Currently we assume that the power level correspond
* cpu caches. Currently we assume that the power level correspond
...
@@ -117,6 +128,12 @@ static void psci_suspend_to_pwrdown_start(unsigned int end_pwrlvl,
...
@@ -117,6 +128,12 @@ static void psci_suspend_to_pwrdown_start(unsigned int end_pwrlvl,
* and the cpu-ops power down to perform from the platform.
* and the cpu-ops power down to perform from the platform.
*/
*/
psci_do_pwrdown_cache_maintenance
(
max_off_lvl
);
psci_do_pwrdown_cache_maintenance
(
max_off_lvl
);
#if ENABLE_RUNTIME_INSTRUMENTATION
PMF_CAPTURE_TIMESTAMP
(
rt_instr_svc
,
RT_INSTR_EXIT_CFLUSH
,
PMF_NO_CACHE_MAINT
);
#endif
}
}
/*******************************************************************************
/*******************************************************************************
...
...
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