tracetool/ftrace: add Rust support
Signed-off-by: Tanish Desai <tanishdesai37@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250929154938.594389-16-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
c4e8d44bac
commit
7dbee12742
3 changed files with 48 additions and 2 deletions
|
|
@ -12,7 +12,7 @@ __maintainer__ = "Stefan Hajnoczi"
|
|||
__email__ = "stefanha@redhat.com"
|
||||
|
||||
|
||||
from tracetool import out
|
||||
from tracetool import out, expand_format_string
|
||||
|
||||
|
||||
PUBLIC = True
|
||||
|
|
@ -43,3 +43,9 @@ def generate_h(event, group):
|
|||
def generate_h_backend_dstate(event, group):
|
||||
out(' trace_event_get_state_dynamic_by_id(%(event_id)s) || \\',
|
||||
event_id="TRACE_" + event.name.upper())
|
||||
|
||||
def generate_rs(event, group):
|
||||
out(' let format_string = c"%(fmt)s";',
|
||||
' unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_char, %(args)s);}',
|
||||
fmt=expand_format_string(event.fmt),
|
||||
args=event.args.rust_call_varargs())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue