From nobody Wed Nov 5 03:12:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500918238962995.3182737678408; Mon, 24 Jul 2017 10:43:58 -0700 (PDT) Received: from localhost ([::1]:56143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZhOd-0002YD-18 for importer@patchew.org; Mon, 24 Jul 2017 13:43:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZhNl-0002E0-R5 for qemu-devel@nongnu.org; Mon, 24 Jul 2017 13:43:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZhNi-0002fY-Ke for qemu-devel@nongnu.org; Mon, 24 Jul 2017 13:43:01 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:38522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZhNi-0002eX-89 for qemu-devel@nongnu.org; Mon, 24 Jul 2017 13:42:58 -0400 Received: from correu-2.ac.upc.es (correu-2.ac.upc.es [147.83.30.92]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id v6OHgtK5000533; Mon, 24 Jul 2017 19:42:55 +0200 Received: from localhost (unknown [31.210.188.120]) by correu-2.ac.upc.es (Postfix) with ESMTPSA id 72140358; Mon, 24 Jul 2017 19:42:49 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Mon, 24 Jul 2017 20:42:48 +0300 Message-Id: <150091816800.30739.7702589627052162702.stgit@frigg.lan> X-Mailer: git-send-email 2.13.2 In-Reply-To: <150091574424.30739.4131793221953168474.stgit@frigg.lan> References: <150091574424.30739.4131793221953168474.stgit@frigg.lan> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id v6OHgtK5000533 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 147.83.33.10 Subject: [Qemu-devel] [PATCH 10/13] instrument: [softmmu] Add command line library loader X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , "Emilio G. Cota" , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Signed-off-by: Llu=C3=ADs Vilanova --- qemu-options.hx | 17 +++++++++++++++++ vl.c | 11 +++++++++++ 2 files changed, 28 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 9bd6bf0eee..aacd01cee7 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4064,6 +4064,23 @@ HXCOMM HX does not support conditional compilation o= f text. @findex -trace @include qemu-option-trace.texi ETEXI +DEF("instr", HAS_ARG, QEMU_OPTION_instr, + "-instr [file=3D][,arg=3D]\n" + " load an instrumentation library\n", + QEMU_ARCH_ALL) +STEXI +@item -instr file=3D@var{file}[,arg=3D@var{string}] +@findex -instr + +Load a dynamic trace instrumentation library. + +@table @option +@item file=3D@var{file} +Load the given dynamic trace instrumentation library. +@item arg=3D@var{string} +String argument passed as to the library's @code{qi_init} routine (can be = given multiple times). +@end table +ETEXI =20 HXCOMM Internal use DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL) diff --git a/vl.c b/vl.c index fb6b2efafa..1a24b34d47 100644 --- a/vl.c +++ b/vl.c @@ -118,6 +118,7 @@ int main(int argc, char **argv) =20 #include "trace-root.h" #include "trace/control.h" +#include "instrument/cmdline.h" #include "qemu/queue.h" #include "sysemu/arch_init.h" =20 @@ -3031,6 +3032,9 @@ int main(int argc, char **argv, char **envp) } BlockdevOptions_queue; QSIMPLEQ_HEAD(, BlockdevOptions_queue) bdo_queue =3D QSIMPLEQ_HEAD_INITIALIZER(bdo_queue); + char *instrument_path =3D NULL; + int instrument_argc =3D 0; + const char **instrument_argv =3D NULL; =20 module_call_init(MODULE_INIT_TRACE); =20 @@ -3058,6 +3062,7 @@ int main(int argc, char **argv, char **envp) qemu_add_opts(&qemu_global_opts); qemu_add_opts(&qemu_mon_opts); qemu_add_opts(&qemu_trace_opts); + qemu_add_opts(&qemu_instr_opts); qemu_add_opts(&qemu_option_rom_opts); qemu_add_opts(&qemu_machine_opts); qemu_add_opts(&qemu_accel_opts); @@ -3999,6 +4004,10 @@ int main(int argc, char **argv, char **envp) g_free(trace_file); trace_file =3D trace_opt_parse(optarg); break; + case QEMU_OPTION_instr: + instr_opt_parse(optarg, &instrument_path, + &instrument_argc, &instrument_argv); + break; case QEMU_OPTION_readconfig: { int ret =3D qemu_read_config_file(optarg); @@ -4185,6 +4194,8 @@ int main(int argc, char **argv, char **envp) } trace_init_file(trace_file); =20 + instr_init(instrument_path, instrument_argc, instrument_argv); + /* Open the logfile at this point and set the log mask if necessary. */ if (log_file) {