From: Dario Faggioli <dario.faggioli@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
Wei Liu <wei.liu2@citrix.com>, Olaf Hering <olaf@aepfle.de>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH 11/14] xenalyze: handle scheduling events
Date: Fri, 05 Feb 2016 19:35:22 +0100 [thread overview]
Message-ID: <20160205183522.4543.48578.stgit@Solace.station> (raw)
In-Reply-To: <20160205183137.4543.56523.stgit@Solace.station>
so the trace will show properly decoded info,
rather than just a bunch of hex codes.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Olaf Hering <olaf@aepfle.de>
---
tools/xentrace/xenalyze.c | 156 ++++++++++++++++++++++++++++++++++++---------
1 file changed, 126 insertions(+), 30 deletions(-)
diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 6520790..be698aa 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -1519,27 +1519,6 @@ struct pv_data {
};
/* Sched data */
-
-enum {
- SCHED_DOM_ADD=1,
- SCHED_DOM_REM,
- SCHED_SLEEP,
- SCHED_WAKE,
- SCHED_YIELD,
- SCHED_BLOCK,
- SCHED_SHUTDOWN,
- SCHED_CTL,
- SCHED_ADJDOM,
- SCHED_SWITCH,
- SCHED_S_TIMER_FN,
- SCHED_T_TIMER_FN,
- SCHED_DOM_TIMER_FN,
- SCHED_SWITCH_INFPREV,
- SCHED_SWITCH_INFNEXT,
- SCHED_SHUTDOWN_CODE,
- SCHED_MAX
-};
-
enum {
RUNSTATE_RUNNING=0,
RUNSTATE_RUNNABLE,
@@ -7431,6 +7410,17 @@ no_update:
return;
}
+void dump_sched_switch(struct record_info *ri)
+{
+ struct {
+ unsigned int prev_dom, prev_vcpu, next_dom, next_vcpu;
+ } * r = (typeof(r))ri->d;
+
+ printf(" %s sched_switch prev d%uv%u next d%uv%u\n",
+ ri->dump_header, r->prev_dom, r->prev_vcpu,
+ r->next_dom, r->next_vcpu);
+}
+
void sched_switch_process(struct pcpu_info *p)
{
struct vcpu_data *prev, *next;
@@ -7440,10 +7430,7 @@ void sched_switch_process(struct pcpu_info *p)
} * r = (typeof(r))ri->d;
if(opt.dump_all)
- printf("%s sched_switch prev d%uv%u next d%uv%u\n",
- ri->dump_header,
- r->prev_dom, r->prev_vcpu,
- r->next_dom, r->next_vcpu);
+ dump_sched_switch(ri);
if(r->prev_vcpu > MAX_CPUS)
{
@@ -7559,6 +7546,14 @@ void sched_summary_domain(struct domain_data *d)
}
}
+void dump_sched_vcpu_action(struct record_info *ri, const char *action)
+{
+ struct {
+ unsigned int domid, vcpuid;
+ } * r = (typeof(r))ri->d;
+
+ printf(" %s %s d%uv%u\n", ri->dump_header, action, r->domid, r->vcpuid);
+}
void sched_process(struct pcpu_info *p)
{
@@ -7573,13 +7568,114 @@ void sched_process(struct pcpu_info *p)
default:
process_generic(&p->ri);
}
- } else {
- if(ri->evt.sub == 1)
- sched_runstate_process(p);
- else {
- UPDATE_VOLUME(p, sched_verbose, ri->size);
+ return;
+ }
+
+ if(ri->evt.sub == 1) {
+ /* TRC_SCHED_MIN */
+ sched_runstate_process(p);
+ } else if (ri->evt.sub == 8) {
+ /* TRC_SCHED_VERBOSE */
+ switch(ri->event)
+ {
+ case TRC_SCHED_DOM_ADD:
+ if(opt.dump_all) {
+ struct {
+ unsigned int domid;
+ } * r = (typeof(r))ri->d;
+
+ printf(" %s domain create d%u\n", ri->dump_header, r->domid);
+ }
+ break;
+ case TRC_SCHED_DOM_REM:
+ if(opt.dump_all) {
+ struct {
+ unsigned int domid, vcpuid;
+ } * r = (typeof(r))ri->d;
+
+ printf(" %s domain destroy d%u\n", ri->dump_header, r->domid);
+ }
+ break;
+ case TRC_SCHED_SLEEP:
+ if(opt.dump_all)
+ dump_sched_vcpu_action(ri, "vcpu_sleep");
+ break;
+ case TRC_SCHED_WAKE:
+ if(opt.dump_all)
+ dump_sched_vcpu_action(ri, "vcpu_wake");
+ break;
+ case TRC_SCHED_YIELD:
+ if(opt.dump_all)
+ dump_sched_vcpu_action(ri, "vcpu_yield");
+ break;
+ case TRC_SCHED_BLOCK:
+ if(opt.dump_all)
+ dump_sched_vcpu_action(ri, "vcpu_block");
+ break;
+ case TRC_SCHED_SHUTDOWN:
+ case TRC_SCHED_SHUTDOWN_CODE:
+ if(opt.dump_all) {
+ struct {
+ unsigned int domid, vcpuid, reason;
+ } * r = (typeof(r))ri->d;
+
+ printf(" %s %s d%uv%u, reason = %u\n", ri->dump_header,
+ ri->event == TRC_SCHED_SHUTDOWN ? "sched_shutdown" :
+ "sched_shutdown_code", r->domid, r->vcpuid, r->reason);
+ }
+ break;
+ case TRC_SCHED_ADJDOM:
+ if(opt.dump_all) {
+ struct {
+ unsigned int domid;
+ } * r = (typeof(r))ri->d;
+
+ printf(" %s sched_adjust d%u\n", ri->dump_header, r->domid);
+ }
+ break;
+ case TRC_SCHED_SWITCH:
+ dump_sched_switch(ri);
+ break;
+ case TRC_SCHED_SWITCH_INFPREV:
+ if(opt.dump_all) {
+ struct {
+ unsigned int domid, runtime;
+ } * r = (typeof(r))ri->d;
+
+ printf(" %s sched_switch prev d%u, run for %u.%uus\n",
+ ri->dump_header, r->domid, r->runtime / 1000,
+ r->runtime % 1000);
+ }
+ break;
+ case TRC_SCHED_SWITCH_INFNEXT:
+ if(opt.dump_all)
+ {
+ struct {
+ unsigned int domid, rsince;
+ int slice;
+ } * r = (typeof(r))ri->d;
+
+ printf(" %s sched_switch next d%u", ri->dump_header, r->domid);
+ if ( r->rsince != 0 )
+ printf(", was runnable for %u.%uus, ", r->rsince / 1000,
+ r->rsince % 1000);
+ if ( r->slice > 0 )
+ printf("next slice %u.%uus\n", r->slice / 1000,
+ r->slice % 1000);
+ printf("\n");
+ }
+ break;
+ case TRC_SCHED_CTL:
+ case TRC_SCHED_S_TIMER_FN:
+ case TRC_SCHED_T_TIMER_FN:
+ case TRC_SCHED_DOM_TIMER_FN:
+ break;
+ default:
process_generic(&p->ri);
}
+ } else {
+ UPDATE_VOLUME(p, sched_verbose, ri->size);
+ process_generic(&p->ri);
}
}
next prev parent reply other threads:[~2016-02-05 18:35 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-05 18:33 [PATCH 00/14] Scheduling related tracing improvements Dario Faggioli
2016-02-05 18:33 ` [PATCH 01/14] xen: sched: __runq_tickle takes a useless cpu parameter Dario Faggioli
2016-02-15 16:14 ` Konrad Rzeszutek Wilk
2016-02-15 16:29 ` Dario Faggioli
2016-02-05 18:33 ` [PATCH 02/14] xen: sched: move up the trace record for vcpu_wake and vcpu_sleep Dario Faggioli
2016-02-15 16:18 ` Konrad Rzeszutek Wilk
2016-02-05 18:33 ` [PATCH 03/14] xen: sched: fi position of TRC_SCHED_DOM_{ADD, REM} Dario Faggioli
2016-02-15 16:22 ` Konrad Rzeszutek Wilk
2016-02-15 16:37 ` Dario Faggioli
2016-02-15 16:41 ` Konrad Rzeszutek Wilk
2016-02-05 18:33 ` [PATCH 04/14] xen: credit2: pack trace data better for xentrace_format Dario Faggioli
2016-02-15 16:29 ` Konrad Rzeszutek Wilk
2016-02-05 18:34 ` [PATCH 05/14] xen: RTDS: " Dario Faggioli
2016-02-15 16:31 ` Konrad Rzeszutek Wilk
2016-02-05 18:34 ` [PATCH 06/14] xen: sched: tracing: enable TSC tracing for all events Dario Faggioli
2016-02-15 16:32 ` Konrad Rzeszutek Wilk
2016-02-15 17:00 ` Dario Faggioli
2016-02-05 18:34 ` [PATCH 07/14] xentrace: formats: update format of scheduling events Dario Faggioli
2016-02-15 16:38 ` Konrad Rzeszutek Wilk
2016-02-15 16:42 ` Dario Faggioli
2016-02-05 18:34 ` [PATCH 08/14] xentrace: formats: add events from Credit scheduler Dario Faggioli
2016-02-15 16:40 ` Konrad Rzeszutek Wilk
2016-02-05 18:34 ` [PATCH 09/14] xentrace: formats: add events from Credit2 scheduler Dario Faggioli
2016-02-15 16:44 ` Konrad Rzeszutek Wilk
2016-02-05 18:35 ` [PATCH 10/14] xentrace: formats: add events from RTDS scheduler Dario Faggioli
2016-02-05 18:35 ` Dario Faggioli [this message]
2016-02-15 16:51 ` [PATCH 11/14] xenalyze: handle scheduling events Konrad Rzeszutek Wilk
2016-02-15 17:03 ` Dario Faggioli
2016-02-05 18:35 ` [PATCH 12/14] xenalyze: handle Credit1 scheduler events Dario Faggioli
2016-02-05 18:35 ` [PATCH 13/14] xenalyze: handle Credit2 " Dario Faggioli
2016-02-05 18:35 ` [PATCH 14/14] xenalyze: handle RTDS " Dario Faggioli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160205183522.4543.48578.stgit@Solace.station \
--to=dario.faggioli@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=olaf@aepfle.de \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).