Messages in this thread | | | Date | Wed, 10 Feb 2010 13:33:48 +0800 | From | Li Zefan <> | Subject | Re: [PATCH] ftrace: Allow to remove a single function from function graph filter |
| |
>> do_for_each_ftrace_rec(pg, rec) { >> >> - if (*idx >= FTRACE_GRAPH_MAX_FUNCS) >> - break; >> - >> if (rec->flags & (FTRACE_FL_FAILED | FTRACE_FL_FREE)) >> continue; >> >> if (ftrace_match_record(rec, search, search_len, type)) { >> - /* ensure it is not already in the array */ >> + /* if it is in the array */ >> exists = false; >> - for (i = 0; i < *idx; i++) >> + for (i = 0; i < *idx; i++) { >> if (array[i] == rec->ip) { >> exists = true; >> break; >> } >> - if (!exists) >> - array[(*idx)++] = rec->ip; >> - found = 1; >> + } >> + >> + if (!not) { >> + if (!exists) { >> + array[(*idx)++] = rec->ip; >> + if (*idx >= FTRACE_GRAPH_MAX_FUNCS) >> + goto out; > > The fail = 0 needs to be first. I just tested this and on the 32'cd > function added, it gives a failed message but still adds the function. >
Will fix. Thanks!
> >> + } >> + fail = 0;
| |