summaryrefslogtreecommitdiffstats
path: root/trace
Commit message (Collapse)AuthorAgeFilesLines
* include/hw/core: Create struct CPUJumpCacheRichard Henderson2022-10-041-1/+1
| | | | | | | | Wrap the bare TranslationBlock pointer into a structure. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* error: use GLib to remember the program nameMarc-André Lureau2022-03-221-1/+1
| | | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* tracing: excise the tcg related from tracetoolAlex Bennée2022-02-091-13/+0Star
| | | | | | | | | | | | | | Now we have no TCG trace events and no longer handle them in the code we can remove the handling from the tracetool to generate them. vcpu tracing is still available although the existing syscall event is an exercise in redundancy (plugins and -strace can also get the information). Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Cc: Luis Vilanova <vilanova@imperial.ac.uk> Cc: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20220204204335.1689602-21-alex.bennee@linaro.org>
* tracing: remove the trace-tcg includes from the buildAlex Bennée2022-02-091-1/+0Star
| | | | | | | | | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Cc: Luis Vilanova <vilanova@imperial.ac.uk> Cc: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220204204335.1689602-20-alex.bennee@linaro.org>
* meson: generate trace events for qmp commandsVladimir Sementsov-Ogievskiy2022-01-271-3/+8
| | | | | | | | | | | | | | | | 1. Use --gen-trace when generate qmp commands 2. Add corresponding .trace-events files as outputs in qapi_files custom target 3. Define global qapi_trace_events list of .trace-events file targets, to fill in trace/qapi.build and to use in trace/meson.build 4. In trace/meson.build use the new array as an additional source of .trace_events files to be processed Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20220126161130.3240892-5-vsementsov@virtuozzo.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* trace: move configuration from configure to MesonPaolo Bonzini2021-10-141-6/+9
| | | | | | | Cc: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20211007130829.632254-4-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* trace: simple: pass trace_file unmodified to config-host.hPaolo Bonzini2021-10-141-1/+1
| | | | | | | | | | Add the suffix directly in trace/simple.c, so that quoting is done properly by Meson. Cc: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20211007130829.632254-3-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* trace: Split guest_mem_beforeRichard Henderson2021-10-061-51/+0Star
| | | | | | | | | | There is no point in encoding load/store within a bit of the memory trace info operand. Represent atomic operations as a single read-modify-write tracepoint. Use MemOpIdx instead of inventing a form specifically for traces. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* trace/mem: Pass MemOpIdx to trace_mem_get_infoRichard Henderson2021-10-061-22/+10Star
| | | | | | | | We (will) often have the complete MemOpIdx handy, so use that. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* meson: switch minimum meson version to 0.58.2, minimum recommended to 0.59.2Paolo Bonzini2021-10-051-2/+2
| | | | | | | | | | | | | | Meson 0.58.2 does not need b_staticpic=$pie anymore, and has stabilized the keyval module. Remove the workaround and use a few replacements for features deprecated in the 0.57.0 release cycle. One feature that we would like to use is passing dependencies to summary. However, that was broken in 0.59.0 and 0.59.1. Therefore, use the embedded Meson if the host has anything older than 0.59.2, but allow --meson= to use 0.58.2. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* meson: look up cp and dtrace with find_program()Paolo Bonzini2021-09-131-2/+3
| | | | | | | Avoid that meson prints a "Program xyz found" test once per custom_target. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* trace: Fold mem-internal.h into mem.hRichard Henderson2021-07-212-59/+37Star
| | | | | | | | | | Since the last thing that mem.h does is include mem-internal.h, the symbols are not actually private. Tested-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* trace, lttng: require .pc filesPaolo Bonzini2021-07-121-1/+1
| | | | | | | | | | | | | | The next version of lttng-libs will not require liburcu at run time anymore. Therefore, it is expected that distros will not include the urcubp libraries anymore when installing lttng-ust-devel. To avoid future problems, just require pkg-config to detect lttng-ust. The .pc files for lttng-ust correctly include liburcubp.a for static builds, and have always done since pkg-config files were added in 2011. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20210712155710.520889-1-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace/simple: add st_init_groupGerd Hoffmann2021-07-123-0/+17
| | | | | | | | | | | Add helper function and call it for each trace event group added. Makes sure that events added at module load time are initialized properly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20210601132414.432430-6-kraxel@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace/simple: pass iter to st_write_event_mappingGerd Hoffmann2021-07-121-5/+5
| | | | | | | | | | Pass an iter to st_write_event_mapping, so the function can interate different things depending on how we initialize the iter. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20210601132414.432430-5-kraxel@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: add trace_event_iter_init_groupGerd Hoffmann2021-07-122-3/+29
| | | | | | | | | This allows to interate over an event group. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20210601132414.432430-4-kraxel@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: iter init tweaksGerd Hoffmann2021-07-125-14/+29
| | | | | | | | | | Rename trace_event_iter_init() to trace_event_iter_init_pattern(), add trace_event_iter_init_all() for interating over all events. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20210601132414.432430-3-kraxel@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: fix "-trace file=..."Paolo Bonzini2021-03-061-6/+7
| | | | | | | | | | | | | | | | | | | | Because trace_opt_parse always deletes the options it has parsed, trace_init_file's call to qemu_find_opts_singleton always creates an empty -trace option group. Therefore, the subsequent qemu_opt_get(opts, "file") always returns NULL. To fix this, save the last "-trace file=..." option in a global variable and use it later in trace_init_file. This is similar to what was done before commit 92eecfff32 ("trace: remove argument from trace_init_file", 2020-11-11), except contained within trace/control.c and without memory leaks. Fixes: 92eecfff32 ("trace: remove argument from trace_init_file", 2020-11-11) Cc: stefanha@redhat.com Reported-by: armbru@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20210209145759.141231-2-pbonzini@redhat.com>
* trace: add meson custom_target() depend_files for tracetoolStefan Hajnoczi2021-02-011-7/+14
| | | | | | | | | | | Re-generate tracetool output when the tracetool source code changes. Use the same approach as qapi_gen_depends and introduce a tracetool_depends files list so meson is aware of the dependencies. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20210125110958.214017-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into ↵Peter Maydell2021-01-061-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging From Alex's pull request: * improve cross-build KVM coverage * new --without-default-features configure flag * add __repr__ for ConsoleSocket for debugging * build tcg tests with -Werror * test 32 bit builds with fedora * remove last traces of debian9 * hotfix for centos8 powertools repo * Move lots of feature detection code to meson (Alex, myself) * CFI and LTO support (Daniele) * test-char dangling pointer (Eduardo) * Build system and win32 fixes (Marc-André) * Initialization fixes (myself) * TCG include cleanup (Richard, myself) * x86 'int N' fix (Peter) # gpg: Signature made Wed 06 Jan 2021 09:21:25 GMT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini-gitlab/tags/for-upstream: (52 commits) win32: drop fd registration to the main-loop on setting non-block configure: move tests/qemu-iotests/common.env generation to meson meson.build: convert --with-default-devices to meson libattr: convert to meson cap_ng: convert to meson virtfs: convert to meson seccomp: convert to meson zstd: convert to meson lzfse: convert to meson snappy: convert to meson lzo: convert to meson rbd: convert to meson libnfs: convert to meson libiscsi: convert to meson bzip2: convert to meson glusterfs: convert to meson curl: convert to meson curl: remove compatibility code, require 7.29.0 brlapi: convert to meson configure: remove CONFIG_FILEVERSION and CONFIG_PRODUCTVERSION ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org> # Conflicts: # trace/meson.build
| * trace: do not include TCG helper tracepoints in no-TCG buildsPaolo Bonzini2021-01-021-1/+1
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | tracetool: add output filename command-line argumentStefan Hajnoczi2021-01-041-14/+7Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The tracetool.py script writes to stdout. This means the output filename is not available to the script. Add the output filename to the command-line so that the script has access to the filename. This also simplifies the tracetool.py invocation. It's no longer necessary to use meson's custom_build(capture : true) to save output. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200827142915.108730-2-stefanha@redhat.com>
* | trace: Send "-d trace:help" output to stdoutDoug Evans2021-01-042-7/+8
|/ | | | | | | | ... for consistency with "-d help". Signed-off-by: Doug Evans <dje@google.com> Message-id: 20201125215245.3514695-1-dje@google.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qapi: Use QAPI_LIST_PREPEND() where possibleEric Blake2020-12-191-12/+10Star
| | | | | | | | | | | | | | | | | | | | | | | | | Anywhere we create a list of just one item or by prepending items (typically because order doesn't matter), we can use QAPI_LIST_PREPEND(). But places where we must keep the list in order by appending remain open-coded until later patches. Note that as a side effect, this also performs a cleanup of two minor issues in qga/commands-posix.c: the old code was performing new = g_malloc0(sizeof(*ret)); which 1) is confusing because you have to verify whether 'new' and 'ret' are variables with the same type, and 2) would conflict with C++ compilation (not an actual problem for this file, but makes copy-and-paste harder). Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20201113011340.463563-5-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> [Straightforward conflicts due to commit a8aa94b5f8 "qga: update schema for guest-get-disks 'dependents' field" and commit a10b453a52 "target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c" resolved. Commit message tweaked.] Signed-off-by: Markus Armbruster <armbru@redhat.com>
* trace: use STAP_SDT_V2 to work around symbol visibilityStefan Hajnoczi2020-11-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QEMU binaries no longer launch successfully with recent SystemTap releases. This is because modular QEMU builds link the sdt semaphores into the main binary instead of into the shared objects where they are used. The symbol visibility of semaphores is 'hidden' and the dynamic linker prints an error during module loading: $ ./configure --enable-trace-backends=dtrace --enable-modules ... ... Failed to open module: /builddir/build/BUILD/qemu-4.2.0/s390x-softmmu/../block-curl.so: undefined symbol: qemu_curl_close_semaphore The long-term solution is to generate per-module dtrace .o files and link them into the module instead of the main binary. In the short term we can define STAP_SDT_V2 so dtrace(1) produces a .o file with 'default' symbol visibility instead of 'hidden'. This workaround is small and easier to merge for QEMU 5.2 and downstream backports. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1898700 Cc: wcohen@redhat.com Cc: fche@redhat.com Cc: kraxel@redhat.com Cc: rjones@redhat.com Cc: ddepaula@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com> Message-id: 20201119141457.844452-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: remove argument from trace_init_filePaolo Bonzini2020-11-112-15/+7Star
| | | | | | | | | | It is not needed, all the callers are just saving what was retrieved from -trace and trace_init_file can retrieve it on its own. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20201102115841.4017692-1-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace/simple: Enable tracing on startup only if the user specifies a trace ↵Josh DuBois2020-10-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | option Tracing can be enabled at the command line or via the monitor. Command-line trace options are recorded during trace_opt_parse(), but tracing is not enabled until the various front-ends later call trace_init_file(). If the user passes a trace option on the command-line, remember that and enable tracing during trace_init_file(). Otherwise, trace_init_file() should record the trace file specified by the frontend and avoid enabling traces until the user requests them via the monitor. This fixes 1b7157be3a8c4300fc8044d40f4b2e64a152a1b4 and also db25d56c014aa1a96319c663e0a60346a223b31e, by allowing the user to enable traces on the command line and also avoiding unwanted trace-<pid> files when the user has not asked for them. Fixes: 1b7157be3a8c4300fc8044d40f4b2e64a152a1b4 Signed-off-by: Josh DuBois <josh@joshdubois.com> Message-id: 20200816174610.20253-1-josh@joshdubois.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* monitor: Use getter/setter functions for cur_monKevin Wolf2020-10-091-1/+1
| | | | | | | | | | | | | cur_mon really needs to be coroutine-local as soon as we move monitor command handlers to coroutines and let them yield. As a first step, just remove all direct accesses to cur_mon so that we can implement this in the getter function later. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20201005155855.256490-4-kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* meson: clean up build_by_defaultPaolo Bonzini2020-09-301-1/+0Star
| | | | | | | | | | | Build all executables by default except for the known-broken ones. This also allows running qemu-iotests without manually building socket_scm_helper. Reported-by: Max Reitz <mreitz@redhat.com> Tested-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* meson: use meson datadir instead of qemu_datadirMarc-André Lureau2020-09-011-1/+1
| | | | | | | | | | When cross-compiling, by default qemu_datadir is 'c:\Program Files\QEMU', which is not recognized as being an absolute path, and meson will end up adding the prefix again. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200826110419.528931-6-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* meson: Don't make object files for dtrace on macOSRoman Bolshakov2020-08-271-5/+8
| | | | | | | | | | | | | | | | dtrace on macOS uses unresolved symbols with a special prefix to define probes [1], only headers should be generated for USDT (dtrace(1)). But it doesn't support backwards compatible no-op -G flag [2] and implicit build rules fail. 1. https://markmail.org/message/6grq2ygr5nwdwsnb 2. https://markmail.org/message/5xrxt2w5m42nojkz Cc: Daniel P. Berrangé <berrange@redhat.com> Cc: Cameron Esfahani <dirty@apple.com> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* meson: convert systemtap filesMarc-André Lureau2020-08-211-7/+7
| | | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* meson: convert trace/Marc-André Lureau2020-08-212-9/+4Star
| | | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* meson: add remaining generated tcg trace helpersMarc-André Lureau2020-08-211-0/+14
| | | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* libqemuutil, qapi, trace: convert to mesonPaolo Bonzini2020-08-212-51/+76
| | | | | | | | | | | | | | | This shows how to do some "computations" in meson.build using its array and dictionary data structures, and also a basic usage of the sourceset module for conditional compilation. Notice the new "if have_system" part of util/meson.build, which fixes a bug in the old build system was buggy: util/dbus.c was built even for non-softmmu builds, but the dependency on -lgio was lost when the linking was done through libqemuutil.a. Because all of its users required gio otherwise, the bug was hidden. Meson instead propagates libqemuutil's dependencies down to its users, and shows the problem. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* trace: switch position of headers to what Meson requiresPaolo Bonzini2020-08-212-2/+2
| | | | | | | | | | | | | | | | | Meson doesn't enjoy the same flexibility we have with Make in choosing the include path. In particular the tracing headers are using $(build_root)/$(<D). In order to keep the include directives unchanged, the simplest solution is to generate headers with patterns like "trace/trace-audio.h" and place forwarding headers in the source tree such that for example "audio/trace.h" includes "trace/trace-audio.h". This patch is too ugly to be applied to the Makefiles now. It's only a way to separate the changes to the tracing header files from the Meson rewrite of the tracing logic. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* trace/simple: Allow enabling simple traces from command lineJosh DuBois2020-07-291-0/+1
| | | | | | | | | | | | | | The simple trace backend is enabled / disabled with a call to st_set_trace_file_enabled(). When initializing tracing from the command-line, this must be enabled on startup. (Prior to db25d56c014aa1a9, command-line initialization of simple trace worked because every call to st_set_trace_file enabled tracing.) Fixes: db25d56c014aa1a96319c663e0a60346a223b31e Signed-off-by: Josh DuBois <josh@joshdubois.com> Message-id: 20200723053359.256928-1-josh@joshdubois.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace/simple: Fix unauthorized enableMarkus Armbruster2020-06-242-7/+15
| | | | | | | | | | | | | | | | st_set_trace_file() accidentally enables tracing. It's called unconditionally during startup, which is why QEMU built with the simple trace backend always writes a trace file "trace-$PID". This has been broken for quite a while. I didn't track down the exact commit. Fix st_set_trace_file() to restore the state. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20200527065613.25322-1-armbru@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* tracing: only allow -trace to override -D if setAlex Bennée2020-02-251-3/+8
| | | | | | | | | Otherwise any -D settings the user may have made get ignored. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Tested-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Robert Foley <robert.foley@linaro.org> Message-Id: <20200225124710.14152-10-alex.bennee@linaro.org>
* qemu_set_log_filename: filename argument may be NULLSalvador Fandino2020-01-301-3/+1Star
| | | | | | | | | | | | | NULL is a valid log filename used to indicate we want to use stderr but qemu_set_log_filename (which is called by bsd-user/main.c) was not handling it correctly. That also made redundant a couple of NULL checks in calling code which have been removed. Signed-off-by: Salvador Fandino <salvador@qindel.com> Message-Id: <20200123193626.19956-1-salvador@qindel.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: Remove trace_mem_build_info_no_se_[bl]eRichard Henderson2020-01-161-17/+0Star
| | | | | | | | | | | It is easy for the atomic helpers to use trace_mem_build_info directly, without resorting to symbol pasting. For this usage, we cannot use trace_mem_get_info, because the MemOp does not support 16-byte accesses. Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* trace: replace hand-crafted pattern_glob with g_pattern_match_simpleAlex Bennée2019-12-191-34/+1Star
| | | | | | | | | We already use g_pattern_match elsewhere so remove the duplication. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20191205122518.10010-7-alex.bennee@linaro.org>
* trace: add mmu_index to mem_infoAlex Bennée2019-10-282-12/+26
| | | | | | | We are going to re-use mem_info later for plugins and will need to track the mmu_idx for softmmu code. Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* trace: expand mem_info:size_shift to 4 bitsEmilio G. Cota2019-10-281-4/+4
| | | | | | | | | | | This will allow us to trace 32k-long memory accesses (although our maximum is something like 256 bytes at the moment). Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Emilio G. Cota <cota@braap.org> [AJB: expanded to 3->4 bits] Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* tcg: TCGMemOp is now accelerator independent MemOpTony Nguyen2019-09-032-4/+4
| | | | | | | | | | | | | | Preparation for collapsing the two byte swaps, adjust_endianness and handle_bswap, along the I/O path. Target dependant attributes are conditionalized upon NEED_CPU_H. Signed-off-by: Tony Nguyen <tony.nguyen@bt.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Acked-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <81d9cd7d7f5aaadfa772d6c48ecee834e9cf7882.1566466906.git.tony.nguyen@bt.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* trace: Clarify DTrace/SystemTap help messagePhilippe Mathieu-Daudé2019-08-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most tracing backends are implemented within QEMU, except the DTrace/SystemTap backends. One side effect is when running 'qemu -trace help', an incomplete list of trace events is displayed when using the DTrace/SystemTap backends. This is partly due to trace events registered as modules with trace_init(), and since the events are not used within QEMU, the linker optimize and remove the unused modules (which is OK in this particular case). Currently only the events compiled in trace-root.o and in the last trace.o member of libqemuutil.a are linked, resulting in an incomplete list of events. To avoid confusion, improve the help message, recommending to use the proper systemtap script to display the events list. Before: $ lm32-softmmu/qemu-system-lm32 -trace help 2>&1 | wc -l 70 After: $ lm32-softmmu/qemu-system-lm32 -trace help Run 'qemu-trace-stap list qemu-system-lm32' to print a list of names of trace points with the DTrace/SystemTap backends. $ qemu-trace-stap list qemu-system-lm32 | wc -l 1136 Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190823142203.5210-1-philmd@redhat.com Message-Id: <20190823142203.5210-1-philmd@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* hw/core: Move cpu.c, cpu.h from qom/ to hw/core/Markus Armbruster2019-08-211-1/+1
| | | | | | | | | | Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190709152053.16670-2-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> [Rebased onto merge commit 95a9457fd44; missed instances of qom/cpu.h in comments replaced]
* trace: Do not include qom/cpu.h into generated trace.hMarkus Armbruster2019-08-164-50/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | docs/devel/tracing.txt explains "since many source files include trace.h, [the generated trace.h use] a minimum of types and other header files included to keep the namespace clean and compile times and dependencies down." Commit 4815185902 "trace: Add per-vCPU tracing states for events with the 'vcpu' property" made them all include qom/cpu.h via control-internal.h. qom/cpu.h in turn includes about thirty headers. Ouch. Per-vCPU tracing is currently not supported in sub-directories' trace-events. In other words, qom/cpu.h can only be used in trace-root.h, not in any trace.h. Split trace/control-vcpu.h off trace/control.h and trace/control-internal.h. Have the generated trace.h include trace/control.h (which no longer includes qom/cpu.h), and trace-root.h include trace/control-vcpu.h (which includes it). The resulting improvement is a bit disappointing: in my "build everything" tree, some 1100 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h) depend on a trace.h, and about 600 of them no longer depend on qom/cpu.h. But more than 1300 others depend on trace-root.h. More work is clearly needed. Left for another day. Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190812052359.30071-8-armbru@redhat.com>
* Include qemu-common.h exactly where neededMarkus Armbruster2019-06-121-1/+0Star
| | | | | | | | | | | | | | | | No header includes qemu-common.h after this commit, as prescribed by qemu-common.h's file comment. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-5-armbru@redhat.com> [Rebased with conflicts resolved automatically, except for include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and net/tap-bsd.c fixed up]
* trace: Simplify how st_print_trace_file_status() printsMarkus Armbruster2019-04-182-4/+5
| | | | | | | | | | | | | | | | st_print_trace_file_status() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_trace_file() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly. Drop the callback, and call qemu_printf() instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20190417191805.28198-3-armbru@redhat.com>