public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/11695] DWIM promotion of ++ to <<<
       [not found] <bug-11695-6586@http.sourceware.org/bugzilla/>
@ 2019-05-28 19:00 ` fche at redhat dot com
  0 siblings, 0 replies; 4+ messages in thread
From: fche at redhat dot com @ 2019-05-28 19:00 UTC (permalink / raw)
  To: systemtap

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #4 from Frank Ch. Eigler <fche at redhat dot com> ---
Not that compelling, and the translator may not have the wits to know whether
the write vs read*#cpus tradeoffs are worthwhile.

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

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

* [Bug translator/11695] DWIM promotion of ++ to <<<
  2010-06-12  2:58 [Bug translator/11695] New: " fche at redhat dot com
  2010-06-12  3:03 ` [Bug translator/11695] " mjw at redhat dot com
  2010-06-12 14:27 ` jistone at redhat dot com
@ 2010-06-14 16:56 ` mjw at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: mjw at redhat dot com @ 2010-06-14 16:56 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From mjw at redhat dot com  2010-06-14 09:26 -------
(In reply to comment #2)
> So this transformation is only worthwhile when updating the value is more common
> than reading it.

The example that triggered this was like that:

$ stap -e 'global modules;
  probe timer.profile { if (target() == pid()) modules[umodname(uaddr())]++ }
  probe end { foreach ([m] in modules- limit 5)
              { printf("%4d:%s\n", modules[m], m) } }' -x `pidof firefox`

There are two advantages to using aggregates. It is "cheaper" in this use case.
And you don't necessarily need to write the end probe since systemtap detects
that it is only written to, so will generate the end probe printing it itself.
(That is bug #6954 for global arrays).

The disadvantage is that is it slightly obscure (you don't actually want the
whole aggregate, only the @count). And that the generated printing of the global
is somewhat messy (you get the whole aggregate printed out).

It might always be a win for global arrays that are never read.

-- 


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

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

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

* [Bug translator/11695] DWIM promotion of ++ to <<<
  2010-06-12  2:58 [Bug translator/11695] New: " fche at redhat dot com
  2010-06-12  3:03 ` [Bug translator/11695] " mjw at redhat dot com
@ 2010-06-12 14:27 ` jistone at redhat dot com
  2010-06-14 16:56 ` mjw at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jistone at redhat dot com @ 2010-06-12 14:27 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From jistone at redhat dot com  2010-06-11 15:52 -------
(In reply to comment #1)
> The aggregate doesn't need a global lock, it uses per-cpu counters.

It does have a lock, but the exclusiveness is inverted: <<< takes a read lock
and @extract takes a write lock.  You can think of it as locking the aggregate
structure, which you write to when @extracting data from the per-cpu structures.

So this transformation is only worthwhile when updating the value is more common
than reading it.

-- 


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

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

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

* [Bug translator/11695] DWIM promotion of ++ to <<<
  2010-06-12  2:58 [Bug translator/11695] New: " fche at redhat dot com
@ 2010-06-12  3:03 ` mjw at redhat dot com
  2010-06-12 14:27 ` jistone at redhat dot com
  2010-06-14 16:56 ` mjw at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: mjw at redhat dot com @ 2010-06-12  3:03 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From mjw at redhat dot com  2010-06-11 14:36 -------
In case it isn't clear why the transformation from scalar to aggregate is better
(as I did before it was explained to me). The aggregate doesn't need a global
lock, it uses per-cpu counters.

-- 


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

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

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

end of thread, other threads:[~2019-05-28 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-11695-6586@http.sourceware.org/bugzilla/>
2019-05-28 19:00 ` [Bug translator/11695] DWIM promotion of ++ to <<< fche at redhat dot com
2010-06-12  2:58 [Bug translator/11695] New: " fche at redhat dot com
2010-06-12  3:03 ` [Bug translator/11695] " mjw at redhat dot com
2010-06-12 14:27 ` jistone at redhat dot com
2010-06-14 16:56 ` mjw 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).