From patchwork Tue Feb 16 18:11:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 8330531 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 6DA609F399 for ; Tue, 16 Feb 2016 18:14:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FDF7202AE for ; Tue, 16 Feb 2016 18:14:15 +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 55A8C20295 for ; Tue, 16 Feb 2016 18:14:14 +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 1aVk6J-0003S4-Gb; Tue, 16 Feb 2016 18:11:51 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aVk6H-0003RE-PK for xen-devel@lists.xenproject.org; Tue, 16 Feb 2016 18:11:49 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id 08/FA-07451-46663C65; Tue, 16 Feb 2016 18:11:48 +0000 X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1455646308!22305707!1 X-Originating-IP: [74.125.82.65] 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 25904 invoked from network); 16 Feb 2016 18:11:48 -0000 Received: from mail-wm0-f65.google.com (HELO mail-wm0-f65.google.com) (74.125.82.65) by server-11.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 16 Feb 2016 18:11:48 -0000 Received: by mail-wm0-f65.google.com with SMTP id a4so16749438wme.3 for ; Tue, 16 Feb 2016 10:11:48 -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=XEAKao7B+LWM2Dc0CEz1iBGVudvhhF4DlNB3XPL+XO0=; b=EvhtyBWolu9Ka9uSxNODiXmUaM978fXvZmCvjUnV4y3Y8qkWGwmu/yiFzQyf7petSj G9lBVN3WrNzM+xlAx4PFJUjR7rTyri59cdflXzMv2UDSY3OHZn0CXxrB8lsjyWLP5Vnn sZy0j7Y8QnIRr9BnSm8xA6GWLYE5A3jDbY8MQclT1z6pnu0avA06KWmku3oy/U7M+wFx 8ZTrMCKgbW55QVku/BiG4I73bx3KKTzcN4sNYnTIDRSPZ36CDzlRaBQA2jI7cggX+gxU ie8Q+HEfggisdZdjNIYI8Qi69cWS1Cu88xH5Qk71gPeFxU4Ym93zZW7rGV4hcssfDpa0 rqYA== 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=XEAKao7B+LWM2Dc0CEz1iBGVudvhhF4DlNB3XPL+XO0=; b=aPl3UNMx30Zeuel9YIQ5Bv9XnbxiWzbt1GIxI6h3CjJ+EjnDjJrkvMSd79ZDhOKPUW Cp0OfnU84h05tUoJe+Js/as42AbDnu2eTv6WYnQHmyl9YhYW8Ejoxv3pbiwK0n9CwEF4 TSF3FUbl+1sTj+XZUH0seXAiUR0quxtP/Pqjt8ZXzy0wu+9BP5CpexJVr1WNjaVbGp0i qktiK3MvZGEmRqiQLMFirJ5kq3kyBlDaMgGyLLZxYLmFuZaAU7w7PZF4VeBi439M3t6n Ho62VoBqKE1LaUFm7XmDBxgHQxf5YdWOjlD9Rcx0kBIDntmZH24pClN+9QBJq2iqZQLr 3ycQ== X-Gm-Message-State: AG10YOQNKMomG4BoU9FqGSKoi7joqwHClvp6L+uV6pt6vlhSO4Rky53MjdvMWQiclNiNcw== X-Received: by 10.28.35.66 with SMTP id j63mr21011983wmj.78.1455646308254; Tue, 16 Feb 2016 10:11:48 -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 ka4sm31353370wjc.47.2016.02.16.10.11.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2016 10:11:47 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Tue, 16 Feb 2016 19:11:45 +0100 Message-ID: <20160216181144.27876.14577.stgit@Solace.station> In-Reply-To: <20160216180550.27876.22680.stgit@Solace.station> References: <20160216180550.27876.22680.stgit@Solace.station> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Olaf Hering , Tianyang Chen , Meng Xu , George Dunlap Subject: [Xen-devel] [PATCH v2 05/16] xen: RTDS: pack trace data better for xentrace_format 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 when tracing runstate changes, the vcpu and domain IDs are encoded in the lower and higher, respectively, parts of a 32 bits integer. When decoding a trace with xentrace_format, this makes it possible to display such events like this: CPU0 833435853624 (+ 768) running_to_runnable [ dom:vcpu = 0x7fff0000 ] CPU0 833435854416 (+ 792) runnable_to_running [ dom:vcpu = 0x00000007 ] For consistency, we should do the same when displaying the events coming from the RTDS scheduler (when using the same tool), and to do that, we need to invert the order in which the fields are being put in the trace struct right now. While there, we also: - fix the use of TRC_RTDS_SCHED_TASKLET (it should only be involved when a tasklet is scheduled, not _every_ time rt_schedule() is invoked!); - remove a very chatty and useless (nothing has been picked!) use of TRC_RTDS_RUNQ_PICK. In fact, one can already figure out when nothing has been picked from the runqueue, by looking at when cpu_idle is invoked --which is the same thing one would do if on Credit or Credit2. Signed-off-by: Dario Faggioli Reviewed-by: Konrad Rzeszutek Wilk Acked-by: George Dunlap Reviewed-by: Meng Xu --- Cc: George Dunlap Cc: Meng Xu Cc: Tianyang Chen Cc: Olaf Hering --- Changes from v1: * enhanced changelog, as suggested during review. --- xen/common/sched_rt.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c index 2e5430f..53de6d6 100644 --- a/xen/common/sched_rt.c +++ b/xen/common/sched_rt.c @@ -362,7 +362,7 @@ rt_update_deadline(s_time_t now, struct rt_vcpu *svc) /* TRACE */ { struct { - unsigned dom:16,vcpu:16; + unsigned vcpu:16, dom:16; unsigned cur_deadline_lo, cur_deadline_hi; unsigned cur_budget_lo, cur_budget_hi; } d; @@ -711,7 +711,7 @@ burn_budget(const struct scheduler *ops, struct rt_vcpu *svc, s_time_t now) /* TRACE */ { struct { - unsigned dom:16, vcpu:16; + unsigned vcpu:16, dom:16; unsigned cur_budget_lo; unsigned cur_budget_hi; int delta; @@ -763,7 +763,7 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask) if( svc != NULL ) { struct { - unsigned dom:16, vcpu:16; + unsigned vcpu:16, dom:16; unsigned cur_deadline_lo, cur_deadline_hi; unsigned cur_budget_lo, cur_budget_hi; } d; @@ -777,8 +777,6 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask) sizeof(d), (unsigned char *) &d); } - else - trace_var(TRC_RTDS_RUNQ_PICK, 1, 0, NULL); } return svc; @@ -845,6 +843,7 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched if ( tasklet_work_scheduled ) { + trace_var(TRC_RTDS_SCHED_TASKLET, 1, 0, NULL); snext = rt_vcpu(idle_vcpu[cpu]); } else @@ -885,24 +884,6 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched ret.time = MIN(snext->budget, MAX_SCHEDULE); /* sched quantum */ ret.task = snext->vcpu; - /* TRACE */ - { - struct { - unsigned dom:16,vcpu:16; - unsigned cur_deadline_lo, cur_deadline_hi; - unsigned cur_budget_lo, cur_budget_hi; - } d; - d.dom = snext->vcpu->domain->domain_id; - d.vcpu = snext->vcpu->vcpu_id; - d.cur_deadline_lo = (unsigned) snext->cur_deadline; - d.cur_deadline_hi = (unsigned) (snext->cur_deadline >> 32); - d.cur_budget_lo = (unsigned) snext->cur_budget; - d.cur_budget_hi = (unsigned) (snext->cur_budget >> 32); - trace_var(TRC_RTDS_SCHED_TASKLET, 1, - sizeof(d), - (unsigned char *)&d); - } - return ret; }