1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 10:50:51 +01:00
Commit Graph

297 Commits

Author SHA1 Message Date
Patrick Bellasi
658005a178 cgroups: properly format attributes path and check for being supported
CGroups controller can be mounted by specifying a "noprefix" option,
in which case attribute names are named as:
   <mountpoint>/<attribute_name>
instead of the (more recent) naming schema using:
   <mountpoint>/<contoller_name>.<attribute_name>

For example, Android uses the old format for backward compatibility
with user-space. Thus, it's possible in general to work on a target
system where some controller are mounted "noprefix" while others not.

This patchset adds a set of updates which allows to use the proper
attributes naming schema based on how the controller has been mounted.

This patch makes use of the Controller::_noprefix option to properly
build the attribute path. It adds also a check which reports a more
clear error in case an attribute is set which is not provided by the
controller.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-04-26 16:38:25 +01:00
Patrick Bellasi
15f9c03b45 cgroups: keep track if a controller is mounted with noprefix option
CGroups controller can be mounted by specifying a "noprefix" option,
in which case attribute names are named as:
   <mountpoint>/<attribute_name>
instead of the (more recent) naming schema using:
   <mountpoint>/<contoller_name>.<attribute_name>

For example, Android uses the old format for backward compatibility
with user-space. Thus, it's possible in general to work on a target
system where some controller are mounted "noprefix" while others not.

This patchset adds a set of updates which allows to use the proper
attributes naming schema based on how the controller has been mounted.

This first patch keeps track of whatever a controller has been mounted
using the noprefix option.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-04-26 16:38:21 +01:00
Patrick Bellasi
28739397c0 cgroups: add a couple of functions to move tasks among groups
This patch provides a couple of utility functions which makes it
easy to run a command under a specific CGroup or to move all tasks
from a group to another.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-04-22 11:43:49 +01:00
setrofim
741157c000 Merge pull request #31 from derkling/fix-newline-separator
fix: AdbConnection: added automatic detection of new line separators
2016-03-29 09:26:06 +01:00
Patrick Bellasi
c2329bd80e fix: AdbConnection: added automatic detection of new line separators
The newline separator is a property of AdbConnection while the adb_shell is
just a method of the android module, thus we do not have a "self" pointer
to and AdbConnection from within the adb_shell function.

This patch fixes 8de24b5 by exposing the newline_separator used by adb_shell
as a parameter of that method and using the AdbConnection::newline_separator
to properly initialize it at executue() time.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-03-28 12:29:45 +01:00
setrofim
10978b0fd7 Merge pull request #29 from ep1cman/fixes
AdbConnection: added automatic detection of new line separators
2016-03-23 15:20:58 +00:00
Sebastian Goscik
8de24b5601 AdbConnection: added automatic detection of new line separators 2016-03-23 15:10:26 +00:00
Morten Rasmussen
192fb52cae Fix typos in overview documentation 2016-03-21 15:15:26 +00:00
Sergei Trofimov
6bda8cb867 AndroidTarget: do not set executables_directory inside __init__
This is already being resolved inside the base's __init__.
2016-03-04 18:34:09 +00:00
setrofim
91f4f97a0b Merge pull request #25 from mdigiorgio/bg-as_root
ssh: add possibility to run command in background as root
2016-03-01 14:37:51 +00:00
Michele Di Giorgio
3bf3017f85 ssh: add possibility to run command in background as root
Executing a command as root was not possible when running it in background.
This is done in a similar way as with a standard execute call.

This was also a bug in ssh.py because if you tried to run a background command
on the target, the background function in target.py was passing the as_root
parameter which was not present in ssh.py.

Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
2016-03-01 11:12:10 +00:00
setrofim
95aaa2662e Merge pull request #17 from derkling/ftrace_optional_confs
FTrace: optional function and events
2016-02-26 08:23:46 +00:00
setrofim
fbe4c4b730 Merge pull request #24 from derkling/cgroup-fixups
cgroup: demote info logging statement
2016-02-26 08:23:05 +00:00
Patrick Bellasi
7112cfef3a cgroup: demote info logging statement
The info statements are clobbering the "normal" output of devlib users.
This patch demote the logging to debug level. The user can still
log-report these information from the corresponding functions call site.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-02-25 18:47:39 +00:00
Patrick Bellasi
32defe1ce3 ftrace: demote info logging statement
This is the only info statement which is thus clobbering the "normal"
output of a client ueser for that devlib. This patch demote the logging
to debug level. The user can still log-report the output file which is also
an input parameter.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-02-25 18:47:31 +00:00
Patrick Bellasi
78aa774e25 ftrace: disable trace events not available in the target kernel
In general we could be interested to define a common configuration to use
across different kernels. Thus, for a given set of experiments, some
trace events can be present only on some kernels and not others.

This patch introduces a check for the availability of trace events by
ensuring that we consider only those available in the kernel in use
in the target. In case of a trace event is not supported in the target
kernel we still log a warning.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-02-25 18:47:31 +00:00
Patrick Bellasi
d7bbad3aac ftrace: disable tracing of functions not available in the target kernel
In general we could be interested to defined a common configuration to use
across different kernels. Thus, for a given set of experiments, some
functions can be present only on some kernels and not others.

This patch updates the check for the availability of functions to profile by
ensuring that we consider only functions available in the kernel in use
in the target. In case of a function cannot be profiled in the target kernel
we log a warning instead of raising an exception.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-02-25 18:47:31 +00:00
Patrick Bellasi
a8dfd2e744 ftrace: bugfix start marker injection
The start marker must be inserted when tracing has been already enabled.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-02-25 18:47:31 +00:00
Sergei Trofimov
ebe3a8a0a8 LinuxTarget: fixing reboot sequence
When issuing a target.reboot(), the reset was immediately followed by a
boot() (for platforms that have it) and an attempt to connect. When
issuing a soft reset, it's possible the target is still shutting down
when the attempt to connect is made. This results in the connection
succeeding but being severed shortly thereafter.

This introduces a delay after the reset to the reboot sequence, giving
the target time to shutdown and improves the handling of EOF's that
result from failed reconnection attempts (while still being with the
allotted timeout period.
2016-02-25 10:28:45 +00:00
setrofim
9c89ca0437 Merge pull request #22 from derkling/cgroup-fixups
Cgroup fixups
2016-02-24 14:32:13 +00:00
setrofim
3f804a42fe Merge pull request #23 from ep1cman/fixes
uname: Fixed calls to uname to use busybox
2016-02-24 14:30:46 +00:00
Sebastian Goscik
bdbf474023 uname: Fixed calls to uname to use busybox
Not all devices have uname, since devlib deploys its own busybox binary
the most portable way to use uname is to use it via busybox.
2016-02-24 14:29:05 +00:00
Patrick Bellasi
e2e5e687e9 cgroups: use splitlines instead of split('\n')
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-02-24 11:22:48 +00:00
Patrick Bellasi
a65ff13617 cgroups: fix attributes reporting for controller with only one attribute
The current code used to read the attributes values for a controller uses
a "grep '' CONTROLLER.*" under the assumption that the output is a list of
   file:value
However, if there is a single controller attribute, grep does not report
the file name in output thus returning an empty list at the python side.

This patch fix that issue by also switching to the usage of a shutil
implementation of the attributes parsing code.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-02-24 11:22:48 +00:00
setrofim
615f1ce5e8 Merge pull request #21 from ep1cman/fixes
Fixes
2016-02-23 17:15:00 +00:00
Sebastian Goscik
f5b7c82f52 AndroidTarget & LinuxTarget: Added a model property 2016-02-23 17:11:26 +00:00
Sebastian Goscik
a7f6ddb05a LocalConnection: Added a password parameter
This means it can now be set programatically and not always require
a prompt.
2016-02-23 17:11:26 +00:00
setrofim
f420612b5b Merge pull request #19 from ep1cman/fixes
AndroidTarget: Added package data and extrenal storage path settings
2016-02-23 10:35:46 +00:00
Sebastian Goscik
040daab2cb Target: Fixed fstab parsing 2016-02-23 10:30:02 +00:00
Sebastian Goscik
0a8b0c6989 AndroidTarget: Added package data and extrenal storage path settings
`package_data_directory` and `external_storage_directory` are now arguments of AndroidTarget
2016-02-23 10:30:02 +00:00
setrofim
e7aea717cc Merge pull request #18 from ep1cman/fixes
Updates to support WA integration
2016-02-16 12:51:08 +00:00
Sebastian Goscik
0c11289e18 Android: Updated ANDROID_VERSION_MAP 2016-02-15 15:55:59 +00:00
Sebastian Goscik
ff8261e44b AndroidTarget: Updated default executables_directory
Now defaults to '/data/local/tmp' which is both executable and writable
on all android devices, including production ones.
2016-02-15 15:55:59 +00:00
Sebastian Goscik
1424cebb90 Added quotes around commands using raw paths
This fixes issues with spaces in path names.
2016-02-15 15:46:35 +00:00
Sebastian Goscik
aab487c1ac pylint 2016-02-15 15:44:38 +00:00
Sebastian Goscik
880a0bcb7c AndroidTarget: Added swipe direction to swipe_to_unlock
swipe_to_unlock can now do either horizontal or vertical swipes to
unlock a target
2016-02-15 15:44:38 +00:00
Sebastian Goscik
cafeb81b83 AndroidTarget: Added android_id property
Get the device's ANDROID_ID. Which is
  "A 64-bit number (as a hex string) that is randomly generated when the user
   first sets up the device and should remain constant for the lifetime of the
   user's device."
2016-02-15 15:44:38 +00:00
Sebastian Goscik
be8f972f60 Target: Added install_if_needed method
This method will first search the target for a binary, only installing
it, if one was not found.
2016-02-15 15:44:33 +00:00
Sebastian Goscik
84151f953a Target: Modified get_installed search order
Changed get_installed to search self.executables_directory first.
This means that user provided binaries will be used over system ones.

Also added the option to not search system folders for a binary.
2016-02-15 15:09:27 +00:00
Sebastian Goscik
33603c6648 Target: Added directory_exists method 2016-02-15 15:07:19 +00:00
Sebastian Goscik
1890db7c04 AndroidTarget: Updated ANDROID_SCREEN_STATE_REGEX
The format of "dumpsys power" changed in Android M
2016-02-15 14:43:30 +00:00
Sergei Trofimov
40fce1392a ARM platforms: fixing big_core setting.
Juno and TC2 platfroms where ignorring big_core parameter passed in,
always setting it to their corresponding defaults. This removes that
problem, and removes the setting of the big core defaults entirely, as
they would be adentified through the regular Platform mechanism.
2016-02-02 12:36:56 +00:00
Sergei Trofimov
10a80d2335 target: added insmod() method.
This allows to install a kernel module from a host-side path.
2016-01-27 17:02:59 +00:00
Sergei Trofimov
5a81fe9888 target: added lsmod method
Added a wrapper for lsmod that parses the output into named tuples.
2016-01-27 16:51:48 +00:00
setrofim
798745ff4e Merge pull request #16 from derkling/add_ftrace_function_profiling
Add ftrace function profiling
2016-01-27 10:41:59 +00:00
Patrick Bellasi
082a82c7c5 ftrace: add support to report function profiling data
Functions profiling data are reported in a set of files, one for each CPU.

This patch adds the required support to collect these data into a single
JSON formatted file. Data are collected using a shutils routing on the
target side and formatted in JSON on the host side.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-01-26 18:37:53 +00:00
Patrick Bellasi
7f5a150b4f ftrace: add support to collect function stats
Function stats can be collected while events are accumulated into a trace.

This function adds the required support to start and stop functions
profiling across a trace collection.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-01-26 18:37:51 +00:00
Patrick Bellasi
c5bc987226 ftrace: add initial support for function profiling
FTrace allows to collect profiling stats for kernel functions.
This patch adds the initial support which allows to specify a list of
kernel function we would like to profile.

If a list of functions to profile is specified, for each specified function
we check for that function to be actually one of the available instrumented
functions which can be monitored by FTrace.
If a function is not supported, we throw an expection so that the user
is aware about the analysis which is going to do.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-01-26 18:37:24 +00:00
Patrick Bellasi
bda7a16656 ftrace: move file path definitions
All ftrace generated files are present under a common base folder.

This patch updates the FtraceCollector API to exposes just the common
base folder from where all the other paths can be generated.
This is a refactoring patch which makes it easier to add further attributes.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-01-26 18:36:39 +00:00
setrofim
3f1577dd02 Merge pull request #15 from derkling/add_shutils_support
Add shutils support
2016-01-26 17:41:02 +00:00