BenchmarkDotNet icon indicating copy to clipboard operation
BenchmarkDotNet copied to clipboard

Cross platform disassembler doensn't output anything on macOS

Open NinoFloris opened this issue 5 years ago • 2 comments

Cross platform disassembler doesn't output anything on macOS

Details: .net core 5.0 preview 6, BDN 0.12.1 (which should have xplat support)

For a benchmark like

open BenchmarkDotNet.Attributes
open BenchmarkDotNet.Running

type Service =
    abstract Prop : int

[<Sealed>]
type Impl() =
    interface Service with
        member x.Prop = 1

[<DisassemblyDiagnoser(exportGithubMarkdown= true)>]
type Devirt() =
    [<Benchmark>]
    member _.DevirtProp() = (Impl() :> Service).Prop

[<EntryPoint>]
let main argv =
   BenchmarkRunner.Run<Devirt>() |> ignore
   0

BDN returns

// * Diagnostic Output - DisassemblyDiagnoser * No benchmarks were disassembled

This does not seem to be an F# issue, a quick port of this benchmark to C# bore no fruit either.

NinoFloris avatar Jul 15 '20 18:07 NinoFloris

Could be that clrmd is unable to read anything from the process. Updating to latest 1.x or trying 2.x could possibly fix that https://www.nuget.org/packages/Microsoft.Diagnostics.Runtime/

0xd4d avatar Jul 23 '20 23:07 0xd4d

I've ported BDN to use ClrMd2 (https://github.com/dotnet/BenchmarkDotNet/pull/2040) but I was not able to get macOS support: https://github.com/microsoft/clrmd/issues/1034

It seems that attaching a debugger to another process requires a lot of work on macOS: http://os-tres.net/blog/2010/02/17/mac-os-x-and-task-for-pid-mach-call/

adamsitnik avatar Jul 18 '22 09:07 adamsitnik