Skip to contentSkip to conversation

Questions about OProfile

DISCUSSION W. Michael Petullo 3 participants 8 messages Apr 5, 2011 – Apr 18, 2011

lore
Share & tools
lore
#0 lore raw

The Xenoprof page, http://xenoprof.sourceforge.net/, asks that OProfile-related questions be sent to the xen-devel mailing list.

I am interested in passive domain profiling using OProfile. I have downloaded the 0.9.5 patch, modified it so it applies against 0.9.6 and built OProfile for Fedora [1]. I have not yet had success performing passive profiling of a DomU. I am using "Tutorial: Profiling in Xen" by J. Renato Santos and have some questions.

First, what is the status of Xenoprof? The latest patch is against 0.9.5, but OProfile 0.9.6 is about 16 months old. Is Xenoprof actively maintained?

Second, should I expect Xenoprof to work with Linux 2.6.38 and Xen 4.1? I have observed the following:

No Xen: works fine.

Xen Dom0: receive "error: no sample files found: profile specification too strict."

Xen Dom0, module option timer=1: profiling Dom0 works fine but I don't see any statistics from DomU; I also see "/usr/bin/opcontrol: line 1430: /dev/oprofile/passive_domains:
Permission denied" In fact, /dev/oprofile/passive_domains does not exist. Has the kernel dropped support for the passive profiling of domains?

[1] https://bugzilla.redhat.com/show_bug.cgi?id=693596

Signature · 3 lines
Mike

:wq
#1 lore raw
Quoted 5 lines · W. Michael Petullo

First, what is the status of Xenoprof? The latest patch is against 0.9.5, but OProfile 0.9.6 is about 16 months old. Is Xenoprof actively maintained?

There is a crufty pv_ops patch that I forward ported to 2.6.32 in this tree:

https://github.com/avsm/linux-2.6.32-xen-oprofile

It's not suitable for upstreaming, but passive profiling of domains works fine for me using this kernel. Ian Pratt suggested dropping active profiling in order to simplify the patch: does anyone actually use active profiling?

Jeremy also pointed out the new perf framework in Linux to me at the hackathon, but I haven't had a chance to look at how it works:
https://perf.wiki.kernel.org/index.php/Main_Page

-anil

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 7 lines
Quoted 3 lines

First, what is the status of Xenoprof? The latest patch is against 0.9.5, but OProfile 0.9.6 is about 16 months old. Is Xenoprof actively maintained?

There is a crufty pv_ops patch that I forward ported to 2.6.32 in this tree:

https://github.com/avsm/linux-2.6.32-xen-oprofile

So, is it true that I need to 1) use this patch or 2) use a non-PV Ops Dom0? I thought 2.6.32 was already non-PV Ops.

Quoted 4 lines

It's not suitable for upstreaming, but passive profiling of domains works fine for me using this kernel. Ian Pratt suggested dropping active profiling in order to simplify the patch: does anyone actually use active profiling?

I am especially interested in passive profiling because I wish to profile experimental kernels. Developing on top of Xen is a big win for this type of work precisely because of tools like gdbsx and passive profiling. With this capability, there is no need to spend time adding debugging or profiling features into a new kernel.

Quoted 4 lines

Jeremy also pointed out the new perf framework in Linux to me at the hackathon, but I haven't had a chance to look at how it works:

https://perf.wiki.kernel.org/index.php/Main_Page

Signature · 3 lines
Mike

:wq
#3 lore raw
Quoted 10 lines · W. Michael Petullo
Quoted 7 lines
Quoted 3 lines

First, what is the status of Xenoprof? The latest patch is against 0.9.5, but OProfile 0.9.6 is about 16 months old. Is Xenoprof actively maintained?

There is a crufty pv_ops patch that I forward ported to 2.6.32 in this tree:

https://github.com/avsm/linux-2.6.32-xen-oprofile

So, is it true that I need to 1) use this patch or 2) use a non-PV Ops Dom0? I thought 2.6.32 was already non-PV Ops.

I don't understand the question. The above tree is a pv_ops kernel, with additional patches applied so it can be a full Xen dom0 (including netback, etc). I'm only sporadically updating it as I need to, so you probably just want the oprofile patch [1] if you want to apply it to some other kernel.

https://github.com/avsm/linux-2.6.32-xen-oprofile/commit/4df4780e638d14249b7aa4005511218a9183c324

-anil

#4 lore raw
Quoted 11 lines
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines

First, what is the status of Xenoprof? The latest patch is against 0.9.5, but OProfile 0.9.6 is about 16 months old. Is Xenoprof actively maintained?

There is a crufty pv_ops patch that I forward ported to 2.6.32 in this tree:

https://github.com/avsm/linux-2.6.32-xen-oprofile

So, is it true that I need to 1) use this patch or 2) use a non-PV Ops Dom0? I thought 2.6.32 was already non-PV Ops.

Quoted 7 lines

I don't understand the question. The above tree is a pv_ops kernel, with additional patches applied so it can be a full Xen dom0 (including netback, etc). I'm only sporadically updating it as I need to, so you probably just want the oprofile patch [1] if you want to apply it to some other kernel.

https://github.com/avsm/linux-2.6.32-xen-oprofile/commit/4df4780e638d14249b7aa4005511218a9183c324

Thanks, Anil. I was able to get your patch to work. If anyone is interested in what I did, please see:

	https://bugzilla.redhat.com/show_bug.cgi?id=693596#c2

An a related note, would there be any interest in cleaning up this patch and moving it to 2.6.38 as a part of Google Summer of Code?

Signature · 3 lines
Mike

:wq
#5 lore raw
Quoted 19 lines · W. Michael Petullo
Quoted 11 lines
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines

First, what is the status of Xenoprof? The latest patch is against 0.9.5, but OProfile 0.9.6 is about 16 months old. Is Xenoprof actively maintained?

There is a crufty pv_ops patch that I forward ported to 2.6.32 in this tree:

https://github.com/avsm/linux-2.6.32-xen-oprofile

So, is it true that I need to 1) use this patch or 2) use a non-PV Ops Dom0? I thought 2.6.32 was already non-PV Ops.

Quoted 7 lines

I don't understand the question. The above tree is a pv_ops kernel, with additional patches applied so it can be a full Xen dom0 (including netback, etc). I'm only sporadically updating it as I need to, so you probably just want the oprofile patch [1] if you want to apply it to some other kernel.

https://github.com/avsm/linux-2.6.32-xen-oprofile/commit/4df4780e638d14249b7aa4005511218a9183c324

Quoted 7 lines

Thanks, Anil. I was able to get your patch to work. If anyone is interested in what I did, please see:

	https://bugzilla.redhat.com/show_bug.cgi?id=693596#c2

An a related note, would there be any interest in cleaning up this patch and moving it to 2.6.38 as a part of Google Summer of Code?

There would be interest in getting it cleaned up for 2.6.38.

I don't think it could be done under GSOC - it looks like it would just take a week for it to be done.

#6 lore raw
In reply to Anil Madhavapeddy
Quoted 11 lines
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines

First, what is the status of Xenoprof? The latest patch is against 0.9.5, but OProfile 0.9.6 is about 16 months old. Is Xenoprof actively maintained?

There is a crufty pv_ops patch that I forward ported to 2.6.32 in this tree:

https://github.com/avsm/linux-2.6.32-xen-oprofile

So, is it true that I need to 1) use this patch or 2) use a non-PV Ops Dom0? I thought 2.6.32 was already non-PV Ops.

Quoted 7 lines

I don't understand the question. The above tree is a pv_ops kernel, with additional patches applied so it can be a full Xen dom0 (including netback, etc). I'm only sporadically updating it as I need to, so you probably just want the oprofile patch [1] if you want to apply it to some other kernel.

https://github.com/avsm/linux-2.6.32-xen-oprofile/commit/4df4780e638d14249b7aa4005511218a9183c324

I ported Anil's patch to Linux 2.6.38. The result is available at:

	http://www.flyn.org/patches/linux-2.6.38-xen-passive-oprofile/linux-2.6.38-xen-passive-oprofile.patch.gz

With this patch applied to Linux 2.6.38 (along with various orthagonal Xen patches), I can perform passive profiling on an unprivileged Xen domain.

Signature · 3 lines
Mike

:wq
#7 lore raw
Quoted 17 lines · W. Michael Petullo
Quoted 17 lines
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines

First, what is the status of Xenoprof? The latest patch is against 0.9.5, but OProfile 0.9.6 is about 16 months old. Is Xenoprof actively maintained?

There is a crufty pv_ops patch that I forward ported to 2.6.32 in this tree:

https://github.com/avsm/linux-2.6.32-xen-oprofile

So, is it true that I need to 1) use this patch or 2) use a non-PV Ops Dom0? I thought 2.6.32 was already non-PV Ops.

I don't understand the question. The above tree is a pv_ops kernel, with additional patches applied so it can be a full Xen dom0 (including netback, etc). I'm only sporadically updating it as I need to, so you probably just want the oprofile patch [1] if you want to apply it to some other kernel.

Quoted 8 lines
Quoted 1 line

https://github.com/avsm/linux-2.6.32-xen-oprofile/commit/4df4780e638d14249b7aa4005511218a9183c324

I ported Anil's patch to Linux 2.6.38. The result is available at:

	http://www.flyn.org/patches/linux-2.6.38-xen-passive-oprofile/linux-2.6.38-xen-passive-oprofile.patch.gz

With this patch applied to Linux 2.6.38 (along with various orthagonal Xen patches), I can perform passive profiling on an unprivileged Xen domain.

Woot! Awesome. For fun I tried to stick on 2.6.39, but got this:

patch -p1 --dry-run < ~/linux-2.6.38-xen-passive-oprofile.patch
patching file arch/x86/include/asm/xen/hypercall.h
Hunk #1 succeeded at 447 (offset 7 lines).
patching file arch/x86/oprofile/Makefile
patching file arch/x86/oprofile/xenoprof.c
patching file arch/x86/xen/mmu.c
Hunk #1 succeeded at 2349 (offset 55 lines).
Hunk #2 succeeded at 2381 (offset 55 lines).
Hunk #3 succeeded at 2403 with fuzz 1 (offset 55 lines).
patching file drivers/oprofile/buffer_sync.c
patching file drivers/oprofile/cpu_buffer.c
Hunk #5 FAILED at 259.
Hunk #6 FAILED at 275.
Hunk #7 FAILED at 408.
Hunk #8 succeeded at 448 (offset 10 lines).
3 out of 8 hunks FAILED -- saving rejects to file drivers/oprofile/cpu_buffer.c.rej patching file drivers/oprofile/cpu_buffer.h
patching file drivers/oprofile/event_buffer.h
patching file drivers/oprofile/oprof.c
patching file drivers/oprofile/oprof.h
patching file drivers/oprofile/oprofile_files.c
patching file drivers/xen/xenoprof/xenoprofile.c
patching file include/linux/oprofile.h
Hunk #4 succeeded at 130 (offset 7 lines).
patching file include/xen/interface/xen.h
patching file include/xen/interface/xenoprof.h
patching file include/xen/xenoprof.h
patching file include/xen/xen-ops.h

And looking at the code it would require some little help in cpu_buffer depatment.

It definitly has a lot of #ifdef CONFIG_XEN in it.. you wouldn't be by any chance signing up for also trying to upstream it?