How can I access ULONG_MAX constant without using -g option?

Tetsuo Handa penguin-kernel@I-love.SAKURA.ne.jp
Tue May 6 06:03:00 GMT 2014


Hello.

I'm using systemtap-2.3-4.el6_5.i686 and I need to mask a value with ULONG_MAX
constant because task_current() returns 64bits value on 32bits architecture.

  # uname -m
  i686
  # stap -e 'probe begin { printf("current=%lx\n", task_current()); exit(); }'
  current=ffffffffc1681aa0

In the example output above, current=c1681aa0 is the expected value on i686.

I know I can wrap like

  function get_current:long() {
    return task_current() & %{ ULONG_MAX %};
  }

and use get_current() instead of task_current(), but this needs -g option.
Is there a way to do it without using -g option?

Regards.



More information about the Systemtap mailing list