Decoding Consumer Minds: Fresh Ideas for Marketing Research Papers
by kefag22407@haotuwu.com
Marketing is no longer just about selling — it’s about understanding why people buy, share, and stay loyal. Research papers in marketing can dive into fascinating areas like consumer psychology, digital engagement, and emotional branding. Exploring topics such as the impact of social media influencers on brand perception, consumer trust in AI-driven recommendations, or sustainability as a driver of purchase intent can help uncover what really shapes modern consumer decisions.
Another promising angle is studying data and personalization in marketing. With companies relying heavily on analytics, there’s a growing need to explore how data-driven strategies influence consumer experience and brand loyalty. Researching ethical data usage, AI in customer segmentation, or neuromarketing trends can lead to insights that bridge creativity with strategy — essential for any marketer looking to make an impact in today’s competitive landscape. Have more info at: https://thedissertationhelp.co.uk/marketing-research-paper-topics/
2 months
[PATCH RESEND] Add a command line option to retrieve build-id
by Munehisa Kamata
Resending because my previous post is held for presumably being sent
without a list subscription.
Since Linux kernel commit 0935288c6e00 ("kdump: append kernel build-id
string to VMCOREINFO") merged in v5.9, VMCOREINFO data contains a kernel
build-id. Add a simple --build-id command line option that retrieves the
build-id from a kernel dump file, which works just like the existing
--osrelease option (and the implementation mimics it).
Example:
# crash --build-id /var/crash/127.0.0.1-2025-11-28-00\:33\:07/vmcore
03cc3b4eb67df4e66a6a794a39521bafabef0886
While we may also want to implement the strict build-id based
verification between namelist and dump file, this would be still handy
for some scripting or automation tasks without namelist.
Signed-off-by: Munehisa Kamata <kamatam(a)amazon.com>
---
crash.8 | 7 +++++++
defs.h | 1 +
diskdump.c | 17 +++++++++++++++++
help.c | 6 ++++++
main.c | 30 ++++++++++++++++++++++++++++++
makedumpfile.c | 40 ++++++++++++++++++++++++++++++++++------
netdump.c | 17 +++++++++++++++++
7 files changed, 112 insertions(+), 6 deletions(-)
diff --git a/crash.8 b/crash.8
index c7dc27d..4c06cb7 100644
--- a/crash.8
+++ b/crash.8
@@ -398,6 +398,13 @@ Display the OSRELEASE vmcoreinfo string from a kdump
.I dumpfile
header.
.TP
+.BI --build-id \ dumpfile
+Display the BUILD-ID vmcoreinfo string from a kdump
+.I dumpfile
+header.
+Note: this option only works for kernel (>=v5.9); otherwise it
+prints "unknown" and exits with non-zero status.
+.TP
.BI --hyper
Force the session to be that of a Xen hypervisor.
.TP
diff --git a/defs.h b/defs.h
index 24dad93..ff8041c 100644
--- a/defs.h
+++ b/defs.h
@@ -570,6 +570,7 @@ struct program_context {
#define MEMSRC_LOCAL (0x80000ULL)
#define REDZONE (0x100000ULL)
#define VMWARE_VMSS_GUESTDUMP (0x200000ULL)
+#define GET_BUILD_ID (0x400000ULL)
char *cleanup;
char *namelist_orig;
char *namelist_debug_orig;
diff --git a/diskdump.c b/diskdump.c
index b1ca0a7..0ff8782 100644
--- a/diskdump.c
+++ b/diskdump.c
@@ -91,6 +91,7 @@ static void dump_vmcoreinfo(FILE *);
static void dump_note_offsets(FILE *);
static char *vmcoreinfo_read_string(const char *);
static void diskdump_get_osrelease(void);
+static void diskdump_get_build_id(void);
static int valid_note_address(unsigned char *);
/* For split dumpfile */
@@ -1074,6 +1075,9 @@ is_diskdump(char *file)
if (pc->flags2 & GET_OSRELEASE)
diskdump_get_osrelease();
+ if (pc->flags2 & GET_BUILD_ID)
+ diskdump_get_build_id();
+
#ifdef LZO
if (lzo_init() == LZO_E_OK)
dd->flags |= LZO_SUPPORTED;
@@ -2446,6 +2450,19 @@ diskdump_get_osrelease(void)
pc->flags2 &= ~GET_OSRELEASE;
}
+static void
+diskdump_get_build_id(void)
+{
+ char *string;
+
+ if ((string = vmcoreinfo_read_string("BUILD-ID"))) {
+ fprintf(fp, "%s\n", string);
+ free(string);
+ }
+ else
+ pc->flags2 &= ~GET_BUILD_ID;
+}
+
static int
valid_note_address(unsigned char *offset)
{
diff --git a/help.c b/help.c
index 78d7a5c..1a21062 100644
--- a/help.c
+++ b/help.c
@@ -266,6 +266,12 @@ char *program_usage_info[] = {
" Display the OSRELEASE vmcoreinfo string from a kdump dumpfile",
" header.",
"",
+ " --build-id dumpfile",
+ " Display the BUILD-ID vmcoreinfo string from a kdump dumpfile",
+ " header.",
+ " Note: this option only works for kernel(>=v5.9); otherwise it",
+ " prints \"unknown\" and exits with non-zero status",
+ "",
" --hyper",
" Force the session to be that of a Xen hypervisor.",
"",
diff --git a/main.c b/main.c
index 71bcc15..d4c335b 100644
--- a/main.c
+++ b/main.c
@@ -29,6 +29,7 @@ static void check_xen_hyper(void);
static void show_untrusted_files(void);
static void get_osrelease(char *);
static void get_log(char *);
+static void get_build_id(char *);
static struct option long_options[] = {
{"memory_module", required_argument, 0, 0},
@@ -66,6 +67,7 @@ static struct option long_options[] = {
{"no_elf_notes", 0, 0, 0},
{"osrelease", required_argument, 0, 0},
{"log", required_argument, 0, 0},
+ {"build-id", required_argument, 0, 0},
{"hex", 0, 0, 0},
{"dec", 0, 0, 0},
{"no_strip", 0, 0, 0},
@@ -276,6 +278,11 @@ main(int argc, char **argv)
get_log(optarg);
}
+ else if (STREQ(long_options[option_index].name, "build-id")) {
+ pc->flags2 |= GET_BUILD_ID;
+ get_build_id(optarg);
+ }
+
else if (STREQ(long_options[option_index].name, "hex")) {
pc->flags2 |= RADIX_OVERRIDE;
pc->output_radix = 16;
@@ -1502,6 +1509,8 @@ dump_program_context(void)
fprintf(fp, "%sREDZONE", others++ ? "|" : "");
if (pc->flags2 & VMWARE_VMSS_GUESTDUMP)
fprintf(fp, "%sVMWARE_VMSS_GUESTDUMP", others++ ? "|" : "");
+ if (pc->flags2 & GET_BUILD_ID)
+ fprintf(fp, "%sGET_BUILD_ID", others++ ? "|" : "");
fprintf(fp, ")\n");
fprintf(fp, " namelist: %s\n", pc->namelist);
@@ -1972,6 +1981,27 @@ get_log(char *dumpfile)
clean_exit(retval);
}
+static void
+get_build_id(char *dumpfile)
+{
+ int retval = 1;
+
+ if (is_flattened_format(dumpfile)) {
+ if (pc->flags2 & GET_BUILD_ID)
+ retval = 0;
+ } else if (is_diskdump(dumpfile)) {
+ if (pc->flags2 & GET_BUILD_ID)
+ retval = 0;
+ } else if (is_kdump(dumpfile, KDUMP_LOCAL)) {
+ if (pc->flags2 & GET_BUILD_ID)
+ retval = 0;
+ }
+
+ if (retval)
+ fprintf(fp, "unknown\n");
+
+ clean_exit(retval);
+}
char *
no_vmcoreinfo(const char *unused)
diff --git a/makedumpfile.c b/makedumpfile.c
index 26d12b6..ee03199 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -24,6 +24,7 @@
#include <byteswap.h>
static void flattened_format_get_osrelease(char *);
+static void flattened_format_get_build_id(char *);
int flattened_format = 0;
@@ -196,7 +197,7 @@ read_all_makedumpfile_data_header(char *file)
void
check_flattened_format(char *file)
{
- int fd, get_osrelease;
+ int fd, get_osrelease, get_build_id;
struct stat stat;
struct makedumpfile_header fh;
@@ -206,6 +207,12 @@ check_flattened_format(char *file)
} else
get_osrelease = FALSE;
+ if (pc->flags2 & GET_BUILD_ID) {
+ get_build_id = TRUE;
+ pc->flags2 &= ~GET_BUILD_ID;
+ } else
+ get_build_id = FALSE;
+
if (flattened_format)
goto out;
@@ -237,6 +244,11 @@ check_flattened_format(char *file)
return;
}
+ if (get_build_id) {
+ flattened_format_get_build_id(file);
+ return;
+ }
+
if (!read_all_makedumpfile_data_header(file))
return;
@@ -251,6 +263,9 @@ check_flattened_format(char *file)
out:
if (get_osrelease)
pc->flags2 |= GET_OSRELEASE;
+
+ if (get_build_id)
+ pc->flags2 |= GET_BUILD_ID;
}
static int
@@ -368,26 +383,39 @@ dump_flat_header(FILE *ofp)
}
static void
-flattened_format_get_osrelease(char *file)
+flattened_format_get_common(char *file, char *key, ulonglong flag)
{
int c;
FILE *pipe;
- char buf[BUFSIZE], *p1, *p2;
+ char keybuf[BUFSIZE], buf[BUFSIZE], *p1, *p2;
- c = strlen("OSRELEASE=");
+ sprintf(keybuf, "%s=", key);
+ c = strlen(keybuf);
sprintf(buf, "/usr/bin/strings -n %d %s", c, file);
if ((pipe = popen(buf, "r")) == NULL)
return;
for (c = 0; (c < 100) && fgets(buf, BUFSIZE-1, pipe); c++) {
- if ((p1 = strstr(buf, "OSRELEASE="))) {
+ if ((p1 = strstr(buf, keybuf))) {
p2 = strstr(p1, "=");
fprintf(fp, "%s", p2+1);
flattened_format = TRUE;
- pc->flags2 |= GET_OSRELEASE;
+ pc->flags2 |= flag;
}
}
pclose(pipe);
}
+
+static void
+flattened_format_get_osrelease(char *file)
+{
+ flattened_format_get_common(file, "OSRELEASE", GET_OSRELEASE);
+}
+
+static void
+flattened_format_get_build_id(char *file)
+{
+ flattened_format_get_common(file, "BUILD-ID", GET_BUILD_ID);
+}
diff --git a/netdump.c b/netdump.c
index c7ff009..ba1c6c4 100644
--- a/netdump.c
+++ b/netdump.c
@@ -50,6 +50,7 @@ static int proc_kcore_init_64(FILE *, int);
static char *get_regs_from_note(char *, ulong *, ulong *);
static void kdump_get_osrelease(void);
static char *vmcoreinfo_read_string(const char *);
+static void kdump_get_build_id(void);
#define ELFSTORE 1
@@ -477,6 +478,10 @@ is_netdump(char *file, ulong source_query)
get_log_from_vmcoreinfo(file);
}
+ if ((source_query == KDUMP_LOCAL) &&
+ (pc->flags2 & GET_BUILD_ID))
+ kdump_get_build_id();
+
return nd->header_size;
bailout:
@@ -4996,6 +5001,18 @@ kdump_get_osrelease(void)
pc->flags2 &= ~GET_OSRELEASE;
}
+static void
+kdump_get_build_id(void)
+{
+ char *string;
+
+ if ((string = vmcoreinfo_read_string("BUILD-ID"))) {
+ fprintf(fp, "%s\n", string);
+ free(string);
+ } else
+ pc->flags2 &= ~GET_BUILD_ID;
+}
+
void
dump_registers_for_qemu_mem_dump(void)
{
--
2.47.3
2 months
[PATCH v4] make the MAX_MALLOC_BUFS customizable
by Shivang Upadhyay
the default (and minimum) value of MAX_MALLOC_BUFS is 3072, but can be
changed with command line with flag `--max-malloc-bufs`.
Signed-off-by: Shivang Upadhyay <shivangu(a)linux.ibm.com>
---
defs.h | 8 ++++++++
main.c | 4 ++++
tools.c | 9 ++++++---
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/defs.h b/defs.h
index ab4aee8..f3de0e5 100644
--- a/defs.h
+++ b/defs.h
@@ -188,6 +188,13 @@
#define HIST_BLKSIZE (4096)
static inline int string_exists(char *s) { return (s ? TRUE : FALSE); }
+
+static inline int max(int a, int b) {
+ if (a > b)
+ return a;
+ return b;
+}
+
#define STREQ(A, B) (string_exists((char *)A) && string_exists((char *)B) && \
(strcmp((char *)(A), (char *)(B)) == 0))
#define STRNEQ(A, B) (string_exists((char *)A) && string_exists((char *)B) && \
@@ -5608,6 +5615,7 @@ void exec_args_input_file(struct command_table_entry *, struct args_input_file *
/*
* tools.c
*/
+extern int MAX_MALLOC_BUFS;
FILE *set_error(char *);
int __error(int, char *, ...);
#define error __error /* avoid conflict with gdb error() */
diff --git a/main.c b/main.c
index 71bcc15..247779c 100644
--- a/main.c
+++ b/main.c
@@ -46,6 +46,7 @@ static struct option long_options[] = {
{"version", 0, 0, 0},
{"buildinfo", 0, 0, 0},
{"cpus", required_argument, 0, 0},
+ {"max-malloc-bufs", required_argument, 0, 0},
{"no_ikconfig", 0, 0, 0},
{"hyper", 0, 0, 0},
{"p2m_mfn", required_argument, 0, 0},
@@ -163,6 +164,9 @@ main(int argc, char **argv)
else if (STREQ(long_options[option_index].name, "cpus"))
kt->cpus_override = optarg;
+ else if (STREQ(long_options[option_index].name, "max-malloc-bufs"))
+ MAX_MALLOC_BUFS = max(MAX_MALLOC_BUFS, atoi(optarg));
+
else if (STREQ(long_options[option_index].name, "hyper"))
pc->flags |= XEN_HYPER;
diff --git a/tools.c b/tools.c
index a9ad18d..69250c4 100644
--- a/tools.c
+++ b/tools.c
@@ -5698,7 +5698,7 @@ ll_power(long long base, long long exp)
#define B32K (4)
#define SHARED_BUF_SIZES (B32K+1)
-#define MAX_MALLOC_BUFS (2000)
+int MAX_MALLOC_BUFS = 3072; /* can be changed from command line args */
#define MAX_CACHE_SIZE (KILOBYTES(32))
struct shared_bufs {
@@ -5723,7 +5723,7 @@ struct shared_bufs {
long buf_8K_ovf;
long buf_32K_ovf;
int buf_inuse[SHARED_BUF_SIZES];
- char *malloc_bp[MAX_MALLOC_BUFS];
+ char **malloc_bp;
long smallest;
long largest;
long embedded;
@@ -5744,6 +5744,7 @@ buf_init(void)
bp->smallest = 0x7fffffff;
bp->total = 0.0;
+ bp->malloc_bp = (char**) calloc(MAX_MALLOC_BUFS * sizeof(char*), 1);
#ifdef VALGRIND
VALGRIND_MAKE_MEM_NOACCESS(&bp->buf_1K, sizeof(bp->buf_1K));
@@ -6130,7 +6131,9 @@ getbuf(long reqsize)
dump_shared_bufs();
return ((char *)(long)
- error(FATAL, "cannot allocate any more memory!\n"));
+ error(FATAL, "cannot allocate any more memory!\n"
+ "try increasing --max-malloc-bufs (current value : %d)\n",
+ MAX_MALLOC_BUFS));
}
/*
--
2.52.0
2 months
[PATCH v3] make the MAX_MALLOC_BUFS customizable
by Shivang Upadhyay
the default (and minimum) value of MAX_MALLOC_BUFS is 3072, but can be
changed with command line with flag `--max-malloc-bufs`.
Signed-off-by: Shivang Upadhyay <shivangu(a)linux.ibm.com>
---
defs.h | 1 +
main.c | 9 +++++++++
tools.c | 9 ++++++---
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/defs.h b/defs.h
index ab4aee8..863baf9 100644
--- a/defs.h
+++ b/defs.h
@@ -5608,6 +5608,7 @@ void exec_args_input_file(struct command_table_entry *, struct args_input_file *
/*
* tools.c
*/
+extern int MAX_MALLOC_BUFS;
FILE *set_error(char *);
int __error(int, char *, ...);
#define error __error /* avoid conflict with gdb error() */
diff --git a/main.c b/main.c
index 71bcc15..0b0cabe 100644
--- a/main.c
+++ b/main.c
@@ -46,6 +46,7 @@ static struct option long_options[] = {
{"version", 0, 0, 0},
{"buildinfo", 0, 0, 0},
{"cpus", required_argument, 0, 0},
+ {"max-malloc-bufs", required_argument, 0, 0},
{"no_ikconfig", 0, 0, 0},
{"hyper", 0, 0, 0},
{"p2m_mfn", required_argument, 0, 0},
@@ -163,6 +164,14 @@ main(int argc, char **argv)
else if (STREQ(long_options[option_index].name, "cpus"))
kt->cpus_override = optarg;
+ else if (STREQ(long_options[option_index].name, "max-malloc-bufs")) {
+ MAX_MALLOC_BUFS = atoi(optarg);
+
+ if (MAX_MALLOC_BUFS < 3072) {
+ MAX_MALLOC_BUFS = 3072;
+ }
+ }
+
else if (STREQ(long_options[option_index].name, "hyper"))
pc->flags |= XEN_HYPER;
diff --git a/tools.c b/tools.c
index a9ad18d..69250c4 100644
--- a/tools.c
+++ b/tools.c
@@ -5698,7 +5698,7 @@ ll_power(long long base, long long exp)
#define B32K (4)
#define SHARED_BUF_SIZES (B32K+1)
-#define MAX_MALLOC_BUFS (2000)
+int MAX_MALLOC_BUFS = 3072; /* can be changed from command line args */
#define MAX_CACHE_SIZE (KILOBYTES(32))
struct shared_bufs {
@@ -5723,7 +5723,7 @@ struct shared_bufs {
long buf_8K_ovf;
long buf_32K_ovf;
int buf_inuse[SHARED_BUF_SIZES];
- char *malloc_bp[MAX_MALLOC_BUFS];
+ char **malloc_bp;
long smallest;
long largest;
long embedded;
@@ -5744,6 +5744,7 @@ buf_init(void)
bp->smallest = 0x7fffffff;
bp->total = 0.0;
+ bp->malloc_bp = (char**) calloc(MAX_MALLOC_BUFS * sizeof(char*), 1);
#ifdef VALGRIND
VALGRIND_MAKE_MEM_NOACCESS(&bp->buf_1K, sizeof(bp->buf_1K));
@@ -6130,7 +6131,9 @@ getbuf(long reqsize)
dump_shared_bufs();
return ((char *)(long)
- error(FATAL, "cannot allocate any more memory!\n"));
+ error(FATAL, "cannot allocate any more memory!\n"
+ "try increasing --max-malloc-bufs (current value : %d)\n",
+ MAX_MALLOC_BUFS));
}
/*
--
2.52.0
2 months
[PATCH] Add a command line option to retrieve build-id
by Munehisa Kamata
Since Linux kernel commit 0935288c6e00 ("kdump: append kernel build-id
string to VMCOREINFO") merged in v5.9, VMCOREINFO data contains a kernel
build-id. Add a simple --build-id command line option that retrieves the
build-id from a kernel dump file, which works just like the existing
--osrelease option (and the implementation mimics it).
Example:
# crash --build-id /var/crash/127.0.0.1-2025-11-28-00\:33\:07/vmcore
03cc3b4eb67df4e66a6a794a39521bafabef0886
While we may also want to implement the strict build-id based
verification between namelist and dump file, this would be still handy
for some scripting or automation tasks without namelist.
Signed-off-by: Munehisa Kamata <kamatam(a)amazon.com>
---
crash.8 | 7 +++++++
defs.h | 1 +
diskdump.c | 17 +++++++++++++++++
help.c | 6 ++++++
main.c | 30 ++++++++++++++++++++++++++++++
makedumpfile.c | 40 ++++++++++++++++++++++++++++++++++------
netdump.c | 17 +++++++++++++++++
7 files changed, 112 insertions(+), 6 deletions(-)
diff --git a/crash.8 b/crash.8
index c7dc27d..4c06cb7 100644
--- a/crash.8
+++ b/crash.8
@@ -398,6 +398,13 @@ Display the OSRELEASE vmcoreinfo string from a kdump
.I dumpfile
header.
.TP
+.BI --build-id \ dumpfile
+Display the BUILD-ID vmcoreinfo string from a kdump
+.I dumpfile
+header.
+Note: this option only works for kernel (>=v5.9); otherwise it
+prints "unknown" and exits with non-zero status.
+.TP
.BI --hyper
Force the session to be that of a Xen hypervisor.
.TP
diff --git a/defs.h b/defs.h
index 24dad93..ff8041c 100644
--- a/defs.h
+++ b/defs.h
@@ -570,6 +570,7 @@ struct program_context {
#define MEMSRC_LOCAL (0x80000ULL)
#define REDZONE (0x100000ULL)
#define VMWARE_VMSS_GUESTDUMP (0x200000ULL)
+#define GET_BUILD_ID (0x400000ULL)
char *cleanup;
char *namelist_orig;
char *namelist_debug_orig;
diff --git a/diskdump.c b/diskdump.c
index b1ca0a7..0ff8782 100644
--- a/diskdump.c
+++ b/diskdump.c
@@ -91,6 +91,7 @@ static void dump_vmcoreinfo(FILE *);
static void dump_note_offsets(FILE *);
static char *vmcoreinfo_read_string(const char *);
static void diskdump_get_osrelease(void);
+static void diskdump_get_build_id(void);
static int valid_note_address(unsigned char *);
/* For split dumpfile */
@@ -1074,6 +1075,9 @@ is_diskdump(char *file)
if (pc->flags2 & GET_OSRELEASE)
diskdump_get_osrelease();
+ if (pc->flags2 & GET_BUILD_ID)
+ diskdump_get_build_id();
+
#ifdef LZO
if (lzo_init() == LZO_E_OK)
dd->flags |= LZO_SUPPORTED;
@@ -2446,6 +2450,19 @@ diskdump_get_osrelease(void)
pc->flags2 &= ~GET_OSRELEASE;
}
+static void
+diskdump_get_build_id(void)
+{
+ char *string;
+
+ if ((string = vmcoreinfo_read_string("BUILD-ID"))) {
+ fprintf(fp, "%s\n", string);
+ free(string);
+ }
+ else
+ pc->flags2 &= ~GET_BUILD_ID;
+}
+
static int
valid_note_address(unsigned char *offset)
{
diff --git a/help.c b/help.c
index 78d7a5c..1a21062 100644
--- a/help.c
+++ b/help.c
@@ -266,6 +266,12 @@ char *program_usage_info[] = {
" Display the OSRELEASE vmcoreinfo string from a kdump dumpfile",
" header.",
"",
+ " --build-id dumpfile",
+ " Display the BUILD-ID vmcoreinfo string from a kdump dumpfile",
+ " header.",
+ " Note: this option only works for kernel(>=v5.9); otherwise it",
+ " prints \"unknown\" and exits with non-zero status",
+ "",
" --hyper",
" Force the session to be that of a Xen hypervisor.",
"",
diff --git a/main.c b/main.c
index 71bcc15..d4c335b 100644
--- a/main.c
+++ b/main.c
@@ -29,6 +29,7 @@ static void check_xen_hyper(void);
static void show_untrusted_files(void);
static void get_osrelease(char *);
static void get_log(char *);
+static void get_build_id(char *);
static struct option long_options[] = {
{"memory_module", required_argument, 0, 0},
@@ -66,6 +67,7 @@ static struct option long_options[] = {
{"no_elf_notes", 0, 0, 0},
{"osrelease", required_argument, 0, 0},
{"log", required_argument, 0, 0},
+ {"build-id", required_argument, 0, 0},
{"hex", 0, 0, 0},
{"dec", 0, 0, 0},
{"no_strip", 0, 0, 0},
@@ -276,6 +278,11 @@ main(int argc, char **argv)
get_log(optarg);
}
+ else if (STREQ(long_options[option_index].name, "build-id")) {
+ pc->flags2 |= GET_BUILD_ID;
+ get_build_id(optarg);
+ }
+
else if (STREQ(long_options[option_index].name, "hex")) {
pc->flags2 |= RADIX_OVERRIDE;
pc->output_radix = 16;
@@ -1502,6 +1509,8 @@ dump_program_context(void)
fprintf(fp, "%sREDZONE", others++ ? "|" : "");
if (pc->flags2 & VMWARE_VMSS_GUESTDUMP)
fprintf(fp, "%sVMWARE_VMSS_GUESTDUMP", others++ ? "|" : "");
+ if (pc->flags2 & GET_BUILD_ID)
+ fprintf(fp, "%sGET_BUILD_ID", others++ ? "|" : "");
fprintf(fp, ")\n");
fprintf(fp, " namelist: %s\n", pc->namelist);
@@ -1972,6 +1981,27 @@ get_log(char *dumpfile)
clean_exit(retval);
}
+static void
+get_build_id(char *dumpfile)
+{
+ int retval = 1;
+
+ if (is_flattened_format(dumpfile)) {
+ if (pc->flags2 & GET_BUILD_ID)
+ retval = 0;
+ } else if (is_diskdump(dumpfile)) {
+ if (pc->flags2 & GET_BUILD_ID)
+ retval = 0;
+ } else if (is_kdump(dumpfile, KDUMP_LOCAL)) {
+ if (pc->flags2 & GET_BUILD_ID)
+ retval = 0;
+ }
+
+ if (retval)
+ fprintf(fp, "unknown\n");
+
+ clean_exit(retval);
+}
char *
no_vmcoreinfo(const char *unused)
diff --git a/makedumpfile.c b/makedumpfile.c
index 26d12b6..ee03199 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -24,6 +24,7 @@
#include <byteswap.h>
static void flattened_format_get_osrelease(char *);
+static void flattened_format_get_build_id(char *);
int flattened_format = 0;
@@ -196,7 +197,7 @@ read_all_makedumpfile_data_header(char *file)
void
check_flattened_format(char *file)
{
- int fd, get_osrelease;
+ int fd, get_osrelease, get_build_id;
struct stat stat;
struct makedumpfile_header fh;
@@ -206,6 +207,12 @@ check_flattened_format(char *file)
} else
get_osrelease = FALSE;
+ if (pc->flags2 & GET_BUILD_ID) {
+ get_build_id = TRUE;
+ pc->flags2 &= ~GET_BUILD_ID;
+ } else
+ get_build_id = FALSE;
+
if (flattened_format)
goto out;
@@ -237,6 +244,11 @@ check_flattened_format(char *file)
return;
}
+ if (get_build_id) {
+ flattened_format_get_build_id(file);
+ return;
+ }
+
if (!read_all_makedumpfile_data_header(file))
return;
@@ -251,6 +263,9 @@ check_flattened_format(char *file)
out:
if (get_osrelease)
pc->flags2 |= GET_OSRELEASE;
+
+ if (get_build_id)
+ pc->flags2 |= GET_BUILD_ID;
}
static int
@@ -368,26 +383,39 @@ dump_flat_header(FILE *ofp)
}
static void
-flattened_format_get_osrelease(char *file)
+flattened_format_get_common(char *file, char *key, ulonglong flag)
{
int c;
FILE *pipe;
- char buf[BUFSIZE], *p1, *p2;
+ char keybuf[BUFSIZE], buf[BUFSIZE], *p1, *p2;
- c = strlen("OSRELEASE=");
+ sprintf(keybuf, "%s=", key);
+ c = strlen(keybuf);
sprintf(buf, "/usr/bin/strings -n %d %s", c, file);
if ((pipe = popen(buf, "r")) == NULL)
return;
for (c = 0; (c < 100) && fgets(buf, BUFSIZE-1, pipe); c++) {
- if ((p1 = strstr(buf, "OSRELEASE="))) {
+ if ((p1 = strstr(buf, keybuf))) {
p2 = strstr(p1, "=");
fprintf(fp, "%s", p2+1);
flattened_format = TRUE;
- pc->flags2 |= GET_OSRELEASE;
+ pc->flags2 |= flag;
}
}
pclose(pipe);
}
+
+static void
+flattened_format_get_osrelease(char *file)
+{
+ flattened_format_get_common(file, "OSRELEASE", GET_OSRELEASE);
+}
+
+static void
+flattened_format_get_build_id(char *file)
+{
+ flattened_format_get_common(file, "BUILD-ID", GET_BUILD_ID);
+}
diff --git a/netdump.c b/netdump.c
index c7ff009..ba1c6c4 100644
--- a/netdump.c
+++ b/netdump.c
@@ -50,6 +50,7 @@ static int proc_kcore_init_64(FILE *, int);
static char *get_regs_from_note(char *, ulong *, ulong *);
static void kdump_get_osrelease(void);
static char *vmcoreinfo_read_string(const char *);
+static void kdump_get_build_id(void);
#define ELFSTORE 1
@@ -477,6 +478,10 @@ is_netdump(char *file, ulong source_query)
get_log_from_vmcoreinfo(file);
}
+ if ((source_query == KDUMP_LOCAL) &&
+ (pc->flags2 & GET_BUILD_ID))
+ kdump_get_build_id();
+
return nd->header_size;
bailout:
@@ -4996,6 +5001,18 @@ kdump_get_osrelease(void)
pc->flags2 &= ~GET_OSRELEASE;
}
+static void
+kdump_get_build_id(void)
+{
+ char *string;
+
+ if ((string = vmcoreinfo_read_string("BUILD-ID"))) {
+ fprintf(fp, "%s\n", string);
+ free(string);
+ } else
+ pc->flags2 &= ~GET_BUILD_ID;
+}
+
void
dump_registers_for_qemu_mem_dump(void)
{
--
2.47.3
2 months
[PATCH] Fix external command output not redirected to pipe
by neilfsun
When executing external commands (cat, etc.) with pipes,
the command output was not properly redirected to the pipe.
crash> cat /tmp/testfile
line1
line2
line3
crash> cat /tmp/testfile | head -1
line1
line2
line3
crash>
Signed-off-by: neilfsun <neilfsun(a)tencent.com>
Signed-off-by: Feng Sun <loyou85(a)gmail.com>
---
main.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
index 71bcc15..95d455a 100644
--- a/main.c
+++ b/main.c
@@ -1034,6 +1034,8 @@ is_external_command(void)
int i;
char *cmd;
char command[BUFSIZE];
+ FILE *pipe;
+ char buf[BUFSIZE];
cmd = args[0];
@@ -1057,8 +1059,19 @@ is_external_command(void)
else
strcat(command, args[i]);
}
- if (system(command) == -1)
- perror(command);
+
+ if (pc->redirect & REDIRECT_TO_PIPE) {
+ if ((pipe = popen(command, "r")) == NULL) {
+ error(INFO, "cannot execute: %s\n", command);
+ return TRUE;
+ }
+ while (fgets(buf, BUFSIZE, pipe))
+ fputs(buf, fp);
+ pclose(pipe);
+ } else {
+ if (system(command) == -1)
+ perror(command);
+ }
return TRUE;
}
--
2.50.1
2 months
[PATCH] Fix exit status handling for piped commands in input files
by neilfsun
When executing commands with pipes followed by && or || operators from
input files, the exit status was not properly propagated. This caused
shell operators to always receive success status, leading to incorrect
conditional execution.
crash> sys | grep CPUS && echo yes || echo no
CPUS: 256
yes
crash> sys1 | grep CPUS && echo yes || echo no
crash: command not found: sys1
no
crash> cat test
sys | grep CPUS && echo yes || echo no
sys1 | grep CPUS && echo yes || echo no
crash> < ./test
crash> sys | grep CPUS && echo yes || echo no
CPUS: 256
yes
crash> sys1 | grep CPUS && echo yes || echo no
crash: command not found: sys1
yes
The root cause was in restore_ifile_sanity() which used close() instead
of pclose() to close the pipe.
Also fix the same issue in restore_sanity() for both pc->pipe and
pc->ifile_pipe which were opened with popen() but incorrectly closed
with close().
Signed-off-by: neilfsun <neilfsun(a)tencent.com>
Signed-off-by: Feng Sun <loyou85(a)gmail.com>
---
cmdline.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/cmdline.c b/cmdline.c
index 030ae56..e9fe92a 100644
--- a/cmdline.c
+++ b/cmdline.c
@@ -1108,7 +1108,7 @@ restore_sanity(void)
pc->stdpipe_pid = 0;
}
if (pc->pipe) {
- close(fileno(pc->pipe));
+ pclose(pc->pipe);
pc->pipe = NULL;
console("wait for redirect %d->%d to finish...\n",
pc->pipe_shell_pid, pc->pipe_pid);
@@ -1127,7 +1127,7 @@ restore_sanity(void)
}
if (pc->ifile_pipe) {
fflush(pc->ifile_pipe);
- close(fileno(pc->ifile_pipe));
+ pclose(pc->ifile_pipe);
pc->ifile_pipe = NULL;
if (pc->pipe_pid &&
((pc->redirect & (PIPE_OPTIONS|REDIRECT_PID_KNOWN)) ==
@@ -1259,7 +1259,7 @@ restore_ifile_sanity(void)
pc->flags &= ~IFILE_ERROR;
if (pc->ifile_pipe) {
- close(fileno(pc->ifile_pipe));
+ pclose(pc->ifile_pipe);
pc->ifile_pipe = NULL;
}
--
2.50.1
2 months
[PATCH] Fix prompt output interfering with piped commands in input files
by neilfsun
When executing piped commands from input files, the prompt text was
incorrectly written to the pipe instead of stdout.
This caused commands read the prompt as their first line,
consuming it instead of the actual command output.
crash> p cpu_info:0 | head -1
per_cpu(cpu_info, 0) = $29 = {
crash> p cpu_info:0 | head -2
per_cpu(cpu_info, 0) = $4 = {
x86 = 0x6,
crash> cat crashrc1
p cpu_info:0 | head -1
crash> < crashrc1
crash> p cpu_info:0 | head -1
crash> cat crashrc2
p cpu_info:0 | head -2
crash> < crashrc2
crash> p cpu_info:0 | head -2
per_cpu(cpu_info, 0) = $30 = {
crash>
Fix: Output prompt to incoming_fp (stdout) instead of fp (which may be the pipe
after setup_redirect()), ensuring prompts display on terminal while command output
goes to the pipe as intended.
Signed-off-by: neilfsun <neilfsun(a)tencent.com>
Signed-off-by: Feng Sun <loyou85(a)gmail.com>
---
cmdline.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmdline.c b/cmdline.c
index 4add548..030ae56 100644
--- a/cmdline.c
+++ b/cmdline.c
@@ -1488,8 +1488,8 @@ exec_input_file(void)
continue;
if (!(pc->flags & SILENT)) {
- fprintf(fp, "%s%s", pc->prompt, buf);
- fflush(fp);
+ fprintf(incoming_fp, "%s%s", pc->prompt, buf);
+ fflush(incoming_fp);
}
exec_command();
--
2.50.1
2 months
Behind the Scenes of Campus Data Centers: Insights from Crash Utility Practices
by yingashley13@gmail.com
Modern universities rely heavily on digital infrastructure to keep classrooms, online platforms, and administrative systems running smoothly. While students and faculty experience seamless access to online courses, virtual libraries, and academic portals, much of this reliability comes from what happens behind the scenes—specifically within campus data centers. These centers serve as the backbone of digital learning, ensuring continuous access to resources, stable performance, and quick recovery during system failures.
In higher education, the importance of uninterrupted online learning cannot be overstated. Many students, for instance, rely on platforms like Myassignmenthelp for academic support, where they might search for options such as take my online class for me (https://myassignmenthelp.com/take-my-online-class.html
). This highlights how critical system reliability is for educational services, whether hosted directly by universities or through third-party academic support platforms. Without dependable infrastructure, both students and institutions risk losing valuable time, resources, and learning opportunities.
This is where practices drawn from tools like the Crash Utility come into play. Originally designed for analyzing Linux kernel crash dumps, these tools provide system administrators with detailed insights into why systems fail. For campus data centers, adopting similar diagnostic approaches allows IT teams to quickly identify the root cause of failures, prevent recurring issues, and maintain high system availability. In turn, this ensures that students can log into their learning portals, submit assignments, and access lecture recordings without disruption.
Moreover, proactive crash analysis fosters a culture of resilience within educational institutions. Instead of waiting for problems to escalate, IT administrators can anticipate potential bottlenecks or vulnerabilities and resolve them before they affect users. For universities striving to enhance their digital infrastructure, integrating such practices strengthens their ability to support large-scale e-learning initiatives, hybrid classrooms, and research collaborations.
In conclusion, while students may only see the front-end of digital learning systems, the true strength of an institution lies in its backend stability. By incorporating insights from crash utility practices, campus data centers can ensure smooth, uninterrupted academic experiences—making education more accessible, reliable, and future-ready.
2 months, 1 week