User/kernel mode support in the various platforms
Carl Love <[email protected]>
| Newsgroups | gmane.linux.oprofile |
|---|---|
| Message-ID | <[email protected]> |
If you would let me know if the architecture you work on supports or
does not support user and kernel mode profiling, it would be greatly
appreciated. Please run "uname -m" and let me know what the string
says so I can get the correct string into the patch.
I need the information for a patch that I am working on OProfile
testsuite to skip the user/kernel scaling tests if the architecture
doesn't support data in user mode only and kernel mode only.
Thanks.
Carl Love
------------------------------------------------------------------
Oprofile-test, skip mode selection tests if not supported.
Event counts may occur when the system is running in user mode, kernel
mode or hypervisor modes. Some architectures have settings that allow
the user to select which modes the events should be collected. The
testsuite contains tests to make sure sum of counting in each of the modes
individually is the same as counting in each mode simultaneously. This
patch skips these tests for architectures that do not support mode selection
Signed-off-by: Carl Love <[email protected]>
---
testsuite/lib/ocount_util.exp | 21 +++++++++++++++++++++
testsuite/oprofile-ocount/ocount-run.exp | 14 ++++++++++++++
2 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/testsuite/lib/ocount_util.exp b/testsuite/lib/ocount_util.exp
index c8913f2..33da187 100644
--- a/testsuite/lib/ocount_util.exp
+++ b/testsuite/lib/ocount_util.exp
@@ -196,3 +196,24 @@ proc ocount_get_version {} {
operf_ocount_get_version "ocount"
set ocount_version $operf_ocount_version
}
+
+proc arch_does_not_support_exclusive_mode_settings {} {
+ set line [lindex [split [local_exec "uname -m" "" "" 10] "\{" ] 1]
+ set arch [string trim $line " \}\n\r"]
+
+ # Event counts may occur when the system is running in user mode, kernel
+ # mode or hypervisor modes. Some architectures have settings that allow
+ # the user to select which modes the events should be collected in. Return
+ # 0 if the architecture being tested does support selecting the mode
+ # to collect the counts in, otherwise, return 1.
+
+ if {[ regexp "x86_64" $arch ] == 1 } {
+ return 0
+ }
+
+ if {[ regexp "ppc64" $arch ] == 1 } {
+ return 0
+ }
+
+ return 1
+}
diff --git a/testsuite/oprofile-ocount/ocount-run.exp b/testsuite/oprofile-ocount/ocount-run.exp
index 9c75fda..92e1726 100644
--- a/testsuite/oprofile-ocount/ocount-run.exp
+++ b/testsuite/oprofile-ocount/ocount-run.exp
@@ -157,6 +157,20 @@ proc do_test_ocount_scaling {workload_exec} {
proc do_test_ocount_modes {workload_exec} {
global ocount_version
+ # This test counts the events that occur in user mode, then for kernel
+ # mode and then in hypervisor mode. The test then counts the number of
+ # events when all three modes are selected. The count with all three
+ # modes selected is then compared to the sum of the counts when each
+ # mode was counted individually to see if they agree. This test is
+ # only run on architectures that allow the counts to be collected in
+ # based on a selected mode.
+
+ if {[arch_does_not_support_exclusive_mode_settings] == 1} {
+ send "\nNote: Architecture does not support User, Kernel, Hypervisor\n"
+ send "mode selection. Skipping mode scaling tests.\n"
+ return
+ }
+
# The actual result is expected to be within the following percent of the
# actual count
set percent 5
--
1.7.1
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk