[Crash-utility] Re: [PATCH] runqueue struct is changed to 'rq'

Dave Anderson anderson at redhat.com
Tue Aug 1 17:49:54 UTC 2006


Haren Myneni wrote:

>  'struct runqueue' is changed to 'rq' in 2.6.18-rc1 and it causes
> failure when invoking the crash tool - noticed on powerpc, but should
> see even on other archs. The attached patch has been created against the
> latest crach sources (crash-4.0-2.33).
>
> Thanks
> Haren
>

Haren,

Thanks for catching this.  I'll test it now in conjunction with a new
"cannot determine idle task addresses from init_tasks[] or runqueues[]"
init-time error that's popped up in later Fedora kernels.

Dave



>
>   ------------------------------------------------------------------------------------------------------------------------
> --- crash-4.0-2.33/kernel.c.orig        2006-07-18 19:09:29.000000000 -0700
> +++ crash-4.0-2.33/kernel.c     2006-07-19 17:53:39.000000000 -0700
> @@ -54,6 +54,7 @@ kernel_init(int when)
>         int i;
>         char *p1, *p2, buf[BUFSIZE];
>         struct syment *sp1, *sp2;
> +       char *rqstruct;
>
>         if (pc->flags & KERNEL_DEBUG_QUERY)
>                 return;
> @@ -157,7 +158,15 @@ kernel_init(int when)
>                                 &kt->__per_cpu_offset[0]);
>                         kt->flags |= PER_CPU_OFF;
>                 }
> -               MEMBER_OFFSET_INIT(runqueue_cpu, "runqueue", "cpu");
> +               if (STRUCT_EXISTS("runqueue"))
> +                       rqstruct = "runqueue";
> +               else if (STRUCT_EXISTS("rq"))
> +                       rqstruct = "rq";
> +
> +               MEMBER_OFFSET_INIT(runqueue_cpu, rqstruct, "cpu");
> +               /*
> +                * 'cpu' does not exist in 'struct rq'.
> +                */
>                 if (VALID_MEMBER(runqueue_cpu) &&
>                     (get_array_length("runqueue.cpu", NULL, 0) > 0)) {
>                         MEMBER_OFFSET_INIT(cpu_s_curr, "cpu_s", "curr");
> @@ -182,17 +191,17 @@ kernel_init(int when)
>              "runq_siblings: %d: __cpu_idx and __rq_idx arrays don't exist?\n",
>                                         kt->runq_siblings);
>                 } else {
> -                       MEMBER_OFFSET_INIT(runqueue_idle, "runqueue", "idle");
> -                       MEMBER_OFFSET_INIT(runqueue_curr, "runqueue", "curr");
> +                       MEMBER_OFFSET_INIT(runqueue_idle, rqstruct, "idle");
> +                       MEMBER_OFFSET_INIT(runqueue_curr, rqstruct, "curr");
>                         ASSIGN_OFFSET(runqueue_cpu) = INVALID_OFFSET;
>                 }
> -               MEMBER_OFFSET_INIT(runqueue_active, "runqueue", "active");
> -               MEMBER_OFFSET_INIT(runqueue_expired, "runqueue", "expired");
> -               MEMBER_OFFSET_INIT(runqueue_arrays, "runqueue", "arrays");
> +               MEMBER_OFFSET_INIT(runqueue_active, rqstruct, "active");
> +               MEMBER_OFFSET_INIT(runqueue_expired, rqstruct, "expired");
> +               MEMBER_OFFSET_INIT(runqueue_arrays, rqstruct, "arrays");
>                 MEMBER_OFFSET_INIT(prio_array_queue, "prio_array", "queue");
>                  MEMBER_OFFSET_INIT(prio_array_nr_active, "prio_array",
>                          "nr_active");
> -               STRUCT_SIZE_INIT(runqueue, "runqueue");
> +               STRUCT_SIZE_INIT(runqueue, rqstruct);
>                 STRUCT_SIZE_INIT(prio_array, "prio_array");
>
>                 /*




More information about the Crash-utility mailing list