[Crash-utility] [PATCH] extensions, ptdump: Add error message when the crash analyses a live system.

Inoguchi, Yuki inoguchi.yuki at jp.fujitsu.com
Tue Jun 6 07:07:33 UTC 2017


Hi, Indoh-san,

ptdump does not support retrieving the trace data from the live system.
However, the current error message does not tell so.  
When the crash analyses a live system, ptdump only displays the following message:

  crash> ptdump foo
  ptdump: invalid size request: 0  type: "read page for write"

I think it's better to have a different message to let users know why error occurs.
Therefore, I added the following error message in ptdump:

  crash> ptdump foo
  ptdump: no support on live system

Please merge this patch.

---
 ptdump.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ptdump.c b/ptdump.c
index 8d5c367..44b19fb 100644
--- a/ptdump.c
+++ b/ptdump.c
@@ -491,6 +491,9 @@ cmd_ptdump(void)
        if (argcnt != 2)
                cmd_usage(pc->curcmd, SYNOPSIS);

+  if (ACTIVE())
+         error(FATAL, "no support on live system\n");
+
        outdir = args[1];
        if ((ret = mkdir(outdir, mode))) {
                fprintf(fp, "Cannot create directory %s: %d\n", outdir, ret);
--
1.8.3.1

Regards, 
--
Yuki Inoguchi





More information about the Crash-utility mailing list