[PATCH][RESEND] tracing/ftrace: Remove unused code in sched_switch tracer - Kernel

This is a discussion on [PATCH][RESEND] tracing/ftrace: Remove unused code in sched_switch tracer - Kernel ; When init_sched_switch_trace() is called, it has no reason to start the sched tracer if the sched_ref is not zero. _ If this is non-zero, the tracer is already used, but we can register it to the tracing engine. There is ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH][RESEND] tracing/ftrace: Remove unused code in sched_switch tracer

  1. [PATCH][RESEND] tracing/ftrace: Remove unused code in sched_switch tracer

    When init_sched_switch_trace() is called, it has no reason to start
    the sched tracer if the sched_ref is not zero.

    _ If this is non-zero, the tracer is already used, but we can register it
    to the tracing engine. There is already a security which avoid the tracer
    probes not to be resgistered twice.

    _ If this is zero, this block will not be used.

    Signed-off-by: Frederic Weisbecker
    CC: Steven Rostedt
    ---
    kernel/trace/trace_sched_switch.c | 8 --------
    1 files changed, 0 insertions(+), 8 deletions(-)
    diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c
    index 59de514..96620c7 100644
    --- a/kernel/trace/trace_sched_switch.c
    +++ b/kernel/trace/trace_sched_switch.c
    @@ -203,14 +203,6 @@ static struct tracer sched_switch_trace __read_mostly =

    __init static int init_sched_switch_trace(void)
    {
    - int ret = 0;
    -
    - if (atomic_read(&sched_ref))
    - ret = tracing_sched_register();
    - if (ret) {
    - pr_info("error registering scheduler trace\n");
    - return ret;
    - }
    return register_tracer(&sched_switch_trace);
    }
    device_initcall(init_sched_switch_trace);
    --
    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/

  2. Re: [PATCH][RESEND] tracing/ftrace: Remove unused code in sched_switch tracer

    2008/10/31 Frederic Weisbecker :
    > When init_sched_switch_trace() is called, it has no reason to start
    > the sched tracer if the sched_ref is not zero.
    >
    > _ If this is non-zero, the tracer is already used, but we can register it
    > to the tracing engine. There is already a security which avoid the tracer
    > probes not to be resgistered twice.
    >
    > _ If this is zero, this block will not be used.
    >
    > Signed-off-by: Frederic Weisbecker
    > CC: Steven Rostedt
    > ---
    > kernel/trace/trace_sched_switch.c | 8 --------
    > 1 files changed, 0 insertions(+), 8 deletions(-)
    > diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c
    > index 59de514..96620c7 100644
    > --- a/kernel/trace/trace_sched_switch.c
    > +++ b/kernel/trace/trace_sched_switch.c
    > @@ -203,14 +203,6 @@ static struct tracer sched_switch_trace __read_mostly =
    >
    > __init static int init_sched_switch_trace(void)
    > {
    > - int ret = 0;
    > -
    > - if (atomic_read(&sched_ref))
    > - ret = tracing_sched_register();
    > - if (ret) {
    > - pr_info("error registering scheduler trace\n");
    > - return ret;
    > - }
    > return register_tracer(&sched_switch_trace);
    > }
    > device_initcall(init_sched_switch_trace);
    >


    (depends on tracing/ftrace: Fix a race condition in sched_switch tracer)
    --
    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/

+ Reply to Thread