本文整理汇总了Python中tracetool.out函数的典型用法代码示例。如果您正苦于以下问题:Python out函数的具体用法?Python out怎么用?Python out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了out函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: generate
def generate(events, backend, group):
events = [e for e in events
if "disable" not in e.properties]
out('/* This file is autogenerated by tracetool, do not edit. */',
'')
for e in events:
# Define prototype for probe arguments
out('probe %(probeprefix)s.%(name)s = process("%(binary)s").mark("%(name)s")',
'{',
probeprefix=probeprefix(),
name=e.name,
binary=binary())
i = 1
if len(e.args) > 0:
for name in e.args.names():
name = stap_escape(name)
out(' %s = $arg%d;' % (name, i))
i += 1
out('}')
out()
开发者ID:8tab,项目名称:qemu,代码行数:25,代码来源:stap.py
示例2: generate_h_begin
def generate_h_begin(events):
out('#include <stdio.h>',
'#include <sys/time.h>',
'#include <sys/types.h>',
'#include <unistd.h>',
'#include "trace/control.h"',
'')
开发者ID:32bitmicro,项目名称:riscv-qemu,代码行数:7,代码来源:stderr.py
示例3: begin
def begin(events):
out('/* This file is autogenerated by tracetool, do not edit. */',
'',
'#ifndef TRACE__GENERATED_TRACERS_H',
'#define TRACE__GENERATED_TRACERS_H',
'',
'#include "qemu-common.h"')
开发者ID:01org,项目名称:KVMGT-qemu,代码行数:7,代码来源:h.py
示例4: generate
def generate(events, backend):
events = [e for e in events
if "disable" not in e.properties]
out('/* This file is autogenerated by tracetool, do not edit. */',
'',
)
for e in events:
if "tcg-exec" not in e.properties:
continue
# tracetool.generate always transforms types to host
e_args = e.original.args
# TCG helper proxy declaration
fmt = "DEF_HELPER_FLAGS_%(argc)d(%(name)s, %(flags)svoid%(types)s)"
args = e_args.transform(HOST_2_TCG_COMPAT, HOST_2_TCG,
TCG_2_TCG_HELPER_DECL)
types = ", ".join(args.types())
if types != "":
types = ", " + types
flags = "TCG_CALL_NO_RWG, "
out(fmt,
flags=flags,
argc=len(args),
name=e.api() + "_proxy",
types=types,
)
开发者ID:32bitmicro,项目名称:riscv-qemu,代码行数:31,代码来源:tcg_helper_h.py
示例5: generate
def generate(events, backend):
events = [e for e in events
if "disable" not in e.properties]
out('/* This file is autogenerated by tracetool, do not edit. */',
'')
for e in events:
# Define prototype for probe arguments
out('probe %(probeprefix)s.%(name)s = process("%(binary)s").mark("%(name)s")',
'{',
probeprefix=probeprefix(),
name=e.name,
binary=binary())
i = 1
if len(e.args) > 0:
for name in e.args.names():
# Append underscore to reserved keywords
if name in RESERVED_WORDS:
name += '_'
out(' %s = $arg%d;' % (name, i))
i += 1
out('}')
out()
开发者ID:DeanSinaean,项目名称:qemu,代码行数:27,代码来源:stap.py
示例6: h
def h(events):
out('#include "trace/ftrace.h"',
'#include "trace/control.h"',
'',
)
for e in events:
argnames = ", ".join(e.args.names())
if len(e.args) > 0:
argnames = ", " + argnames
out('static inline void trace_%(name)s(%(args)s)',
'{',
' char ftrace_buf[MAX_TRACE_STRLEN];',
' int unused __attribute__ ((unused));',
' int trlen;',
' bool _state = trace_event_get_state(%(event_id)s);',
' if (_state) {',
' trlen = snprintf(ftrace_buf, MAX_TRACE_STRLEN,',
' "%(name)s " %(fmt)s "\\n" %(argnames)s);',
' trlen = MIN(trlen, MAX_TRACE_STRLEN - 1);',
' unused = write(trace_marker_fd, ftrace_buf, trlen);',
' }',
'}',
name = e.name,
args = e.args,
event_id = "TRACE_" + e.name.upper(),
fmt = e.fmt.rstrip("\n"),
argnames = argnames,
)
开发者ID:01org,项目名称:KVMGT-qemu,代码行数:30,代码来源:ftrace.py
示例7: generate
def generate(events, backend):
events = [e for e in events
if "disable" not in e.properties]
out('/* This file is autogenerated by tracetool, do not edit. */',
'',
'#include "qemu/osdep.h"',
'#include "qemu-common.h"',
'#include "trace.h"',
'#include "exec/helper-proto.h"',
'',
)
for e in events:
if "tcg-exec" not in e.properties:
continue
# tracetool.generate always transforms types to host
e_args = e.original.args
values = ["(%s)%s" % (t, n)
for t, n in e.args.transform(TCG_2_TCG_HELPER_DEF)]
out('void %(name_tcg)s(%(args)s)',
'{',
' %(name)s(%(values)s);',
'}',
name_tcg="helper_%s_proxy" % e.api(),
name=e.api(),
args=e_args.transform(HOST_2_TCG_COMPAT, TCG_2_TCG_HELPER_DEF),
values=", ".join(values),
)
开发者ID:JMR-b,项目名称:qemu,代码行数:32,代码来源:tcg_helper_c.py
示例8: begin
def begin(events):
out('/* This file is autogenerated by tracetool, do not edit. */',
'',
'#undef TRACEPOINT_PROVIDER',
'#define TRACEPOINT_PROVIDER qemu',
'',
'#undef TRACEPOINT_INCLUDE_FILE',
'#define TRACEPOINT_INCLUDE_FILE ./generated-ust-provider.h',
'',
'#if !defined (TRACE__GENERATED_UST_H) || defined(TRACEPOINT_HEADER_MULTI_READ)',
'#define TRACE__GENERATED_UST_H',
'',
'#include "qemu-common.h"',
'#include <lttng/tracepoint.h>',
'',
'/*',
' * LTTng ust 2.0 does not allow you to use TP_ARGS(void) for tracepoints',
' * requiring no arguments. We define these macros introduced in more recent'
' * versions of LTTng ust as a workaround',
' */',
'#ifndef _TP_EXPROTO1',
'#define _TP_EXPROTO1(a) void',
'#endif',
'#ifndef _TP_EXDATA_PROTO1',
'#define _TP_EXDATA_PROTO1(a) void *__tp_data',
'#endif',
'#ifndef _TP_EXDATA_VAR1',
'#define _TP_EXDATA_VAR1(a) __tp_data',
'#endif',
'#ifndef _TP_EXVAR1',
'#define _TP_EXVAR1(a)',
'#endif',
'')
开发者ID:AbnerChang,项目名称:RiscVQemuPcat,代码行数:33,代码来源:ust_events_h.py
示例9: generate
def generate(events, backend):
events = [e for e in events
if "disable" not in e.properties]
out('/* This file is autogenerated by tracetool, do not edit. */',
'',
'#include "qemu/osdep.h"',
'#include "qemu-common.h"',
'#include "cpu.h"',
'#include "trace.h"',
'#include "exec/helper-proto.h"',
'',
)
for e in events:
if "tcg-exec" not in e.properties:
continue
e_args_api = tracetool.vcpu.transform_args(
"tcg_helper_c", e.original, "header").transform(
HOST_2_TCG_COMPAT, TCG_2_TCG_HELPER_DEF)
e_args_call = tracetool.vcpu.transform_args(
"tcg_helper_c", e, "code")
out('void %(name_tcg)s(%(args_api)s)',
'{',
' %(name)s(%(args_call)s);',
'}',
name_tcg="helper_%s_proxy" % e.api(),
name=e.api(),
args_api=e_args_api,
args_call=", ".join(e_args_call.casted()),
)
开发者ID:GamerSource,项目名称:qemu,代码行数:33,代码来源:tcg_helper_c.py
示例10: generate_h
def generate_h(event, group):
argnames = ", ".join(event.args.names())
if len(event.args) > 0:
argnames = ", " + argnames
out(' tracepoint(qemu, %(name)s%(tp_args)s);',
name=event.name,
tp_args=argnames)
开发者ID:JunaidLoonat,项目名称:qemu,代码行数:8,代码来源:ust.py
示例11: generate_h_begin
def generate_h_begin(events, group):
if group == "root":
header = "trace-dtrace-root.h"
else:
header = "trace-dtrace.h"
out('#include "%s"' % header,
'')
开发者ID:JunaidLoonat,项目名称:qemu,代码行数:8,代码来源:dtrace.py
示例12: generate_h_begin
def generate_h_begin(events, group):
if group == "root":
header = "trace-ust-root.h"
else:
header = "trace-ust.h"
out('#include <lttng/tracepoint.h>',
'#include "%s"' % header,
'')
开发者ID:JunaidLoonat,项目名称:qemu,代码行数:9,代码来源:ust.py
示例13: nop
def nop(events):
for e in events:
out('',
'static inline void trace_%(name)s(%(args)s)',
'{',
'}',
name = e.name,
args = e.args,
)
开发者ID:01org,项目名称:KVMGT-qemu,代码行数:9,代码来源:h.py
示例14: end
def end(events):
for e in events:
if "disable" in e.properties:
enabled = 0
else:
enabled = 1
out('#define TRACE_%s_ENABLED %d' % (e.name.upper(), enabled))
out('',
'#endif /* TRACE_H */')
开发者ID:AlexWWW,项目名称:qemu-linaro-clone,代码行数:9,代码来源:h.py
示例15: generate
def generate(events, backend):
events = [e for e in events
if "disable" not in e.properties]
out('/* This file is autogenerated by tracetool, do not edit. */',
'')
backend.generate_begin(events)
for event in events:
backend.generate(event)
backend.generate_end(events)
开发者ID:01org,项目名称:qemu-lite,代码行数:10,代码来源:c.py
示例16: generate
def generate(events, backend, group):
if group == "root":
header = "trace-root.h"
else:
header = "trace.h"
out('/* This file is autogenerated by tracetool, do not edit. */',
'/* You must include this file after the inclusion of helper.h */',
'',
'#ifndef TRACE_%s_GENERATED_TCG_TRACERS_H' % group.upper(),
'#define TRACE_%s_GENERATED_TCG_TRACERS_H' % group.upper(),
'',
'#include "exec/helper-proto.h"',
'#include "%s"' % header,
'',
)
for e in events:
# just keep one of them
if "tcg-exec" not in e.properties:
continue
out('static inline void %(name_tcg)s(%(args)s)',
'{',
name_tcg=e.original.api(e.QEMU_TRACE_TCG),
args=tracetool.vcpu.transform_args("tcg_h", e.original))
if "disable" not in e.properties:
args_trans = e.original.event_trans.args
args_exec = tracetool.vcpu.transform_args(
"tcg_helper_c", e.original.event_exec, "wrapper")
if "vcpu" in e.properties:
trace_cpu = e.args.names()[0]
cond = "trace_event_get_vcpu_state(%(cpu)s,"\
" TRACE_%(id)s)"\
% dict(
cpu=trace_cpu,
id=e.original.event_exec.name.upper())
else:
cond = "true"
out(' %(name_trans)s(%(argnames_trans)s);',
' if (%(cond)s) {',
' gen_helper_%(name_exec)s(%(argnames_exec)s);',
' }',
name_trans=e.original.event_trans.api(e.QEMU_TRACE),
name_exec=e.original.event_exec.api(e.QEMU_TRACE),
argnames_trans=", ".join(args_trans.names()),
argnames_exec=", ".join(args_exec.names()),
cond=cond)
out('}')
out('',
'#endif /* TRACE_%s_GENERATED_TCG_TRACERS_H */' % group.upper())
开发者ID:8tab,项目名称:qemu,代码行数:55,代码来源:tcg_h.py
示例17: begin
def begin(events):
out('/* This file is autogenerated by tracetool, do not edit. */',
'',
'#define TRACEPOINT_DEFINE',
'#define TRACEPOINT_CREATE_PROBES',
'',
'/* If gcc version 4.7 or older is used, LTTng ust gives a warning when compiling with',
' -Wredundant-decls.',
' */',
'#pragma GCC diagnostic ignored "-Wredundant-decls"',
'',
'#include "generated-ust-provider.h"')
开发者ID:AbnerChang,项目名称:RiscVQemuPcat,代码行数:12,代码来源:ust_events_c.py
示例18: h
def h(events):
out('#include "trace/simple.h"',
'')
for event in events:
out('void trace_%(name)s(%(args)s);',
name = event.name,
args = event.args,
)
out('')
out('#define NR_TRACE_EVENTS %d' % len(events))
out('extern TraceEvent trace_list[NR_TRACE_EVENTS];')
开发者ID:AlexWWW,项目名称:qemu-linaro-clone,代码行数:12,代码来源:simple.py
示例19: h
def h(events):
out('#include "trace/generated-tracers-dtrace.h"',
'')
for e in events:
out('static inline void trace_%(name)s(%(args)s) {',
' QEMU_%(uppername)s(%(argnames)s);',
'}',
name = e.name,
args = e.args,
uppername = e.name.upper(),
argnames = ", ".join(e.args.names()),
)
开发者ID:01org,项目名称:KVMGT-qemu,代码行数:13,代码来源:dtrace.py
示例20: generate
def generate(events, backend):
events = [e for e in events
if "disable" not in e.properties]
out('/* This file is autogenerated by tracetool, do not edit. */',
'',
'#define tcg_temp_new_nop(v) (v)',
'#define tcg_temp_free_nop(v)',
'',
)
for e in events:
if "tcg-exec" not in e.properties:
continue
# tracetool.generate always transforms types to host
e_args = tracetool.vcpu.transform_args("tcg_helper_c", e.original, "wrapper")
# mixed-type to TCG helper bridge
args_tcg_compat = e_args.transform(HOST_2_TCG_COMPAT)
code_new = [
"%(tcg_type)s __%(name)s = %(tcg_func)s(%(name)s);" %
{"tcg_type": transform_type(type_, HOST_2_TCG),
"tcg_func": transform_type(type_, HOST_2_TCG_TMP_NEW),
"name": name}
for (type_, name) in args_tcg_compat
]
code_free = [
"%(tcg_func)s(__%(name)s);" %
{"tcg_func": transform_type(type_, HOST_2_TCG_TMP_FREE),
"name": name}
for (type_, name) in args_tcg_compat
]
gen_name = "gen_helper_" + e.api()
out('static inline void %(name)s(%(args)s)',
'{',
' %(code_new)s',
' %(proxy_name)s(%(tmp_names)s);',
' %(code_free)s',
'}',
name=gen_name,
args=e_args,
proxy_name=gen_name + "_proxy",
code_new="\n ".join(code_new),
code_free="\n ".join(code_free),
tmp_names=", ".join(["__%s" % name for _, name in e_args]),
)
开发者ID:01org,项目名称:qemu-lite,代码行数:51,代码来源:tcg_helper_wrapper_h.py
注:本文中的tracetool.out函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论