[Qemu-devel] [PATCH 4/6] scripts/dump-guest-memory.py: Cleanup functions

2016-01-22 Thread Janosch Frank
Increase readability by adding newlines and comments, as well as removing wrong whitespaces and C style braces around conditionals and loops. Reviewed-by: Laszlo Ersek Signed-off-by: Janosch Frank --- scripts/dump-guest-memory.py | 75 +--- 1 file

[Qemu-devel] [PATCH 3/6] scripts/dump-guest-memory.py: Improve python 3 compatibility

2016-01-22 Thread Janosch Frank
. Reviewed-by: Laszlo Ersek Signed-off-by: Janosch Frank --- scripts/dump-guest-memory.py | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py index d0b927a..bb4ca8e 100644 --- a/scripts/dump

[Qemu-devel] [PATCH 5/6] scripts/dump-guest-memory.py: Introduce multi-arch support

2016-01-22 Thread Janosch Frank
By modelling the ELF with ctypes we not only gain full python 3 support but can also create dumps for different architectures more easily. Tested-by: Andrew Jones Acked-by: Laszlo Ersek Signed-off-by: Janosch Frank --- scripts/dump-guest-memory.py | 486

[Qemu-devel] [PATCH 0/6] scripts/dump-guest-memory.py: Add multi-arch support

2016-01-22 Thread Janosch Frank
compatibility comment being added in the wrong commit. Fix docstrings that get displayed by gdb. Replaced ceil(len_desc / 4.0) with ((len_desc + 3) // 4) Added patch that fixes module docstring to account for moved gdb help string. Janosch Frank (6): scripts/dump-guest-memory.py: Move

[Qemu-devel] [PATCH 6/6] scripts/dump-guest-memory.py: Fix module docstring

2016-01-22 Thread Janosch Frank
The module docstring is changed into a multi-line comment to comply with pep 257. The comment about the docstring that gets used by gdb to print the help is moved to the location of the docstring. Signed-off-by: Janosch Frank --- scripts/dump-guest-memory.py | 35

[Qemu-devel] [PATCH 1/6] scripts/dump-guest-memory.py: Move constants to the top

2016-01-22 Thread Janosch Frank
The constants bloated the class definition and were therefore moved to the top. Reviewed-by: Laszlo Ersek Signed-off-by: Janosch Frank --- scripts/dump-guest-memory.py | 126 +-- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/scripts

[Qemu-devel] [PATCH 2/6] scripts/dump-guest-memory.py: Make methods functions

2016-01-22 Thread Janosch Frank
The functions dealing with qemu components rarely used parts of the class, so they were moved out of the class. As the uintptr_t variable is needed both within and outside the class, it was made a constant and moved to the top. Reviewed-by: Laszlo Ersek Signed-off-by: Janosch Frank

[Qemu-devel] [PATCH] scripts/kvm/kvm_stat: Fix tracefs access checking

2016-02-02 Thread Janosch Frank
ected without kernel support, warn with a small timeout, set the debugfs statistics option to True and the tracefs one to False. Fixes: 7aa4ee5 ('scripts/kvm/kvm_stat: Improve debugfs access checking') Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 20 +++- 1 f

[Qemu-devel] [PATCH] scripts/kvm/kvm_stat: Fix tracefs access checking

2016-02-02 Thread Janosch Frank
to annoy users with longer delays and the message is still visible after closing kvm_stat. Janosch Frank (1): scripts/kvm/kvm_stat: Fix tracefs access checking scripts/kvm/kvm_stat | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) -- 2.3.0

[Qemu-devel] [PATCH v2] scripts/kvm/kvm_stat: Fix tracefs access checking

2016-02-03 Thread Janosch Frank
s checking') Signed-off-by: Janosch Frank --- v1 to v2: Exit if -t is set explicitly scripts/kvm/kvm_stat | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index d43e8f3..4756eee 100755 --- a/scripts/kvm

[Qemu-devel] [PATCH 34/34] scripts/kvm/kvm_stat: Add interactive filtering

2015-12-10 Thread Janosch Frank
Interactively changing the filter is much more useful than the drilldown, because it is more versatile. With this patch, the filter can be changed by pressing 'f' in the text ui and entering a new filter regex. --- scripts/kvm/kvm_stat | 26 ++ 1 file changed, 26 insertion

[Qemu-devel] [PATCH 17/34] scripts/kvm/kvm_stat: Rename _perf_event_open

2015-12-10 Thread Janosch Frank
The underscore in front of the function name does not comply with the python coding guidelines. Reviewed-by: Jason J. Herne --- scripts/kvm/kvm_stat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index ef23474..59fa39c 100755 -

[Qemu-devel] [PATCH 02/34] scripts/kvm/kvm_stat: Replaced os.listdir with os.walk

2015-12-10 Thread Janosch Frank
Os.walk gives back lists of directories and files, no need to filter directories from the list that listdir gives back. To make it better understandable a wrapper with docstring was introduced. --- scripts/kvm/kvm_stat | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff -

[Qemu-devel] [PATCH 22/34] scripts/kvm/kvm_stat: Cleanup of Stats class

2015-12-10 Thread Janosch Frank
Converted class definition to new style and renamed improper named variables. Introduced property for fields_filter. Moved member variable declaration to init, so one can see all class variables when reading the init method. Completely clear the values dict, as we don't need to keep single value

[Qemu-devel] [PATCH 21/34] scripts/kvm/kvm_stat: Encapsulate filters variable

2015-12-10 Thread Janosch Frank
The variable was only used in one class but still was defined globally. Additionaly the detect_platform routine which prepares the data that goes into the variable was called on each start of the script, no matter if the class was needed. To make the variable local to the TracepointProvider class,

[Qemu-devel] [PATCH 01/34] scripts/kvm/kvm_stat: Cleanup of multiple imports

2015-12-10 Thread Janosch Frank
Removed multiple imports of the same module and moved all imports to the top. It is not necessary to import a module each time one of its functions/classes is used. For readability each import should get its own line. --- scripts/kvm/kvm_stat | 26 +++--- 1 file changed, 11 in

[Qemu-devel] [PATCH 32/34] scripts/kvm/kvm_stat: Fix rlimit for unprivileged users

2015-12-10 Thread Janosch Frank
Setting the hard limit as a unprivileged user either returns an error when it is higher than the current one or irreversibly sets it lower. Therefore we leave the hardlimit untouched as long as we don't need to raise it as this needs CAP_SYS_RESOURCE. This gives admins the possibility to run the

[Qemu-devel] [PATCH 05/34] scripts/kvm/kvm_stat: Mark globals in functions

2015-12-10 Thread Janosch Frank
Updating globals over the globals().update() method is not the standard way of changing globals. Marking variables as global and modifying them the standard way is better readable. --- scripts/kvm/kvm_stat | 41 ++--- 1 file changed, 22 insertions(+), 19 deletio

[Qemu-devel] [PATCH 14/34] scripts/kvm/kvm_stat: Set sensible no. files rlimit

2015-12-10 Thread Janosch Frank
As num cpus * 1000 is NOT a sensible rlimit, we need to calculate a more accurate rlimit. The number of open files is directly dependent on the cpu count and on the number of trace points per cpu. A additional constant works as a buffer for files that are needed by python or do get opened when the

[Qemu-devel] [PATCH 30/34] scripts/kvm/kvm_stat: Cleanup and pre-init perf_event_attr

2015-12-10 Thread Janosch Frank
All initializations of the ctypes struct that don't need additional information were moved to its init method. The unneeded initializations for sample_type and sample_period were removed as they do not affect the counters that are read. This improves readability of the setup_event_attribute by hal

[Qemu-devel] [PATCH 31/34] scripts/kvm/kvm_stat: Read event values as u64

2015-12-10 Thread Janosch Frank
The struct read_format, which denotes the returned values on a read states that the values are u64 and not long long which is used for struct unpacking. Therefore the 'q' long long formatter was exchanged with 'Q' which is the format for u64 data. --- scripts/kvm/kvm_stat | 2 +- 1 file changed,

[Qemu-devel] [PATCH 13/34] scripts/kvm/kvm_stat: Fixup syscall error reporting

2015-12-10 Thread Janosch Frank
In 2008 a patch was written that introduced ctypes.get_errno() and set_errno() as official interfaces to the libc errno variable. Using them we can avoid accessing private libc variables. The patch was included in python 2.6. Also we need to raise the right exception, with the right parameters and

[Qemu-devel] [PATCH 12/34] scripts/kvm/kvm_stat: Moved DebugfsProvider

2015-12-10 Thread Janosch Frank
When it is next to the TracepointProvider less scrolling is needed to change related, surrounding code. Reviewed-by: Jason J. Herne --- scripts/kvm/kvm_stat | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat

[Qemu-devel] [PATCH 10/34] scripts/kvm/kvm_stat: Fix spaces around keyword assignments

2015-12-10 Thread Janosch Frank
Keyword assignments should not not have spaces around the equal character according to PEP8. Reviewed-by: Jason J. Herne --- scripts/kvm/kvm_stat | 62 ++-- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scri

[Qemu-devel] [PATCH 03/34] scripts/kvm/kvm_stat: Make constants uppercase

2015-12-10 Thread Janosch Frank
Constants should be uppercase with separating underscores, as requested in PEP8. This helps identifying them when reading the code. Reviewed-by: Jason J. Herne --- scripts/kvm/kvm_stat | 64 ++-- 1 file changed, 32 insertions(+), 32 deletions(-) d

[Qemu-devel] [PATCH 23/34] scripts/kvm/kvm_stat: Cleanup of Groups class

2015-12-10 Thread Janosch Frank
Introduced separating newlines for readability and removed special treatment/variable of the group leader. Renamed fmt to read_format. The group leader's file descriptor will not be turned into a file object anymore, instead os.read is used to read from the descriptor. --- scripts/kvm/kvm_stat |

[Qemu-devel] [PATCH 24/34] scripts/kvm/kvm_stat: Cleanup of Event class

2015-12-10 Thread Janosch Frank
Added additional newlines for readability. Factored out attribute and event setup code into own methods. All data necessary for setting up the events was consolidated into one dictionary. That way we get rid of the large argument list of the functions that handle the data. Exchanged file() with

[Qemu-devel] [PATCH 18/34] scripts/kvm/kvm_stat: Introduce properties for providers

2015-12-10 Thread Janosch Frank
As previous commit authors used a mixture of setters/getters and direct access to class variables consolidating them the python way improved readability. Properties allow us to assign a value to a class variable through a setter without the need to call the setter ourselves. Reviewed-by: Jason J.

[Qemu-devel] [PATCH 11/34] scripts/kvm/kvm_stat: Rename variables that redefine globals

2015-12-10 Thread Janosch Frank
Filter, id and byte are builtin python modules which should not be redefined by local variables. Reviewed-by: Jason J. Herne --- scripts/kvm/kvm_stat | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index 92

[Qemu-devel] [PATCH 08/34] scripts/kvm/kvm_stat: Improve debugfs access checking

2015-12-10 Thread Janosch Frank
Access checking with F_OK was replaced with the better readable os.path.exists(). On Linux exists() returns False when the user doesn't have sufficient permissions for statting the directory. Therefore the error message now states that sufficient rights are needed when the check fails. Also added

[Qemu-devel] [PATCH 29/34] scripts/kvm/kvm_stat: Move to argparse and add description

2015-12-10 Thread Janosch Frank
The OptionParser is deprecated since the introduction of the ArgumentParser in 2.7. Additionally added a description text for the script, so new users don't have to guess its purpose and inner workings. --- scripts/kvm/kvm_stat | 86 1 file cha

[Qemu-devel] [PATCH 06/34] scripts/kvm/kvm_stat: Invert dictionaries

2015-12-10 Thread Janosch Frank
The exit reasons dictionaries were defined number -> value but later on were accessed the other way around. Therefore a invert function inverted them. Defining them the right way removes the need to invert them and therefore also speeds up the script's setup process. --- scripts/kvm/kvm_stat | 34

[Qemu-devel] [PATCH 20/34] scripts/kvm/kvm_stat: Cleanup cpu list retrieval

2015-12-10 Thread Janosch Frank
Reading /sys/devices/system/cpu/online makes opening the cpu directories unnecessary and works on more/older systems. --- scripts/kvm/kvm_stat | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index 7bd76b3..20fc5

[Qemu-devel] [PATCH 07/34] scripts/kvm/kvm_stat: Cleanup of path variables

2015-12-10 Thread Janosch Frank
Paths to debugfs and trace dirs are now specified globally to remove redundancies in the code. Reviewed-by: Jason J. Herne --- scripts/kvm/kvm_stat | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index d53945e..e7f359

[Qemu-devel] [PATCH 15/34] scripts/kvm/kvm_stat: Cleanup of platform detection

2015-12-10 Thread Janosch Frank
s390 machines can also be detected via uname -m, i.e. python's os.uname, no need for more complicated checks. Calling uname once and saving its value for multiple checks is perfectly sufficient. We don't expect the machine's architecture to change when the script is running anyway. On multi-cpu s

[Qemu-devel] [PATCH 25/34] scripts/kvm/kvm_stat: Group arch specific data

2015-12-10 Thread Janosch Frank
Using global variables and multiple initialization functions for arch specific data makes the code hard to read. By grouping them in the Arch class we encapsulate and initialize them in one place. --- scripts/kvm/kvm_stat | 106 +-- 1 file changed, 5

[Qemu-devel] [PATCH 26/34] scripts/kvm/kvm_stat: Remove unneeded X86_EXIT_REASONS

2015-12-10 Thread Janosch Frank
The architecture detection method directly accesses vmx and smv exit reason constants. Therefore we don't need it anymore. --- scripts/kvm/kvm_stat | 5 - 1 file changed, 5 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index d81e7b6..345ead8 100755 --- a/scripts/kvm/kv

[Qemu-devel] [PATCH 00/34] kvm_stat: Cleanup and fixup

2015-12-10 Thread Janosch Frank
all of its interface modes. Testing was done rarely on X86_64 RHEL 6.7 and mostly on s390. Tests on other architectures would be beneficial. Janosch Frank (34): scripts/kvm/kvm_stat: Cleanup of multiple imports scripts/kvm/kvm_stat: Replaced os.listdir with os.walk scripts/kvm/kvm_stat: Make

[Qemu-devel] [PATCH 16/34] scripts/kvm/kvm_stat: Make cpu detection a function

2015-12-10 Thread Janosch Frank
The online cpus detection method is in the Stats class but does not use any class variables. Moving it out of the class to the platform detection function makes the Stats class more readable. --- scripts/kvm/kvm_stat | 30 +++--- 1 file changed, 15 insertions(+), 15 deleti

[Qemu-devel] [PATCH 28/34] scripts/kvm/kvm_stat: Fix output formatting

2015-12-10 Thread Janosch Frank
The key names in log mode were capped to 10 characters which is not enough for distinguishing between keys. Capping was therefore removed. In batch mode the spacing between keys and values was too narrow and therefore had to be extended to 42. --- scripts/kvm/kvm_stat | 4 ++-- 1 file changed, 2

[Qemu-devel] [PATCH 19/34] scripts/kvm/kvm_stat: Cleanup of TracepointProvider

2015-12-10 Thread Janosch Frank
Variables with bad names like f and m were renamed to their full name, so it is clearer which data they contain. Unneeded variables were removed and the field generating code was moved in an own function. dict.iteritems() was removed as directly iterating over a dictionary also yields the needed

[Qemu-devel] [PATCH 27/34] scripts/kvm/kvm_stat: Make tui function a class

2015-12-10 Thread Janosch Frank
The tui function itself had a few sub-functions and therefore basically already was class-like. Making it an actual one with proper methods improved readability. The tui function lives on as a wrapper for the class. Also renamed single character variable name, so the name reflects the content. --

[Qemu-devel] [PATCH 33/34] scripts/kvm/kvm_stat: Fixup filtering

2015-12-10 Thread Janosch Frank
When filtering, the group leader event should not be disabled, as all other events under it will also be disabled. Also we should make sure that values from disabled fields will not be displayed. This also filters the fields from the log and batch output for better readability. Also the drilldown

[Qemu-devel] [PATCH 09/34] scripts/kvm/kvm_stat: Introduce main function

2015-12-10 Thread Janosch Frank
The main function should be the main location for initialization and helps encapsulating variables into a scope. This way they don't have to be global and might be mistaken for local ones. As the providers variable is scoped now it can't be accessed from within the Stats class. Hence, the global a

[Qemu-devel] [PATCH 04/34] scripts/kvm/kvm_stat: Removed unneeded PERF constants

2015-12-10 Thread Janosch Frank
Only two of the constants are actually needed to set up the events, so the others were removed. All variables that used them were also removed. --- scripts/kvm/kvm_stat | 28 ++-- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/

[Qemu-devel] [PATCH v2 25/34] scripts/kvm/kvm_stat: Group arch specific data

2016-01-11 Thread Janosch Frank
Using global variables and multiple initialization functions for arch specific data makes the code hard to read. By grouping them in the Arch classes we encapsulate and initialize them in one place. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 117

[Qemu-devel] [PATCH v2 23/34] scripts/kvm/kvm_stat: Cleanup of Groups class

2016-01-11 Thread Janosch Frank
Introduced separating newlines for readability and removed special treatment/variable of the group leader. Renamed fmt to read_format. The group leader's file descriptor will not be turned into a file object anymore, instead os.read is used to read from the descriptor. Signed-off-by: Ja

[Qemu-devel] [PATCH v2 17/34] scripts/kvm/kvm_stat: Rename _perf_event_open

2016-01-11 Thread Janosch Frank
The underscore in front of the function name does not comply with the python coding guidelines. Reviewed-by: Jason J. Herne Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat

[Qemu-devel] [PATCH v2 13/34] scripts/kvm/kvm_stat: Fixup syscall error reporting

2016-01-11 Thread Janosch Frank
and a helpful message. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index b5422f8..457624d 100755 --- a/scripts/kvm/kvm_stat +++ b/scripts/kvm/kvm_stat @@ -287,10 +287,8

[Qemu-devel] [PATCH v2 04/34] scripts/kvm/kvm_stat: Removed unneeded PERF constants

2016-01-11 Thread Janosch Frank
Only two of the constants are actually needed to set up the events, so the others were removed. All variables that used them were also removed. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 28 ++-- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a

[Qemu-devel] [PATCH v2 07/34] scripts/kvm/kvm_stat: Cleanup of path variables

2016-01-11 Thread Janosch Frank
Paths to debugfs and trace dirs are now specified globally to remove redundancies in the code. Reviewed-by: Jason J. Herne Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm

[Qemu-devel] [PATCH v2 19/34] scripts/kvm/kvm_stat: Cleanup of TracepointProvider

2016-01-11 Thread Janosch Frank
keys. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 40 +--- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index c4e22d0..032e491 100755 --- a/scripts/kvm/kvm_stat +++ b/scripts/kvm

[Qemu-devel] [PATCH v2 08/34] scripts/kvm/kvm_stat: Improve debugfs access checking

2016-01-11 Thread Janosch Frank
Also added check for /sys/kernel/debug/tracing/. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index 5ca09f4..6f0692d 100755 --- a/scripts/kvm/kvm_stat +++ b/sc

[Qemu-devel] [PATCH v2 11/34] scripts/kvm/kvm_stat: Rename variables that redefine globals

2016-01-11 Thread Janosch Frank
Filter, id and byte are builtin python modules which should not be redefined by local variables. Reviewed-by: Jason J. Herne Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/kvm/kvm_stat

[Qemu-devel] [PATCH v2 06/34] scripts/kvm/kvm_stat: Invert dictionaries

2016-01-11 Thread Janosch Frank
The exit reasons dictionaries were defined number -> value but later on were accessed the other way around. Therefore a invert function inverted them. Defining them the right way removes the need to invert them and therefore also speeds up the script's setup process. Signed-off-by: Janos

[Qemu-devel] [PATCH v2 01/34] scripts/kvm/kvm_stat: Cleanup of multiple imports

2016-01-11 Thread Janosch Frank
Removed multiple imports of the same module and moved all imports to the top. It is not necessary to import a module each time one of its functions/classes is used. For readability each import should get its own line. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 26

[Qemu-devel] [PATCH v2 02/34] scripts/kvm/kvm_stat: Replaced os.listdir with os.walk

2016-01-11 Thread Janosch Frank
Os.walk gives back lists of directories and files, no need to filter directories from the list that listdir gives back. To make it better understandable a wrapper with docstring was introduced. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 15 +++ 1 file changed, 11

[Qemu-devel] [PATCH v2 24/34] scripts/kvm/kvm_stat: Cleanup of Event class

2016-01-11 Thread Janosch Frank
Added additional newlines for readability. Factored out attribute and event setup code into own methods. Exchanged file() with preferred open(). Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 67 +--- 1 file changed, 43 insertions(+), 24

[Qemu-devel] [PATCH v2 00/34] kvm_stat: Cleanup and fixup

2016-01-11 Thread Janosch Frank
. Janosch Frank (34): scripts/kvm/kvm_stat: Cleanup of multiple imports scripts/kvm/kvm_stat: Replaced os.listdir with os.walk scripts/kvm/kvm_stat: Make constants uppercase scripts/kvm/kvm_stat: Removed unneeded PERF constants scripts/kvm/kvm_stat: Mark globals in functions scripts/kvm

[Qemu-devel] [PATCH v2 14/34] scripts/kvm/kvm_stat: Set sensible no. files rlimit

2016-01-11 Thread Janosch Frank
the script runs. Hence we have: cpus * traces + constant Reviewed-by: Jason J. Herne Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index 457624d..93b5ea7

[Qemu-devel] [PATCH v2 10/34] scripts/kvm/kvm_stat: Fix spaces around keyword assignments

2016-01-11 Thread Janosch Frank
Keyword assignments should not not have spaces around the equal character according to PEP8. Reviewed-by: Jason J. Herne Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 62 ++-- 1 file changed, 31 insertions(+), 31 deletions(-) diff

[Qemu-devel] [PATCH v2 03/34] scripts/kvm/kvm_stat: Make constants uppercase

2016-01-11 Thread Janosch Frank
Constants should be uppercase with separating underscores, as requested in PEP8. This helps identifying them when reading the code. Reviewed-by: Jason J. Herne Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 64 ++-- 1 file changed, 32

[Qemu-devel] [PATCH v2 15/34] scripts/kvm/kvm_stat: Cleanup of platform detection

2016-01-11 Thread Janosch Frank
. On multi-cpu systems x86_init currently will get called multiple times, returning makes sure we don't waste cicles on that. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 31 ++- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/scripts/kv

[Qemu-devel] [PATCH v2 20/34] scripts/kvm/kvm_stat: Cleanup cpu list retrieval

2016-01-11 Thread Janosch Frank
Reading /sys/devices/system/cpu/online makes opening the cpu directories unnecessary and works on more/older systems. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/scripts/kvm/kvm_stat

[Qemu-devel] [PATCH v2 34/34] scripts/kvm/kvm_stat: Add optparse description

2016-01-11 Thread Janosch Frank
Added a description text that explains what the script does and which requirements have to be met to let it run. The help formatter class is needed as the default optparse formatter makes the text unreadable. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 29

[Qemu-devel] [PATCH v2 16/34] scripts/kvm/kvm_stat: Make cpu detection a function

2016-01-11 Thread Janosch Frank
The online cpus detection method is in the Stats class but does not use any class variables. Moving it out of the class to the platform detection function makes the Stats class more readable. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 30 +++--- 1 file

[Qemu-devel] [PATCH v2 22/34] scripts/kvm/kvm_stat: Cleanup of Stats class

2016-01-11 Thread Janosch Frank
ingle values. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 52 +++- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index 7837f40..203873e 100755 --- a/scripts/kvm/kvm_stat +++ b/sc

[Qemu-devel] [PATCH v2 27/34] scripts/kvm/kvm_stat: Make tui function a class

2016-01-11 Thread Janosch Frank
proposing it and supplying me with most of the code. Also renamed single character variable name, so the name reflects the content. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 121 --- 1 file changed, 77 insertions(+), 44 deletions(-) diff

[Qemu-devel] [PATCH v2 18/34] scripts/kvm/kvm_stat: Introduce properties for providers

2016-01-11 Thread Janosch Frank
. Herne Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index 66dfed6..c4e22d0 100755 --- a/scripts/kvm/kvm_stat +++ b/scripts/kvm/kvm_stat @@ -385,9

[Qemu-devel] [PATCH v2 12/34] scripts/kvm/kvm_stat: Moved DebugfsProvider

2016-01-11 Thread Janosch Frank
When it is next to the TracepointProvider less scrolling is needed to change related, surrounding code. Reviewed-by: Jason J. Herne Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/kvm

[Qemu-devel] [PATCH v2 28/34] scripts/kvm/kvm_stat: Fix output formatting

2016-01-11 Thread Janosch Frank
The key names in log mode were capped to 10 characters which is not enough for distinguishing between keys. Capping was therefore removed. In batch mode the spacing between keys and values was too narrow and therefore had to be extended to 42. Signed-off-by: Janosch Frank --- scripts/kvm

[Qemu-devel] [PATCH v2 29/34] scripts/kvm/kvm_stat: Cleanup and pre-init perf_event_attr

2016-01-11 Thread Janosch Frank
te by halfing its LOC. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index 3c32046..ea5bae8 100755 --- a/scripts/kvm/kvm_stat +++ b/scripts/kvm/kvm_stat @@ -331,6 +3

[Qemu-devel] [PATCH v2 05/34] scripts/kvm/kvm_stat: Mark globals in functions

2016-01-11 Thread Janosch Frank
Updating globals over the globals().update() method is not the standard way of changing globals. Marking variables as global and modifying them the standard way is better readable. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 41 ++--- 1 file

[Qemu-devel] [PATCH v2 30/34] scripts/kvm/kvm_stat: Read event values as u64

2016-01-11 Thread Janosch Frank
The struct read_format, which denotes the returned values on a read states that the values are u64 and not long long which is used for struct unpacking. Therefore the 'q' long long formatter was exchanged with 'Q' which is the format for u64 data. Signed-off-by: Janosch Fra

[Qemu-devel] [PATCH v2 26/34] scripts/kvm/kvm_stat: Remove unneeded X86_EXIT_REASONS

2016-01-11 Thread Janosch Frank
The architecture detection method directly accesses vmx and smv exit reason constants. Therefore we don't need it anymore. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 5 - 1 file changed, 5 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index 42

[Qemu-devel] [PATCH v2 21/34] scripts/kvm/kvm_stat: Encapsulate filters variable

2016-01-11 Thread Janosch Frank
, a new function that calls detect_platform and returns the filters was introduced. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index 083dd2f..7837f40

[Qemu-devel] [PATCH v2 33/34] scripts/kvm/kvm_stat: Add interactive filtering

2016-01-11 Thread Janosch Frank
Interactively changing the filter is much more useful than the drilldown, because it is more versatile. With this patch, the filter can be changed by pressing 'f' in the text ui and entering a new filter regex. Signed-off-by: Janosch Frank --- scripts/kvm/kvm

[Qemu-devel] [PATCH v2 31/34] scripts/kvm/kvm_stat: Fix rlimit for unprivileged users

2016-01-11 Thread Janosch Frank
n the script as an unprivileged user to increase security. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index e71fbef..bab831d 100755 --- a/scripts/kvm/kvm

[Qemu-devel] [PATCH v2 32/34] scripts/kvm/kvm_stat: Fixup filtering

2016-01-11 Thread Janosch Frank
drilldown update now directly checks for the stats' field filter and (un)sets drilldown accordingly. Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm

[Qemu-devel] [PATCH v2 09/34] scripts/kvm/kvm_stat: Introduce main function

2016-01-11 Thread Janosch Frank
the global access to the variable was changed to a local one. Reviewed-by: Jason J. Herne Signed-off-by: Janosch Frank --- scripts/kvm/kvm_stat | 145 +++ 1 file changed, 78 insertions(+), 67 deletions(-) diff --git a/scripts/kvm/kvm_stat b/s

[Qemu-devel] [RFC 3/5] scripts/dump-guest-memory.py: Improve python 3 compatibility

2016-01-14 Thread Janosch Frank
. Signed-off-by: Janosch Frank --- scripts/dump-guest-memory.py | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py index 76a6ecb..fe93135 100644 --- a/scripts/dump-guest-memory.py +++ b/scripts

[Qemu-devel] [RFC 1/5] scripts/dump-guest-memory.py: Move constants to the top

2016-01-14 Thread Janosch Frank
The constants bloated the class definition and were therefore moved to the top. Signed-off-by: Janosch Frank --- scripts/dump-guest-memory.py | 126 +-- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/scripts/dump-guest-memory.py b/scripts

[Qemu-devel] [RFC 4/5] scripts/dump-guest-memory.py: Cleanup functions

2016-01-14 Thread Janosch Frank
Increase readability by adding newlines and comments, as well as removing wrong whitespaces and C style braces around conditionals and loops. Signed-off-by: Janosch Frank --- scripts/dump-guest-memory.py | 71 +++- 1 file changed, 50 insertions(+), 21

[Qemu-devel] [RFC 0/5] scripts/dump-guest-memory.py: Add multi-arch support

2016-01-14 Thread Janosch Frank
tested on a s390 s12 guest only, I'd appreciate tests for the other architectures. Janosch Frank (5): scripts/dump-guest-memory.py: Move constants to the top scripts/dump-guest-memory.py: Make methods functions scripts/dump-guest-memory.py: Improve python 3 compatibility scripts/dump-

[Qemu-devel] [RFC 2/5] scripts/dump-guest-memory.py: Make methods functions

2016-01-14 Thread Janosch Frank
The functions dealing with qemu components rarely used parts of the class, so they were moved out of the class. As the uintptr_t variable is needed both within and outside the class, it was made a constant and moved to the top. Signed-off-by: Janosch Frank --- scripts/dump-guest-memory.py

[Qemu-devel] [RFC 5/5] scripts/dump-guest-memory.py: Introduce multi-arch support

2016-01-14 Thread Janosch Frank
By modelling the ELF with ctypes we not only gain full python 3 support but can also create dumps for different architectures more easily. Signed-off-by: Janosch Frank --- scripts/dump-guest-memory.py | 484 --- 1 file changed, 321 insertions(+), 163

Re: [Qemu-devel] [RFC 3/5] scripts/dump-guest-memory.py: Improve python 3 compatibility

2016-01-15 Thread Janosch Frank
On 01/14/2016 05:03 PM, Laszlo Ersek wrote: > On 01/14/16 09:48, Janosch Frank wrote: >> This commit does not make the script python 3 compatible, it is a >> preparation that fixes the easy and common incompatibilities. >> >> Print is a function in python 3 and theref

Re: [Qemu-devel] [RFC 0/5] scripts/dump-guest-memory.py: Add multi-arch support

2016-01-20 Thread Janosch Frank
On 01/18/2016 06:57 PM, Laszlo Ersek wrote: > On 01/18/16 17:31, Andrew Jones wrote: >> On Thu, Jan 14, 2016 at 05:24:23PM +0100, Laszlo Ersek wrote: >>> On 01/14/16 09:48, Janosch Frank wrote: >>>> The dump guest memory script for extracting a Linux core from a qemu

Re: [Qemu-devel] [RFC 3/5] scripts/dump-guest-memory.py: Improve python 3 compatibility

2016-01-20 Thread Janosch Frank
On 01/20/2016 12:18 PM, Paolo Bonzini wrote: > > > On 14/01/2016 09:48, Janosch Frank wrote: >> This commit does not make the script python 3 compatible, it is a >> preparation that fixes the easy and common incompatibilities. >> >> Print is a function in py

Re: [Qemu-devel] [PATCH 07/34] scripts/kvm/kvm_stat: Cleanup of path variables

2016-01-07 Thread Janosch Frank
On 01/07/2016 03:56 PM, Paolo Bonzini wrote: > > > On 10/12/2015 13:12, Janosch Frank wrote: >> if not os.access('/sys/kernel/debug', os.F_OK): > > PATH_DEBUGFS should be /sys/kernel/debug, while... > >> print 'Please enable CONFIG_DEBUG_FS i

Re: [Qemu-devel] [PATCH] scripts/kvm/kvm_stat: Fix missing right parantheses

2016-02-18 Thread Janosch Frank
On 02/17/2016 07:18 AM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > scripts/kvm/kvm_stat | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat > index 3cf1181..517fbec 100755 > --- a/scripts/kvm/kvm_stat > +++ b/scripts/kvm/k

Re: [Qemu-devel] [PATCH v2] scripts/kvm/kvm_stat: Fix missing right parantheses and ".format(...)"

2016-02-18 Thread Janosch Frank
On 02/19/2016 03:20 AM, Fam Zheng wrote: > They seem to have snuck in when applying Janosch Frank > 's previous patch. > > Signed-off-by: Fam Zheng > > --- > v2: Also fix .format. [Janosch] > --- > scripts/kvm/kvm_stat | 5 +++-- > 1 file changed, 3 inse

Re: [Qemu-devel] [PATCH] scripts: Fix dump-guest-memory.py for MemoryRegion.ram_block removal

2016-03-07 Thread Janosch Frank
On 03/07/2016 10:17 AM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > > --- > > This goes after "[PATCH v2 4/7] memory: Drop MemoryRegion.ram_addr" (or > squashed into it if we want strict synchronization). > --- > scripts/dump-guest-memory.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletio

Re: [Qemu-devel] [PATCH] scripts: Fix dump-guest-memory.py for MemoryRegion.ram_block removal

2016-03-08 Thread Janosch Frank
On 03/07/2016 05:35 PM, Janosch Frank wrote: > On 03/07/2016 10:17 AM, Fam Zheng wrote: >> Signed-off-by: Fam Zheng >> >> --- >> >> This goes after "[PATCH v2 4/7] memory: Drop MemoryRegion.ram_addr" (or >> squashed into it if we want stric

Re: [PATCH] docs/system/s390x: Document the "loadparm" machine property

2022-11-15 Thread Janosch Frank
On 11/14/22 14:25, Thomas Huth wrote: The "loadparm" machine property is useful for selecting alternative kernels on the disk of the guest, but so far we do not tell the users yet how to use it. Add some documentation to fill this gap. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2128235

[PATCH v4 02/17] dump: Introduce GuestPhysBlock offset and length filter functions

2022-07-26 Thread Janosch Frank
lock_*() functions. Signed-off-by: Janosch Frank --- dump/dump.c | 37 + include/sysemu/dump.h | 5 + 2 files changed, 42 insertions(+) diff --git a/dump/dump.c b/dump/dump.c index 0ed7cf9c7b..0fd7c76c1e 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -

[PATCH v4 00/17] dump: Add arch section and s390x PV dump

2022-07-26 Thread Janosch Frank
Cleanup memblock usage" * Fixed whitespace problems and review comments * Added missing *errp check in dump_end Janosch Frank (17): dump: Rename write_elf_loads to write_elf_phdr_loads dump: Introduce GuestPhysBlock offset and length filter functions dump: Convert Guest

[PATCH v4 01/17] dump: Rename write_elf_loads to write_elf_phdr_loads

2022-07-26 Thread Janosch Frank
Let's make it a bit clearer that we write the program headers of the PT_LOAD type. Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau --- dump/dump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 4d9658ffa2..0ed7cf9c7b 1

[PATCH v4 04/17] dump: Rework get_start_block

2022-07-26 Thread Janosch Frank
-name the function to validate_start_block() Signed-off-by: Janosch Frank --- dump/dump.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 35b9833a00..b59faf9941 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -1498,30 +14

[PATCH v4 03/17] dump: Convert GuestPhysBlock iterators and use the filter functions

2022-07-26 Thread Janosch Frank
lock_*() functions. Signed-off-by: Janosch Frank --- dump/dump.c | 51 +++ 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 0fd7c76c1e..35b9833a00 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -628,56 +6

  1   2   3   4   5   6   7   8   9   >