25

BUD17-416: Benchmark and profiling in OP-TEE

  • Upload
    linaro

  • View
    197

  • Download
    0

Embed Size (px)

Citation preview

Page 1: BUD17-416: Benchmark and profiling in OP-TEE
Page 2: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICES

WORKING TOGETHER

●○○

●○○○

●○○

Page 3: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

●○○

■■■■

Secure Monitor

Use

r

Use

rK

ern

el

Ke

rne

l

client

libtee.so

TEE generic

OP-TEE driver

OP-TEE core

libutee

TATA

TA

Page 4: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

●●

○○

●○

○○

Page 5: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

●●

●●

Page 6: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

Secure WorldNormal World

EL0

EL1

libTEEC

OP-TEE KMOD

Benchmark app Client app

OP-TEE OS CoreBenchmark Pseudo TA

1.BENCHMARK_CMD_REGISTER_MEMREF Benchmark_aux

libUTEE

Client TA

Hijack timestamp memref

2.fork/exec

3.InvokeCommand

4.BENCHMARK_CMD_GET_MEMREF

5.resume Invoke

Page 7: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

Page 8: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

Page 9: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

●○○○

●●●●

Page 10: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICES

WORKING TOGETHER

●○○

●○

Page 11: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

Page 12: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

●○○○○○

●○○

●○

Page 13: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

main()

2 s.

foo(2)

2 s.

bar()

3 s.

foo(1)

1 s.

x3

Page 14: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

main()

2 s.

foo(2)

2 s.

bar()

3 s.

foo(1)

1 s.

x3

Page 15: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

make CFG_TA_GPROF_SUPPORT=y CFLAGS_ta_arm32=-pg

/tmp/gmon-<uuid>.out

U=8aaaf200-2450-11e4-abe20002a5d5c51b

gprof $U.elf /tmp/gmon-$U.out

Page 16: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

TA_InvokeCommandEntryPoint()

2 s.

foo(2)

2 s.

bar()

3 s.

foo(1)

1 s.

x3

Page 17: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

TA_InvokeCommandEntryPoint()

2 s.

foo(2)

2 s.

bar()

3 s.

foo(1)

1 s.

x3

Page 18: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

●●●

○●

○○

Page 20: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

●●●●

example.o: file format elf32-littlearm

00000000 <foo>: 0: e92d 4ff0 stmdb sp!, {r4, r5, r6, ... 4: b08d sub sp, #52 ; 0x34 6: af00 add r7, sp, #0 8: b500 push {lr} a: f7ff fffe bl 0 <__gnu_mcount_nc> e: 60f8 str r0, [r7, #12] 10: f240 0300 movw r3, #0 14: f2c0 0300 movt r3, #0...

example.o: file format elf64-littleaarch64

0000000000000000 <foo>: 0: a9bb7bfd stp x29, x30, [sp,#-80]! 4: 910003fd mov x29, sp 8: aa1e03e1 mov x1, x30 c: b9001fa0 str w0, [x29,#28] 10: aa0103e0 mov x0, x1 14: 94000000 bl 0 <_mcount> 18: 90000000 adrp x0, 0 <__stack_chk_guard> 1c: 91000000 add x0, x0, #0x0...

Page 21: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

Page 22: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

Page 23: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

Linux kernel

tee-supplicant

gprof.c

OP-TEE core

gprof_pta.c

RPCthread_rpc_cmd()

Task switchingthread_state_suspend(

)

Trusted App code

libutee

gprof.c

Profiling buffer (.bss)

PCsamples Call arcsSecure WorldNormal World

EL0

EL1

gmon-*.out

1a

1b

2

Page 24: BUD17-416: Benchmark and profiling in OP-TEE

ENGINEERS AND DEVICESWORKING TOGETHER

●○○

●○

○●

○○○