[patch] LINUX_REBOOT_MAGIC1 printed as UNKNOWN VALUE in argstr

Frank Ch. Eigler fche@redhat.com
Thu Sep 13 07:57:00 GMT 2007


"Zhaolei" <zhaolei@cn.fujitsu.com> writes:

> Argument of magic in argstr is displayed as "UNKNOWN VALUE" because:
> Stap get value of magic from kernel, and it is negative value. 

This makes sense, as reboot(2) is defined to take signed int parameters.

> For this problem, I will commit following patch:

Could this be better (to accept more sign/size mismatches)?

>  function _reboot_magic_str(magic) {
> -   if(magic==0xFEE1DEAD) return "LINUX_REBOOT_MAGIC1"
> +   if(magic==        0xFEE1DEAD) return "LINUX_REBOOT_MAGIC1"
> +   if(magic==0xFFFFFFFFFEE1DEAD) return "LINUX_REBOOT_MAGIC1"
> [...]

- FChE



More information about the Systemtap mailing list