From patchwork Fri Feb 5 18:33:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 8238141 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5B5899F3CD for ; Fri, 5 Feb 2016 18:36:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E9EE20392 for ; Fri, 5 Feb 2016 18:36:17 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8331220375 for ; Fri, 5 Feb 2016 18:36:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aRlCW-0003n9-2S; Fri, 05 Feb 2016 18:33:48 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aRlCU-0003mZ-Op for xen-devel@lists.xenproject.org; Fri, 05 Feb 2016 18:33:46 +0000 Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id 18/6C-10115-A0BE4B65; Fri, 05 Feb 2016 18:33:46 +0000 X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1454697225!21858900!1 X-Originating-IP: [74.125.82.68] X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46328 invoked from network); 5 Feb 2016 18:33:45 -0000 Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by server-15.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 5 Feb 2016 18:33:45 -0000 Received: by mail-wm0-f68.google.com with SMTP id g62so4174768wme.2 for ; Fri, 05 Feb 2016 10:33:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=h0yXvmbfz6sw6sBlD9rU+psjtFi46nqBbyBiwFW6QrU=; b=QbEiyDu9TlA/UwgnwlKcbBB1nMEe6PjeVy+RrfgBP8avPbAJ3FHfilJd+xEOClHS79 f5pWwrT6F/BY56BqRJUecL1ZquLU+yla3JgpaahL3Gswmb1+i0ihXQi3aKAG3/xr+46T Di1uuaQ/9rSZEf5wakeF5x3AqWWHz+OyColbDoZVQ7lpU0IvSUBJ4Zscn3PTfkHT5NZc nvM6RFe54fVXmiqpcJACxNBsP9ev8j8VZCizwMu8D6/frTbMQWDlCb2aeYqBaVrzG4AW BV5is/dukWNziaLTZqJX+X41/qhprRzUWwPeXw1worNgHpwJNF5hUCQUemKhWieNmkwI uYLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version:content-type :content-transfer-encoding; bh=h0yXvmbfz6sw6sBlD9rU+psjtFi46nqBbyBiwFW6QrU=; b=QX91CnOPZFHsTLk1jc3ns3xvA9yD5dzeKx4eQqW/JplfPTDhcks92+UpK7iCYlmQLL QAelmVIKP5Quv5hSOnRDS3ACCujX4mIQvZfDsD5Mm761ZPZkHpYx8ZVmPkGJTNIC1Kf7 d4DwqYSk5VE/UdzoAqvDrO3pmbrlKhO30PBoF45223E2Oifs6KWvz881nTmB2CYcFVr9 1Yi7QC+KyEtOWrMIEp11euHWq9ZJSSq6Ip/qE9z/7TlsnPWamkVHKvZz3xHAsuyebC7B 5EpXvZMPqvj9fXVs9BSxVT4hI3BHM4GFzJ3eG1pqSdbYkILUEL7n7hkl02cXAO0EcXaU wW0Q== X-Gm-Message-State: AG10YORw3uBwWPiCRPsp7UbqzOFyKoMJ3XMD5MoZLMzAFrdmswvrz2mdGytuGO/du1A4Zg== X-Received: by 10.194.185.199 with SMTP id fe7mr5089284wjc.50.1454697224827; Fri, 05 Feb 2016 10:33:44 -0800 (PST) Received: from Solace.station (net-2-35-170-8.cust.vodafonedsl.it. [2.35.170.8]) by smtp.gmail.com with ESMTPSA id u4sm17038439wjz.4.2016.02.05.10.33.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Feb 2016 10:33:44 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Fri, 05 Feb 2016 19:33:42 +0100 Message-ID: <20160205183342.4543.51431.stgit@Solace.station> In-Reply-To: <20160205183137.4543.56523.stgit@Solace.station> References: <20160205183137.4543.56523.stgit@Solace.station> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: George Dunlap Subject: [Xen-devel] [PATCH 02/14] xen: sched: move up the trace record for vcpu_wake and vcpu_sleep X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP vcpu_wake() and vcpu_sleep() are called before the specific schedulers wakeup and sleep routines (in fact, it is them that calls those specific routine). Make the trace reflect that, by moving the records up. In fact, it is more natural and easy to find the record of the event (e.g., the wakeup) *before* the records of the actions that deals with the event itself. Signed-off-by: Dario Faggioli Reviewed-by: Konrad Rzeszutek Wilk --- Cc: George Dunlap --- xen/common/schedule.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 7306d71..c87922f 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -381,7 +381,11 @@ void sched_destroy_domain(struct domain *d) void vcpu_sleep_nosync(struct vcpu *v) { unsigned long flags; - spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags); + spinlock_t *lock; + + TRACE_2D(TRC_SCHED_SLEEP, v->domain->domain_id, v->vcpu_id); + + lock = vcpu_schedule_lock_irqsave(v, &flags); if ( likely(!vcpu_runnable(v)) ) { @@ -392,8 +396,6 @@ void vcpu_sleep_nosync(struct vcpu *v) } vcpu_schedule_unlock_irqrestore(lock, flags, v); - - TRACE_2D(TRC_SCHED_SLEEP, v->domain->domain_id, v->vcpu_id); } void vcpu_sleep_sync(struct vcpu *v) @@ -409,7 +411,11 @@ void vcpu_sleep_sync(struct vcpu *v) void vcpu_wake(struct vcpu *v) { unsigned long flags; - spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags); + spinlock_t *lock; + + TRACE_2D(TRC_SCHED_WAKE, v->domain->domain_id, v->vcpu_id); + + lock = vcpu_schedule_lock_irqsave(v, &flags); if ( likely(vcpu_runnable(v)) ) { @@ -424,8 +430,6 @@ void vcpu_wake(struct vcpu *v) } vcpu_schedule_unlock_irqrestore(lock, flags, v); - - TRACE_2D(TRC_SCHED_WAKE, v->domain->domain_id, v->vcpu_id); } void vcpu_unblock(struct vcpu *v)