Embedded Software SKKU 15 1 김혁중, 한규화, 황연성 Tizen System Analysis
Embedded Software SKKU 15 2 To evaluate the hardware behavior Tizen on QEMU + GEM5 – Idea from Gemdroid – Expected to simulator Tizen behavior using GEM5 with the trace extracted from Tizen emulator (QEMU) Primary Goal: Gem+Tizen
Embedded Software SKKU 15 3 "GemDroid: A Framework to Evaluate Mobile Platforms“ The 2014 ACM International Conference on Measurement and Modeling of Computer Systems. ACM(SIGMETRICS), The Pennsylvania State University – Chidambaram Nachiappan Nachiappan, Praveen Yedlapalli, Mahmut T. Kandemir, Anand Sivasubramaniam, Chita R. Das Intel Corp. – Niranjan Soundararajan GemDroid
Embedded Software SKKU 15 4 Holistic evaluation tools for mobile system covering cores, IPs, memory, and system SW. GemDroid (cont) – provides cycle-accurate simulation models (800x slowdown) – captures and replays instruction- level trace (ARM instructions + IP calls)
Embedded Software SKKU 15 5 QEMU(Quick EMUlator) – Open source – Hypervisor (Virtual machine monitor) – Hardware virtualization – GNU GPL version2 license – Supports IA_32, X86-64… QEMU
Embedded Software SKKU 15 6 Modular discrete event driven computer system simulator platform Merger of the best aspects of the M5 and GEMS – M5 provide a highly configurable simulation framework, multiple ISAs, and diverse CPU models – GEMS complement M5’s features with a detailed and flexible memory system – multiple cache coherence protocols and interconnect models Provide a wide variety of capabilities and components – CPU model – System mode – Memory system GEM5
Embedded Software SKKU 15 7 GEM5 is ‘architecture simulator’ – Impossible to simulate using instruction trace from QEMU (runtime simulation is needed) – In case of the paper (GemDroid), it may only simulate memory event using memory event trace and GEM5. Tizen should be run on GEM5 for using GEM5 (rather than trace) – Trace-driven simulation is not available – GEM5 uses pre-built OS image for full-system simulation Android image and ubuntu image are provided by the GEM5 community, but Tizen has no specific image. Problem of using GEM5
Embedded Software SKKU 15 8 Architecture Simulator (like GEM5) – Run simulation based on QEMU with PTLsim and DRAMsim. – Because Tizen (3.0) can run on generic QEMU, ‘expected’ to simulate Tizen behavior using MARSS. Plan B: MARSSx86 simulator
Embedded Software SKKU 15 9 Need to use Generic QEMU (because MARSS modified QEMU source code) To run Tizen on Generic QEMU, we need to choose Tizen 3.0 common x11 image – Port Tizen 3.0 common image into QEMU (in MARSS) MARSSx86 uses old version of QEMU – QEMU version on MARSSx86 is (currently QEMU is 2.2.0) On generic QEMU, display don’t show up with Tizen image. – Modify the display option into fbdev (Framebuffer) rather than DRM – In systemd, set fbdev (dev/fb0) as default mount. – Success to boot up Tizen 3.0 image on QEMU. – Success to run Crosswalk on Tizen 3.0 image. Tizen porting on MARSSx86Sim Ref:
Embedded Software SKKU Emulation was available, but, simulation was not available – When start simulation, the system gets crash. Reason: PTLsim (Core simulator) can’t translate corresponding instruction. – Solution Linux kernel downgrade – Current linux kernel version on Tizen is 3.14 – Success to port Tizen on linux vanilla kernel 3.10 (with some boot up fail like SMACK) – Still get translation error Fix instruction translation problem – After fixing: other Instruction also has same translation error. – It is impossible to translate all x86 instruction into up-to-date Problem on running MARSSx86 simulation
Embedded Software SKKU MARSSx86 simulation Failed
Embedded Software SKKU Overview – Qemu memory trace Fix Tizen QEMU (Tizen_2.2) to get memory trace profile Simulate memory behavior using Trafficgen in GEM5 load/store, memory address, tick information – Qemu device behavior trace Tizen emulator uses virtio device to improve the performance It may available to get event trace on QEMU virtio source Insert event trace code on GPU, codec, touch screen virtio driver Plan C: QEMU Tracing on Tizen
Embedded Software SKKU Clone Tizen emulator on emulator repository – git clone ssh://review.tizen.org:gerrit/sdk/emulator/qemu.git Install pre-requisite tools for configure – run./emulator_configure.sh on [QEMU]/tizen – if get some error about dependency, install required tool for corresponding error Build 진행 – run./build.sh – built emulator-x86 image is in [QEMU]/tizen/emulator/bin Run emulator using built image – copy emulator-x86 into [Tizen-sdk]/tools/emulator/bin – Run emulator (IDE or emulator manager) Tizen_2.2 emulator build & Execution 참고
Embedded Software SKKU Memory tracing – tlb_fill ([QEMU]/target-i386/mem_helper.c) Check whether accessed address is in TLB Memory address, read/write, time(tick) = total 13 byte Memory trace parsing – Make memory trace as binary data (because of huge size) – 21-byte entry: operation, address, size, tick – Convert binary trace into readable trace using parser Implementation
Embedded Software SKKU 15 Implementation (cont) Device tracing – [QEMU]/tizen/src/hw/ – maru_brill_codec.c – maru_virtio_hwkey.c – maru_virtio_touchscree.c – virtio-gl.c
Embedded Software SKKU Qemu tracing and parsing – QQIBhjOTEENNOiGwAg&index=2 QQIBhjOTEENNOiGwAg&index=2 Demo
Embedded Software SKKU Memory Trace – Extract memory trace on Tizen emulator – Native application (5min) watch cube drawing board scheduler – Web application (5min) analog watch image rotation paint app event manager Experiment
Embedded Software SKKU NativeWeb # of Instruction (million) Total cycle (billion) Mem write (GB) Mem read (GB) Brill_codec15742 touchscreen hwkey7242 virtio-gl Results Each Native app & Web app workload – Extract memory event, instruction count, memory RW request, device event brill_codec is codec device, touchscreen is touch event, hwkey is hardware key event, virtio-gl is OpenGL event
Embedded Software SKKU Not a same workload between Native and Web App – Try to make similar workload with similar application but it is not same – Need to analyze micro component like view, interaction Tracing – Need to analyze core, instruction pipe-line or cache behavior Device tracing – Only trace event call count – Need to break down into detail behavior like memory allocation, task scheduling, etc. Limitation