diff options
author | Stewart Smith <stewart@linux.ibm.com> | 2018-11-19 15:17:05 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-11-21 21:55:53 -0600 |
commit | 50ea35c2d07874755c03e6ae2bdf7a33ad2c768a (patch) | |
tree | d947f9317bf4f8e790eb881fae065e388e775d44 /core | |
parent | 8a2f8a3c12c683e29436395233da63e5978ab923 (diff) | |
download | skiboot-50ea35c2d07874755c03e6ae2bdf7a33ad2c768a.zip skiboot-50ea35c2d07874755c03e6ae2bdf7a33ad2c768a.tar.gz skiboot-50ea35c2d07874755c03e6ae2bdf7a33ad2c768a.tar.bz2 |
Warn on long OPAL calls
Measure entry/exit time for OPAL calls and warn appropriately if the
calls take too long (>100ms gets us a DEBUG log, > 1000ms gets us a
warning).
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/opal.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/opal.c b/core/opal.c index 63a0851..2834b38 100644 --- a/core/opal.c +++ b/core/opal.c @@ -167,6 +167,7 @@ int64_t opal_entry_check(struct stack_frame *eframe) } } + cpu->entered_opal_call_at = mftb(); return OPAL_SUCCESS; } @@ -176,6 +177,8 @@ int64_t opal_exit_check(int64_t retval, struct stack_frame *eframe) { struct cpu_thread *cpu = this_cpu(); uint64_t token = eframe->gpr[0]; + uint64_t now = mftb(); + uint64_t call_time = tb_to_msecs(now - cpu->entered_opal_call_at); if (!cpu->in_opal_call) { disable_fast_reboot("Un-accounted firmware entry"); @@ -193,6 +196,12 @@ int64_t opal_exit_check(int64_t retval, struct stack_frame *eframe) drop_my_locks(true); } } + + if (call_time > 100) { + prlog((call_time < 1000) ? PR_DEBUG : PR_WARNING, + "Spent %llu msecs in OPAL call %llu!\n", + call_time, token); + } return retval; } |