This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] LINUX_REBOOT_MAGIC1 printed as UNKNOWN VALUE in argstr


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]