Re: Late CC profiling

2025-04-07 Thread Andreas Klebinger via ghc-devs
ure point of view as well. For example LateCC must return a list of inserted cost centres, while CorePrep doesn't need to care about such a thing at all currently! So I would rather keep those clearly separated. > I was thinking that the class-op selector is a small, cheap function

Re: Late CC profiling

2025-04-07 Thread Simon Peyton Jones
n. I was thinking that the class-op selector is a small, cheap function, so I don't mind not profiling it. But perhaps your point is that calling it symptomatic of running overloaded code, and we might want to know that. Simon On Mon, 7 Apr 2025 at 10:37, Andreas Klebinger wrote: &g

Re: Late CC profiling

2025-04-07 Thread Andreas Klebinger via ghc-devs
A interesting wrinkle! I agree with matt that having class methods show up in the profile can be very helpful at times. Constructors and their wrappers on the other hand should be of no concern. We explicitly try to avoid wrapping them in cost centres as they generally add no useful information

Re: Late CC profiling

2025-04-07 Thread Matthew Pickering
Hi Simon, It does seem strange (at first glance) that these implicit things happen in two different places. However, I think you should do this refactoring in a separate MR to !10479, it seems unrelated to the purpose of that patch and affects other things like you have mentioned. Why do you thi

Late CC profiling

2025-04-04 Thread Simon Peyton Jones
Hi Matthew, Andreas, Ben In GHC today there is a strange inconsistency: - Bindings for data constructor wrappers and class method selectors are added at the end of CoreTidy. - Bindings for data constructor workers are added at the start of CorePrep This is deeply strange. In !10479

Re: Question about profiling reports

2024-08-05 Thread Rodrigo Mesquita
Hi Celeste, You may already be aware, but there’s an alternative format to visualise profiles graphically. Instead of `-p`, use `-pj` to produce the profiling report in JSON format, and then load the resulting .prof file into speedscope.app <https://www.speedscope.app/>. Cheers, R

Re: Question about profiling reports

2024-08-05 Thread Teofil Camarasu
24 at 3:58 PM Celeste Hollenbeck < celeste.hollenb...@gmail.com> wrote: > Hi GHC Team, > > I have a question for a research project. I'm looking at GHC's profiler, > and the documentation says a profiling report displays "a break-down by > cost centre of the most

Question about profiling reports

2024-07-30 Thread Celeste Hollenbeck
Hi GHC Team, I have a question for a research project. I'm looking at GHC's profiler, and the documentation says a profiling report displays "a break-down by cost centre of the most costly functions in the program". Here's an example of the report that I'm tal

Coordination on FreeBSD CI, default WinIO and Info Tables profiling work

2023-03-15 Thread Hécate
Hi everyone, I have created topical aggregators of tickets that go beyond the rhythm of releases (aka. "epics") for  the following topics: * Info Tables Profiling: https://gitlab.haskell.org/groups/ghc/-/epics/3 * Setting WinIO "on" by default: https://gitlab.haskell.or

Getting Info Table Profiling to the finish line

2023-02-13 Thread Hécate
Hello fellow devs, I am indexing the work necessary to bring Info Table Profiling to the finish line: Seamless for the user to employ. Some of the tickets refer to external ticket trackers, they have been marked as FOREIGN. Their counterpart tickets will be opened there when the situation

Re: GHC head, profiling with -O2 does not work

2021-05-23 Thread Ben Gamari
Harendra Kumar writes: > Hi, > > I am trying to build a small program with profiling using a ghc built from > haskell gitlab master branch. When I use -O2 I run into: > > $ ghc/inplace/bin/ghc-stage2 --make -O2 -prof -fprof-auto -rtsopts Main.hs > Linking Main ... > .

GHC head, profiling with -O2 does not work

2021-05-23 Thread Harendra Kumar
Hi, I am trying to build a small program with profiling using a ghc built from haskell gitlab master branch. When I use -O2 I run into: $ ghc/inplace/bin/ghc-stage2 --make -O2 -prof -fprof-auto -rtsopts Main.hs Linking Main ... ./StreamD.o(.text+0x1b9f2): error: undefined reference to

RE: GHC/ | GHC doesn't inline small type class method marked as INLINE with profiling enabled (#18372)

2020-06-22 Thread Simon Peyton Jones via ghc-devs
I get a 404 for https://gitlab.haskell.org/ghc/ghc/-/issues/18372 You may need to re-submit this… s From: Andrzej Rybczak Sent: 21 June 2020 15:44 To: Simon Peyton Jones Subject: GHC/ | GHC doesn't inline small type class method marked as INLINE with profiling enabled (#18372) An

Re: profiling a constructor?

2020-05-23 Thread Ben Gamari
Richard Eisenberg writes: > Thanks for all the responses. Yes, I'm looking for the number of > allocations of a constructor; this is an allocations issue, not a > retention/liveness issue. I'm not concerned about accesses (not even > sure what that would mean). Adding this to -ticky would be very

Re: profiling a constructor?

2020-05-23 Thread Richard Eisenberg
Not hard to > add either. > > (Richard is asking for number of allocations, not what is live at any moment.) > > Simon > > | -Original Message- > | From: ghc-devs On Behalf Of Richard > | Eisenberg > | Sent: 23 May 2020 13:59 > | To: GHC developer

RE: profiling a constructor?

2020-05-23 Thread Simon Peyton Jones via ghc-devs
developers | Subject: profiling a constructor? | | Hi devs, | | Is there a way to count the number of times a particular constructor is | allocated? I might want to know, say, the total number of cons cells | allocated over the course of a program, or (in my actual case) the total

Re: profiling a constructor?

2020-05-23 Thread Ben Gamari
On May 23, 2020 9:32:32 AM EDT, Andreas Klebinger wrote: >> Surely, the RTS must be able to count the number of times a >constructor is used. >It can't. For one there are different kinds of "uses" for constructors. This is a fair point. I had assumed that Richard was debugging a residency issue

Re: profiling a constructor?

2020-05-23 Thread Andreas Klebinger
tructor? That's even harder to track. * The constructor being present during GC? One can do this using heap profiling (as ben described). There are also top level constructors which currently don't generate code at all (just static data). So currently there is no such feature. For allo

Re: profiling a constructor?

2020-05-23 Thread Ben Gamari
Yes, you can use +RTS -hT, which is available even in the non-profiled runtime. This breaks down the heap by closure type. Of course, you don't have visibility into the source of the allocation, but this is often still quite useful. — Ben On May 23, 2020 8:58:30 AM EDT, Richard Eisenberg

profiling a constructor?

2020-05-23 Thread Richard Eisenberg
Hi devs, Is there a way to count the number of times a particular constructor is allocated? I might want to know, say, the total number of cons cells allocated over the course of a program, or (in my actual case) the total number of FunTy cells allocated over the course of a program. I can try

Preview of new profiling mode - profile by info table

2020-05-03 Thread Matthew Pickering
Hi all, I have hacked together a new profiling mode code named "Profile by Info Table" which uses the address of the info table as the band identity in the profile. The main point of this is that you can then look up the source location of the info table in the dwarf information when

Re: Time-profiling the compiler pipeline

2020-02-26 Thread Ben Gamari
erience as well. This is indeed a major problem for architectures like ARM which are only supported via the LLVM backend. > If we want to improve compilation times, we should be able to measure it > first. > As far as I understand, the only way for profiling the compiler pipeline today > is bui

Time-profiling the compiler pipeline

2020-02-26 Thread Sergej Jaskiewicz via ghc-devs
ete, on my machine I've managed to build the whole toolchain in just half an hour with NCG, but the same build with LLVM-powered GHC took several hours. If we want to improve compilation times, we should be able to measure it first. As far as I understand, the only way for profiling the compiler

Tip for profiling GHC

2019-08-24 Thread Matthew Pickering
Hi all, I thought for a long while that if you wanted to profile GHC itself then you had to build a profiled version of HEAD. However, this isn't true. The easiest way to profile GHC itself is to write a simple GHC API application and compile that with profiling. Normal GHC distributions

Zurihac 2019 - Heap Profiling Projects

2019-06-06 Thread Matthew Pickering
Hi all, I plan to do some work on the heap profiler during Zurihac this year. I've written down quite a long list of possible projects if anyone else wants to work on this with me. They are split into two categories. 1. Improving my replacement for hp2ps/hp2pretty which parses and renders eventlo

Re: GHC API, GHCi, profiling, shared objects

2019-05-16 Thread Matthew Pickering
that there are some advantages to the external interpreter. 1. The interpreter and compiler can be run using separate runtimes. In the context of the GHCi API I believe this means that the GHC API program can be compiled the profiling way BUT the interpreted code can be compiled the normal way

GHC API, GHCi, profiling, shared objects

2019-04-27 Thread Matthew Pickering
Hi, If I write a program using the GHC API then the resulting executable is sensitive to the version of GHC which I used to build the program. For example, if I build a version of GHC which has profiling enabled (prof flavour) then building my application (static linking) with this version means

Re: New core profiling mode

2017-11-15 Thread Ben Gamari
n adding them to HsSyn before > simplification. This makes it harder to map cost-centres into source > code (You have to -ddump-prep currently), but in > exchange you are profiling the same core program as the non-profilied build. > Sounds quite reasonable to me. > I intend to investi

RE: New core profiling mode

2017-11-15 Thread Simon Peyton Jones via ghc-devs
Doug Good stuff. Do you know about ticky-ticky profiling? It is /guaranteed/ not to affect optimisation. Moreover you can mix modules compiled with and without profiling. But it’s very low level. I had not thought of doing /cost-centre/ profiling after optimisation. That’s an

New core profiling mode

2017-11-14 Thread Douglas Wilson
have to -ddump-prep currently), but in exchange you are profiling the same core program as the non-profilied build. I intend to investigate whether I can use SourceNotes to create SrcSpans for the generated cost-centres to somewhat alleviate the need to inspect dumped core. There are several new

Re: [GHC] #10416: GHC 7.10.1 User Guide profiling section 5.4 missing images

2015-07-21 Thread Alan & Kim Zimmerman
Ok. But it may be worth manually fixing the version on the official web site once 7.10.2 comes out On Tue, Jul 21, 2015 at 9:19 PM, GHC wrote: > #10416: GHC 7.10.1 User Guide profiling section 5.4 missing ima

Re: biographical profiling is broken?

2014-08-08 Thread Simon Marlow
On 07/08/2014 16:29, Ömer Sinan Ağacan wrote: Hi all, I'm trying to use LDV profiling features of GHC but I'm failing. Here's what I try: (I'm using GHC 7.8.2) * I'm compiling my app with `-prof` and I'm also using `-fprof-auto` just to be sure. * I'm runn

biographical profiling is broken?

2014-08-07 Thread Ömer Sinan Ağacan
Hi all, I'm trying to use LDV profiling features of GHC but I'm failing. Here's what I try: (I'm using GHC 7.8.2) * I'm compiling my app with `-prof` and I'm also using `-fprof-auto` just to be sure. * I'm running my app using `+RTS -hbdrag,void

Re: Questions about "time and space profiling for non-strict langs" paper and cost centre impl. of GHC

2014-05-21 Thread Simon Marlow
TG syntax is stands for "push" operation explained in the slides but as far as I can see "call" is missing in generated STG. "call" is implemented by enterFunCCS() in rts/Profiling.c. I'm afraid there's no good high-level description of how profiling works

RE: Questions about "time and space profiling for non-strict langs" paper and cost centre impl. of GHC

2014-05-18 Thread Peter Wortmann
> In Simon Marlow's slides, stack traces are implemented in terms of > "call" and "push" operations. I guess `push` in STG syntax is stands > for "push" operation explained in the slides but as far as I can see > "call" is missing in generated STG. There seems to be some confusion here - "push" i

Re: Questions about "time and space profiling for non-strict langs" paper and cost centre impl. of GHC

2014-05-18 Thread Ömer Sinan Ağacan
Thanks again for the answer. > Not sure what "_call_" is suppose to be. What's the context? In Simon Marlow's slides, stack traces are implemented in terms of "call" and "push" operations. I guess `push` in STG syntax is stands for "push" operation explained in the slides but as far as I can see

Re: Questions about "time and space profiling for non-strict langs" paper and cost centre impl. of GHC

2014-05-18 Thread Peter Wortmann
Ömer Sinan Ağacan wrote: > (off-topic: I'm wondering why an empty tuple is passed to `getCurrentCSS`?) See the comment on getCurrentCCS# in compiler/prelude/primops.txt.pp - it's a token to prevent GHC optimisations from floating the primop up (which obviously might change the call stack). > No

Re: Questions about "time and space profiling for non-strict langs" paper and cost centre impl. of GHC

2014-05-18 Thread Ömer Sinan Ağacan
Thanks Peter. Simon Marlow's talk was really interesting. After reading the slides I read related GHC code and realized that "cost-centre stack" and the stack trace printed using GHC.Stack is same thing. `libraries/base/GHC/Stack.hsc` has this definition: currentCallStack :: IO [String] cu

Re: Questions about "time and space profiling for non-strict langs" paper and cost centre impl. of GHC

2014-05-15 Thread Peter Wortmann
rifying this. I'm > also looking for more recent papers about GHC's profiler > implementation. I'm especially interested profiling in multi-threaded > RTS. There have been no new papers that I know of, but we had a talk by Simon Marlow[1] about improvements to cost-centre st

Questions about "time and space profiling for non-strict langs" paper and cost centre impl. of GHC

2014-05-15 Thread Ömer Sinan Ağacan
Hi all, I'm trying to understand the paper "Time and space profiling for non-strict, higher-order functional languages"[1] and I'm hoping that experienced GHC devs here could help me clarifying some points. Here's my question: In Figure 5, I don't understand why no

Re: Testsuite with profiling

2013-09-19 Thread Edward Z. Yang
That's to be expected, because unfortunately, profiling is not a "transparent" operation; you have to compile things differently and certain features don't work. You might have better luck doing a slow test run, with WAY=prof (there are actually a number of other cases too

Testsuite with profiling

2013-09-19 Thread Jan Stolarek
I need to run testsuite with profiling turned on. When I run make WAY=normal EXTRA_HC_OPTS="-prof -fprof-auto -rtsopts" lots of tests are failing with: Dynamic linking required, but this is a non-standard build (eg. prof). You need to build the program twice: once the d

Re: Profiling segfaulting in HEAD again

2013-09-12 Thread Jan Stolarek
Do: "ghc-devs" Wysłane: niedziela, 8 wrzesień 2013 6:39:20 Temat: Profiling segfaulting in HEAD again Hey folks, I noticed that profiling has started segfaulting again in HEAD. Anyone recently push something that might be triggering this? Edward ___

Re: Profiling segfaulting in HEAD again

2013-09-12 Thread Jan Stolarek
I second Edward's question. I need to do a profiling build of GHC, but I'm getting segfaults. Janek - Oryginalna wiadomość - Od: "Edward Z. Yang" Do: "ghc-devs" Wysłane: niedziela, 8 wrzesień 2013 6:39:20 Temat: Profiling segfaulting in HEAD again Hey fo

Profiling segfaulting in HEAD again

2013-09-07 Thread Edward Z. Yang
Hey folks, I noticed that profiling has started segfaulting again in HEAD. Anyone recently push something that might be triggering this? Edward ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

Re: profiling

2013-06-18 Thread 山本和彦
> Yes, this is a bug; see #7978. I am working with Simon to get it fixed. Thanks. I joined the ticket. --Kazu ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

Re: profiling

2013-06-18 Thread Geoffrey Mainland
Yes, this is a bug; see #7978. I am working with Simon to get it fixed. Geoff On 06/18/2013 01:43 PM, Kazu Yamamoto (山本和彦) wrote: > Hi, > > The following command can install acme-http with profiling if GHC > 7.6.3 is used: > > % cabal install -p --ghc-options="-pro

profiling

2013-06-18 Thread 山本和彦
Hi, The following command can install acme-http with profiling if GHC 7.6.3 is used: % cabal install -p --ghc-options="-prof -fprof-auto" --enable-executable-profiling -j10 acme-http But if GHC head is used, the following error occurs: % cabal install -p --ghc-opti

shared libraries for profiling

2013-06-17 Thread 山本和彦
Hi, I seems to me that shared libraries for profiling are not installed. For example, let's see the base library: % cd lib/ghc-7.7.20130616/base-4.7.0.0 % ls -1 libHSbase* libHSbase-4.7.0.0.a libHSbase-4.7.0.0-ghc7.7.20130616.so* libHSbase-4.7.0.0_p

Re: [GHC] #7820: Installing profiling library BREAKS non-profiling executable

2013-04-08 Thread Ryan Newton
820: Installing profiling library BREAKS non-profiling executable > > --+- > Reporter: rrnewton | Owner: > Type: bug| Status: new > Priority: normal | Co

Re: upcoming changes to ticky profiling

2013-03-29 Thread Nicolas Frisby
/Debugging/TickyTicky Thanks. On Sun, Mar 24, 2013 at 3:20 PM, Nicolas Frisby wrote: > I'm soon to commit some improvements/extensions to ticky-ticky profiling, > including changing the format of the ticky report. > > (To be clear, I'm referring to the file foo generated by +R

upcoming changes to ticky profiling

2013-03-24 Thread Nicolas Frisby
I'm soon to commit some improvements/extensions to ticky-ticky profiling, including changing the format of the ticky report. (To be clear, I'm referring to the file foo generated by +RTS -rfoo -RTS, having used the -ticky compiler flag). Please let me know if your workflow makes any a

Re: ticky/cc profiling and heap checks

2013-02-18 Thread Nicolas Frisby
Got it. Will do. On Mon, Feb 18, 2013 at 8:10 PM, Simon Marlow wrote: > On 18/02/13 17:38, Nicolas Frisby wrote: > >> Moving all ticky bumps after the heapcheck did prevent the wiggling I >> noticed. >> Could you also weigh in on the location of the cost centre profilin

Re: low-level profiling

2013-02-18 Thread Simon Marlow
On 18/02/13 17:37, Nicolas Frisby wrote: Hmm. build.mk.sample includes STRIP_CMD = : (so do the build.mk files I'm using) Is that symbol for something else or is there a typo somewhere? It looks like the GHC build system uses STRIP_CMD, but the nofib build system uses STRIP.

Re: ticky/cc profiling and heap checks

2013-02-18 Thread Simon Marlow
On 18/02/13 17:38, Nicolas Frisby wrote: Moving all ticky bumps after the heapcheck did prevent the wiggling I noticed. Could you also weigh in on the location of the cost centre profiling entries? The cost centre bumps should definitely be after the heap check too. Cheers, Simon

Re: ticky/cc profiling and heap checks

2013-02-18 Thread Nicolas Frisby
Moving all ticky bumps after the heapcheck did prevent the wiggling I noticed. Could you also weigh in on the location of the cost centre profiling entries? Thanks! On Mon, Feb 18, 2013 at 2:19 PM, Simon Marlow wrote: > On 16/02/13 16:32, Nicolas Frisby wrote: > >> I noticed som

Re: low-level profiling

2013-02-18 Thread Nicolas Frisby
Hmm. build.mk.sample includes STRIP_CMD = : (so do the build.mk files I'm using) Is that symbol for something else or is there a typo somewhere? On Mon, Feb 18, 2013 at 2:12 PM, Simon Marlow wrote: > On 15/02/13 20:31, Johan Tibell wrote: > >> On Fri, Feb 15, 2013 at 12:02 PM, Nicolas Frisby

Re: ticky/cc profiling and heap checks

2013-02-18 Thread Simon Marlow
k is after. Questions: * Does any object to me moving both ticky counters after the heap check? * Is there a reason the two cost centre profiling entries are on opposite sides of the heap check? It sounds wrong to me. If you could clean this up that would be great. These counters should never

Re: low-level profiling

2013-02-18 Thread Simon Marlow
On 15/02/13 20:31, Johan Tibell wrote: On Fri, Feb 15, 2013 at 12:02 PM, Nicolas Frisby mailto:nicolas.fri...@gmail.com>> wrote: Thanks for rallying everyone! I made a bit of a breakthrough while trying to pinpoint where the linker is invoked. Here's the situation: * If I use

ticky/cc profiling and heap checks

2013-02-16 Thread Nicolas Frisby
me moving both ticky counters after the heap check? * Is there a reason the two cost centre profiling entries are on opposite sides of the heap check? Thanks. ___ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

Re: low-level profiling

2013-02-15 Thread Nicolas Frisby
OK. I added a blurb on the wiki page. On Fri, Feb 15, 2013 at 8:31 PM, Johan Tibell wrote: > On Fri, Feb 15, 2013 at 12:02 PM, Nicolas Frisby > wrote: > >> Thanks for rallying everyone! I made a bit of a breakthrough while trying >> to pinpoint where the linker is invoked. >> >> Here's the situ

Re: low-level profiling

2013-02-15 Thread Johan Tibell
On Fri, Feb 15, 2013 at 12:02 PM, Nicolas Frisby wrote: > Thanks for rallying everyone! I made a bit of a breakthrough while trying > to pinpoint where the linker is invoked. > > Here's the situation: > > * If I use nofib's "make" command to build the text, the executable does > not have the fun

Re: low-level profiling

2013-02-15 Thread Nicolas Frisby
> > Geoff > > ** ** > > *From:* ghc-devs-boun...@haskell.org [mailto:ghc-devs-boun...@haskell.org] > *On Behalf Of *Nicolas Frisby > *Sent:* Friday, February 15, 2013 7:41 PM > *To:* Johan Tibell > *Cc:* ghc-devs@haskell.org > *Subject:* Re: low-level profiling &

RE: low-level profiling

2013-02-15 Thread Geoffrey Mainland
Try invoking ghc with -optl-g? Geoff From: ghc-devs-boun...@haskell.org [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Nicolas Frisby Sent: Friday, February 15, 2013 7:41 PM To: Johan Tibell Cc: ghc-devs@haskell.org Subject: Re: low-level profiling Ah, looks like the symbol information

Re: low-level profiling

2013-02-15 Thread Nicolas Frisby
Ah, looks like the symbol information exists in the .o files, but not in my actual executable. Could I invoke ld manually with some incantation to preserve the function symbols? On Fri, Feb 15, 2013 at 7:18 PM, Nicolas Frisby wrote: > No, nothing fancy. It's just a nofib program. > > I am seei

Re: low-level profiling

2013-02-15 Thread Nicolas Frisby
No, nothing fancy. It's just a nofib program. I am seeing the .size directives in the .s files. And objdump -S gives output like this: 0368 : 368: 48 83 e3 07 and$0x7,%rbx 36c: 48 83 fb 02 cmp$0x2,%rbx 370: 0f 83 96 00 00 00 jae40c 376: 48 8b 4

Re: low-level profiling

2013-02-15 Thread Johan Tibell
On Fri, Feb 15, 2013 at 10:24 AM, Nicolas Frisby wrote: > I'm not passing any flags related to code generation, I don't think. > > $HC -H64m -O -Rghc-timing -package array -H32m -hisuf hi -O1 -rtsopts -c > Main.hs -o Main.o > > So that'd just be the native code generator, right?. > > $ uname -a >

Re: low-level profiling

2013-02-15 Thread Nicolas Frisby
I'm not passing any flags related to code generation, I don't think. $HC -H64m -O -Rghc-timing -package array -H32m -hisuf hi -O1 -rtsopts -c Main.hs -o Main.o So that'd just be the native code generator, right?. $ uname -a Linux cam-05-unx 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC

Re: low-level profiling

2013-02-15 Thread Johan Tibell
On Fri, Feb 15, 2013 at 10:05 AM, Nicolas Frisby wrote: > I'm way below my depth here, but I'd like to use the perf tool to see > where a program is spending its time. > > Unfortunately, the recipe here > > http://hackage.haskell.org/trac/ghc/wiki/Debugging/LowLevelProfiling/Perf > > isn't working

low-level profiling

2013-02-15 Thread Nicolas Frisby
I'm way below my depth here, but I'd like to use the perf tool to see where a program is spending its time. Unfortunately, the recipe here http://hackage.haskell.org/trac/ghc/wiki/Debugging/LowLevelProfiling/Perf isn't working for me. I get output like this instead 90.20% drbg_test drbg_test