Re: [PATCH] perf: Add Sparc annotate support.

From: David Miller
Date: Wed Oct 17 2018 - 12:42:37 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Date: Wed, 17 Oct 2018 09:39:02 -0300

> Em Tue, Oct 16, 2018 at 08:55:55PM -0700, David Miller escreveu:
>
> Great!
>
> Could you try something like:
>
> # perf record some_workload
> # perf annotate --stdio2 hot_function
>
> So that we can see this thing in action, i.e. sparc assembly annotated?
> :-)
>
> With 'perf annotate --tui hot_function' or 'perf top' 'A' you can
> navigate, but for showing it in action in a git changelog comment
> example --stdio is more convenient :-)

Sure :-)

This is run on __gettimeofday when running perf record on your "gtod"
test. (Still working on getting glibc to use the VDSO properly on
sparc :-( )

Samples: 7K of event 'cycles:ppp', 4000 Hz, Event count (approx.): 3086733887
__gettimeofday /lib32/libc-2.27.so [Percent: local period]
Percent│


│ Disassembly of section .text:

│ 000a6fa0 <__gettimeofday@@GLIBC_2.0>:
0.47 │ save %sp, -96, %sp
0.73 │ sethi %hi(0xe9000), %l7
│ → call __frame_state_for@@GLIBC_2.0+0x480
0.30 │ add %l7, 0x58, %l7 ! e9058 <nftw64@@GLIBC_2.3.3+0x818>
1.33 │ mov %i0, %o0
│ mov %i1, %o1
0.43 │ mov 0x74, %g1
│ ta 0x10
88.92 │ ↓ bcc 30
2.95 │ clr %g1
│ neg %o0
│ mov 1, %g1
0.31 │30: cmp %g1, 0
│ bne,pn %icc, a6fe4 <__gettimeofday@@GLIBC_2.0+0x44>
│ mov %o0, %i0
1.96 │ ← return %i7 + 8
2.62 │ nop
│ sethi %hi(0), %g1
│ neg %o0, %g2
│ add %g1, 0x160, %g1
│ ld [ %l7 + %g1 ], %g1
│ st %g2, [ %g7 + %g1 ]
│ ← return %i7 + 8
│ mov -1, %o0