Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   Problem in runq command (http://www.linux-archive.org/crash-utility/682784-problem-runq-command.html)

"Karlsson, Jan" 07-12-2012 06:19 AM

Problem in runq command
 
Hi Dave
*
I found a problem with the runq command in the function dump_CFS_runqueues in task.c. The problem is in:
*
* if (!(rq_sp = per_cpu_symbol_search("per_cpu__runqueues")))
*** error(FATAL, "per-cpu runqueues does not exist
");
*
as that code does not support single core systems. However the rest of the function seems to handle single core correctly, so by just adding one line:
*
* if (!(rq_sp = per_cpu_symbol_search("per_cpu__runqueues")))
*** if (!(rq_sp = symbol_search("runqueues")))
***** error(FATAL, "per-cpu runqueues does not exist
");
*
the runq command works as it should. Of course the text in the error message should also be updated to something more proper.
*
Jan
*
*
Jan Karlsson
Senior Software Engineer
MIB
*
Sony Mobile Communications
Tel: +46703062174
sonymobile.com
*

*
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Dave Anderson 07-12-2012 01:17 PM

Problem in runq command
 
----- Original Message -----
>
> Hi Dave
>
> I found a problem with the runq command in the function
> dump_CFS_runqueues in task.c. The problem is in:
>
> if (!(rq_sp = per_cpu_symbol_search("per_cpu__runqueues")))
>
> error(FATAL, "per-cpu runqueues does not exist
");
>
> as that code does not support single core systems. However the rest
> of the function seems to handle single core correctly, so by just
> adding one line:
>
> if (!(rq_sp = per_cpu_symbol_search("per_cpu__runqueues")))
> if (!(rq_sp = symbol_search("runqueues")))
> error(FATAL, "per-cpu runqueues does not exist
");
>
> the runq command works as it should. Of course the text in the error
> message should also be updated to something more proper.
>

Interesting -- as it turns out, I've only got one sample x86_64 UP
kernel vmcore, and even though it's non-smp, a "per_cpu__runqueues"
symbol exists that points to the single runqueue. But it's a 2.6.31
UP kernel, and per-cpu handling has changed since then.

Anyway I see see the problem with the sample UP 2.6.38 ARM vmcore you
guys sent me, and note that it also breaks the "runq -t" option as well.
But that is also fixable by applying the same patch.

Good catch -- fixes are queued for crash-6.0.9.

Thanks,
Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Dave Anderson 07-12-2012 02:55 PM

Problem in runq command
 
----- Original Message -----
>
>
> ----- Original Message -----
> >
> > Hi Dave
> >
> > I found a problem with the runq command in the function
> > dump_CFS_runqueues in task.c. The problem is in:
> >
> > if (!(rq_sp = per_cpu_symbol_search("per_cpu__runqueues")))
> >
> > error(FATAL, "per-cpu runqueues does not exist
");
> >
> > as that code does not support single core systems. However the rest
> > of the function seems to handle single core correctly, so by just
> > adding one line:
> >
> > if (!(rq_sp = per_cpu_symbol_search("per_cpu__runqueues")))
> > if (!(rq_sp = symbol_search("runqueues")))
> > error(FATAL, "per-cpu runqueues does not exist
");
> >
> > the runq command works as it should. Of course the text in the error
> > message should also be updated to something more proper.
> >
>
> Interesting -- as it turns out, I've only got one sample x86_64 UP
> kernel vmcore, and even though it's non-smp, a "per_cpu__runqueues"
> symbol exists that points to the single runqueue. But it's a 2.6.31
> UP kernel, and per-cpu handling has changed since then.
>
> Anyway I see see the problem with the sample UP 2.6.38 ARM vmcore you
> guys sent me, and note that it also breaks the "runq -t" option as well.
> But that is also fixable by applying the same patch.

I take that back -- the per_cpu_symbol_search() function should find
the non-percpu symbol and return its syment pointer. And because that
function fails, other command(s) that call per_cpu_symbol_search() will
fail with your vmcore as well. For example, the "timer" command:.

crash> runq
runq: per-cpu runqueues does not exist
crash> timer
timer: zero-size memory allocation! (called from 811c199)
crash>

This doesn't appear to be ARM-specific, but to be safe, the fix I'm
going with is this:

--- ARM_crash-6.0.8/symbols.c.orig
+++ ARM_crash-6.0.8/symbols.c
@@ -4789,6 +4789,9 @@ per_cpu_symbol_search(char *symbol)
if ((sp = symbol_search(new))) {
if ((sp->type == 'V') || (is_percpu_symbol(sp)))
return sp;
+ if ((sp->type == 'd') &&
+ (st->__per_cpu_start == st->__per_cpu_end))
+ return sp;
}
} else {
if ((sp = symbol_search(symbol))) {

Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

"Karlsson, Jan" 07-13-2012 06:11 AM

Problem in runq command
 
I have tested your new solution and, as expected, it solves the problems I see. Thanks.

Jan


Jan Karlsson
Senior Software Engineer
MIB
*
Sony Mobile Communications
Tel: +46703062174
sonymobile.com
*


-----Original Message-----
From: crash-utility-bounces@redhat.com [mailto:crash-utility-bounces@redhat.com] On Behalf Of Dave Anderson
Sent: torsdag den 12 juli 2012 16:56
To: Discussion list for crash utility usage, maintenance and development
Subject: Re: [Crash-utility] Problem in runq command



----- Original Message -----
>
>
> ----- Original Message -----
> >
> > Hi Dave
> >
> > I found a problem with the runq command in the function
> > dump_CFS_runqueues in task.c. The problem is in:
> >
> > if (!(rq_sp = per_cpu_symbol_search("per_cpu__runqueues")))
> >
> > error(FATAL, "per-cpu runqueues does not exist
");
> >
> > as that code does not support single core systems. However the rest
> > of the function seems to handle single core correctly, so by just
> > adding one line:
> >
> > if (!(rq_sp = per_cpu_symbol_search("per_cpu__runqueues")))
> > if (!(rq_sp = symbol_search("runqueues")))
> > error(FATAL, "per-cpu runqueues does not exist
");
> >
> > the runq command works as it should. Of course the text in the error
> > message should also be updated to something more proper.
> >
>
> Interesting -- as it turns out, I've only got one sample x86_64 UP
> kernel vmcore, and even though it's non-smp, a "per_cpu__runqueues"
> symbol exists that points to the single runqueue. But it's a 2.6.31
> UP kernel, and per-cpu handling has changed since then.
>
> Anyway I see see the problem with the sample UP 2.6.38 ARM vmcore you
> guys sent me, and note that it also breaks the "runq -t" option as well.
> But that is also fixable by applying the same patch.

I take that back -- the per_cpu_symbol_search() function should find
the non-percpu symbol and return its syment pointer. And because that
function fails, other command(s) that call per_cpu_symbol_search() will
fail with your vmcore as well. For example, the "timer" command:.

crash> runq
runq: per-cpu runqueues does not exist
crash> timer
timer: zero-size memory allocation! (called from 811c199)
crash>

This doesn't appear to be ARM-specific, but to be safe, the fix I'm
going with is this:

--- ARM_crash-6.0.8/symbols.c.orig
+++ ARM_crash-6.0.8/symbols.c
@@ -4789,6 +4789,9 @@ per_cpu_symbol_search(char *symbol)
if ((sp = symbol_search(new))) {
if ((sp->type == 'V') || (is_percpu_symbol(sp)))
return sp;
+ if ((sp->type == 'd') &&
+ (st->__per_cpu_start == st->__per_cpu_end))
+ return sp;
}
} else {
if ((sp = symbol_search(symbol))) {

Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility


All times are GMT. The time now is 03:44 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.