From patchwork Fri Oct 5 15:48:59 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: 148209 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp623650lji; Fri, 5 Oct 2018 09:01:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV63zYYVPxUgTrfobNKOap5pLj8CKMhbAlSfXvXwYyP3veO2t3xMTW/RaMQv+3+tAegze3laz X-Received: by 2002:a37:5ac2:: with SMTP id o185-v6mr9666386qkb.115.1538755273132; Fri, 05 Oct 2018 09:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538755273; cv=none; d=google.com; s=arc-20160816; b=x/Vuut/qDb2FVh9B8Io1DaLK9QjPKU2l5rFKk/4QgVRiDe9N3d12IkLMTYcyqpdwuj zD/44dA1vEl8BQcylsOn0t8z82u7XXJT0/qODtN4toEXm/MWQz0expS8EZxat7C4mwOO p1Tzfj1L0dsgZcRPLLnosuFjcJj7GxGKUIc4KjaRXUmR/8cMsrjOKwvQdk6QCwidqZKk csyzWMqYUNG7BzB+30kJ28I1onwFZGjChelMEXra6wMJZH/bZ+aN8zSRbgqNEphrJs37 DXJf24MEFnOsw1hnaHAfFSLySBdGuWtvykAgotlJu7a+yZS+hokYf8eCcgcoxWO1WS93 1f5g== 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=SN4jT9SwigzPCMSYeuvVx6C0flfiliEjnaW2VCVhVso=; b=oVou7AW8Pj+HV4fyozBbNFb640pxjx1DDFPbv1ec4TFwz2hAtdKfubJsyPKMHeE7Sb 04b1Kku0M0etHIfJVrc/J0PlehLPqG7U0pTusvQ+lfdeZcCDGpBeHawoUMqegQNQkIPR 7pGlCTQN0wPnt6S1o0fB4VGSLsdNz4nF0MNObmg1eGU2VW6629VpYMWdi6vWyNqhN+qB /kWlr8EQ+zX9rH2DYi89+oJXR2d66BJnp4sU5rgJdc4F8jQ48QaOD54YGTLfF6fWMTTK LPAIKF1yk0RVFS6GuhqIDGo40m4jxf8e6qDtr+CaD8vvZXCYAiMB4WDtBTJrYhYQb68l NNpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KHdnp1LT; 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 m54-v6si1616925qtc.111.2018.10.05.09.01.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 05 Oct 2018 09:01:13 -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=KHdnp1LT; 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]:35776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SXQ-00033v-46 for patch@linaro.org; Fri, 05 Oct 2018 12:01:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SMA-0006ai-LT 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 1g8SM8-0006Cm-MT for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:34 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:32859) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8SM8-000655-7V for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:32 -0400 Received: by mail-wr1-x444.google.com with SMTP id e4-v6so14082628wrs.0 for ; Fri, 05 Oct 2018 08:49:22 -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=SN4jT9SwigzPCMSYeuvVx6C0flfiliEjnaW2VCVhVso=; b=KHdnp1LTMTlH/B6ZuqS1nuCRC4bk+cSRB5lrOYHnbsFbkixNYZQrxQIPCKBUW1TBl1 1F2V7CUTbECZMFxGkpSsDzBQmvNvrshty0pSS10BoX+KPF3mClMcY2UK2gQAzDeGUkDy HqVMNvOXuPXnNwa9yI08cZtFGXh35j7mF0GIY= 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=SN4jT9SwigzPCMSYeuvVx6C0flfiliEjnaW2VCVhVso=; b=e+zdYVJkrMZnSwMJIUF7UTl6DVwmibeDIS3p+3KVQ0OpHQJyuozpdJDNuezDOSnOLQ NLH3dLMHGgV/gLoTZvTyiZvko6PCh+OhSRKFPPmoFbI9a7iNLJj5JYBhlHTFSPUjWP3M x8Jtl6vXER1MGfaR9QZ5DN7FpNLWZ8zLt6TwEldLAewspUgNzbLKFGB8vsfOIPjf4RH7 A/lldECLTk5JaPxNPZIiOjwVSGeOFWu1lltCv64DgMTobtUkkJ9dlVUkraZ6NIqGSem0 vbkVnyvRB92XohGQWFeUL4WMRB2SVpB2Z93b+YicR3NbvYngGrXns3h1GbQadpbElHwT OU1A== X-Gm-Message-State: ABuFfohXUUJzQwlKHdDcPBpMxfzI7fm9S7I6w4AulGmn39r8BH9il+Je h7xbVBayMy+qJOrf8VtquDKkdA== X-Received: by 2002:a05:6000:111:: with SMTP id o17mr9104672wrx.279.1538754561981; Fri, 05 Oct 2018 08:49:21 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l70-v6sm4876889wma.0.2018.10.05.08.49.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 08:49:15 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 823FE3E063B; 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:48:59 +0100 Message-Id: <20181005154910.3099-11-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::444 Subject: [Qemu-devel] [RFC PATCH 10/21] qom/cpu: add a cpu_exit trace event 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: cota@braap.org, =?utf-8?q?Alex_Benn=C3=A9e?= , vilanova@ac.upc.edu, Pavel.Dovgaluk@ispras.ru, =?utf-8?q?Andreas_F?= =?utf-8?b?w6RyYmVy?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is useful for tracing cpu_exit events where we signal the CPU to come back to the main loop. Signed-off-by: Alex Bennée --- qom/cpu.c | 3 +++ qom/trace-events | 4 ++++ 2 files changed, 7 insertions(+) -- 2.17.1 Reviewed-by: Richard Henderson diff --git a/qom/cpu.c b/qom/cpu.c index 92599f3541..5a77ff6acd 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "trace.h" #include "qapi/error.h" #include "qemu-common.h" #include "qom/cpu.h" @@ -111,6 +112,8 @@ void cpu_reset_interrupt(CPUState *cpu, int mask) void cpu_exit(CPUState *cpu) { + trace_cpu_exit(cpu, cpu->cpu_index); + atomic_set(&cpu->exit_request, 1); /* Ensure cpu_exec will see the exit request after TCG has exited. */ smp_wmb(); diff --git a/qom/trace-events b/qom/trace-events index 5d86fbf019..1162dd86fe 100644 --- a/qom/trace-events +++ b/qom/trace-events @@ -1,5 +1,9 @@ # See docs/devel/tracing.txt for syntax documentation. +# qom/cpu.c +# cpu_exit events +cpu_exit(void *cpu, int id) "cpu:%p id:%d" + # qom/object.c object_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)" object_class_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)"