FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 01-18-2012, 02:19 PM
Per Fransson
 
Default ARM: don't read __per_cpu_offset table again

Hi Dave/Mika/Jan and other Crash users,

Here's some code that can be thrown away. The __per_cpu_offset table is read in
arm.c:arm_get_crash_notes() even though it's already available.

Regards,
Per


diff --git a/arm.c b/arm.c
index 5eb5649..36a26cc 100644
--- a/arm.c
+++ b/arm.c
@@ -497,8 +497,6 @@ arm_get_crash_notes(void)
ulong offset;
char *buf, *p;
ulong *notes_ptrs;
- ulong per_cpu_offsets_addr;
- ulong *per_cpu_offsets;
ulong i;

if (!symbol_exists("crash_notes"))
@@ -521,24 +519,9 @@ arm_get_crash_notes(void)
}

if (symbol_exists("__per_cpu_offset")) {
-
- /* Get the __per_cpu_offset array */
- per_cpu_offsets_addr = symbol_value("__per_cpu_offset");
-
- per_cpu_offsets = (ulong *)GETBUF(kt->cpus*sizeof(*per_cpu_offsets));
-
- if (!readmem(per_cpu_offsets_addr, KVADDR, per_cpu_offsets,
- kt->cpus*sizeof(*per_cpu_offsets), "per_cpu_offsets",
- RETURN_ON_ERROR)) {
- error(WARNING, "cannot read per_cpu_offsets
");
- FREEBUF(per_cpu_offsets);
- return FALSE;
- }
-
/* Add __per_cpu_offset for each cpu to form the pointer to the notes */
for (i = 0; i<kt->cpus; i++)
- notes_ptrs[i] = notes_ptrs[kt->cpus-1] + per_cpu_offsets[i];
- FREEBUF(per_cpu_offsets);
+ notes_ptrs[i] = notes_ptrs[kt->cpus-1] + kt->__per_cpu_offset[i];
}

buf = GETBUF(SIZE(note_buf));

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 01-18-2012, 07:40 PM
Mika Westerberg
 
Default ARM: don't read __per_cpu_offset table again

On Wed, Jan 18, 2012 at 04:19:13PM +0100, Per Fransson wrote:
> Hi Dave/Mika/Jan and other Crash users,
>
> Here's some code that can be thrown away. The __per_cpu_offset table is read in
> arm.c:arm_get_crash_notes() even though it's already available.

Nice!

Acked-by: Mika Westerberg <mika.westerberg@iki.fi>

--
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 03:55 PM.

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