New ThreadScope release, version 0.2.0

71 views
Skip to first unread message

Duncan Coutts

unread,
Sep 5, 2011, 9:13:07 AM9/5/11
to parallel...@googlegroups.com
Hi all,

I've just released a new version of ThreadScope. It's on hackage, along
with a new version of the ghc-events lib.

Of course ThreadScope relies on Gtk: I've been helping the Gtk2Hs
maintainers to make a new release that's compatible with GHC 7.2.

So first I'll explain what's new in this release and then give some
install instructions for Gtk.

Comments and feedback most welcome.


ThreadScope 0.2.0
=================

There's been a number of changes since the previous release, 0.1.3:

* New spark profiling visualisation (details below)
* Bookmarks with editable names/labels
* 'traceEvent' calls visualised as named bookmarks
* Rearranged GUI
* timeline and events visible simultaneously
* single side panel with key/legend, traces, bookmarks
* more traditional layout of tool bar & tabs
* GUI behaviour changes
* cursor synchronised between events and timeline views
* improved event list display
* traces pane allows toggling whole groups at once
* Improved open/export file dialogs
* Keyboard shortcuts for loading & reloading files
* Progress while loading big files
* --version, --help command line flags
* Various bug fixes:
* a few pattern match failures
* file load errors not reported
* failure displaying non-ascii symbols
* cursor disappearing at some zoom levels
* Significant internal GUI code refactoring (clearer state & event
handling)
* Builds with ghc-7.2 (as well as 7.0, 6.12, 6.10)

Spark profiling
---------------

This lets you visualise what is going on with par sparks in your
program. If the .eventlog includes spark events (requires GHC 7.3) then
we now provide three new graphs (off by default -- have to be made
visible in the traces panel):

* rate of spark creation on each HEC (sparks per ms)
* rate of spark conversion on each HEC (sparks per ms)
* size of spark pool on each HEC (num sparks)

This lets you see if you're getting a reasonable number of sparks (not
too many, not too few), in particular if the spark pool ends up empty.
It can also show you if you're getting lots of 'dud' sparks, or sparks
that fizzle or are GCed.

Here's a (slightly old now) screenshot:

https://github.com/Mikolaj/threadscope-sparkgraph-demo/raw/master/png/2x3sparks2.patch.png

(The real thing has better labels on the graphs)

That's showing lots of sparks overflowing (red) and a relatively small
number being created (green) and converted (green). You can see the pool
size maxes out at 8k and then empties relatively quickly. This demo
program is creating far too many sparks and then loosing allmost all of
them (it's using parList on a long list).

As I mentioned, you currently need GHC 7.3 to generate .eventlogs
containing the spark events. So you can build the development version
now. GHC 7.4 is expected to be released towards the end of the year.

Not included in this release, but we expect to include in the next
release is spark granularity visualisation to see if you're making too
many sparks that are too small (or perhaps too big). Here's roughly what
that will look like:

https://github.com/Mikolaj/ThreadScope/raw/histogram/MicroHistogram.png


'traceEvent' and Bookmarks
--------------------------

GHC.Exts exports an action:

traceEvent :: String -> IO ()

This emits a message into the .eventlog file. As a bit of an experiment
ThreadScope now loads these as bookmarks, so they get visualised as
lines in the timeline. This can be handy for delimiting phases of your
program in time.

It is however perhaps not appropriate to re-use this event for this
purpose, and we might want to have a separate events for such named
markers, leaving the general string message for other purposes. Comments
welcome.


Installing Gtk
==============

The ghc-events and threadscope packages are now on hackage. If you're
using GHC 7.2 however you will not yet have been able to install gtk.


Windows and OSX
---------------

For Windows and OSX you first need to install the Gtk+ C libs:

http://www.haskell.org/haskellwiki/Gtk2Hs#Installation_Notes

If you try this on Windows or OSX, please let me know. I've heard
successful reports of people building these tarballs on OSX so far, but
they were regular gtk2hs users.


Pre-release tarballs
--------------------

There are new gtk-0.12.1 pre-release tarballs available here:

http://code.haskell.org/~duncan/gtk2hs/

These will build with any recent version of GHC (6.10, 6.12, 7.0, 7.2).

If you're using a recent version of the cabal tool you can install them
all in a couple steps like so:

cabal install http://code.haskell.org/~duncan/gtk2hs/gtk2hs-buildtools-0.12.1.tar.gz
cabal install threadscope http://code.haskell.org/~duncan/gtk2hs/glib-0.12.1.tar.gz http://code.haskell.org/~duncan/gtk2hs/gio-0.12.1.tar.gz http://code.haskell.org/~duncan/gtk2hs/pango-0.12.1.tar.gz http://code.haskell.org/~duncan/gtk2hs/cairo-0.12.1.tar.gz http://code.haskell.org/~duncan/gtk2hs/gtk-0.12.1.tar.gz

(Yes, cabal can do remote tarballs directly these days and will resolve
the deps appropriately)

--
Duncan Coutts, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com/

Satnam Singh

unread,
Nov 4, 2011, 11:47:02 AM11/4/11
to parallel...@googlegroups.com
Duncan,

You asked me to change a Threadscope link on the web somewhere.... I think that email went to my Microsoft account which I can't read anymore. Please can you remind me what link you would like changed and what you would like it to point to? Thanks!

Cheers,

Satnam

Satnam Singh
Email: sat...@raintown.org
URL: http://cs.bham.ac.uk/~singhsu/
UK tel: +44 1223 479905
UK mobile: +44 7979 648412
USA cell: 408 656 4590

Duncan Coutts

unread,
Nov 4, 2011, 4:14:27 PM11/4/11
to sat...@raintown.org, parallel...@googlegroups.com
On Fri, 2011-11-04 at 15:47 +0000, Satnam Singh wrote:
> Duncan,
>
> You asked me to change a Threadscope link on the web somewhere.... I
> think that email went to my Microsoft account which I can't read
> anymore. Please can you remind me what link you would like changed and
> what you would like it to point to? Thanks!

Hi Satnam,

Yes, currently top hit on google for ThreadScope is:

http://research.microsoft.com/en-us/projects/threadscope/

then:

http://raintown.org/?page_id=132

The latter has a link through to the darcs repo
http://code.haskell.org/ThreadScope which in turn points to the new home
page which is:

http://www.haskell.org/haskellwiki/ThreadScope


So if we could perhaps get the first page to just do an automatic
redirect and the link on the second page updated, that'd be great. And
of course if you want to change anything on the new homepage, it's just
part of the haskell wiki so you can go right ahead.

Thanks!

Duncan

Johan Tibell

unread,
Nov 4, 2011, 4:24:14 PM11/4/11
to dun...@well-typed.com, sat...@raintown.org, parallel...@googlegroups.com

I would use a permanent redirect (i.e. status code 301) to tell search engines that the page has moved.

-- Johan
 
Reply all
Reply to author
Forward
0 new messages