public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/6929] New: support constant global variables
@ 2008-10-01 16:05 mhiramat at redhat dot com
  2008-10-01 17:37 ` [Bug translator/6929] " fche at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: mhiramat at redhat dot com @ 2008-10-01 16:05 UTC (permalink / raw)
  To: systemtap

Systemtap global variable can be translated to constant immediate value(or just
a macro) if no one does write access to it(or, const suffix like as global
XXX:const).

-- 
           Summary: support constant global variables
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: translator
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: mhiramat at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=6929

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/6929] support constant global variables
  2008-10-01 16:05 [Bug translator/6929] New: support constant global variables mhiramat at redhat dot com
@ 2008-10-01 17:37 ` fche at redhat dot com
  2008-10-01 18:39 ` mhiramat at redhat dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2008-10-01 17:37 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2008-10-01 17:36 -------
(In reply to comment #0)
> Systemtap global variable can be translated to constant immediate value(or just
> a macro) if no one does write access to it

This should be straightforward.  We already know when locking is unneeded for just
such globals: bug #2341.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6929

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/6929] support constant global variables
  2008-10-01 16:05 [Bug translator/6929] New: support constant global variables mhiramat at redhat dot com
  2008-10-01 17:37 ` [Bug translator/6929] " fche at redhat dot com
@ 2008-10-01 18:39 ` mhiramat at redhat dot com
  2008-10-01 18:46 ` fche at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: mhiramat at redhat dot com @ 2008-10-01 18:39 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From mhiramat at redhat dot com  2008-10-01 18:38 -------
(In reply to comment #1)
> This should be straightforward.  We already know when locking is unneeded for just
> such globals: bug #2341.

Sure, this request is more advanced one. We expect some formula including
immediate values are compounded to simpler formula. For example,
---
global TICKS:const=100
global HZ:const=1000

function ticktohz:long (tick) {
   return tick * HZ / TICKS; # this will be translated to tick * 10
}
---

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6929

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/6929] support constant global variables
  2008-10-01 16:05 [Bug translator/6929] New: support constant global variables mhiramat at redhat dot com
  2008-10-01 17:37 ` [Bug translator/6929] " fche at redhat dot com
  2008-10-01 18:39 ` mhiramat at redhat dot com
@ 2008-10-01 18:46 ` fche at redhat dot com
  2008-10-11  2:48 ` fche at redhat dot com
  2008-10-11  2:52 ` mhiramat at redhat dot com
  4 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2008-10-01 18:46 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2008-10-01 18:44 -------

> Sure, this request is more advanced one. We expect some formula including
> immediate values are compounded to simpler formula. For example,
> ---
> global TICKS:const=100
> global HZ:const=1000
> 
> function ticktohz:long (tick) {
>    return tick * HZ / TICKS; # this will be translated to tick * 10
> }

Reusing the same analysis already done for lock elision, it should not be
necessary to designate anything with ":const" for this treatment.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6929

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/6929] support constant global variables
  2008-10-01 16:05 [Bug translator/6929] New: support constant global variables mhiramat at redhat dot com
                   ` (2 preceding siblings ...)
  2008-10-01 18:46 ` fche at redhat dot com
@ 2008-10-11  2:48 ` fche at redhat dot com
  2008-10-11  2:52 ` mhiramat at redhat dot com
  4 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2008-10-11  2:48 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2008-10-10 20:24 -------
Note that this conflicts with bug #5642 and existing staprun GLOBAL=VALUE
functionality, since globals can be reinitialized later via staprun.
That means we couldn't literally substitute them at translate time.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


http://sourceware.org/bugzilla/show_bug.cgi?id=6929

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/6929] support constant global variables
  2008-10-01 16:05 [Bug translator/6929] New: support constant global variables mhiramat at redhat dot com
                   ` (3 preceding siblings ...)
  2008-10-11  2:48 ` fche at redhat dot com
@ 2008-10-11  2:52 ` mhiramat at redhat dot com
  4 siblings, 0 replies; 7+ messages in thread
From: mhiramat at redhat dot com @ 2008-10-11  2:52 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From mhiramat at redhat dot com  2008-10-10 23:53 -------
(In reply to comment #4)
> Note that this conflicts with bug #5642 and existing staprun GLOBAL=VALUE
> functionality, since globals can be reinitialized later via staprun.
> That means we couldn't literally substitute them at translate time.

Hmm, even though, as I mentioned in comment #1, const suffix or something like that
can solve that conflict.
(or, const XXXXX=NNNN instead of global XXXXX:const=NNNNN)


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6929

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug translator/6929] support constant global variables
       [not found] <bug-6929-6586@http.sourceware.org/bugzilla/>
@ 2015-11-28 14:20 ` fche at redhat dot com
  0 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2015-11-28 14:20 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=6929

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
                 CC|                            |fche at redhat dot com
         Resolution|---                         |WORKSFORME

--- Comment #6 from Frank Ch. Eigler <fche at redhat dot com> ---
this may now be implemented via macros


@define const_global_foo %( 1 %)
probe begin { println(@const_global_foo) }

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-11-28 14:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-01 16:05 [Bug translator/6929] New: support constant global variables mhiramat at redhat dot com
2008-10-01 17:37 ` [Bug translator/6929] " fche at redhat dot com
2008-10-01 18:39 ` mhiramat at redhat dot com
2008-10-01 18:46 ` fche at redhat dot com
2008-10-11  2:48 ` fche at redhat dot com
2008-10-11  2:52 ` mhiramat at redhat dot com
     [not found] <bug-6929-6586@http.sourceware.org/bugzilla/>
2015-11-28 14:20 ` fche at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).