lkml.org 
[lkml]   [2010]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[RFC][PATCH 5/5] [PATCH 5/5] tracing/events: Add sched_migrate_task stable event
    From: Steven Rostedt <srostedt@redhat.com>

    Add the stable event for sched_migrate_task.

    [root@bxf ~]# cat /sys/kernel/event/sched_migrate_task/format
    array:comm type:char size:8 count:16 align:1 signed:1;
    field:pid type:pid_t size:32 align:4 signed:1;
    field:orig_cpu type:int size:32 align:4 signed:1;
    field:dest_cpu type:int size:32 align:4 signed:1;

    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    ---
    include/trace/stable/sched.h | 13 +++++++++++++
    kernel/events/events.c | 10 ++++++++++
    2 files changed, 23 insertions(+), 0 deletions(-)

    diff --git a/include/trace/stable/sched.h b/include/trace/stable/sched.h
    index b5f4fd7..55d0e6f 100644
    --- a/include/trace/stable/sched.h
    +++ b/include/trace/stable/sched.h
    @@ -17,4 +17,17 @@ STABLE_EVENT(sched_switch,
    )
    );

    +/*
    + * Tracepoint for a task being migrated:
    + */
    +STABLE_EVENT(sched_migrate_task,
    +
    + EVENT_STRUCT(
    + __array( char, comm, TASK_COMM_LEN )__SEP__
    + __field( pid_t, pid )__SEP__
    + __field( int, orig_cpu )__SEP__
    + __field( int, dest_cpu )
    + )
    +);
    +
    #endif /* _STABLE_SCHED_H */
    diff --git a/kernel/events/events.c b/kernel/events/events.c
    index f69e720..6ca2d2d 100644
    --- a/kernel/events/events.c
    +++ b/kernel/events/events.c
    @@ -35,4 +35,14 @@ static void hook_sched_switch(void *ignore,
    next->comm, next->pid);
    }

    +DECLARE_TRACE(stable_sched_migrate_task,
    + TP_PROTO(char *comm, pid_t pid, int orig_cpu, int dest_cpu),
    + TP_ARGS(comm, pid, orig_cpu, dest_cpu));
    +DEFINE_TRACE(stable_sched_migrate_task);
    +
    +static void hook_sched_migrate_task(void *ignore, struct task_struct *p, int dest_cpu)
    +{
    + trace_stable_sched_migrate_task(p->comm, p->pid, task_cpu(p), dest_cpu);
    +}
    +
    #include "event_reg.h"
    --
    1.7.1



    \
     
     \ /
      Last update: 2010-11-17 02:03    [W:0.021 / U:2.604 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site