0

Let's say, we have a server with Ubuntu 22.04 and ARM64 architecture. Also, we have the latest dotnet:

$ dotnet --version
7.0.102

I want to view JIT assembly output for a program, for example:

C.CurrentAction()
    19fc:       64616572        strbtvs r6, [r1], #-1394        ; 0xfffffa8e
    1a00:       6e6f635f        mcrvs   3, 3, r6, cr15, cr15, {2}
    1a04:       69735f64        ldmdbvs r3!, {r2, r5, r6, r8, r9, sl, fp, ip, lr}^
    1a08:       6c616e67        stclvs  14, cr6, [r1], #-412    ; 0xfffffe64
    1a0c:       68747000        ldmdavs r4!, {ip, sp, lr}^
    1a10:       64616572        strbtvs r6, [r1], #-1394        ; 0xfffffa8e
    1a14:       7474615f        ldrbtvc r6, [r4], #-351 ; 0xfffffea1

We can do it on https://sharplab.io/, however this website doesn't support ARM64 at the moment. Also, we can do it in Visual studio, using Disassembly window, but we have a server without Visual studio.

I am looking for something similar to PrintAssembly in Java, which allows to get JIT output from command line.

Denis
  • 3,595
  • 12
  • 52
  • 86

1 Answers1

0

I've found a few things, which could work for you, but it doesn't work for me on Linux (it works in Windows, though):

  1. DOTNET_JitDisasm - https://devblogs.microsoft.com/dotnet/performance_improvements_in_net_7/
  2. Using BenchmarkDotNet to get ASM - https://github.com/dotnet/BenchmarkDotNet/issues/1422
Denis
  • 3,595
  • 12
  • 52
  • 86