A Web Framework for Interactive Trace Visualization

A Web Framework for Interactive Trace Visualization

Author Stefan Rumzucker, BSc Submission Institute for System Software Thesis Supervisor o.Univ.-Prof. Dipl.-Ing. Dr.Dr.h.c. Hanspeter Mössenböck Assistant Thesis Supervisor Dipl.-Ing. Dr. Matthias Grimmer Dipl.-Ing. Dr. Christian Wirth Linz, May 2016 A WEB FRAMEWORK FOR INTERACTIVE TRACE VISUALIZATION Master’s Thesis to confer the academic degree of Diplom-Ingenieur in the Master’s Program Computer Science JOHANNES KEPLER UNIVERSITY LINZ Altenberger Str. 69 4040 Linz, Austria www.jku.at DVR 0093696 i Abstract Most optimizations performed by a modern compiler are applied to a specific intermediate representation (IR). When debugging the compiler it is important for developers to be able to inspect this IR in order to trace the changes and verify its correctness. The data structures used for modelling such an IR can be be complex and hard to comprehend, so it’s essential to offer a suitable representation that allows proper inspection. This thesis introduces Salver, a modular web framework that supports developers in building tools for inspecting internals of the Graal Compiler. The Graal Compiler is a just-in-time com- piler written in Java that aims to produce highly optimized code. It uses a graph-based IR, the Graal IR, on which it performs optimizations in several compilation phases. For debug- ging purposes, the most intuitive way to inspect the IR is by providing a graph visualization. Besides the Graal IR, which is considered the high-level IR, there is also a low-level IR (LIR) used to produce machine code. The LIR has different characteristics and therefore requires individual representations when being inspected. Currently two separate tools are used to inspect either the Graal IR or the LIR. These tools require individual workflows and use different data formats as their input. They are also not able to interchange information or link to data within the other tool. Salver aims to unify the inspection workflow by having a single extensible tool that can be used to inspect different kinds of information collected during the compilation process of the Graal Compiler. The tool can be used via a modern web browser, without the need of installing additional software, and is also accessible remotely, which allows to share the collected data among other users. In this thesis we extend the Graal Compiler with additional functionality to provide infor- mation on the Graal IR during compilation. This information is then used within our tool to visualize IR graphs. The tool focuses on graph visualization and the inspection of nodes, which enables to visually perceive changes applied to IR graphs in each phase, helping to gain a better understanding of the optimizations done by the compiler. ii Kurzfassung Viele Optimierungen moderner Compilern werden auf eine spezielle interne Zwischendar- stellung (Intermediate Representation, IR) angewendet. Im Falle einer Fehlersuche ist es für Entwickler wichtig in der Lage zu sein diese IR auf ihre Richtigkeit zu prüfen und die Verän- derungen nachvollziehen zu können. Die Datenstrukturen, welche verwendet werden um die IR zu modellieren, sind unter Umständen nur schwer verständlich, darum ist es notwendig eine passende Darstellung für eine Untersuchung zu finden. Diese Arbeit beschreibt Salver, ein modulares Web Framework, welches Entwickler dabei unterstützt Anwendungen für das Inspizieren von internen Daten des Graal Compilers zu bauen. Der Graal Compiler ist ein Just-In-Time Compiler, welcher in Java geschrieben wurde und darauf abzielt hoch optimierten Code zu produzieren. Er verwendet eine graph-basierte IR, die Graal IR, welche er für Optimierungen in unterschiedlichen Kompilierphasen nutzt. Für eine Fehlersuche ist es hilfreich diese IR auch als Graph darzustellen. Neben der Graal IR, welche als höhere Zwischendarstellung fungiert, gibt es auch eine architekturnähere IR, welche für die Erstellung des Maschinencodes verwendet wird, die sogenannte Low-Level IR (LIR). Diese hat wiederum andere Charakteristiken und benötigt folglich eine individuelle Darstellung zur Inspektion. Im Moment werden zwei unterschiedliche Anwendungen für die Inspektion der Graal IR beziehungsweise der LIR verwendet. Diese Anwendungen nutzen unterschiedliche Arbeits- abläufe, sowie eigene Formate um Daten zu laden. Auch sind sie nicht in der Lage Infor- mationen untereinander auszutauschen oder einen Zusammenhang zu Daten in der jeweils anderen Anwendung herzustellen. Salver versucht einen einheitlichen Arbeitsablauf bereitzustellen, indem lediglich eine An- wendung verwendet wird um unterschiedliche Informationen darzustellen, welche während des Kompiliervorgangs des Graal Compilers gesammelt wurden. Diese Anwendung kann in einem modernen Web Browser verwendet werden, wobei keine zusätzliche Software instal- liert werden muss. Zudem kann sie aus der Ferne genutzt werden, was erlaubt die gesam- melten Daten auch mit anderen Nutzern zu teilen. In dieser Arbeit erweitern wir den Graal Compiler mit zusätzlicher Funktionalität um die nöti- gen Informationen während des Kompiliervorgangs bereitstellen zu können. Diese Informa- tionen werden dann in unserer Anwendung für die Visualisierung der Graphen verwendet. Die Anwendung konzentriert sich auf Graph Visualisierung und Inspektion der einzelnen Knoten, was es erlaubt die Veränderung der IR in jeder Phase nachzuvollziehen um somit ein besseres Verständnis der durchgeführten Optimierungen des Compilers zu erlangen. iii Contents Abstract i Kurzfassung ii 1 Introduction 1 1.1 Motivation . .1 1.2 Goals and Scope . .2 1.3 Challenges . .3 1.4 Structure of the Thesis . .4 2 Graal Project 5 2.1 Virtual Machine . .5 2.2 Graal Compiler . .5 3 Salver Framework 9 3.1 Architecture . .9 3.2 Components . 11 3.3 Tracing . 11 3.3.1 Trace Messages . 12 3.3.2 Trace Context . 15 3.3.3 Metadata . 16 3.3.4 Serialization . 18 3.4 Trace Resources . 20 3.4.1 Extracted Resources . 20 3.4.2 Generated Resources . 20 3.4.3 Resource Path . 21 3.5 Workflow . 21 Contents iv 4 Case Study 25 4.1 Graal Trace Provider . 25 4.1.1 Graal IR Data . 27 4.1.2 Trace Messages . 30 4.1.3 Implementation . 32 4.2 Graal IR Visualization Tool . 35 4.2.1 Architecture . 35 4.2.2 Functionality . 37 4.2.3 Trace Messages . 38 4.2.4 Graph Resources . 38 4.2.5 Visualization . 39 4.2.6 User Interface . 42 5 Evaluation 43 6 Related Work 46 7 Summary 50 Bibliography 57 1 1 Introduction This chapter introduces Salver, a web framework that aims to simplify the devel- opment of web based tools for inspecting compiler internals. The introduction ad- dresses the goals of this project and outlines the challenges of designing the frame- work. 1.1 Motivation Modern compilers perform most of their optimizations using a specific intermediate repre- sentation (IR). For debugging purposes it is essential to visualize this IR in a comprehensible way, so that developers are able to inspect and verify the optimizations. As for this thesis we are focusing on the Graal Compiler, which essentially provides informa- tion on two important compiler internals for inspection, the Graal IR and the low-level IR. The project includes tools that are able to appropriately present this information to the user. The fact that separate tools have to be used for that purpose renders the inspection work- flow inconvenient. It also limits the functionality as these tools are working independently, prohibiting data aggregation that might otherwise offer additional knowledge about the in- ternals. They use different data formats and there is also no common way of transferring information from the compiler to these tools. To solve these issues we propose an alternative approach in this thesis. We suggest a web based application that integrates all needed functionality into one uniform tool. All relevant information needed for inspection shall be processed and stored in one place. Ideally this is a remote server that can serve as the central endpoint for several machines providing such information. Users are then able to use the frontend of the inspection tool via a modern web browser, without the need of installing additional software. Since the collected information can be shared among other users, this approach would allow access to data sets from any previous compilations of all users. It also facilitates data aggregation, which offers additional knowledge about the data set. 1.2 Goals and Scope 2 1.2 Goals and Scope This thesis describes the effort to design and develop a modular web framework, which aims to simplify the development of tools for software tracing with a special focus on visualization of compiler internals. Tracing Framework The main goal of this thesis is to create a flexible and extensible web framework that allows to build web based tools for tracing and inspection of compiler internals. This includes collecting of trace information produced by the compiler as well as processing and storing the resulting data. The framework consists of individual modules that can be used to provide specific visualizations for individual compiler internals. Web as a Platform The intention behind the framework is to create web applications, meaning the frontend is accessible via a modern web browser. The browser has to support up to date standards allowing to take full advantage of currently available web technologies. A web application gives users the ability to access the frontend from almost every machine or device without the need of installing additional software. Unified Workflow The framework intends to provide a unified workflow for different types of compiler inter- nals. It tries to do this by providing a common mechanism to create serializable information for tracing purposes within the compiler. Extensibility The ability to add new features and domain specific functionality is an essential requirement for the framework and for the tools using it as a basis. The framework can be extended with additional modules as well as plugins to enhance a particular tool. Case Study Another goal of this thesis is to show the usefulness of the framework by developing a visual- ization tool for the graph-based intermediate representation of the Graal Compiler.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    65 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us