xref: /qemu/scripts/tracetool/backend/ust.py (revision 72ac97cd)
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4"""
5LTTng User Space Tracing backend.
6"""
7
8__author__     = "Lluís Vilanova <vilanova@ac.upc.edu>"
9__copyright__  = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
10__license__    = "GPL version 2 or (at your option) any later version"
11
12__maintainer__ = "Stefan Hajnoczi"
13__email__      = "stefanha@linux.vnet.ibm.com"
14
15
16from tracetool import out
17
18
19PUBLIC = True
20
21
22def generate_h_begin(events):
23    out('#include <lttng/tracepoint.h>',
24        '#include "trace/generated-ust-provider.h"',
25        '')
26
27
28def generate_h(event):
29    argnames = ", ".join(event.args.names())
30    if len(event.args) > 0:
31        argnames = ", " + argnames
32
33    out('    tracepoint(qemu, %(name)s%(tp_args)s);',
34        name=event.name,
35        tp_args=argnames)
36