Re: [PATCH 3/3] tracing/ksym_tracer: support quick clear for ksym_trace_filter

Xiao Guangrong
2009-07-23T00:50:50Z

K.Prasad wrote:

> As I stated before, the ability to support
> echo "*:---" > ksym_trace_filter was Ingo Molnar's suggestion, so if
> he's not particular about having it now we may skip it.
>

OK, I'll fix it.

> However, given that it requires just a few lines of code in addition,
> say
>
> + /* Clear all breakpoints if echo "*:---" > ksym_trace_filter */
> + if ((strncmp(ksymname, "*", strlen("*")) == 0) && (op == 0)) {
> + ksym_trace_reset(NULL);
> + kfree(input_string);
> + return count;
> + }
>

I think below way is simpler:

+ /*
+ /* Clear all breakpoints if:
+ /* 1: echo > ksym_trace_filter
+ /* 2: echo 0 > ksym_trace_filter
+ /* 3: echo "*:---" > ksym_trace_filter
+ */
+ strstrip(input_string);
+ if (!input_string[0] || !strcmp(input_string, "0") ||
+ (!strcmp(input, "*:---")) {
+ __ksym_trace_reset();
+ kfree(input_string);
+ return count;
+ }
+

I'll sent a new patch after do some test for it.

Thanks,
Xiao

> in ksym_trace_filter_write(), and that the patch is already present it
> shouldn't be bothersome to add it.
>
> Thanks,
> K.Prasad
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>