Re: [PATCH] ftrace: Allow to remove a single function from functiongraph filter

From: Li Zefan
Date: Wed Feb 10 2010 - 00:33:38 EST


>> 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/