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

135 Commits

Author SHA1 Message Date
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
setrofim
d4c8b0f222 Merge pull request #4 from derkling/cpufreq-tracing
Add support to properly trace CPUs frequencies
2015-11-16 18:06:10 +00:00
Patrick Bellasi
a7cfd28bd0 ftrace: force report CPU frequencies at trace start and stop
When the cpufreq module is loaded, quite likely we want to run experiments
which involve an analysis of frequencies transitions. However, if during
an experiment there are not cpu_frequency events, the generated trace
does not allows to know at which frequency the experiment has been executed.
This happens for example when we are running at constant frequency or just
because the workload is not generating a variable capacity request in the
system.

This path ensure the a "cpu_frequency" events is always generated at the
beginning and at the end of a collected trace. This support is required
for example to properly plot CPUs frequencies event when there are not
CPUFreq generated changes of OPP.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-11-16 17:47:58 +00:00
Patrick Bellasi
701e6adf7a cpufreq: add method to trace current frequencies
This patch add a method which allows to inject into a trace a "cpu_frequency"
event for each CPU reporting the current frequency the CPU is running at.
Such a method could be useful to force report CPUs frequency into a trace
file, for example at tracing start and stop, thus allowing to know always
at which frequency an experiment has been executed.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-11-16 17:47:58 +00:00
setrofim
f46057f836 Merge pull request #3 from derkling/drk-for-master
Fixes and additions for master
2015-11-13 08:24:09 +00:00
setrofim
b6ae0f4aa2 Merge pull request #2 from derkling/drk-adds
CPUFreq: add some methods
2015-11-13 08:23:57 +00:00
Patrick Bellasi
b598b38f12 cpufreq: add methods to configure all CPUs at once
Sometimes it could be required to change governor or frequency for a all the
online CPUs of a target. This patch provides an utility method to easily
do that using a single method call.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-11-12 19:35:25 +00:00
Patrick Bellasi
4dcb4974e5 cpufreq: add methods to set the governor for a specified set of CPUs
Sometimes it could be required to change the governor for a set of different
CPUs. This patch provides an utility method to easily and achieve that with
a single method call.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-11-12 19:35:25 +00:00
Patrick Bellasi
9c9a74826a cgroups: big refactoring to make it more generic
This patch refactors the CGroup module to support multiple controllers.
The new interface is based on two main classes:

.:: Controller(kind)

    Provides a wrapper class for a CGgroup controller of "kind".
    At module initialization time, all the controller available in the
    system are enumerated and a corresponding controller class created.

    A valid reference to the Controller class for a specific CGroup
    controller can be obtained using the controller(kind) method exposed
    by the module, e.g. to get a reference to the CPUSET controller:
	cpuset = target.cgroups.controller('cpuset')

.:: CGroup(name)

    Provides a wrapper class for a CGroup of "name", i.e. a folder which
    path is "name" relative to the controller mount point.
    At module initialization time, the root control group for each
    controller is created by the controller class.

    A valid reference to a CGroup for a specific controller can be
    obtained using the cgroup(name) method exposed by the controller
    object, e.g. to get a reference to the "/LITTLE" cgroup of the
    cpuset controller:
        cpuset_littles = cpuset.cgroup('/LITTLE')

The CGroup object exposes simple get()/set() methods which allows to
read and configure all the supported attributes of a controller.

For example, to set the "cpus" of a cpuset control group:
       cpuset_littles.set(cpus=[0,1])

NOTE: the set() method accepts a variable list of parameters which name
must match a valid (writable) attribute for that controller.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-11-12 19:20:09 +00:00
Patrick Bellasi
10c80a94ad ssh: disable commands echo
This should help on fixing issue related to echoed commands which make
it difficult to parse the commands results.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-11-10 18:30:48 +00:00
Patrick Bellasi
5d288efa9c ssh: increase terminal size to avoid issues with echoed command parsing
By default the terminal emulated by pxssh is 24x80 in size, which force
the addition of unwanted "\r" in long commands. These \r are painful to
parse and remove from the echoed command.

This patch tries to alleviate this issue by setting a bigger TTY terminal
by default. A 200 columns display should be big enough to execute most
of the commands. In case longer commands are required it is better
have them on a script to push on the target for execution.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-11-10 18:30:48 +00:00
setrofim
db14589886 Merge pull request #1 from derkling/drk-fixups
Fixup some modules initialization
2015-10-16 10:45:35 +01:00
Patrick Bellasi
68e5e83864 utils/serial_port: fix fdpexpect import for pexpect versions >= 4.0
The pexpect module exposes a fdpexpect class starting from version 4.0.
This patch makes uses of the proper pxssh import statement depending on the
version of pexpect available in the host.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-10-12 18:35:29 +01:00
Patrick Bellasi
c1d7cfafcc utils/ssh: fix pxssh import for pexpect versions >= 4.0
The pexpect module exposes a pxssh class starting from version 4.0.
This patch makes uses of the proper pxssh import statement depending on the
version of pexpect available in the host.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-10-12 18:35:29 +01:00
Patrick Bellasi
b83e51856d target: fix 'bl' module initialisation
When "load_default_modules" is set to False at target initialisation time
but the "bl" module is explicitly required, the initialization of this module
fails because the system as not yet been identified as a big.LITTLE.
This identification is performed by platform.update_from_target.

This patch post-pone modules initialisation at the end of the connection
method to ensure that all the required information are available at modules
probe time.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-10-12 18:35:29 +01:00
Patrick Bellasi
cbe80da3a1 cpufreq: make probing more robust
On some machines, when a different CPUFreq policy could be configured
for each CPU, there is not a top-level 'cpufreq' folder exposed
at top level but just per-CPU ones.

This patch makes the probing for CPUFreq support more robust by checking
on all the supported paths.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-10-12 18:35:29 +01:00
Patrick Bellasi
b19d76d4b0 cpufreq: fix probe method to support Intel machine
Recent Intel machines uses the CPUFreq pstate driver, which does not create
the standard "/sys/devices/system/cpu/cpufreq" folder usually created by
other (mostly ARM platform) drivers.

This patch fixes the probe method to check for the propert pstate driver
being available in order to enabled the CPUFreq module.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-10-12 18:35:29 +01:00
Patrick Bellasi
7ba791b2a7 hotplug: make hotplug probing more robust
In general it makes not sense to hotplug out all the CPUs of a system, thus
ususally CPU0 is configured as not hot/plugggable.
Definitively, on a single core system it does not make sense to hotpolug out
the only available CPU.

This patch switch to usage of CPU1 for hotplug support probing, which is the
really first one for which enabling hotplug could be useful.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2015-10-12 18:35:29 +01:00
Sergei Trofimov
4e6afe960b devlib initial commit. 2015-10-09 09:30:04 +01:00