2012-04-03 22:48:12 +04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
"""
|
|
|
|
DTrace/SystemTAP backend.
|
|
|
|
"""
|
|
|
|
|
|
|
|
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
|
2014-02-23 23:37:02 +04:00
|
|
|
__copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
|
2012-04-03 22:48:12 +04:00
|
|
|
__license__ = "GPL version 2 or (at your option) any later version"
|
|
|
|
|
|
|
|
__maintainer__ = "Stefan Hajnoczi"
|
|
|
|
__email__ = "stefanha@linux.vnet.ibm.com"
|
|
|
|
|
|
|
|
|
|
|
|
from tracetool import out
|
|
|
|
|
|
|
|
|
2013-03-05 17:47:26 +04:00
|
|
|
PUBLIC = True
|
|
|
|
|
|
|
|
|
2012-04-03 22:48:12 +04:00
|
|
|
PROBEPREFIX = None
|
|
|
|
|
2014-02-23 23:37:40 +04:00
|
|
|
def probeprefix():
|
2012-04-03 22:48:12 +04:00
|
|
|
if PROBEPREFIX is None:
|
|
|
|
raise ValueError("you must set PROBEPREFIX")
|
|
|
|
return PROBEPREFIX
|
|
|
|
|
|
|
|
|
|
|
|
BINARY = None
|
|
|
|
|
2014-02-23 23:37:40 +04:00
|
|
|
def binary():
|
2012-04-03 22:48:12 +04:00
|
|
|
if BINARY is None:
|
|
|
|
raise ValueError("you must set BINARY")
|
|
|
|
return BINARY
|
|
|
|
|
|
|
|
|
2014-02-23 23:37:40 +04:00
|
|
|
def generate_h_begin(events):
|
2012-12-14 23:13:09 +04:00
|
|
|
out('#include "trace/generated-tracers-dtrace.h"',
|
2012-04-03 22:48:12 +04:00
|
|
|
'')
|
|
|
|
|
2014-02-23 23:37:40 +04:00
|
|
|
|
|
|
|
def generate_h(event):
|
|
|
|
out(' QEMU_%(uppername)s(%(argnames)s);',
|
|
|
|
uppername=event.name.upper(),
|
|
|
|
argnames=", ".join(event.args.names()))
|