[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for 2.10] trace: ensure unique function / variab
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH for 2.10] trace: ensure unique function / variable names per .stp file |
Date: |
Mon, 31 Jul 2017 10:50:23 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Fri, Jul 28, 2017 at 02:36:57PM +0100, Daniel P. Berrange wrote:
> The simpletrace compatibility code for systemtap creates a
> function and some global variables for mapping to event ID
> numbers. We generate multiple -simpletrace.stp files though,
> one per target and systemtap considers functions & variables
> to be globally scoped, not per file. So if trying to use the
> simpletrace compat probes, systemtap will complain:
>
> # stap -e 'probe qemu.system.arm.simpletrace.visit_type_str { print(
> "hello")}'
> semantic error: conflicting global variables: identifier
> 'event_name_to_id_map' at
> /usr/share/systemtap/tapset/qemu-aarch64-simpletrace.stp:3:8
> source: global event_name_to_id_map
> ^
> identifier 'event_name_to_id_map' at
> /usr/share/systemtap/tapset/qemu-system-arm-simpletrace.stp:3:8
> source: global event_name_to_id_map
> ^
>
> WARNING: cross-file global variable reference to identifier
> 'event_name_to_id_map' at
> /usr/share/systemtap/tapset/qemu-system-arm-simpletrace.stp:3:8 from:
> identifier 'event_name_to_id_map' at
> /usr/share/systemtap/tapset/qemu-aarch64-simpletrace.stp:8:21
> source: if (!([name] in event_name_to_id_map)) {
> ^
> WARNING: cross-file global variable reference to identifier 'event_next_id'
> at /usr/share/systemtap/tapset/qemu-system-arm-simpletrace.stp:4:8 from:
> identifier 'event_next_id' at :9:38
> source: event_name_to_id_map[name] = event_next_id
> ^
>
> We already have a string used to prefix probe names, so just
> replace '.' with '_' to get a function / variable name prefix
>
> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---
> scripts/tracetool/format/simpletrace_stap.py | 29
> ++++++++++++++++++----------
> 1 file changed, 19 insertions(+), 10 deletions(-)
Thanks, applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracing
Stefan
signature.asc
Description: PGP signature