Hello Dave,
On Mon, 23 Apr 2012 08:50:02 -0400 (EDT)
Dave Anderson <anderson(a)redhat.com> wrote:
[snip]
Question: how does that code path ever get run?
Interesting...
I only tested the patch on a live dump and not on the live system
with /dev/mem. Therefore I did not see that. On a live system, as you
described it, the s390x.c code is not used.
If you try a "bt" on an active task on a live system, it would
print the "(active)" here in back_trace(), prior to calling into
the machine-specific backtrace function:
if (ACTIVE() && !(bt->flags & BT_EFRAME_SEARCH) &&
((bt->task == tt->this_task) ||
is_task_active(bt->task))) {
if (BT_REFERENCE_CHECK(bt) ||
bt->flags &
(BT_TEXT_SYMBOLS_PRINT|BT_TEXT_SYMBOLS_NOPRINT)) return;
if (!(bt->flags &
(BT_KSTACKP|BT_TEXT_SYMBOLS|BT_TEXT_SYMBOLS_ALL)))
fprintf(fp, "(active)\n");
if (!(bt->flags &
(BT_TEXT_SYMBOLS|BT_TEXT_SYMBOLS_ALL))) return;
}
Note the "bt -[tT]" options should be allowed even if the task is
active.
So the check should be done in kernel.c and not in s390x.c.
Would the following patch be better?
---
kernel.c | 2 +-
s390x.c | 4 ----
2 files changed, 1 insertion(+), 5 deletions(-)
--- a/kernel.c
+++ b/kernel.c
@@ -2245,7 +2245,7 @@ back_trace(struct bt_info *bt)
return;
}
- if (ACTIVE() && !(bt->flags & BT_EFRAME_SEARCH) &&
+ if (LIVE() && !(bt->flags & BT_EFRAME_SEARCH) &&
((bt->task == tt->this_task) || is_task_active(bt->task))) {
if (BT_REFERENCE_CHECK(bt) ||
--- a/s390x.c
+++ b/s390x.c
@@ -1092,10 +1092,6 @@ static void s390x_back_trace_cmd(struct
* Print lowcore and print interrupt stacks when task has cpu
*/
if (s390x_has_cpu(bt)) {
- if (ACTIVE()) {
- fprintf(fp,"(active)\n");
- return;
- }
s390x_get_lowcore(bt, lowcore);
psw_flags = ULONG(lowcore + OFFSET(s390_lowcore_psw_save_area));