xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Question about xentrace to trace s_time_t type of data
@ 2014-08-24  3:24 Meng Xu
  2014-08-25 13:31 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 8+ messages in thread
From: Meng Xu @ 2014-08-24  3:24 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org; +Cc: George Dunlap, Dario Faggioli


[-- Attachment #1.1: Type: text/plain, Size: 2498 bytes --]

Hi,

I'm trying to trace the scheduler-specific events for debug purpose by
using xentrace (instead of using printk). I read the trace code in credit
and credit2 scheduler (sched_credit.c and sched_credit2.c) and "followed"
the way credit2 wrote.

I added the following code into the burn_budget() in my scheduler file,
sched_rt.c:

        /* TRACE */

        {

            struct {

                unsigned dom:16,vcpu:16;

                s_time_t cur_budget;

            } d;

            d.dom = svc->vcpu->domain->domain_id;

            d.vcpu = svc->vcpu->vcpu_id;

            d.cur_budget = svc->cur_budget;

            trace_var(TRC_RT_BUDGET_REPLENISH, 1,

                      sizeof(d),

                      (unsigned char *) &d);

        }

​The result I got from "xenanalyze --dump-all"​ for this event is (I only
show one entry):

]  0.285656366 x-|- d0v1   22804(2:2:804) 4 [ 00010000 ffff82d0 003d0900
00000000 ]

​What I'm confused is the meaning of "[ 00010000 ffff82d0 003d0900 00000000
]":

I can understand that 00010000 represents dom 0's vcpu 1. But I don't know
how to interpret the rest of numbers "ffff82d0 003d0900 00000000".

The cur_budget traced should always be 4000000. So the expected result
should be the hex value of 4000000.

*My question is:*
1) How should I interpret the    "ffff82d0 003d0900 00000000 " to be
"4000000"?
2) Why does it has three more 32bits in "[ 00010000 ffff82d0 003d0900
00000000 ]" instead of just two? (since s_time_t is a signed 64 bit type)

It seems that xentrace just dump this struct d to a file and xenalyze just
print it out one by one (and each item is 32bit). In my opinion, the output
in [ ... ]​ should have only three 32bit-size fields instead of 4. I'm not
sure where it goes wrong.

I also tried to change the struct d to

 struct {

                unsigned dom:16,vcpu:16;

                unsigned cur_budget_lo;

                unsigned cur_budget_hi;

            } d;
​and it give me expected output, which has only three 32bit-size fields in
[ ... ] in  xenalyze's output​.

So I'm guessing I should not use a field larger than 32bit in the trace
struct d. But I'm not sure about the reason. Could any one give me some
insight?

Thank you very much for your time and help in this question!

Best,

Meng


-----------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania

[-- Attachment #1.2: Type: text/html, Size: 5228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-09-01 15:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-24  3:24 Question about xentrace to trace s_time_t type of data Meng Xu
2014-08-25 13:31 ` Konrad Rzeszutek Wilk
2014-08-25 15:14   ` Meng Xu
2014-08-25 15:20     ` Konrad Rzeszutek Wilk
2014-08-25 16:22       ` Meng Xu
2014-08-25 16:39         ` Konrad Rzeszutek Wilk
2014-08-25 19:34           ` Meng Xu
2014-09-01 15:23   ` George Dunlap

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).