From d0fddf5de842ffca34a5efb5479bb9c8a8d900a0 Mon Sep 17 00:00:00 2001 From: "hp.com!davidm" Date: Wed, 24 Sep 2003 21:56:42 +0000 Subject: [PATCH] (ia64_find_save_locs): Only call ia64_fetch_proc_info() when we really have to (i.e., if we don't have cached info). Otherwise, the unnecessary calls cause a performance regression. (Logical change 1.102) --- src/ia64/Gscript-ia64.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ia64/Gscript-ia64.c b/src/ia64/Gscript-ia64.c index 37651097..9c527b8d 100644 --- a/src/ia64/Gscript-ia64.c +++ b/src/ia64/Gscript-ia64.c @@ -496,16 +496,15 @@ ia64_find_save_locs (struct cursor *c) sigset_t saved_sigmask; int ret = 0; - ret = ia64_fetch_proc_info (c, c->ip, 1); - if (ret < 0) - return ret; - cache = get_script_cache (c->as, &saved_sigmask); { if (c->as->caching_policy == UNW_CACHE_NONE) { struct ia64_script tmp_script; + if ((ret = ia64_fetch_proc_info (c, c->ip, 1)) < 0) + goto out; + script = &tmp_script; script->ip = c->ip; script->hint = 0; @@ -519,6 +518,9 @@ ia64_find_save_locs (struct cursor *c) __FUNCTION__, (long) c->ip, script ? "hit" : "missed"); if (!script) { + if ((ret = ia64_fetch_proc_info (c, c->ip, 1)) < 0) + goto out; + script = script_new (cache, c->ip); if (!script) {