From patchwork Fri Oct 5 15:49:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 148207 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp623483lji; Fri, 5 Oct 2018 09:01:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV601b6ucEH1ZIArVOKUmOBmZ33Fizdk/LWuCDAQG9VLuqcrbdFZ7ibcaK/HstEVtGRp80aEc X-Received: by 2002:a37:39c8:: with SMTP id g191-v6mr9177841qka.289.1538755265517; Fri, 05 Oct 2018 09:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538755265; cv=none; d=google.com; s=arc-20160816; b=Y3dcD1pQ8jXEy6bI6FKPBpKNXubHBrcptKXS9xZtfGH3/jbuptVnzO5bZNLwxBCqxf zbFgAJDvDQJQuy38JUcNj2PoCNJ+s+MKFSc1VPu2NBD+T6pwxB+v0k07dwsr0aI6HCBA bktJZJBfMSME1a9xkUZiDgZZbgAK2aqg8KdbyUa5DO2XwgVUsw/pr3/TN1Ab0wp3OsTM G/FZk8ZeSc5/bskg5dsd9W7q4X6N3ePs2STXqg9Jm/T+RSd9uPAY1x3pbjyJM9l18UFC jKOmvh99YEtmr1OriwPbRYioXpaeLsVCBUGBarYlw5OJPxCSo9Veo8dQLqXk6qs9ea5T ZsrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=pTezd02bQSxmcq683cGX0+CsPAikNVdIw3kttYYPxIE=; b=CWl+jm8enwPK9kd8By8YprQC0PgcqGPJJ10YxULn1h6tjCqxSgiJeeTwspCVbB3lr9 i/BeB+Bgo1Jm/JmvZcdzsDGAtCdHLvAYt39r146B7IUA1UFVgmsgqAh25Unj33258vwT 0ZQjJElwA4/b3HtsdRUtfTJhhmdSdqCUCPoMosU96kECCQAeHBlTMj5kCdJz/MDkwQZE XyrgwfNSS1nzVBj2ZGJ4Ala3COE5rlD3VV0DZTNGlcgvtruINnDgMpdQdQMru0w/e/fJ bgofgaBffY3gDdwsxgBih/FJ+ReRhx3it73DrtmGzGqhNjsZ6UWUcaB/ElCUxhIqHfdA lXaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iy86TiQV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p59-v6si1094898qtd.270.2018.10.05.09.01.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 05 Oct 2018 09:01:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iy86TiQV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SXI-0002WD-9Q for patch@linaro.org; Fri, 05 Oct 2018 12:01:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SSH-0005zp-84 for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:55:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8SSC-0004eb-Ni for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:55:53 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:53776) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8SSC-0004eN-Fz for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:55:48 -0400 Received: by mail-wm1-x32d.google.com with SMTP id b19-v6so2333565wme.3 for ; Fri, 05 Oct 2018 08:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pTezd02bQSxmcq683cGX0+CsPAikNVdIw3kttYYPxIE=; b=iy86TiQVz+DaWLI19VSwghy2dFBP7DQVGAoR6XF0e2TOS62mD9dLmwpWf7qH6wZHJQ N8D9uxWyeNY9a6E1eY+arFXIccdMnBp6GJw/1na5rQn1ef0FJJ+yEuI9azSfrR7ERRYj B5VKEQoD3wi2GT+H9VzmIP8gwxjeXiBlyUw5Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pTezd02bQSxmcq683cGX0+CsPAikNVdIw3kttYYPxIE=; b=S+sqbgSdyBkZTCxVl+b8v4UjgEUMh6aBoKErGWTAgHzTup73M5wtQ0+1O9Jge6jDQm I/7WzqlS/23sk15xeX7o56Sl6Lxkv5Z9pa8aQX8QrqW6GcbBI6H+RcZBOznfdPA1R02H xUYVP8d2xryyqOTa/EO3usKwyNYvf/gM+53Fqo4/UgYpfDpPfp5KB7V5sYOGKWlhxJ0w 6Zpldu0S/jR8OaClYCCRNyJdrnHulXEQsglkE7+FmTW5LjnRjtqqyhCZVpAPqjfHTufz UvDKSrhQx3vxv4QHi4rk22XlYF45Sr4B+GlQfK+5LuTuAHWY4DMchOdnBD3y7uNCPx5g E7MA== X-Gm-Message-State: ABuFfog7Zfz0Ehngq70NJSh3Nuob+vfQvoagqQYg2vLPBVkM07sUM6jc ulEarrx9K0nhx/QtwabR6YDMZw== X-Received: by 2002:a1c:9895:: with SMTP id a143-v6mr8290579wme.43.1538754947394; Fri, 05 Oct 2018 08:55:47 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x203-v6sm2418391wmg.42.2018.10.05.08.55.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 08:55:45 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id E62053E0792; Fri, 5 Oct 2018 16:49:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 16:49:04 +0100 Message-Id: <20181005154910.3099-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005154910.3099-1-alex.bennee@linaro.org> References: <20181005154910.3099-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d Subject: [Qemu-devel] [RFC PATCH 15/21] trace: add linux-user plugin support 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: Pavel.Dovgaluk@ispras.ru, Riku Voipio , Laurent Vivier , cota@braap.org, Aaron Lindsay , =?utf-8?q?Alex_Benn=C3=A9e?= , vilanova@ac.upc.edu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Aaron Lindsay Signed-off-by: Aaron Lindsay [AJB: ifdeffery] Signed-off-by: Alex Bennée --- linux-user/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 2.17.1 Reviewed-by: Richard Henderson diff --git a/linux-user/main.c b/linux-user/main.c index a68674d0de..9fbb827fe0 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -38,6 +38,7 @@ #include "trace/control.h" #include "target_elf.h" #include "cpu_loop-common.h" +#include "qemu/plugins.h" char *exec_path; @@ -393,6 +394,13 @@ static void handle_arg_trace(const char *arg) trace_file = trace_opt_parse(arg); } +#ifdef CONFIG_TRACE_PLUGIN +static void handle_arg_plugin(const char *arg) +{ + qemu_plugin_parse_cmd_args(arg); +} +#endif + struct qemu_argument { const char *argv; const char *env; @@ -444,6 +452,10 @@ static const struct qemu_argument arg_table[] = { "", "Seed for pseudo-random number generator"}, {"trace", "QEMU_TRACE", true, handle_arg_trace, "", "[[enable=]][,events=][,file=]"}, +#ifdef CONFIG_TRACE_PLUGIN + {"plugin", "QEMU_PLUGIN", true, handle_arg_plugin, + "", "file=[,args=]"}, +#endif {"version", "QEMU_VERSION", false, handle_arg_version, "", "display version information and exit"}, {NULL, NULL, false, NULL, NULL, NULL} @@ -830,6 +842,9 @@ int main(int argc, char **argv, char **envp) } gdb_handlesig(cpu, 0); } + + qemu_plugins_init(); + cpu_loop(env); /* never exits */ return 0;