FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ


Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 01-21-2008, 04:58 PM
Alan Tyson
 
Default do_radix_tree() function in filesys.c

I notice that there is a function to look at radix trees in filesys.c,
but it's not called by anything in the crash executable from what I can
see. In fact when I wrote a small extension to call it, I see that it
simply doesn't work for several reasons (wrong structures, incorrect
dereferencing of pointers). Attached is a patch which addresses these.
I've tested it on i686, x86_64 and ia64.


If you think that this type of ("utility") code is best left out of
crash, then let's just remove this from the source and not clutter it
with dead code. Personally, I think it's nice to have it there... when
it works.


Regards,

Alan Tyson, HP.
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 01-21-2008, 06:38 PM
Dave Anderson
 
Default do_radix_tree() function in filesys.c

Alan Tyson wrote:
I notice that there is a function to look at radix trees in filesys.c,
but it's not called by anything in the crash executable from what I can
see. In fact when I wrote a small extension to call it, I see that it
simply doesn't work for several reasons (wrong structures, incorrect
dereferencing of pointers). Attached is a patch which addresses these.
I've tested it on i686, x86_64 and ia64.


If you think that this type of ("utility") code is best left out of
crash, then let's just remove this from the source and not clutter it
with dead code. Personally, I think it's nice to have it there... when
it works.




I don't care either way any more, but since you've made it work
again, I'll queue your changes for the next release.

Thanks,
Dave



Regards,

Alan Tyson, HP.


------------------------------------------------------------------------

--- a/filesys.c 2008-01-11 19:35:32.000000000 +0000
+++ b/filesys.c 2008-01-21 16:21:20.000000000 +0000
@@ -3484,10 +3484,14 @@ cleanup_memory_driver(void)
#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 @@ static void *
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 @@ radix_tree_lookup(ulong root_rnode, ulon
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-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
 

Thread Tools




All times are GMT. The time now is 12:24 AM.

VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org