Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn

2010-08-24 Thread Chen Cao
On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote:
  On 08/24/2010 03:07 PM, Isaku Yamahata wrote:
 On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote:
   On 08/24/2010 02:35 PM, Isaku Yamahata wrote:
 Add Cc: m...@redhat.com.
 
 MAX_PCI_SLOTS should be in pci.h instead of qdev.h?
 And the name should be start with PCI_ prefix for consistency?
 
 Except that, the patches look okay.
 
 These aren't slots, are they?  They are functions.
 The function checks if given $slot.$fn (or $slot) is valid.
 So it's slots. max 32.
 
 +assert(devfn  PCIBUS_MAX_DEVICES);
 
 
 Looks like we're comparing a function number to PCIBUS_MAX_DEVICES.
 

PCIBUS_MAX_DEVICES is the size of PCIBus.devices[], I have added it in
the first patch at the defination of struct PCIBus, line 50 hw/pci.c.
so i think the better name of the macro should be PCIBUS_MAX_FN,
right?


Ken

 -- 
 error compiling committee.c: too many arguments to function
 
 --
 To unsubscribe from this list: send the line unsubscribe kvm in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files

2010-07-07 Thread Chen Cao
Michael,

Can rss provide some log (files)?

Cao, Chen

On Wed, Jul 07, 2010 at 01:32:17PM +0300, Michael Goldish wrote:
 Signed-off-by: Michael Goldish mgold...@redhat.com
 ---
  client/tests/kvm/deps/rss.cpp |3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)
 
 diff --git a/client/tests/kvm/deps/rss.cpp b/client/tests/kvm/deps/rss.cpp
 index 26c5ed6..8df70e4 100644
 --- a/client/tests/kvm/deps/rss.cpp
 +++ b/client/tests/kvm/deps/rss.cpp
 @@ -976,8 +976,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE 
 hPrevInstance,
  if (!hMainWindow)
  ExitOnError(Could not create window);
  
 -//ShowWindow(hMainWindow, SW_SHOWMINNOACTIVE);
 -ShowWindow(hMainWindow, SW_SHOW);
 +ShowWindow(hMainWindow, SW_SHOWMINNOACTIVE);
  UpdateWindow(hMainWindow);
  
  // Main message loop
 -- 
 1.5.4.1
 
 ___
 Autotest mailing list
 autot...@test.kernel.org
 http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

-- 
Regards,

Cao, Chen

GnuPG Key-ID:AC54E05E
keyserver hkp://keys.gnupg.net
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [KVM-AUTOTEST PATCH] KVM test: Windows unattended_install: don't start the telnet service at startup

2010-06-28 Thread Chen Cao
On Mon, Jun 28, 2010 at 05:54:18PM +0300, Michael Goldish wrote:
 The telnet service isn't used by kvm-autotest (AFAIK) and may interfere with
 rss.exe (port 23).
 

Michael,

I think it is better to leave the port 23 (and also 22) alone, people
may want to use both telnet (e.g. telnet is integrited into some
testing tools and/or some other reasons) and rss.exe.
and rss.exe could use other port and we can configure the port NR
through the config file of kvm-autotest to use it.


Regards,

Cao, Chen
2010/06/29

 Signed-off-by: Michael Goldish mgold...@redhat.com
 ---
  client/tests/kvm/unattended/win2003-32.sif |   10 +++-
  client/tests/kvm/unattended/win2003-64.sif |   10 +++-
  .../kvm/unattended/win2008-32-autounattend.xml |   18 ++-
  .../kvm/unattended/win2008-64-autounattend.xml |   18 ++-
  .../kvm/unattended/win2008-r2-autounattend.xml |   18 ++-
  .../tests/kvm/unattended/win7-32-autounattend.xml  |   22 ---
  .../tests/kvm/unattended/win7-64-autounattend.xml  |   22 ---
  .../kvm/unattended/winvista-32-autounattend.xml|   18 ++-
  .../kvm/unattended/winvista-64-autounattend.xml|   18 ++-
  9 files changed, 33 insertions(+), 121 deletions(-)
 
 diff --git a/client/tests/kvm/unattended/win2003-32.sif 
 b/client/tests/kvm/unattended/win2003-32.sif
 index f58b0b0..d1e8495 100644
 --- a/client/tests/kvm/unattended/win2003-32.sif
 +++ b/client/tests/kvm/unattended/win2003-32.sif
 @@ -56,9 +56,7 @@
  YResolution=768
  
  [GuiRunOnce]
 -Command0=cmd /c sc config TlntSvr start= auto
 -Command1=cmd /c netsh firewall set opmode disable
 -Command2=cmd /c net start telnet
 -Command3=cmd /c E:\setuprss.bat
 -Command4=cmd /c netsh interface ip set address local dhcp
 -Command5=cmd /c ping 10.0.2.2 -n 20  A:\finish.exe
 +Command0=cmd /c netsh firewall set opmode disable
 +Command1=cmd /c E:\setuprss.bat
 +Command2=cmd /c netsh interface ip set address local dhcp
 +Command3=cmd /c ping 10.0.2.2 -n 20  A:\finish.exe
 diff --git a/client/tests/kvm/unattended/win2003-64.sif 
 b/client/tests/kvm/unattended/win2003-64.sif
 index f58b0b0..d1e8495 100644
 --- a/client/tests/kvm/unattended/win2003-64.sif
 +++ b/client/tests/kvm/unattended/win2003-64.sif
 @@ -56,9 +56,7 @@
  YResolution=768
  
  [GuiRunOnce]
 -Command0=cmd /c sc config TlntSvr start= auto
 -Command1=cmd /c netsh firewall set opmode disable
 -Command2=cmd /c net start telnet
 -Command3=cmd /c E:\setuprss.bat
 -Command4=cmd /c netsh interface ip set address local dhcp
 -Command5=cmd /c ping 10.0.2.2 -n 20  A:\finish.exe
 +Command0=cmd /c netsh firewall set opmode disable
 +Command1=cmd /c E:\setuprss.bat
 +Command2=cmd /c netsh interface ip set address local dhcp
 +Command3=cmd /c ping 10.0.2.2 -n 20  A:\finish.exe
 diff --git a/client/tests/kvm/unattended/win2008-32-autounattend.xml 
 b/client/tests/kvm/unattended/win2008-32-autounattend.xml
 index 44a9fc4..74f99b1 100644
 --- a/client/tests/kvm/unattended/win2008-32-autounattend.xml
 +++ b/client/tests/kvm/unattended/win2008-32-autounattend.xml
 @@ -116,30 +116,18 @@
   FirstLogonCommands
   SynchronousCommand wcm:action=add
   Order1/Order
 - CommandLine%WINDIR%\System32\cmd /c 
 start /w pkgmgr /iu:TelnetServer/CommandLine
 - /SynchronousCommand
 - SynchronousCommand wcm:action=add
 - Order2/Order
 - CommandLine%WINDIR%\System32\cmd /c 
 sc config TlntSvr start= auto/CommandLine
 - /SynchronousCommand
 - SynchronousCommand wcm:action=add
 - Order3/Order
   CommandLine%WINDIR%\System32\cmd /c 
 netsh firewall set opmode disable/CommandLine
   /SynchronousCommand
   SynchronousCommand wcm:action=add
 - Order4/Order
 - CommandLine%WINDIR%\System32\cmd /c 
 net start telnet/CommandLine
 - /SynchronousCommand
 - SynchronousCommand wcm:action=add
 - Order5/Order
 + Order2/Order
   CommandLine%WINDIR%\System32\cmd /c 
 E:\setuprss.bat/CommandLine
   /SynchronousCommand
   SynchronousCommand wcm:action=add
 - Order6/Order
 + Order3/Order
   CommandLine%WINDIR%\System32\cmd 

[KVM-AUTOTEST PATCH 0/2] Make autoit wrapper support more guest scripts than just AutoIt

2010-06-18 Thread Chen Cao
Just rename variables and the file, the wrapper itself can support other
scripts already.

---

Chen Cao (2):
  KVM-test: autoit: Generalize the variables in autoit.py
  KVM-test: rename autoit to guest_test and update the sample config file


 client/tests/kvm/tests/autoit.py   |   91 ---
 client/tests/kvm/tests/guest_test.py   |   94 
 client/tests/kvm/tests_base.cfg.sample |   37 -
 3 files changed, 118 insertions(+), 104 deletions(-)
 delete mode 100644 client/tests/kvm/tests/autoit.py
 create mode 100644 client/tests/kvm/tests/guest_test.py

-- 
Signature
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[KVM-AUTOTEST PATCH 1/2] KVM-test: autoit: Generalize the variables in autoit.py

2010-06-18 Thread Chen Cao
The autoit.py wrapper can actually support guest scripts more than
AutoIt, so generalize the variables in it.

Signed-off-by: Chen Cao k...@redhat.com
---
 client/tests/kvm/tests/autoit.py   |   27 +++
 client/tests/kvm/tests_base.cfg.sample |   10 +-
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/client/tests/kvm/tests/autoit.py b/client/tests/kvm/tests/autoit.py
index e3fa6f6..0373f38 100644
--- a/client/tests/kvm/tests/autoit.py
+++ b/client/tests/kvm/tests/autoit.py
@@ -5,10 +5,10 @@ import kvm_utils, kvm_test_utils
 
 def run_autoit(test, params, env):
 
-A wrapper for AutoIt scripts.
+A wrapper for running customized tests in guests.
 
 1) Log into a guest.
-2) Run AutoIt script.
+2) Run script.
 3) Wait for script execution to complete.
 4) Pass/fail according to exit status of script.
 
@@ -30,12 +30,13 @@ def run_autoit(test, params, env):
 logging.info(Starting script...)
 
 # Collect test parameters
-binary = params.get(autoit_binary)
-script = params.get(autoit_script)
-autoit_entry = params.get(autoit_entry, script.au3)
-script_params = params.get(autoit_script_params, )
-timeout = float(params.get(autoit_script_timeout, 600))
+interpreter = params.get(interpreter)
+script = params.get(guest_script)
+dst_rsc_path = params.get(dst_rsc_path, script.au3)
+script_params = params.get(script_params, )
+test_timeout = float(params.get(test_timeout, 600))
 
+logging.debug(Starting preparing resouce files...)
 # Download the script resource from a remote server, or
 # prepare the script using rss?
 if params.get(download) == yes:
@@ -44,16 +45,16 @@ def run_autoit(test, params, env):
 rsc_dir = os.path.basename(rsc_server)
 dst_rsc_dir = params.get(dst_rsc_dir)
 
-# Change dir to dst_rsc_dir, and remove 'autoit' there,
+# Change dir to dst_rsc_dir, and remove the guest script dir there
 rm_cmd = cd %s  (rmdir /s /q %s || del /s /q %s) % \
  (dst_rsc_dir, rsc_dir, rsc_dir)
-if session.get_command_status(rm_cmd, timeout=timeout) != 0:
+if session.get_command_status(rm_cmd, timeout=test_timeout) != 0:
 raise error.TestFail(Remove %s failed. % rsc_dir)
 logging.debug(Clean directory succeeded.)
 
 # then download the resource.
 rsc_cmd = cd %s  %s %s %(dst_rsc_dir, download_cmd, rsc_server)
-if session.get_command_status(rsc_cmd, timeout=timeout) != 0:
+if session.get_command_status(rsc_cmd, timeout=test_timeout) != 0:
 raise error.TestFail(Download test resource failed.)
 logging.info(Download resource finished.)
 else:
@@ -70,12 +71,12 @@ def run_autoit(test, params, env):
internal_timeout=0)
 file.close()
 
-command = cmd /c %s %s %s % (binary, autoit_entry, script_params)
+command = cmd /c %s %s %s %(interpreter, dst_rsc_path, script_params)
 
 logging.info( Script output )
 status = session.get_command_status(command,
 print_func=logging.info,
-timeout=timeout)
+timeout=test_timeout)
 logging.info( End of script output )
 
 if status is None:
@@ -87,5 +88,7 @@ def run_autoit(test, params, env):
 if reboot == yes:
 logging.debug(Rebooting guest after test ...)
 session = kvm_test_utils.reboot(vm, session, timeout=login_timeout)
+
+logging.debug(guest test PASSED.)
 finally:
 session.close()
diff --git a/client/tests/kvm/tests_base.cfg.sample 
b/client/tests/kvm/tests_base.cfg.sample
index fc4fb0b..5b0da6a 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -251,19 +251,19 @@ variants:
 - autoit:   install setup unattended_install.cdrom
 type = autoit
 login_timeout = 360
-autoit_binary = D:\AutoIt3.exe
-autoit_script_timeout = 600
-autoit_script_params =
+interpreter = D:\AutoIt3.exe
+test_timeout = 600
+script_params =
 reboot = yes
 variants:
 - notepad:
-autoit_script = autoit/notepad1.au3
+guest_script = autoit/notepad1.au3
 - stub:
 download = yes
 download_cmd = git clone
 rsc_server = git://the.resource.server/autoit
 dst_rsc_dir = C:\
-autoit_entry = C:\autoit\stub\stub.au3
+dst_rsc_path = C:\autoit\stub\stub.au3
 
 - iozone_windows

[KVM-AUTOTEST PATCH 2/2] KVM-test: rename autoit to guest_test and update the sample config file

2010-06-18 Thread Chen Cao
Rename the autoit.py to guest_test.py.
Update the related tests structure in the sample config file
and add powershell script test demo.

Signed-off-by: Chen Cao k...@redhat.com
---
 client/tests/kvm/tests/autoit.py   |   94 
 client/tests/kvm/tests/guest_test.py   |   94 
 client/tests/kvm/tests_base.cfg.sample |   33 +++
 3 files changed, 116 insertions(+), 105 deletions(-)
 delete mode 100644 client/tests/kvm/tests/autoit.py
 create mode 100644 client/tests/kvm/tests/guest_test.py

diff --git a/client/tests/kvm/tests/autoit.py b/client/tests/kvm/tests/autoit.py
deleted file mode 100644
index 0373f38..000
--- a/client/tests/kvm/tests/autoit.py
+++ /dev/null
@@ -1,94 +0,0 @@
-import os, logging
-from autotest_lib.client.common_lib import error
-import kvm_utils, kvm_test_utils
-
-
-def run_autoit(test, params, env):
-
-A wrapper for running customized tests in guests.
-
-1) Log into a guest.
-2) Run script.
-3) Wait for script execution to complete.
-4) Pass/fail according to exit status of script.
-
-@param test: KVM test object.
-@param params: Dictionary with test parameters.
-@param env: Dictionary with the test environment.
-
-login_timeout = int(params.get(login_timeout, 360))
-reboot = params.get(reboot, no)
-
-vm = kvm_test_utils.get_living_vm(env, params.get(main_vm))
-session = kvm_test_utils.wait_for_login(vm, timeout=login_timeout)
-
-if reboot == yes:
-logging.debug(Rebooting guest before test ...)
-session = kvm_test_utils.reboot(vm, session, timeout=login_timeout)
-
-try:
-logging.info(Starting script...)
-
-# Collect test parameters
-interpreter = params.get(interpreter)
-script = params.get(guest_script)
-dst_rsc_path = params.get(dst_rsc_path, script.au3)
-script_params = params.get(script_params, )
-test_timeout = float(params.get(test_timeout, 600))
-
-logging.debug(Starting preparing resouce files...)
-# Download the script resource from a remote server, or
-# prepare the script using rss?
-if params.get(download) == yes:
-download_cmd = params.get(download_cmd)
-rsc_server = params.get(rsc_server)
-rsc_dir = os.path.basename(rsc_server)
-dst_rsc_dir = params.get(dst_rsc_dir)
-
-# Change dir to dst_rsc_dir, and remove the guest script dir there
-rm_cmd = cd %s  (rmdir /s /q %s || del /s /q %s) % \
- (dst_rsc_dir, rsc_dir, rsc_dir)
-if session.get_command_status(rm_cmd, timeout=test_timeout) != 0:
-raise error.TestFail(Remove %s failed. % rsc_dir)
-logging.debug(Clean directory succeeded.)
-
-# then download the resource.
-rsc_cmd = cd %s  %s %s %(dst_rsc_dir, download_cmd, rsc_server)
-if session.get_command_status(rsc_cmd, timeout=test_timeout) != 0:
-raise error.TestFail(Download test resource failed.)
-logging.info(Download resource finished.)
-else:
-# Send AutoIt script to guest (this code will be replaced once we
-# support sending files to Windows guests)
-session.get_command_output(del script.au3, internal_timeout=0)
-file = open(kvm_utils.get_path(test.bindir, script))
-for line in file.readlines():
-# Insert a '^' before each character
-line = .join(^ + c for c in line.rstrip())
-if line:
-# Append line to the file
-session.get_command_output(echo %sscript.au3 % line,
-   internal_timeout=0)
-file.close()
-
-command = cmd /c %s %s %s %(interpreter, dst_rsc_path, script_params)
-
-logging.info( Script output )
-status = session.get_command_status(command,
-print_func=logging.info,
-timeout=test_timeout)
-logging.info( End of script output )
-
-if status is None:
-raise error.TestFail(Timeout expired before script execution 
- completed (or something weird happened))
-if status != 0:
-raise error.TestFail(Script execution failed)
-
-if reboot == yes:
-logging.debug(Rebooting guest after test ...)
-session = kvm_test_utils.reboot(vm, session, timeout=login_timeout)
-
-logging.debug(guest test PASSED.)
-finally:
-session.close()
diff --git a/client/tests/kvm/tests/guest_test.py 
b/client/tests/kvm/tests/guest_test.py
new file mode 100644
index 000..2ba3d02
--- /dev/null
+++ b/client/tests/kvm/tests/guest_test.py
@@ -0,0 +1,94

[KVM-AUTOTEST PATCH 2/2 diff-rename mode] KVM-test: rename autoit to guest_test and update the sample config file

2010-06-18 Thread Chen Cao
Rename the autoit.py to guest_test.py.
Update the related tests structure in the sample config file
and add powershell script test demo.

Signed-off-by: Chen Cao k...@redhat.com
---
 .../tests/kvm/tests/{autoit.py = guest_test.py}   |2 +-
 client/tests/kvm/tests_base.cfg.sample |   33 +--
 2 files changed, 23 insertions(+), 12 deletions(-)
 rename client/tests/kvm/tests/{autoit.py = guest_test.py} (99%)

diff --git a/client/tests/kvm/tests/autoit.py 
b/client/tests/kvm/tests/guest_test.py
similarity index 99%
rename from client/tests/kvm/tests/autoit.py
rename to client/tests/kvm/tests/guest_test.py
index 0373f38..2ba3d02 100644
--- a/client/tests/kvm/tests/autoit.py
+++ b/client/tests/kvm/tests/guest_test.py
@@ -3,7 +3,7 @@ from autotest_lib.client.common_lib import error
 import kvm_utils, kvm_test_utils
 
 
-def run_autoit(test, params, env):
+def run_guest_test(test, params, env):
 
 A wrapper for running customized tests in guests.
 
diff --git a/client/tests/kvm/tests_base.cfg.sample 
b/client/tests/kvm/tests_base.cfg.sample
index 5b0da6a..105c67a 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -248,22 +248,33 @@ variants:
 used_cpus = 5
 used_mem = 2560
 
-- autoit:   install setup unattended_install.cdrom
-type = autoit
+- guest_test:   install setup unattended_install.cdrom
+type = guest_test
 login_timeout = 360
-interpreter = D:\AutoIt3.exe
 test_timeout = 600
 script_params =
 reboot = yes
 variants:
-- notepad:
-guest_script = autoit/notepad1.au3
-- stub:
-download = yes
-download_cmd = git clone
-rsc_server = git://the.resource.server/autoit
-dst_rsc_dir = C:\
-dst_rsc_path = C:\autoit\stub\stub.au3
+- autoit:
+interpreter = D:\AutoIt3.exe
+variants:
+- notepad:
+guest_script = autoit/notepad1.au3
+- stub:
+download = yes
+download_cmd = git clone
+rsc_server = git://the.resource.server/autoit
+dst_rsc_dir = C:\
+dst_rsc_path = C:\autoit\stub\stub.au3
+- powershell:
+interpreter = powershell.exe -File
+variants:
+- stub:
+download = yes
+download_cmd = git clone
+rsc_server = git://the.resource.server/powershell
+dst_rsc_dir = C:\
+dst_rsc_path = C:\powershell\stub\stub.ps1
 
 - iozone_windows: unattended_install.cdrom
 type = iozone_windows
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Autotest PATCH - updated with current tree] KVM test: Add perfmon into the guest tests

2010-05-27 Thread Chen Cao
perfmon2 API provides access to the hardware performance counters of
modern processors.

Dependency,
To compile the source code of the test, the following packages should
be installed,
glibc-static-2.11.1-6.x86_64
glibc-headers-2.11.1-6.x86_64
glibc-common-2.11.1-6.x86_64
glibc-devel-2.11.1-6.x86_64
glibc-2.11.1-6.x86_64

Note,
1. libpfm uses the Performance Monitor Unit (PMU) on the processors,
but this unit is not provided by kvm currently, i.e. the test should
fail in kvm guests. And this test can be used as a reminder that kvm
still lack the PMU virtualization.
2. According to the README file of perfmon-tests-0.3, 2.6.24 or higer
Linux kernel (with perfmon v2.8 or higher) is needed to run the tests.

Signed-off-by: Chen Cao k...@redhat.com
---
 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/client/tests/kvm/autotest_control/perfmon.control 
b/client/tests/kvm/autotest_control/perfmon.control
new file mode 100644
index 000..d3f5190
--- /dev/null
+++ b/client/tests/kvm/autotest_control/perfmon.control
@@ -0,0 +1,16 @@
+TIME=SHORT
+AUTHOR = Stephane Eranian eran...@google.com
+DOC = 
+This is a simple series of test for the perfmon2 API which
+provides access to the hardware performance counters of modern
+processors.
+
+Information about perfmon2 at:
+http://perfmon2.sf.net
+
+NAME = 'perfmon'
+TEST_CLASS = 'kernel'
+TEST_CATEGORY = 'Functional'
+TEST_TYPE = 'client'
+
+job.run_test('perfmon')
diff --git a/client/tests/kvm/tests_base.cfg.sample 
b/client/tests/kvm/tests_base.cfg.sample
index 5349034..599e4c3 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -154,6 +154,8 @@ variants:
 test_control_file = hwclock.control
 - rtc:
 test_control_file = rtc.control
+- perfmon:
+test_control_file = perfmon.control
 
 - linux_s3: install setup unattended_install
 type = linux_s3

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Autotest PATCH] client test - perfmon: Patch the source code of perfmon to remove the -Werror switch

2010-05-27 Thread Chen Cao
On some OSes, the compilation will failed because of this switch,

...
gcc -O2 -g -Wall -Werror
+-I/home/kcao/projects/autotest/client/tests/perfmon/perfmon-tests-0.3/libpfm-3.
+52/lib/../include -D_REENTRANT -DCONFIG_PFMLIB_ARCH_X86_64 -I. -c
+pfmlib_os_linux.c
cc1: warnings being treated as errors
pfmlib_os_linux.c: In function ‘pfm_init_syscalls_sysfs’:
pfmlib_os_linux.c:398: error: ignoring return value of ‘fscanf’, declared with
+attribute warn_unused_result
make[2]: *** [pfmlib_os_linux.o] Error 1
make[2]: Leaving directory
+`/home/kcao/projects/autotest/client/tests/perfmon/perfmon-tests-0.3/libpfm-3.5
+2/lib'
make[1]: *** [lib] Error 2


Signed-off-by: Chen Cao k...@redhat.com
---
 client/tests/perfmon/perfmon.py |8 +++
 client/tests/perfmon/remove-werror-switch.patch |   55 +++
 2 files changed, 63 insertions(+), 0 deletions(-)
 create mode 100644 client/tests/perfmon/remove-werror-switch.patch

diff --git a/client/tests/perfmon/perfmon.py b/client/tests/perfmon/perfmon.py
index ec1145f..39c6fb2 100644
--- a/client/tests/perfmon/perfmon.py
+++ b/client/tests/perfmon/perfmon.py
@@ -10,6 +10,14 @@ class perfmon(test.test):
 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
 utils.extract_tarball_to_dir(tarball, self.srcdir)
 os.chdir(self.srcdir)
+# Apply the patch to remove the -Werror switch,
+# because there are warnings while compiling,
+# if the compiler sticks to the rules, the source building
+# will fail, although it seems that fedora and rhel ignore
+# these warnings.
+p1 = 'patch -p1  ../remove-werror-switch.patch'
+utils.system(p1)
+
 utils.system('make')
 
 
diff --git a/client/tests/perfmon/remove-werror-switch.patch 
b/client/tests/perfmon/remove-werror-switch.patch
new file mode 100644
index 000..6a5062c
--- /dev/null
+++ b/client/tests/perfmon/remove-werror-switch.patch
@@ -0,0 +1,55 @@
+diff --git a/Makefile b/Makefile
+index 6ba6fba..884274d 100644
+--- a/Makefile
 b/Makefile
+@@ -28,6 +28,7 @@ TOPDIR  := $(shell if [ $$PWD !=  ]; then echo $$PWD; 
else pwd; fi)
+ include config.mk
+ 
+ DIRS=tests
++PATCHNAME=remove-libpfm-werror.patch
+ 
+ all:  libpfm
+   @echo Compiling for \'$(ARCH)\' target
+@@ -36,6 +37,7 @@ all:  libpfm
+ libpfm:
+   @echo Compiling $(LIBPFM)
+   @tar zxf $(LIBPFM).tar.gz
++  @(cd $(LIBPFM)  patch -p1  ../$(PATCHNAME)  cd ..)
+   @ln -sf $(LIBPFM) libpfm
+   @$(MAKE) -C $(LIBPFM) lib
+ clean: 
+diff --git a/config.mk b/config.mk
+index a110111..7321f2d 100644
+--- a/config.mk
 b/config.mk
+@@ -163,7 +163,7 @@ INSTALL=install
+ LN=ln -sf
+ PFMINCDIR=$(TOPDIR)/libpfm/include
+ PFMLIBDIR=$(TOPDIR)/libpfm/lib
+-DBG?=-g -Wall -Werror
++DBG?=-g -Wall
+ # gcc/mips64 bug
+ ifeq ($(CONFIG_PFMLIB_ARCH_SICORTEX),y)
+ OPTIM?=-O
+diff --git a/remove-libpfm-werror.patch b/remove-libpfm-werror.patch
+new file mode 100644
+index 000..252aaa0
+--- /dev/null
 b/remove-libpfm-werror.patch
+@@ -0,0 +1,13 @@
++diff --git a/config.mk b/config.mk
++index 8c76f59..bbf1fc0 100644
++--- a/config.mk
+ b/config.mk
++@@ -164,7 +164,7 @@ INSTALL=install
++ LN=ln -sf
++ PFMINCDIR=$(TOPDIR)/include
++ PFMLIBDIR=$(TOPDIR)/lib
++-DBG?=-g -Wall -Werror
+++DBG?=-g -Wall
++ # gcc/mips64 bug
++ ifeq ($(CONFIG_PFMLIB_ARCH_SICORTEX),y)
++ OPTIM?=-O
+-- 
+1.7.0.4
+

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] KVM test: Add perfmon into the guest tests

2010-05-27 Thread Chen Cao
On Thu, May 27, 2010 at 10:08:49AM +0200, Jes Sorensen wrote:
 On 05/25/10 05:05, Chen Cao wrote:
  perfmon2 API provides access to the hardware performance counters of
  modern processors.
  
  Dependency,
  To compile the source code of the test, the following packages should
  be installed,
  glibc-static-2.11.1-6.x86_64
  glibc-headers-2.11.1-6.x86_64
  glibc-common-2.11.1-6.x86_64
  glibc-devel-2.11.1-6.x86_64
  glibc-2.11.1-6.x86_64
  
  Note,
  1. libpfm uses the Performance Monitor Unit (PMU) on the processors,
  but this unit is not provided by kvm currently, i.e. the test should
  fail in kvm guests.
  2. According to the README file of perfmon-tests-0.3, 2.6.24 or higer
  Linux kernel (with perfmon v2.8 or higher) is needed to run the tests.
 
 I thought perfmon2 was deprecated in favor of perf_event.c ? The only
 reference left for perfmon2 in the kernel is in the ia64 tree, and
 KVM/ia64 seems to be pretty dead these days.
 

Jes,

Thank you for reminding.
I have not noticed your mail this afternoon and resent the patches for
the perfmon test, it seems that i may have made a mistake.

by the way, could you tell me how to verify that perfmon2 was
deprecated in favor of perf_event.c, except looking into the kernel
code?


Regards,

Cao, Chen
2010/05/27
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html