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
01-18-2012, 07:40 PM
Mika Westerberg
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