Skip to contentSkip to conversation

kvmppc: full instruction

PATCH Hollis Blanchard 2 participants 4 messages Apr 14, 2008 – Apr 15, 2008

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines · On Monday 14 April 2008 07:23:57 [email protected] wrote:

From: Christian Ehrhardt <[email protected]>

This adds a relayfs based kernel interface that allows tracing of all emulated guest instructions. It is based on Hollis tracing of tlb activities. A suitable userspace program to read from that interface and a post processing script that give users a readable output follow. This feature is configurable in .config under the kvmppc virtualization itself.

I'm not sure how I feel about logging *every* faulting instruction, rather than aggregating statistics about them. Actually, I know how I feel, and it's uncomfortable. :)

It's a userspace process that must be extracting this data from the relay buffers, and that only happens when it's scheduled. How many instruction exits could we get in a few timeslices? I think we could easily overflow the relay buffers, especially if the host is under load.

Review

Quoted 8 lines
(quoted diff) +8 -0
+struct instr_record {
+       u32 time;
+       u32 pc;
+       u32 instr;
+       u32 rsval;
+       u32 raval;
+       u32 rbval;
+};

In addition to the instruction itself, I can see how the PC would be useful, and maybe also the time when we have multiple cores. (Well, or maybe it would be better to have one channel per core anyways.) But I think RS/RA/RB are way overkill here. What would a userspace tool do with this data anyways?

Signature · 12 lines
Hollis Blanchard
IBM Linux Technology Center

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-ppc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel
#1 lore raw
Quoted 10 lines · Hollis Blanchard
Quoted 8 lines · On Monday 14 April 2008 07:23:57 [email protected] wrote:

From: Christian Ehrhardt <[email protected]>

This adds a relayfs based kernel interface that allows tracing of all emulated guest instructions. It is based on Hollis tracing of tlb activities. A suitable userspace program to read from that interface and a post processing script that give users a readable output follow. This feature is configurable in .config under the kvmppc virtualization itself.

Quoted 8 lines

I'm not sure how I feel about logging *every* faulting instruction, rather than aggregating statistics about them. Actually, I know how I feel, and it's uncomfortable. :)

It's a userspace process that must be extracting this data from the relay buffers, and that only happens when it's scheduled. How many instruction exits could we get in a few timeslices? I think we could easily overflow the relay buffers, especially if the host is under load.

The patch series intentionally has two instruction statistics.
One for low overhead giving you just some counters, and additionally we can extend these counters as we want e.g. with sprn numbers.
The other is to enable knowingly a high overhead profiling, but it gives you a full trace which can be used e.g. to completely see "what exactly is the guest doing there" by looking at which instructions are emulated in which order. So both have there right to exist, because there are use scenarios for both of them. By making them configurable it is developers choice what to use.

Quoted 5 lines
Quoted 5 lines
(quoted diff) +5 -0
+struct instr_record {
+       u32 time;
+       u32 pc;
+       u32 instr;
+       u32 rsval;
Quoted 9 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+       u32 raval;
+       u32 rbval;
+};

In addition to the instruction itself, I can see how the PC would be useful, and maybe also the time when we have multiple cores. (Well, or maybe it would be better to have one channel per core anyways.) But I think RS/RA/RB are way overkill here. What would a userspace tool do with this data anyways?

The decoding scripts shows you what values are used e.g. for a mtmsr you see what value was moved to the register. But I agree that the value of r*val is much smaller than time,pc,instr.
Removing these three should speed it up to allow us tracing all instructions.
I will change the patch and resend it.

Signature · 13 lines
Grüsse / regards, 
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-ppc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel
#2 lore raw
In reply to Hollis Blanchard
Quoted 9 lines · On Tuesday 15 April 2008 01:20:48 Christian Ehrhardt wrote:
Quoted 8 lines

I'm not sure how I feel about logging *every* faulting instruction, rather than aggregating statistics about them. Actually, I know how I feel, and it's uncomfortable. :)

It's a userspace process that must be extracting this data from the relay buffers, and that only happens when it's scheduled. How many instruction exits could we get in a few timeslices? I think we could easily overflow the relay buffers, especially if the host is under load.

Quoted 8 lines

The patch series intentionally has two instruction statistics. One for low overhead giving you just some counters, and additionally we can extend these counters as we want e.g. with sprn numbers. The other is to enable knowingly a high overhead profiling, but it gives you a full trace which can be used e.g. to completely see "what exactly is the guest doing there" by looking at which instructions are emulated in which order. So both have there right to exist, because there are use scenarios for both of them. By making them configurable it is developers choice what to use.

I guess it can be useful to see what's happening when a guest is getting "stuck".

However, there are other interesting events to account for in this case as well, such as the TLB tracing I posted earlier. I think it makes sense to include all of those events in the same relay channel, rather than having one channel for instructions, one for TLB, etc.

Quoted 15 lines
Quoted 6 lines
Quoted 6 lines

+struct instr_record {
+       u32 time;
+       u32 pc;
+       u32 instr;
+       u32 rsval;
+       u32 raval;

Quoted 8 lines
Quoted 2 lines

+       u32 rbval;
+};

In addition to the instruction itself, I can see how the PC would be useful, and maybe also the time when we have multiple cores. (Well, or maybe it would be better to have one channel per core anyways.) But I think RS/RA/RB are way overkill here. What would a userspace tool do with this data anyways?

Quoted 5 lines

The decoding scripts shows you what values are used e.g. for a mtmsr you see what value was moved to the register. But I agree that the value of r*val is much smaller than time,pc,instr. Removing these three should speed it up to allow us tracing all instructions. I will change the patch and resend it.

Does that really speed it up? I wouldn't expect a measurable difference.

Signature · 12 lines
Hollis Blanchard
IBM Linux Technology Center

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-ppc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel
#3 lore raw
In reply to Hollis Blanchard
Quoted 10 lines · On Monday 14 April 2008 07:23:57 [email protected] wrote:

From: Christian Ehrhardt <[email protected]>

This adds a relayfs based kernel interface that allows tracing of all emulated guest instructions. It is based on Hollis tracing of tlb activities. A suitable userspace program to read from that interface and a post processing script that give users a readable output follow. This feature is configurable in .config under the kvmppc virtualization itself.

By the way, check out the new kvm_trace stuff checked in to kvm.git last week. Looks like we'll probably want to use that.

Signature · 12 lines
Hollis Blanchard
IBM Linux Technology Center

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-ppc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel