This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Global constants
On Mon, 2006-02-13 at 14:28 -0500, Frank Ch. Eigler wrote:
> The standard syscalls tapset should define such constants, so end-user
> scripts do not have to.
Hien and I are currently rewriting the syscall tapset, so if constants
get implemented soon, we can make immediate use of them.
> If read-only-ness of these globals is important, then a new "const"
> keyword would indeed come in handy. (I'd promptly reuse it as a
> qualifier for embedded-C functions that are declared to have no
> side-effects.) I would implement this angle by a new flag on vardecl,
> enforced non-lvalueness during elaboration or translation, rather than
> whole new staptree.h classes.
Declaring variables readonly reduces the probe complexity by removing
the global locks around all variable access. So it clearly seems like a
win.
Also it would be nice to have a way to declare these constants in
embedded C, so we can use the C header files to get the values, rather
than look them up.
something like
%{ const_O_CREAT = O_CREAT; %}
instead of
O_CREAT = 64