skip to main content
10.1145/3555776.3577669acmconferencesArticle/Chapter ViewAbstractPublication PagessacConference Proceedingsconference-collections
research-article

CAT: Context Aware Tracing for Rust Asynchronous Programs

Published: 07 June 2023 Publication History

Abstract

Modern programming languages, such as Rust, have adopted the coroutine concept to better utilize computation resources and to improve program execution efficiency by allowing the overlap of the execution for asynchronous tasks. These programming languages often use the concept of userland thread library to dispatch the asynchronous tasks defined by the programmers. Nevertheless, it is often the case that the task scheduling on a user-space library is non-preemptive and would lead to unbounded execution time of a task.
In this work, we aim to develop a tracing methodology to capture unbounded execution time of asynchronous tasks in Rust programs. Based on the analyses of the Rust standard library, we identify several execution contexts of asynchronous computation in Rust, and develop a portable context aware tracing methodology that is able to trace the execution time of nested asynchronous computation work across different Rust runtimes. We develop a framework, called CAT, to collect and visualize the asynchronous runtime activities. The results show that CAT can help pinpoint the asynchronous computation exhibiting prolonged execution time. We believe that CAT is a complement of existing tools to improve the execution efficiency of asynchronous operations in Rust.

References

[1]
Sol Boucher, Anuj Kalia, David G. Andersen, and Michael Kaminsky. 2020. Lightweight Preemptible Functions. In Proceedings of the 2020 USENIX Conference on Usenix Annual Technical Conference (USENIX ATC'20). USENIX Association, USA, Article 31, 13 pages.
[2]
Matthew Fowler. 2022. Python Concurrency with asyncio (1st ed.). Manning Publications.
[3]
Google. 2010. Go language. Retrieved Jun 2, 2022 from https://go.dev/
[4]
Google. 2014. Trace-viewer - Analysis and Visualization tool. Retrieved Jun 2, 2022 from https://github.com/catapult-project/catapult
[5]
Pankaj Khanchandani and Roger Wattenhofer. 2020. Brief Announcement: Byzantine Agreement with Unknown Participants and Failures. In Proceedings of the 39th Symposium on Principles of Distributed Computing (PODC '20). Association for Computing Machinery, New York, NY, USA, 178--180.
[6]
Namhyung Kim. 2014. Uftrace - Function graph tracer for C/C++/Rust. Retrieved Jun 2, 2022 from https://github.com/namhyung/uftrace
[7]
Donald E. Knuth. 1997. The Art of Computer Programming, Vol. 1: Fundamental Algorithms (third ed.). Addison-Wesley, Reading, Mass.
[8]
Jessie A. Morris. 2019. python_opentracing_async_instrumentation. Retrieved Jun 2, 2022 from https://gitlab.com/midigator/python_opentracing_async_instrumentation
[9]
Alice Ryhl. 2020. Async: What is blocking? (2020). https://ryhl.io/blog/async-what-is-blocking/
[10]
Minyoung Sung, Soyoung Kim, Sangsoo Park, Naehyuck Chang, and Heonshik Shin. 2002. Comparative performance evaluation of Java threads for embedded applications: Linux Thread vs. Green Thread. Inform. Process. Lett. 84, 4 (2002), 221--225.
[11]
Tokio. 2019. tokio-tracing. Retrieved May 31, 2022 from https://github.com/tokio-rs/tracing
[12]
Tokio. 2021. tokio-console. Retrieved May 31, 2022 from https://github.com/tokio-rs/console
[13]
Guido van Rossum. 2015. asyncio. Retrieved Jun 2, 2022 from https://docs.python.org/3/library/asyncio.html
[14]
Vincent M. Weaver. 2015. Self-monitoring overhead of the Linux perf_event performance counter interface. In 2015 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS). 102--111.
[15]
zettascale. 2020. zenoh. Retrieved Jun 2, 2022 from https://zenoh.io/

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
SAC '23: Proceedings of the 38th ACM/SIGAPP Symposium on Applied Computing
March 2023
1932 pages
ISBN:9781450395175
DOI:10.1145/3555776
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 07 June 2023

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. rust programming language
  2. performance profiling/tracing
  3. asynchronous programming model

Qualifiers

  • Research-article

Funding Sources

  • National Science and Technology Council, Taiwan
  • Ministry of Education, Taiwan

Conference

SAC '23
Sponsor:

Acceptance Rates

Overall Acceptance Rate 1,650 of 6,669 submissions, 25%

Upcoming Conference

SAC '25
The 40th ACM/SIGAPP Symposium on Applied Computing
March 31 - April 4, 2025
Catania , Italy

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 170
    Total Downloads
  • Downloads (Last 12 months)60
  • Downloads (Last 6 weeks)6
Reflects downloads up to 16 Feb 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media