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

68 Commits

Author SHA1 Message Date
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
setrofim
c2d81ea538 Merge pull request #14 from derkling/add_x86_support
bins: add busybox binary for x86_64 targets
2016-01-26 17:37:38 +00:00
setrofim
b1a7f3fcd0 Merge pull request #13 from derkling/fix_ftrace
ftrace: give more time for a trace to be collected
2016-01-26 17:36:52 +00:00
setrofim
d4686d08d1 Merge pull request #12 from derkling/fix_andoid_dirpull
android: add support to pull multiple files using wildcard expressions
2016-01-26 17:36:18 +00:00
Patrick Bellasi
ebd4349786 bins: add busybox binary for x86_64 targets
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-01-26 15:59:47 +00:00
Patrick Bellasi
82e951b4ce ftrace: give more time for a trace to be collected
The time required to fetch a trace depends not only on it time length but
also on the amount of events collected and the processing power of the
target device. This patch tries to factorise these last two components
into a 5x constant which is good enough to collect a relatively big trace
on a relatively slow device.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-01-26 15:59:14 +00:00
Patrick Bellasi
51b7f01d36 cpufreq: add functions to get frequencies and governors for all online CPUs
This patch adds a couple of shutils functions to efficiently read all
the frequencies/governors and returne them into a dictionary indexed by
CPU id.

The shutils functions are returning a line per each CPU that can be easily
converted into a dictionary in the host side.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-01-26 15:58:41 +00:00
Patrick Bellasi
cf761317bd cpufreq: switch to usage of shutils functions
This patch convert some functions to the usage of shutils provided calls.
This approach is more portable and allows to use these calls also on
an Android target.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-01-26 15:58:41 +00:00
Patrick Bellasi
f2eac51c69 target: add support for target side scripts
Some complex operations are faster if executed on the target side with the
help of a small script. For example, reading the current frequency and
or governor for all the online CPUs.

This patch adds a support script to be deployed on the target as well as
an internal utility function which allows to call functions provided by
that support script.

The support script has to be cross platform, thus:
1. only a limited set of shell functions can be used, which must be supported
   both in BASH and the Android shell
2. some paths needs to be defined depending on the specific target

To address the last constrain, this patch provides a "template" script which
contains some tokens "__DEVLIB_<TOKEN>__" that are replaced right before to
push the script on the target.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-01-26 15:58:41 +00:00
Patrick Bellasi
c93e3d6d83 android: add support to pull multiple files using wildcard expressions
The ADB pull command allows only to pull a single file or a whole directory.

This patch adds the required support to pull only a selection of files, from
a target folder, which match a path specified using '*' and/or '?' wildcards.
In this case we first get the list of files on the target, using the
wildcard expansion support provided by the "ls" command, and than we pull
each and every file returned from the previous command.

This operation mode is available only if the 'dest' parameter is a valid
host-side folder.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2016-01-26 15:57:16 +00:00
setrofim
dcf239b06c Merge pull request #11 from JaviMerino/warn_unsupported_module
target: warn if a module is not supported for the target
2016-01-18 18:07:06 +00:00
Javi Merino
d0c71fbc86 target: warn if a module is not supported for the target
When you create a target using devlib, you may not set
load_default_modules because you want to load a specific list of
modules.  In that case, raise a warning if one of those modules failed
to load, as it is something you are not expecting.

In the general case, the standard set of modules are tried to be loaded.
We know that they are not supported for all platforms so just emit a
debug message.
2016-01-18 17:31:00 +00:00
setrofim
217a97485b Merge pull request #10 from Leo-Yan/use_ordered_dictionary
Instrument: Add channel with ordered sequence
2016-01-07 10:40:58 +00:00
Leo Yan
3229bb181a Instrument: Add channel with ordered sequence
When add channel for power meter with specific order, it also imply the
order with corresponding fields in captured data. So later need read
back the index for channel and use it to reference power data.

So need use ordered dictionary object for channel.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
2016-01-06 10:18:21 +08:00
Sergei Trofimov
47bf915b7c platform: smarter detection of big cores
If big_core  is not explicitly specified by the user, it is populated by
Platform (provided the target has exactly two clusters). Perviously this
was done bu assuming that the target boots on little cluster and that
the last CPU is big. This is still used as a fallback, but now Platform
is ware of the names of big CPUs in currently existing big.LITTLE
configurations and uses that first to identify the big.
2015-12-16 17:19:40 +00:00
Sergei Trofimov
59f4f81447 Cpuinfo: extract CPU featurs from "flags" entry
get_cpu_features() now checks "flags" entry as well as "Features"
entries in cpuinfo section.
2015-12-15 18:08:53 +00:00
Sergei Trofimov
a1e991c12f vexpress-uboot: only set env if bootargs are specified
If env is specified, U-Boot module will wait for U-Boot prompt and then
interrupt the boot sequence so it should be updated. The vexpress module
that used it always set the env to contain bootargs (even if they were
None), always causing boot to be interrupted, even when that is not
necessary. This update means that boot will be interrupted only if
bootargs were specified (and therefore env needs to be updated).
2015-12-15 18:08:53 +00:00
setrofim
4c4d7f177e Merge pull request #9 from credp/junoenergymeter_instantaneous
JunoEnergyInstrument: Provide INSTANTANEOUS interface
2015-12-15 17:52:01 +00:00
setrofim
485b4a62e3 Merge pull request #8 from JaviMerino/fix_android_without_home
android: fix initialization without android
2015-12-15 17:46:32 +00:00
Chris Redpath
09915101d8 JunoEnergyInstrument: Provide INSTANTANEOUS interface
This allows clients to use the instrument more easily from their code
if they were previously used to using an HWMON-style interface.

In order to provide the measurement, the existing readenergy binary
is updated and changed so that if no output option is specified then
we just print the current values and exit.

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
2015-12-15 17:09:55 +00:00
Javi Merino
7f32efcb64 android: fix initialization without android
In workload automation, utils.android._initialize_without_android_home()
gets android_home from adb's path.  When this code was copied to devlib,
we mistakenly dropped parsing the output of "which" and instead call
os.path.dirname() on "adb", which always returns "" and makes
_initialize_without_android_home() fail.

Make _initialize_without_android_home() parse the output of "which"
again.
2015-12-15 13:43:56 +00:00
Sergei Trofimov
171cc25d50 AndroidTarget: fixed use of variables in as_root=True commands.
In order to execute as root, the command string gets echo'd into so;
previusly, double quotes were used in echo, which caused any veriables
in the command string to be expanded _before_ it was echoed.
2015-12-14 17:21:47 +00:00
Sergei Trofimov
f52bf79eb6 android: fixing exit code checking
This fixes an issue introduced in
64261a65cb

The addtional echo means that $? will always have "0" (the exit code for
the echo). This removes the extra echo, prepending \n to $? instead
2015-12-11 17:18:18 +00:00
Sergei Trofimov
2d9c0bf8a5 platform: adding default big core for ARM platforms.
Since for specific platforms (Juno/TC2) we know what the big core is, we
can set the big_core default so it doesn't have to be specified by the
user. Also remove validation prior to being updated from target and
setting little_core based on the value of big_core rather than by
indexing into core_names.
2015-12-10 14:21:02 +00:00
Sergei Trofimov
64261a65cb adb_shell: fixing handling of line breaks at the end of the output
- adb protcol uses "\r\n" for line breaks. This is not handled by
  Python's line break translation, as not a file. So spliting on '\n'
  when extracting the exit code resulted in stray '\r' in the output.
- adb_shell expects exit code to be echoed on the same line. This may
  not have been the case if latest output from executed command was not
  a complete line. An extra echo will now ensure that the exit code will
  be on its own line even in that case.
2015-11-24 12:50:02 +00:00
setrofim
42d41e9345 Merge pull request #5 from punitagrawal/master
module: Add thermal support
2015-11-24 11:52:23 +00:00
Punit Agrawal
c7fc01c6b5 module: Add thermal support
Add a thermal module that will allow querying for thermal zones and trip
points in the target. The module allow supports enable/disabling thermal
zones as well as change trip temperatures.

Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
2015-11-24 11:43:05 +00:00
Sergei Trofimov
40274101ad Version bump. 2015-11-19 09:41:24 +00:00
Sergei Trofimov
b53245344b target: fixed get_installed() on new targets
get_installed() looks in self.executables_directory for the binary. This
may not exist on a target (this is created when setup() is invoked).
This commit updated get_installed() to check whether target_directory
exists first, avoiding the error.
2015-11-18 18:11:59 +00:00
Sergei Trofimov
961f9576e5 target: resolve default paths eariler during the connection
Default paths for working_directory and exectuables_directory used to be
resolved at the end of the connect (because for Linux targets, the
default changes depending on the connection). This is now offloaded to a
separate internal method that is invoked earlier during connect() (after
the connection is established but before other connection actions are
resolved, as some of those actions rely on the directories being set).
2015-11-18 17:38:42 +00:00