Jump to page: 1 2
Thread overview
Profiling
Feb 09, 2021
JG
Feb 09, 2021
Dukc
Feb 09, 2021
Dukc
Feb 09, 2021
drug
Feb 10, 2021
JG
Feb 10, 2021
drug
Feb 10, 2021
Guillaume Piolat
Feb 10, 2021
Max Haughton
Feb 10, 2021
mw
Feb 12, 2021
Imperatorn
Aug 24, 2021
JG
Aug 24, 2021
JG
Aug 24, 2021
JG
Aug 24, 2021
JG
Aug 25, 2021
René Zwanenburg
Feb 12, 2021
James Blachly
February 09, 2021
I was trying to profile a d program. So I ran: dub build --build=profile. I then ran the program and it produced trace.log and trace.def. I then ran d-profile-viewer and got the following error:

std.conv.ConvException@/home/jg/dlang/ldc-1.24.0/bin/../import/std/conv.d(2382): Unexpected '-' when converting from type char[] to type ulong
----------------
??:? [0x564a8630fda5]
??:? [0x564a86333286]
??:? [0x564a863199fd]
/home/jg/dlang/ldc-1.24.0/bin/../import/std/conv.d:2382 [0x564a862c89a1]
/home/jg/dlang/ldc-1.24.0/bin/../import/std/conv.d:1941 [0x564a862c86cc]
/home/jg/dlang/ldc-1.24.0/bin/../import/std/conv.d:223 [0x564a862c869c]
app.d:1095 [0x564a862cdd71]
app.d:1138 [0x564a862ce7ba]
??:? [0x564a863196cb]
??:? [0x564a863195c7]
??:? [0x564a8631941d]
/home/jg/dlang/ldc-1.24.0/bin/../import/core/internal/entrypoint.d:42 [0x564a862ce7e4]
??:? __libc_start_main [0x7fd482807cb1]

Is d-profile-viewer no longer working? Or did I do something wrong?
February 09, 2021
On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote:
> Is d-profile-viewer no longer working? Or did I do something wrong?

You may have or may not have done it wrong, but in any case this is a bug. If you do something wrong, the program should tell you what you did wrong, instead of telling you that character '-' does not belong to middle of a long int.

You can try older d-profile-viewers as a workaround. Or you can try different ways to invoke the profile viewer or to profile different programs and see if you can pinpoint the cause.
February 09, 2021
On Tuesday, 9 February 2021 at 16:39:25 UTC, Dukc wrote:
> You may have or may not have done it wrong, but in any case this is a bug. If you do something wrong, the program should tell you what you did wrong, instead of telling you that character '-' does not belong to middle of a long int.

Oh wait a bit. The stack trace shows calling some function of 'app.d' - that's presumably your program.

I wonder why it's being called - aren't you supposed to be viewing the profiling results instead of profiling? I'm not sure what's happening.
February 09, 2021
On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote:
> I was trying to profile a d program. So I ran: dub build --build=profile. I then ran the program and it produced trace.log and trace.def. I then ran d-profile-viewer and got the following error:
>
> std.conv.ConvException@/home/jg/dlang/ldc-1.24.0/bin/../import/std/conv.d(2382): Unexpected '-' when converting from type char[] to type ulong

I'm guessing only but it looks like slurp is used to read text output but the format used does not correspond to the real data format.
February 10, 2021
On Tuesday, 9 February 2021 at 18:33:16 UTC, drug wrote:
> On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote:
>> I was trying to profile a d program. So I ran: dub build --build=profile. I then ran the program and it produced trace.log and trace.def. I then ran d-profile-viewer and got the following error:
>>
>> std.conv.ConvException@/home/jg/dlang/ldc-1.24.0/bin/../import/std/conv.d(2382): Unexpected '-' when converting from type char[] to type ulong
>
> I'm guessing only but it looks like slurp is used to read text output but the format used does not correspond to the real data format.

Thanks for the suggestions. However, I would prefer not to spend time trying to debug d-profile-viewer at the moment.

As a follow up question I would like to know what tool people use to profile d programs?
February 10, 2021
On 2/10/21 2:52 PM, JG wrote:
> On Tuesday, 9 February 2021 at 18:33:16 UTC, drug wrote:
>> On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote:
>>> I was trying to profile a d program. So I ran: dub build --build=profile. I then ran the program and it produced trace.log and trace.def. I then ran d-profile-viewer and got the following error:
>>>
>>> std.conv.ConvException@/home/jg/dlang/ldc-1.24.0/bin/../import/std/conv.d(2382): Unexpected '-' when converting from type char[] to type ulong
>>
>> I'm guessing only but it looks like slurp is used to read text output but the format used does not correspond to the real data format.
> 
> Thanks for the suggestions. However, I would prefer not to spend time trying to debug d-profile-viewer at the moment.
> 
> As a follow up question I would like to know what tool people use to profile d programs?

Could you provide trace.log that I can take a look? I have no much time but some bugs can be fixed fast. It would be ideal if you create the issue in the package repo and provides the test case. Also there is probability the author will fix this.
February 10, 2021
On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote:
>
> Thanks for the suggestions. However, I would prefer not to spend time trying to debug d-profile-viewer at the moment.
>
> As a follow up question I would like to know what tool people use to profile d programs?

Here is what I use for sampling profiler:

(On Windows)

Build with LDC, x86_64, with dub -b release-debug in order to have debug info.
Run your program into:
- Intel Amplifier (free with System Studio)
- AMD CodeXL (more lightweight, and very good)
- Very Sleepy

(On Mac)

Build with dub -b release-debug
Run your program with Instruments.app which you can find in your Xcode.app

(On Linux)
I don't know.


Though most of the time to validate the optimization a comparison program that runs two siilar programs and computer the speed difference can be needed.
February 10, 2021
On Wednesday, 10 February 2021 at 13:31:09 UTC, Guillaume Piolat wrote:
> On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote:
>> [...]
>
> Here is what I use for sampling profiler:
>
> (On Windows)
>
> Build with LDC, x86_64, with dub -b release-debug in order to have debug info.
> Run your program into:
> - Intel Amplifier (free with System Studio)
> - AMD CodeXL (more lightweight, and very good)
> - Very Sleepy
>
> (On Mac)
>
> Build with dub -b release-debug
> Run your program with Instruments.app which you can find in your Xcode.app
>
> (On Linux)
> I don't know.
>
>
> Though most of the time to validate the optimization a comparison program that runs two siilar programs and computer the speed difference can be needed.

All Intel tools I'm aware of support (and are free on) Linux. Also, it's just called vTune now and it's been put under the "oneAPI" banner.
February 10, 2021
On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote:
>
> As a follow up question I would like to know what tool people use to profile d programs?

I use this one:

https://code.dlang.org/packages/profdump

e.g.

```
dub build --build=debug --build=profile

# run your program to generate trace.log

profdump -b trace.log trace.log.b
profdump -f --dot --threshold 1 trace.log trace.log.dot
echo 'view it with: xdot trace.log.dot'
```

February 12, 2021
On Wednesday, 10 February 2021 at 23:42:31 UTC, mw wrote:
> On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote:
>>
>> As a follow up question I would like to know what tool people use to profile d programs?
>
> I use this one:
>
> https://code.dlang.org/packages/profdump
>
> e.g.
>
> ```
> dub build --build=debug --build=profile
>
> # run your program to generate trace.log
>
> profdump -b trace.log trace.log.b
> profdump -f --dot --threshold 1 trace.log trace.log.dot
> echo 'view it with: xdot trace.log.dot'
> ```

Nice, didn't even know that existed
« First   ‹ Prev
1 2