lkml.org 
[lkml]   [2008]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 06/10] sched: debug: add some rt debug output
    Also display rt_rq information in /proc/sched_debug

    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    ---
    kernel/sched_debug.c | 40 +++++++++++++++++++++++++++++++++++++---
    kernel/sched_rt.c | 14 ++++++++++++++
    2 files changed, 51 insertions(+), 3 deletions(-)

    Index: linux-2.6/kernel/sched_debug.c
    ===================================================================
    --- linux-2.6.orig/kernel/sched_debug.c
    +++ linux-2.6/kernel/sched_debug.c
    @@ -119,9 +119,7 @@ void print_cfs_rq(struct seq_file *m, in
    struct sched_entity *last;
    unsigned long flags;

    -#if !defined(CONFIG_CGROUP_SCHED) || !defined(CONFIG_USER_SCHED)
    - SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
    -#else
    +#if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED)
    char path[128] = "";
    struct cgroup *cgroup = NULL;
    struct task_group *tg = cfs_rq->tg;
    @@ -133,6 +131,8 @@ void print_cfs_rq(struct seq_file *m, in
    cgroup_path(cgroup, path, sizeof(path));

    SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
    +#else
    + SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
    #endif

    SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock",
    @@ -169,6 +169,39 @@ void print_cfs_rq(struct seq_file *m, in
    cfs_rq->nr_spread_over);
    }

    +void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq)
    +{
    +#if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_RT_GROUP_SCHED)
    + char path[128] = "";
    + struct cgroup *cgroup = NULL;
    + struct task_group *tg = rt_rq->tg;
    +
    + if (tg)
    + cgroup = tg->css.cgroup;
    +
    + if (cgroup)
    + cgroup_path(cgroup, path, sizeof(path));
    +
    + SEQ_printf(m, "\nrt_rq[%d]:%s\n", cpu, path);
    +#else
    + SEQ_printf(m, "\nrt_rq[%d]:\n", cpu);
    +#endif
    +
    +
    +#define P(x) \
    + SEQ_printf(m, " .%-30s: %Ld\n", #x, (long long)(rt_rq->x))
    +#define PN(x) \
    + SEQ_printf(m, " .%-30s: %Ld.%06ld\n", #x, SPLIT_NS(rt_rq->x))
    +
    + P(rt_nr_running);
    + P(rt_throttled);
    + PN(rt_time);
    + PN(rt_runtime);
    +
    +#undef PN
    +#undef P
    +}
    +
    static void print_cpu(struct seq_file *m, int cpu)
    {
    struct rq *rq = &per_cpu(runqueues, cpu);
    @@ -208,6 +241,7 @@ static void print_cpu(struct seq_file *m
    #undef PN

    print_cfs_stats(m, cpu);
    + print_rt_stats(m, cpu);

    print_rq(m, rq, cpu);
    }
    Index: linux-2.6/kernel/sched_rt.c
    ===================================================================
    --- linux-2.6.orig/kernel/sched_rt.c
    +++ linux-2.6/kernel/sched_rt.c
    @@ -1447,3 +1447,17 @@ static const struct sched_class rt_sched
    .prio_changed = prio_changed_rt,
    .switched_to = switched_to_rt,
    };
    +
    +#ifdef CONFIG_SCHED_DEBUG
    +extern void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq);
    +
    +static void print_rt_stats(struct seq_file *m, int cpu)
    +{
    + struct rt_rq *rt_rq;
    +
    + rcu_read_lock();
    + for_each_leaf_rt_rq(rt_rq, cpu_rq(cpu))
    + print_rt_rq(m, cpu, rt_rq);
    + rcu_read_unlock();
    +}
    +#endif
    --



    \
     
     \ /
      Last update: 2008-06-19 14:39    [W:0.031 / U:36.000 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site