From 1a429ed1cb1ffd8d100e5669c3ad44d628d0e735 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 4 Feb 2013 11:22:43 +0300 Subject: [PATCH] db: print less --info for a few problematic functions There are a couple functions where we are tracking a ton of values. Mostly these are functions which have some big structs and maybe those structs have pointers to other structs. It ends up taking a long time to print the information on the --info run. What this does is that when we hit the: return ret; Just print the combined information instead of trying to break it down and printing a copy of for every value of ret. It means that instead of 2000 values out six times we just print 2000 values one time. Signed-off-by: Dan Carpenter --- smatch_db.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/smatch_db.c b/smatch_db.c index 175bd585..f32a463c 100644 --- a/smatch_db.c +++ b/smatch_db.c @@ -563,13 +563,18 @@ static int call_return_state_hooks_split_possible(struct expression *expr) struct sm_state *sm; struct sm_state *tmp; int ret = 0; + int nr_possible, nr_states; sm = get_sm_state_expr(SMATCH_EXTRA, expr); if (!sm || !sm->merged) return 0; /* bail if it gets too complicated */ - if (ptr_list_size((struct ptr_list *)sm->possible) >= 100) + nr_possible = ptr_list_size((struct ptr_list *)sm->possible); + nr_states = ptr_list_size((struct ptr_list *)__get_cur_slist()); + if (nr_possible >= 100) + return 0; + if (nr_states * nr_possible >= 1000) return 0; FOR_EACH_PTR(sm->possible, tmp) { -- 2.11.4.GIT