From patchwork Fri Oct 5 15:49:00 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: 148213 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp628796lji; Fri, 5 Oct 2018 09:05:01 -0700 (PDT) X-Google-Smtp-Source: ACcGV61TlcK613xM1PV47Pas2QxlAXEQLoZ2iT6Ykazv1G7/bHc2YgrZiL33rJAPqgCVFqaGpeiz X-Received: by 2002:ad4:5252:: with SMTP id s18-v6mr9823024qvq.96.1538755501155; Fri, 05 Oct 2018 09:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538755501; cv=none; d=google.com; s=arc-20160816; b=LY00Z5+yxcB8nJBm11e5vMax13YnKgXNdXvq5kPf+iW5h9goaQh57qZi6nE7qTxd3L 6KBmgK3PiOyuhX6SUi03fJX6fn4OFgrg9rGUvBCwAsuQPRLeUM3NcK68QUytvL/FnuDB dokgD6sGRcWs1O779PuyZ13tbs+NuEsrvmdU98Ln2igibneFxmJizHrZf/aB+wYM58nf HeUBXAeiZCLjqf3NmKmu7hQFkhkQOW1DuaWEs8Mo/CdQmR/qXmkIZnUjhTGc5UyUMS9T vzaf7UCCUg3an4Aw2qSwLbB2Y3KvZpmJgyWBgTP+aqo6CzhYTuHOQKVRZHFXVQrJSBsS QFiQ== 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=FZGK1pX/0lWiGdcNEkGvPFwvqa10Iu+WxjAabnC7X4I=; b=V+9l/zhYSR8mQ2mgGlqvFkp7KQhZV8MBnFBTSPoXGusMU+tKHqp3gce8IA/kcHar3P 77+lEJbvVXH4RGsi/l0qvl0wSLVtySm4dm4qAE7yeELx9nmvphdE4igcQ0q+dG7pt99Z cB6iIK4L72CDMn2dYLZqHnwkPVhcrxDDn7DOZC89iLA3OnjkhdQm5wX3buuMjrYoAHDk UppTlHN//WeYFVmo9iPZQ6/l7bnQIN/hr8wMU1z+CCcmlzyYPOwPrWqmDNQ4y0ZE9tSO +nKLAofFwCEPmruzQk0pPm4RZpZrCJfTiSA/p42MM9zOpBhaWWyWUipLPKsVpykpBRsS tQFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DHDRI1bv; 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 b190-v6si5865013qkc.304.2018.10.05.09.05.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 05 Oct 2018 09:05:01 -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=DHDRI1bv; 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]:35797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8Sb6-0005iG-Jf for patch@linaro.org; Fri, 05 Oct 2018 12:05:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SMF-0006fL-FE for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8SM9-0006F4-LU for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:39 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:52743) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8SM9-00065z-76 for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:33 -0400 Received: by mail-wm1-x333.google.com with SMTP id 189-v6so2314139wmw.2 for ; Fri, 05 Oct 2018 08:49:25 -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=FZGK1pX/0lWiGdcNEkGvPFwvqa10Iu+WxjAabnC7X4I=; b=DHDRI1bvqoNhG6gDIDAvocvXUfX+gpqLHrSXs0aCxH5isB6/yF+FTsj1lV4mySyaDr jO6Yc7vDlfzinKueNEYpqFjxMS9g1nC+9CaO2KvlLEukmJ0RV/vF2qg6VEW9S2xqcEOD ITL33sB/Yw+mhwzv7OA3icK9+WkMNqUTuSUus= 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=FZGK1pX/0lWiGdcNEkGvPFwvqa10Iu+WxjAabnC7X4I=; b=P0NUifSVliPJTq/xceqLVeW5DMXLb+ml2ioT2FCRROg1p+TJbMk5vz3VIavHVwzf7i +URLO/EUX8l1/FDktVtaCACQfUt8r35RgG9U6mY8CJGgcETa//zFljR6cRTvvAD2DpDL iJwqDp1M1DzurnZHDHB158cL2h/npkbgHXLdD8HxqNrwKjkFYfHfOWQTGTPU/qAsV2YW aadWr62crmsWnlhigGru4P7EjJvpYcCyuFULhJsZFnhlcQzTGghLu+qYNacsgeIP3ocf fl3G4vo9tAe+PlLFFe8LmOrvVWLunTKu2zutfaNQUluZXzIRkL4e2EzN5wmDbna8zNsE GnEw== X-Gm-Message-State: ABuFfogZACwubf4tuSj5morGUH3FSDoKDYOZd351jH7nlasZ2cngoLpf 2/eJVN3ArD80hlNtEgNVUmXV3w== X-Received: by 2002:a1c:845:: with SMTP id 66-v6mr8845296wmi.61.1538754564760; Fri, 05 Oct 2018 08:49:24 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h82-v6sm1675625wmf.14.2018.10.05.08.49.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 08:49:20 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 95B9F3E064A; 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:00 +0100 Message-Id: <20181005154910.3099-12-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::333 Subject: [Qemu-devel] [RFC PATCH 11/21] trace: expose a plugin fn pointer in TraceEvent 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: Stefan Hajnoczi , cota@braap.org, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , vilanova@ac.upc.edu, Pavel.Dovgaluk@ispras.ru Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We'll need somewhere to stash this later. It's up to the generated code to do the funky casting to what it really is. Signed-off-by: Alex Bennée --- trace/control-internal.h | 6 ++++++ trace/event-internal.h | 3 +++ 2 files changed, 9 insertions(+) -- 2.17.1 Reviewed-by: Richard Henderson diff --git a/trace/control-internal.h b/trace/control-internal.h index c7fbe2d3bf..d734576948 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -80,6 +80,12 @@ static inline bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, return trace_event_get_vcpu_state_dynamic_by_vcpu_id(vcpu, vcpu_id); } +#ifdef CONFIG_TRACE_PLUGIN +static inline uintptr_t trace_event_get_plugin(TraceEvent *ev) +{ + return ev->plugin; +} +#endif void trace_event_register_group(TraceEvent **events); diff --git a/trace/event-internal.h b/trace/event-internal.h index 8ab3a29941..3895ee9883 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -38,6 +38,9 @@ typedef struct TraceEvent { const bool sstate; uint16_t *dstate; uint64_t count; +#ifdef CONFIG_TRACE_PLUGIN + uintptr_t plugin; +#endif } TraceEvent; void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state);