1#!/usr/bin/env python 2# -*- coding: utf-8 -*- 3 4""" 5trace/generated-tracers.dtrace (DTrace only). 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 19def generate(events, backend): 20 events = [e for e in events 21 if "disable" not in e.properties] 22 23 out('/* This file is autogenerated by tracetool, do not edit. */' 24 '', 25 'provider qemu {') 26 27 for e in events: 28 args = str(e.args) 29 30 # DTrace provider syntax expects foo() for empty 31 # params, not foo(void) 32 if args == 'void': 33 args = '' 34 35 # Define prototype for probe arguments 36 out('', 37 'probe %(name)s(%(args)s);', 38 name=e.name, 39 args=args) 40 41 out('', 42 '};') 43