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: 979560 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="iy86TiQV"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42RZHw5h8cz9s3Z for ; Sat, 6 Oct 2018 02:01:31 +1000 (AEST) Received: from localhost ([::1]:35770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SXf-0002WD-Eo for incoming@patchwork.ozlabs.org; Fri, 05 Oct 2018 12:01:27 -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-Google-Smtp-Source: ACcGV630f9NT227ngTRL8jI0K2CRMvDUXJFa1iLmvMK8S8gX9w97zcdEUqaXPOiCOZ2vMwUCWfWhtg== 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Aaron Lindsay Signed-off-by: Aaron Lindsay [AJB: ifdeffery] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- linux-user/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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;