All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org, George Dunlap <george.dunlap@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>, Olaf Hering <olaf@aepfle.de>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH v3 6/8] xenalyze: handle more events in sched_process
Date: Fri, 22 May 2015 08:19:37 +0000	[thread overview]
Message-ID: <1432282779-7804-7-git-send-email-olaf@aepfle.de> (raw)
In-Reply-To: <1432282779-7804-1-git-send-email-olaf@aepfle.de>

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/xentrace/xenalyze.c | 75 ++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 68 insertions(+), 7 deletions(-)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 0566d00..2300348 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -30,6 +30,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <public/trace.h>
+#include <public/sched.h>
 #include "analyze.h"
 #include "mread.h"
 #include "pv.h"
@@ -7569,24 +7570,84 @@ void sched_summary_domain(struct domain_data *d)
     }
 }
 
+void sched_class(struct record_info *ri)
+{
+    /* Just a stub for now */
+}
 
 void sched_process(struct pcpu_info *p)
 {
     struct record_info *ri = &p->ri;
 
-    if(ri->evt.sub == 0xf) {
+    if (ri->evt.sub == 1) {
+        sched_runstate_process(p);
+    } else if (ri->evt.sub == 2) {
+        sched_class(ri);
+    } else {
         switch(ri->event)
         {
+        case TRC_SCHED_DOM_ADD:
+            printf(" %s sched_add_domain d%uv%u\n",
+                   ri->dump_header, ri->d[0], ri->d[1]);
+            break;
+        case TRC_SCHED_DOM_REM:
+            printf(" %s sched_rem_domain d%uv%u\n",
+                   ri->dump_header, ri->d[0], ri->d[1]);
+            break;
+        case TRC_SCHED_SLEEP:
+            printf(" %s domain_sleep d%uv%u\n",
+                   ri->dump_header, ri->d[0], ri->d[1]);
+            break;
+        case TRC_SCHED_WAKE:
+            printf(" %s domain_wake d%uv%u\n",
+                   ri->dump_header, ri->d[0], ri->d[1]);
+            break;
+        case TRC_SCHED_YIELD:
+            printf(" %s do_yield d%uv%u\n",
+                   ri->dump_header, ri->d[0], ri->d[1]);
+            break;
+        case TRC_SCHED_BLOCK:
+            printf(" %s do_block d%uv%u\n",
+                   ri->dump_header, ri->d[0], ri->d[1]);
+            break;
+        case TRC_SCHED_SHUTDOWN:
+        {
+            static const char *reason[] = {
+                [SHUTDOWN_poweroff] = "poweroff",
+                [SHUTDOWN_reboot] = "reboot",
+                [SHUTDOWN_suspend] = "suspend",
+                [SHUTDOWN_crash] = "crash",
+                [SHUTDOWN_watchdog] = "watchdog",
+            };
+            printf(" %s domain_shutdown d%uv%u reason %x (%s)\n",
+                   ri->dump_header, ri->d[0], ri->d[1], ri->d[2],
+                   ri->d[2] > SHUTDOWN_MAX ? "unknown" : reason[ri->d[2]]);
+            break;
+        }
+        case TRC_SCHED_SHUTDOWN_CODE:
+        {
+            printf(" %s domain_shutdown_code d%uv%u reason %x\n",
+                   ri->dump_header, ri->d[0], ri->d[1], ri->d[2]);
+            break;
+        }
+        case TRC_SCHED_ADJDOM:
+            printf(" %s sched_adjdom domid d%u\n",
+                   ri->dump_header, ri->d[0]);
+            break;
         case TRC_SCHED_SWITCH:
             sched_switch_process(p);
             break;
+        case TRC_SCHED_SWITCH_INFPREV:
+            printf(" %s switch_infprev old_domid %x runtime %d\n",
+                   ri->dump_header, ri->d[0], ri->d[1]);
+            break;
+        case TRC_SCHED_SWITCH_INFNEXT:
+            printf(" %s switch_infnext new_domid %x time %d r_time %d\n",
+                   ri->dump_header, ri->d[0], ri->d[1], ri->d[2]);
+            break;
         default:
-            process_generic(&p->ri);
-        }
-    } else {
-        if(ri->evt.sub == 1)
-            sched_runstate_process(p);
-        else {
+            fprintf(warn, "%s: event:%x (min:%x sub:%x main:%x)\n",
+                    __func__, ri->event, ri->evt.minor, ri->evt.sub, ri->evt.main);
             UPDATE_VOLUME(p, sched_verbose, ri->size);
             process_generic(&p->ri);
         }

  parent reply	other threads:[~2015-05-22  8:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22  8:19 [PATCH v3 0/8] add xenalyze to staging Olaf Hering
2015-05-22  8:19 ` [PATCH v3 1/8] xenalyze: add to tools/xentrace/ Olaf Hering
2015-05-22 11:25   ` Wei Liu
2015-05-22 11:32     ` Olaf Hering
2015-05-22 11:38       ` Wei Liu
2015-05-22  8:19 ` [PATCH v3 2/8] xenalyze: increase NR_CPUS to 256 Olaf Hering
2015-05-22  8:19 ` [PATCH v3 3/8] xenalyze: print newline after unknown hvm events Olaf Hering
2015-05-22  8:19 ` [PATCH v3 4/8] xenalyze: include odd mmio states in default output Olaf Hering
2015-05-22  8:19 ` [PATCH v3 5/8] xenalyze: handle TRC_TRACE_WRAP_BUFFER Olaf Hering
2015-05-22  8:19 ` Olaf Hering [this message]
2015-05-22 11:19   ` [PATCH v3 6/8] xenalyze: handle more events in sched_process Wei Liu
2015-05-22  8:19 ` [PATCH v3 7/8] xenalyze: remove traling whitespaces Olaf Hering
2015-05-22  8:19 ` [PATCH v3 8/8] xenalyze: remove argp_program_version Olaf Hering
2015-05-22 11:15   ` Wei Liu

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=1432282779-7804-7-git-send-email-olaf@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.