1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4"""
5DTrace/SystemTAP backend.
6"""
7
8__author__     = "Lluís Vilanova <vilanova@ac.upc.edu>"
9__copyright__  = "Copyright 2012-2016, 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
22PROBEPREFIX = None
23
24def probeprefix():
25    if PROBEPREFIX is None:
26        raise ValueError("you must set PROBEPREFIX")
27    return PROBEPREFIX
28
29
30BINARY = None
31
32def binary():
33    if BINARY is None:
34        raise ValueError("you must set BINARY")
35    return BINARY
36
37
38def generate_h_begin(events, group):
39    out('#include "trace/generated-tracers-dtrace.h"',
40        '')
41
42
43def generate_h(event, group):
44    out('        QEMU_%(uppername)s(%(argnames)s);',
45        uppername=event.name.upper(),
46        argnames=", ".join(event.args.names()))
47