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: 979557 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="KHdnp1LT"; 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 42RZDy4vxlz9s8J for ; Sat, 6 Oct 2018 01:58:58 +1000 (AEST) Received: from localhost ([::1]:35743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SVD-0000Tl-VU for incoming@patchwork.ozlabs.org; Fri, 05 Oct 2018 11:58:56 -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-Google-Smtp-Source: ACcGV63MpewIW0LgFpjk5cCdbMh/CUmSyrJKVUmVrmS60lI/Kp50SOo1XeWvd9hakxOfVQkDo87zKg== 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+incoming=patchwork.ozlabs.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 Reviewed-by: Richard Henderson --- qom/cpu.c | 3 +++ qom/trace-events | 4 ++++ 2 files changed, 7 insertions(+) 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)"