Closed mystictot closed 5 years ago
Hi @mysticTot,
both optee_client, optee_os and linux should be built with benchmark support. In your case you enabled it only in optee_os core.
I suggest to set this flag in the build/common.mk
file instead providing it manually in all these projects.
28 # default disable latency benchmarks (over all OP-TEE layers)
29 CFG_TEE_BENCHMARK ?= n
Hi @mysticTot,
Hi @igoropaniuk
Thanks a lot for replying.
both optee_client, optee_os and linux should be built with benchmark support. In your case you enabled it only in optee_os core. I suggest to set this flag in the
build/common.mk
file instead providing it manually in all these projects.28 # default disable latency benchmarks (over all OP-TEE layers) 29 CFG_TEE_BENCHMARK ?= n
I did enabled benchmark support both in optee_os and optee_client using:
make CFG_TEE_BENCHMARK=y
I found It build successfully. Please see below
$ find . -name *.o
./out/tee-supplicant/hmac_sha2.o
./out/tee-supplicant/tee_supplicant.o
./out/tee-supplicant/rpmb.o
./out/tee-supplicant/teec_ta_load.o
./out/tee-supplicant/handle.o
./out/tee-supplicant/tee_supp_fs.o
./out/tee-supplicant/sha2.o
./out/tee-supplicant/tee_socket.o
./out/libteec/teec_benchmark.o
./out/libteec/tee_client_api.o
./out/libteec/teec_trace.o
But, I'm still getting same error.
# benchmark ./optee_example_hello_world
[Benchmark] INFO: 1. Opening BencD/TC:? 0 tee_ta_init_session_with_context:459 Re-open TA 0b9a63b0-b4c6-4c85-a284-a228ef547b4e
hmark Static TA...
[Benchmark] INFO: 2. Allocating pD/TC:? 0 tee_ta_init_session_with_context:459 Re-open TA 0b9a63b0-b4c6-4c85-a284-a228ef547b4e
er-core buffers, cores detected =D/TC:? 0 get_benchmark_memref:126 Benchmark: Sending back timestamp buffer paddr = 0x0
4
D/TC:? 0 tee_ta_close_session:380 tee_ta_close_session(0x2c2552d0)
D/TC:? 0 tee_ta_close_session:399 Destroy session
E/TC:? 0 alloc_benchmark_buffer:80 Benchmark: can't create mobj for timestamp buffer
D/TC:? 0 tee_ta_invoke_command:625 Error: ffff000c of 4
D/TC:? 0 tee_ta_init_session_with_context:459 Re-open TA 0b9a63b0-b4c6-4c85-a284-a228ef547b4e
D/TC:? 0 get_benchmark_memref:126 Benchmark: Sending back timestamp buffer paddr = 0x0
D/TC:? 0 tee_ta_close_session:380 tee_ta_close_session(0x2c2552d0)
D/TC:? 0 tee_ta_close_session:399 Destroy session
[Benchmark] ERROR: TEEC_InvokeComD/TC:? 0 tee_ta_close_session:380 tee_ta_close_session(0x2c255388)
D/TC:? 0 tee_ta_close_session:399 Destroy session
mand: 0xffff000c
Hi @mysticTot,
optee_client, optee_os and linux should be built
Hi @mysticTot,
optee_client, optee_os and linux should be built
which specific option in linux?
https://github.com/linaro-swg/linux/blob/optee/drivers/tee/optee/Kconfig#L17 Sorry, I was looking into the mainline kernel.
@igoropaniuk Now it is working
# benchmark ./optee_example_hello_world
[Benchmark] INFO: 1. Opening BencD/TC:? 0 tee_ta_init_session_with_context:459 Re-open TA 0b9a63b0-b4c6-4c85-a284-a228ef547b4e
hmark Static TA...
[Benchmark] INFO: 2. Allocating pD/TC:? 0 tee_ta_init_session_with_context:459 Re-open TA 0b9a63b0-b4c6-4c85-a284-a228ef547b4e
er-core buffers, cores detected =D/TC:? 0 get_benchmark_memref:126 Benchmark: Sending back timestamp buffer paddr = 0x0
4
D/TC:? 0 tee_ta_close_session:380 tee_ta_close_session(0x2c2552d0)
D/TC:? 0 tee_ta_close_session:399 Destroy session
D/TC:? 0 alloc_benchmark_buffer:98 Benchmark: allocated timestamp buffer, addr = 0x30c01000
D/TC:? 0 tee_ta_init_session_with_context:459 Re-open TA 0b9a63b0-b4c6-4c85-a284-a228ef547b4e
D/TC:? 0 get_benchmark_memref:126 Benchmark: Sending back timestamp buffer paddr = 0x2e001000
D/TC:? 0 tee_ta_close_session:380 tee_ta_close_session(0x2c255260)
D/TC:? 0 tee_ta_close_session:399 Destroy session
[Benchmark] INFO: ts buffer paddr = 2e001000, size = 3144
[Benchmark] INFO: 3. Starting origin host app /optee_example_hello_world ...
[Benchmark] INFO: Dumping timestamps to /optee_example_D/TC:? 0 tee_ta_init_pseudo_ta_session:273 Lookup pseudo TA 8aaaf200-2450-11e4-abe2-0002a5d5c51b
hello_world.ts ...
=============D/TC:? 0 load_elf:842 Lookup user TA ELF 8aaaf200-2450-11e4-abe2-0002a5d5c51b (Secure Storage TA)
=================================================================================================D/TC:? 0 load_elf:842 Lookup user TA ELF 8aaaf200-2450-11e4-abe2-0002a5)
=====
D/TC:? 0 load_elf_from_store:810 ELF load address 0x103000
D/TC:? 0 tee_ta_init_user_ta_session:1029 Processing relocations in 8aaaf200-2450-11e4-abe2-0002a5d5c51b
F/TC:? 0 trace_syscall:128 syscall #1 (syscall_log)
D/TA: TA_CreateEntryPoint:39 has been called
F/TC:? 0 trace_syscall:128 syscall #1 (syscall_log)
D/TA: TA_OpenSessionEntryPoint:68 has been called
F/TC:? 0 trace_syscall:128 syscall #1 (syscall_log)
I/TA: Hello World!
Invoking TA to increment 42
D/TC:? 0 tee_ta_init_session_with_context:459 Re-open TA 0b9a63b0-b4c6-4c85-a284-a228ef547b4e
D/TC:? 0 get_benchmark_memref:126 Benchmark: Sending back timestamp buffer paddr = 0x2e001000
D/TC:? 0 tee_ta_close_session:380 tee_ta_close_session(0x2c2547f0)
D/TC:? 0 tee_ta_close_session:399 Destroy session
F/TC:? 0 trace_syscall:128 syscall #1 (syscall_log)
D/TA: inc_value:105 has been called
F/TC:? 0 trace_syscall:128 syscall #1 (syscall_log)
I/TA: Got value: 42 from NW
F/TC:? 0 trace_syscall:128 syscall #1 (syscall_log)
I/TA: Increase value to: 43
TA incremented value to 43
D/TC:? 0 tee_ta_close_session:380 tee_ta_close_session(0x2c255260)
D/TC:? 0 tee_ta_close_session:399 Destroy session
F/TC:? 0 trace_syscall:128 syscall #1 (syscall_log)
I/TA: Goodbye!
F/TC:? 0 trace_syscall:128 syscall #1 (syscall_log)
D/TA: TA_DestroyEntryPoint:50 has been called
D/TC:? 0 tee_ta_close_session:425 Destroy TA ctx
[Benchmark] INFO: 4. Done benchmaD/TC:? 0 unregister_benchmark:155 Benchmark: Unregister benchmark ts buffer paddr = 0x2e001000
rk
D/TC:? 0 tee_ta_close_session:380 tee_ta_close_session(0x2c255388)
D/TC:? 0 tee_ta_close_session:399 Destroy session
Thanks a lot for all your help
If you want I can send the a proper build instructions patch here https://github.com/OP-TEE/optee_os/blob/master/documentation/benchmark.md.
Please let me know.
If you want I can send the a proper build instructions patch here https://github.com/OP-TEE/optee_os/blob/master/documentation/benchmark.md.
Please do, anything that makes things easier to understand is welcome! Thanks!
If you want I can send the a proper build instructions patch here https://github.com/OP-TEE/optee_os/blob/master/documentation/benchmark.md.
Please do, anything that makes things easier to understand is welcome! Thanks!
Thanks, will send the patch asap.
@mysticTot can you share with us your patch ? Thanks.
@mysticTot can you share with us your patch ? Thanks.
Hi @vschiavoni,
I haven't prepared patch yet but it would only mention that CFG_BENCHMARK should be enabled in optee_client, optee_os and linux. Further linaro-swg version of linux should be used. This one
Do you have any other issue ?
I'm trying to run benchmark on optee_examples but it always throw below mentioned errors: I've already set
CFG_TEE_BENCHMARK=y
in optee_os.Not sure why this error is appearing. @igoropaniuk @jenswi-linaro @etienne-lms