--- crash-4.0-5.0/filesys.c 2008-02-19 10:15:37.000000000 -0500 +++ crash-4.0-5.1/filesys.c 2008-01-21 13:43:40.000000000 -0500 @@ -1,8 +1,8 @@ /* filesys.c - core analysis suite * * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. - * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 David Anderson - * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. All rights reserved. + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 David Anderson + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -3484,10 +3484,14 @@ #define RADIX_TREE_MAP_SHIFT 6 #define RADIX_TREE_MAP_SIZE (1UL << RADIX_TREE_MAP_SHIFT) #define RADIX_TREE_MAP_MASK (RADIX_TREE_MAP_SIZE-1) +#define RADIX_TREE_TAGS 2 +#define RADIX_TREE_TAG_LONGS \ + ((RADIX_TREE_MAP_SIZE + BITS_PER_LONG - 1) / BITS_PER_LONG) struct radix_tree_node { unsigned int count; void *slots[RADIX_TREE_MAP_SIZE]; + unsigned long tags[RADIX_TREE_TAGS][RADIX_TREE_TAG_LONGS]; }; /* @@ -3639,16 +3643,15 @@ radix_tree_lookup(ulong root_rnode, ulong index, int height) { unsigned int shift; - struct radix_tree_node **slot; + void *slot; struct radix_tree_node slotbuf; - void **kslotp, **uslotp; shift = (height-1) * RADIX_TREE_MAP_SHIFT; - kslotp = (void **)root_rnode; + + readmem(root_rnode, KVADDR, &slot, sizeof(void *), + "radix_tree_root rnode", FAULT_ON_ERROR); while (height > 0) { - readmem((ulong)kslotp, KVADDR, &slot, sizeof(void *), - "radix_tree_node slot", FAULT_ON_ERROR); if (slot == NULL) return NULL; @@ -3657,15 +3660,13 @@ sizeof(struct radix_tree_node), "radix_tree_node struct", FAULT_ON_ERROR); - uslotp = (void **) - (slotbuf.slots + ((index >> shift) & RADIX_TREE_MAP_MASK)); - kslotp = *uslotp; - + slot = slotbuf.slots[((index >> shift) & RADIX_TREE_MAP_MASK)]; + shift -= RADIX_TREE_MAP_SHIFT; height--; } - return (void *) kslotp; + return slot; } int --- crash-4.0-5.0/task.c 2008-02-19 10:15:37.000000000 -0500 +++ crash-4.0-5.1/task.c 2008-02-12 15:44:23.000000000 -0500 @@ -212,8 +212,13 @@ MEMBER_OFFSET_INIT(task_struct_pids, "task_struct", "pids"); MEMBER_OFFSET_INIT(task_struct_last_run, "task_struct", "last_run"); MEMBER_OFFSET_INIT(task_struct_timestamp, "task_struct", "timestamp"); + MEMBER_OFFSET_INIT(task_struct_sched_info, "task_struct", "sched_info"); + if (VALID_MEMBER(task_struct_sched_info)) + MEMBER_OFFSET_INIT(sched_info_last_arrival, + "sched_info", "last_arrival"); if (VALID_MEMBER(task_struct_last_run) || - VALID_MEMBER(task_struct_timestamp)) { + VALID_MEMBER(task_struct_timestamp) || + VALID_MEMBER(sched_info_last_arrival)) { char buf[BUFSIZE]; strcpy(buf, "alias last ps -l"); alias_init(buf); @@ -2638,9 +2643,10 @@ case 'l': if (INVALID_MEMBER(task_struct_last_run) && - INVALID_MEMBER(task_struct_timestamp)) { + INVALID_MEMBER(task_struct_timestamp) && + INVALID_MEMBER(sched_info_last_arrival)) { error(INFO, -"neither task_struct.last_run nor task_struct.timestamp exist in this kernel\n"); + "last-run timestamps do not exist in this kernel\n"); argerrs++; break; } @@ -4291,6 +4297,10 @@ } else if (VALID_MEMBER(task_struct_timestamp)) timestamp = tt->last_task_read ? ULONGLONG(tt->task_struct + OFFSET(task_struct_timestamp)) : 0; + else if (VALID_MEMBER(sched_info_last_arrival)) + timestamp = tt->last_task_read ? ULONGLONG(tt->task_struct + + OFFSET(task_struct_sched_info) + + OFFSET(sched_info_last_arrival)) : 0; return timestamp; } @@ -5985,7 +5995,8 @@ cnt++; } } else if (VALID_MEMBER(runqueue_curr)) { - for (i = 0; i < NR_CPUS; i++, runq += SIZE(runqueue)) { + for (i = 0; i < MAX(kt->cpus, kt->kernel_NR_CPUS); i++, + runq += SIZE(runqueue)) { readmem(runq, KVADDR, runqbuf, SIZE(runqueue), "(old) runqueues curr", FAULT_ON_ERROR); --- crash-4.0-5.0/configure.c 2008-02-19 10:15:37.000000000 -0500 +++ crash-4.0-5.1/configure.c 2008-02-04 10:30:09.000000000 -0500 @@ -1,8 +1,8 @@ /* configure.c - core analysis suite * * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. - * Copyright (C) 2002, 2003, 2004, 2005, 2006 David Anderson - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Red Hat, Inc. All rights reserved. + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 David Anderson + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1176,7 +1176,7 @@ printf("offered by Mission Critical Linux, or the LKCD kernel patch.\n"); printf("\n"); printf("%%package devel\n"); - printf("Requires: %%{name} = %%{version}\n"); + printf("Requires: %%{name} = %%{version}, zlib-devel\n"); printf("Summary: crash utility for live systems; netdump, diskdump, kdump, LKCD or mcore dumpfiles\n"); printf("Group: Development/Debuggers\n"); printf("\n"); --- crash-4.0-5.0/symbols.c 2008-02-19 10:15:37.000000000 -0500 +++ crash-4.0-5.1/symbols.c 2008-02-06 16:41:06.000000000 -0500 @@ -5916,6 +5916,10 @@ OFFSET(task_struct_last_run)); fprintf(fp, " task_struct_timestamp: %ld\n", OFFSET(task_struct_timestamp)); + fprintf(fp, " task_struct_sched_info: %ld\n", + OFFSET(task_struct_sched_info)); + fprintf(fp, " sched_info_last_arrival: %ld\n", + OFFSET(sched_info_last_arrival)); fprintf(fp, " task_struct_thread_info: %ld\n", OFFSET(task_struct_thread_info)); fprintf(fp, " task_struct_nsproxy: %ld\n", --- crash-4.0-5.0/defs.h 2008-02-19 10:15:37.000000000 -0500 +++ crash-4.0-5.1/defs.h 2008-02-06 16:41:12.000000000 -0500 @@ -1442,6 +1442,8 @@ long pcpu_info_vcpu; long pcpu_info_idle; long vcpu_struct_rq; + long task_struct_sched_info; + long sched_info_last_arrival; }; struct size_table { /* stash of commonly-used sizes */