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.
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>
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.
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).
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>
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.
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.
This fixes an issue introduced in
64261a65cb8c4c7daeb35186f16d246d3211fa0a
The addtional echo means that $? will always have "0" (the exit code for
the echo). This removes the extra echo, prepending \n to $? instead
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.
- 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.
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>
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.
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).
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>