All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-ppc-devel] Oprofile kvmppc - mini howto and restrictions (atm)
@ 2008-04-04 11:01 Christian Ehrhardt
  2008-04-04 13:46 ` [kvm-ppc-devel] Oprofile kvmppc - mini howto and restrictions Hollis Blanchard
  2008-04-07  7:49 ` Christian Ehrhardt
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Ehrhardt @ 2008-04-04 11:01 UTC (permalink / raw)
  To: kvm-ppc

to sample you can use:
opcontrol --vmlinux=/root/vmlinux.host --session-dir=/mnt/usb/oprofile/
# I use that session dir to separate measurements e.g. so you can store several measurements to analyze later on

opcontrol --start	# starts profiling
opcontrol --stop	# stops but not ends profiling
opcontrol --shutdown	# stops profiling and ensures all data is flushed to the samples dir

Example:
bash-3.00# opcontrol --vmlinux=/root/vmlinux.host --session-dir=/mnt/usb/oprofile/
bash-3.00# opcontrol --start
Using 2.6+ OProfile kernel interface.
Reading module info.
Using log file /mnt/usb/oprofile//samples/oprofiled.log
Daemon started.
Profiler running.

### now I start the guest in another window - boot from ramdisk image with virtio-block&net enabled, shutdown when bootet, killed when on halt

bash-3.00# opcontrol --shutdown
Stopping profiling.
Killing daemon.

# you can now use opreport to analyze the date, use --session-dir to specify what you want to analyze.

That way for the start I sampled a boot&halt and in another sample whats still going on when the guest idles 2 minutes at the login prompt
=> Reports in the following mails

### important ###
Note the bad thing, atm oprofile on ppc440 seems not to have hw perf counters available. Therefore it is covered with the fallback timer-interrupt. But this has drawbacks:
=>from the oprfile info page:
"In 2.6 kernels on CPUs without OProfile support for the hardware performance counters, the driver falls back to using the timer interrupt for profiling. Like the RTC mode in 2.4 kernels, this is not able to profile code that has interrupts disabled. Note that there are no configuration parameters for setting this, unlike the RTC and hardware performance counter setup."

So oprofile works but without real cpu perf counters it will be nearly useless, because we have interrupts disabled in most code we want to profile. I need to look out for some beta support (or write my own) for ppc440 cpu perf counters to enable that for us :(

-- 

Grüsse / regards, 
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
kvm-ppc-devel mailing list
kvm-ppc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel

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

* Re: [kvm-ppc-devel] Oprofile kvmppc - mini howto and restrictions
  2008-04-04 11:01 [kvm-ppc-devel] Oprofile kvmppc - mini howto and restrictions (atm) Christian Ehrhardt
@ 2008-04-04 13:46 ` Hollis Blanchard
  2008-04-07  7:49 ` Christian Ehrhardt
  1 sibling, 0 replies; 3+ messages in thread
From: Hollis Blanchard @ 2008-04-04 13:46 UTC (permalink / raw)
  To: kvm-ppc

On Friday 04 April 2008 06:01:41 Christian Ehrhardt wrote:
> Note the bad thing, atm oprofile on ppc440 seems not to have hw perf
> counters available. Therefore it is covered with the fallback
> timer-interrupt. But this has drawbacks: =>from the oprfile info page:
> "In 2.6 kernels on CPUs without OProfile support for the hardware
> performance counters, the driver falls back to using the timer interrupt
> for profiling. Like the RTC mode in 2.4 kernels, this is not able to
> profile code that has interrupts disabled. Note that there are no
> configuration parameters for setting this, unlike the RTC and hardware
> performance counter setup."
>
> So oprofile works but without real cpu perf counters it will be nearly
> useless, because we have interrupts disabled in most code we want to
> profile. I need to look out for some beta support (or write my own) for
> ppc440 cpu perf counters to enable that for us :(

I don't see any performance counters in the 440 user manuals.

I think the KVM code run with interrupts disabled is mostly the interrupt 
handlers and context switching code. It would be nice to profile that, but we 
have other code too that would be good to analyze.

By the way, when timer profiling is used on code with disabled interrupts, do 
all the events seem to occur on the subsequent instruction that re-enables 
interrupts?

-- 
Hollis Blanchard
IBM Linux Technology Center

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
kvm-ppc-devel mailing list
kvm-ppc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel

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

* Re: [kvm-ppc-devel] Oprofile kvmppc - mini howto and restrictions
  2008-04-04 11:01 [kvm-ppc-devel] Oprofile kvmppc - mini howto and restrictions (atm) Christian Ehrhardt
  2008-04-04 13:46 ` [kvm-ppc-devel] Oprofile kvmppc - mini howto and restrictions Hollis Blanchard
@ 2008-04-07  7:49 ` Christian Ehrhardt
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Ehrhardt @ 2008-04-07  7:49 UTC (permalink / raw)
  To: kvm-ppc

Josh Boyer wrote:
> On Fri, 2008-04-04 at 08:46 -0500, Hollis Blanchard wrote:
>> On Friday 04 April 2008 06:01:41 Christian Ehrhardt wrote:
>>> Note the bad thing, atm oprofile on ppc440 seems not to have hw perf
>>> counters available. Therefore it is covered with the fallback
>>> timer-interrupt. But this has drawbacks: =>from the oprfile info page:
>>> "In 2.6 kernels on CPUs without OProfile support for the hardware
>>> performance counters, the driver falls back to using the timer interrupt
>>> for profiling. Like the RTC mode in 2.4 kernels, this is not able to
>>> profile code that has interrupts disabled. Note that there are no
>>> configuration parameters for setting this, unlike the RTC and hardware
>>> performance counter setup."
>>>
>>> So oprofile works but without real cpu perf counters it will be nearly
>>> useless, because we have interrupts disabled in most code we want to
>>> profile. I need to look out for some beta support (or write my own) for
>>> ppc440 cpu perf counters to enable that for us :(
>> I don't see any performance counters in the 440 user manuals.
> 
> There aren't any that I'm aware of.  The only performance monitor I've
> seen on 440 chip is for the PLB, and I don't believe that is useful for
> your purposes.
> 
> josh

Yes after checking the spec's I agree that there just is no useful perf
monitor to use for us on the core we have.
The major question Hollis already asked me is how these timers behave
when we use it to profile the code that have interrupt enabled e.g. "would
the timers that actual expire while interrupts are disabled trigger on the
code line where we enable interrupts".
Atm I'm not sure about that, but I think it will behave like that. The
timer mechanism oprofile uses does not set up an own timer, it uses
register_timer_hook which is enabled with CONFIG_PROFILING. This is
basically called for each timer_interrupt. And I think as timer interrupts,
profiling will be postponed until MSR[EE] is enabled - comments welcome.

-- 

Grüsse / regards, 
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
kvm-ppc-devel mailing list
kvm-ppc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel

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

end of thread, other threads:[~2008-04-07  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-04 11:01 [kvm-ppc-devel] Oprofile kvmppc - mini howto and restrictions (atm) Christian Ehrhardt
2008-04-04 13:46 ` [kvm-ppc-devel] Oprofile kvmppc - mini howto and restrictions Hollis Blanchard
2008-04-07  7:49 ` Christian Ehrhardt

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.