coredump: use MEMBER_{OFFSET, SIZE} instead of GCORE_{OFFSET, SIZE}
Backport from the upstream crash-gcore. commit 4731ebf085fe6322ba8c7ca14918d3cab2186cf0 Author: HATAYAMA Daisuke <d.hatayama@fujitsu.com> Date: Fri Feb 25 04:45:37 2022 -0500 coredump: use MEMBER_{OFFSET, SIZE} instead of GCORE_{OFFSET, SIZE} fill_auxv_note() and compat_fill_auxv_note() is called just once each time gcore command is invoked because each process has just one NT_AUXV. This means using MEMBER_{OFFSET, SIZE} is enough; using GCORE_{OFFSET, SIZE} is overkill. Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com> Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
This commit is contained in:
parent
403d800813
commit
bf661e7ba2
@ -0,0 +1,53 @@
|
||||
From 4731ebf085fe6322ba8c7ca14918d3cab2186cf0 Mon Sep 17 00:00:00 2001
|
||||
From: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
|
||||
Date: Fri, 25 Feb 2022 04:45:37 -0500
|
||||
Subject: [PATCH 1/8] coredump: use MEMBER_{OFFSET, SIZE} instead of
|
||||
GCORE_{OFFSET, SIZE}
|
||||
|
||||
fill_auxv_note() and compat_fill_auxv_note() is called just once each
|
||||
time gcore command is invoked because each process has just one
|
||||
NT_AUXV. This means using MEMBER_{OFFSET, SIZE} is enough; using
|
||||
GCORE_{OFFSET, SIZE} is overkill.
|
||||
|
||||
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
|
||||
---
|
||||
src/libgcore/gcore_coredump.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/libgcore/gcore_coredump.c b/src/libgcore/gcore_coredump.c
|
||||
index 3d0c0fc..6f57b21 100644
|
||||
--- a/src/libgcore/gcore_coredump.c
|
||||
+++ b/src/libgcore/gcore_coredump.c
|
||||
@@ -930,11 +930,11 @@ fill_auxv_note(struct elf_note_info *info, struct task_context *tc,
|
||||
ulong *auxv;
|
||||
int i;
|
||||
|
||||
- auxv = (ulong *)GETBUF(GCORE_SIZE(mm_struct_saved_auxv));
|
||||
+ auxv = (ulong *)GETBUF(MEMBER_SIZE("mm_struct", "saved_auxv"));
|
||||
|
||||
readmem(task_mm(tc->task, FALSE) +
|
||||
- GCORE_OFFSET(mm_struct_saved_auxv), KVADDR, auxv,
|
||||
- GCORE_SIZE(mm_struct_saved_auxv), "fill_auxv_note",
|
||||
+ MEMBER_OFFSET("mm_struct", "saved_auxv"), KVADDR, auxv,
|
||||
+ MEMBER_SIZE("mm_struct", "saved_auxv"), "fill_auxv_note",
|
||||
gcore_verbose_error_handle());
|
||||
|
||||
i = 0;
|
||||
@@ -956,11 +956,11 @@ compat_fill_auxv_note(struct elf_note_info *info,
|
||||
uint32_t *auxv;
|
||||
int i;
|
||||
|
||||
- auxv = (uint32_t *)GETBUF(GCORE_SIZE(mm_struct_saved_auxv));
|
||||
+ auxv = (uint32_t *)GETBUF(MEMBER_SIZE("mm_struct", "saved_auxv"));
|
||||
|
||||
readmem(task_mm(tc->task, FALSE) +
|
||||
- GCORE_OFFSET(mm_struct_saved_auxv), KVADDR, auxv,
|
||||
- GCORE_SIZE(mm_struct_saved_auxv), "fill_auxv_note32",
|
||||
+ MEMBER_OFFSET("mm_struct", "saved_auxv"), KVADDR, auxv,
|
||||
+ MEMBER_SIZE("mm_struct", "saved_auxv"), "fill_auxv_note32",
|
||||
gcore_verbose_error_handle());
|
||||
|
||||
i = 0;
|
||||
--
|
||||
2.37.1
|
||||
|
Loading…
Reference in New Issue
Block a user