Internships/ProjectIdeas/RustInQemu: Difference between revisions

From QEMU
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Tracing and logging in Rust ==
== Tracing and logging in Rust ==
'''Expected outcome:''' Implement Rust APIs for tracing and logging.


The QEMU project is currently experimenting with using the Rust programming language to create new devices. As part of this, we have to write ''bindings'' to the C code that make it possible to use it from Rust safely.  For example, QEMU needs to include Rust code to manage timers, interrupts and memory regions with safe and idiomatic Rust code.
The QEMU project is currently experimenting with using the Rust programming language to create new devices. As part of this, we have to write ''bindings'' to the C code that make it possible to use it from Rust safely.  For example, QEMU needs to include Rust code to manage timers, interrupts and memory regions with safe and idiomatic Rust code.


QEMU integrates support for tracing using various backends---ranging from good old stdio to systemtap---thanks to a code generator that can produce tracing routines for the hundreds of tracepoints that QEMU supports; for more information see https://qemu-project.gitlab.io/qemu/devel/tracing.html. As part of this project, you will work on adding support for tracing and logging to Rust code.
QEMU integrates support for tracing using various backends---ranging from good old stdio to systemtap---thanks to a code generator that can produce tracing routines for the hundreds of tracepoints that QEMU supports; for more information see the links below. As part of this project, you will work on adding support for tracing and logging to Rust code.


The project spans multiple programming languages: the code generator is written in Python, the generated code will of course be Rust, and you will have to read some C to understand the subsystem.
The project spans multiple programming languages: the code generator is written in Python, the generated code will of course be Rust, and you will have to read some C to understand the subsystem.
Line 9: Line 11:
Among similarly large open source C projects, QEMU is an early adopter for Rust! So you will also have a look at how the two languages can be integrated through the Meson build system.
Among similarly large open source C projects, QEMU is an early adopter for Rust! So you will also have a look at how the two languages can be integrated through the Meson build system.


Tasks:
'''Tasks:'''
* implement bindings for QEMU's logging subsystem (logging is one of the tracing backends)
* implement bindings for QEMU's logging subsystem (logging is one of the tracing backends)
* analyze the code generated by tracetool for C for the various tracing backends
* analyze the code generated by tracetool for C for the various tracing backends
Line 15: Line 17:
* modify tracetool to generate the Rust code automatically
* modify tracetool to generate the Rust code automatically


Details:
'''Links:'''
* [https://qemu-project.gitlab.io/qemu/devel/tracing.html Tracing in QEMU]
* [https://lore.kernel.org/qemu-devel/17ad81c3-98fc-44c2-8f65-f5e2cc07030b@gnu.org/T/#u Rust in QEMU status]
 
'''Details:'''
* Project size: 350 hours
* Project size: 350 hours
* Skill level: intermediate/advanced
* Skill level: intermediate/advanced
* Language: Python, Rust, C
* Languages: Python, Rust, C
* Mentor: Paolo Bonzini (OFTC: bonzini, Email: pbonzini@redhat.com)
* Mentor: Paolo Bonzini (OFTC: bonzini, Email: pbonzini@redhat.com)

Latest revision as of 14:22, 10 February 2025

Tracing and logging in Rust

Expected outcome: Implement Rust APIs for tracing and logging.

The QEMU project is currently experimenting with using the Rust programming language to create new devices. As part of this, we have to write bindings to the C code that make it possible to use it from Rust safely. For example, QEMU needs to include Rust code to manage timers, interrupts and memory regions with safe and idiomatic Rust code.

QEMU integrates support for tracing using various backends---ranging from good old stdio to systemtap---thanks to a code generator that can produce tracing routines for the hundreds of tracepoints that QEMU supports; for more information see the links below. As part of this project, you will work on adding support for tracing and logging to Rust code.

The project spans multiple programming languages: the code generator is written in Python, the generated code will of course be Rust, and you will have to read some C to understand the subsystem.

Among similarly large open source C projects, QEMU is an early adopter for Rust! So you will also have a look at how the two languages can be integrated through the Meson build system.

Tasks:

  • implement bindings for QEMU's logging subsystem (logging is one of the tracing backends)
  • analyze the code generated by tracetool for C for the various tracing backends
  • try to implement by hand a few tracepoints in Rust
  • modify tracetool to generate the Rust code automatically

Links:

Details:

  • Project size: 350 hours
  • Skill level: intermediate/advanced
  • Languages: Python, Rust, C
  • Mentor: Paolo Bonzini (OFTC: bonzini, Email: pbonzini@redhat.com)