[Crash-utility] Re: [PATCH 1/2] Add a new helper function get_value_vmcore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




在 2023/12/1 15:37, HAGIO KAZUHITO(萩尾 一仁) 写道:
[EXTERNAL EMAIL NOTICE: This email originated from an external sender. Please be mindful of safe email handling and proprietary information protection practices.]


On 2023/11/30 17:37, Shijie Huang wrote:

@@ -104,6 +104,20 @@ static void check_vmcoreinfo(void);
    static int is_pvops_xen(void);
    static int get_linux_banner_from_vmlinux(char *, size_t);
+/* Return TRUE if we succeed, return FALSE on failure. */
+bool
+get_value_vmcore(const char *name, ulong *v)
"get_value_vmcoreinfo" is better to clarify.
What about get_symbol_value_vmcoreinfo()?
Agree, it's better.

We can use "htol" to do the convert for symbol, but htol does not work
for "NUMBER()"..


+{
+    char *string = pc->read_vmcoreinfo(name);
+
+    if (!string)
+        return FALSE;
+
+    *v = htol(string, RETURN_ON_ERROR, NULL);
+    return TRUE;
+}
+
    /*
     * popuplate the global kernel table (kt) with kernel version
     * information parsed from UTSNAME/OSRELEASE string
@@ -10984,6 +10998,12 @@ hypervisor_init(void)
            fprintf(fp, "hypervisor: %s\n", kt->hypervisor);
    }
+#define GET_SYM(s,v)    \
How about "GET_SYMBOL" and
no problem.


+    if (get_value_vmcore((s), &(v))) {    \
adding "SYMBOL(" and ")" here?
it is not easy to add "SYMBOL" here.

I prefer to add to get_symbol_value_vmcoreinfo().
I mean

    if (get_symbol_value_vmcoreinfo("SYMBOL(" s ")", &(v))) ...

thanks, I have better solution now :)


Thanks

Huang Shijie
--
Crash-utility mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxxxxxx
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux