From: Daniel Lezcano <daniel.lezcano(a)linaro.org>
Add the support to run a command line with idlestat:
./idlestat -o out.dat -- /bin/sleep 3
Without the '-t' option, idlestat will blindly use the current buffer
size which may not fit with the 'command' duration and lead to a buffer
overflow.
With the example, it would make sense to set the buffer size:
./idlestat -o out.dat -t 3 -- /bin/sleep 3
This is a workaround, until we find a way to set the buffer size automatically.
Signed-off-by: Daniel Lezcano <daniel.lezcano(a)linaro.org>
---
idlestat.c | 49 +++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 43 insertions(+), 6 deletions(-)
diff --git a/idlestat.c b/idlestat.c
index 53ca1c7..f0c6467 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -36,6 +36,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/resource.h>
+#include <sys/wait.h>
#include <assert.h>
#include "idlestat.h"
@@ -112,6 +113,7 @@ static int display_states(struct cpuidle_cstates *cstates,
(c->min_time == DBL_MAX ? 0. : c->min_time),
c->max_time);
}
+
if (pstates) {
for (j = 0; j < pstates->max; j++) {
struct cpufreq_pstate *p = &(pstates->pstate[j]);
@@ -1022,7 +1024,7 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options)
return -1;
}
- return 0;
+ return optind;
}
static int idlestat_file_for_each_line(const char *path, void *data,
@@ -1108,14 +1110,47 @@ static int idlestat_wake_all(void)
return 0;
}
-int main(int argc, char *argv[])
+static int execute(int argc, char *argv[], char *const envp[],
+ struct idledebug_options *options)
+{
+ pid_t pid;
+ int status;
+
+ /* Nothing to execute, just wait an amount of time */
+ if (!argc)
+ return sleep(options->duration);
+
+ pid = fork();
+ if (pid < 0) {
+ perror("fork");
+ return -1;
+ }
+
+ if (pid == 0 && execve(argv[0], argv, envp)) {
+ perror("execv");
+ exit(1);
+ }
+
+ if (pid) {
+ waitpid(pid, &status, 0);
+
+ if (WIFEXITED(status) && !WEXITSTATUS(status))
+ return 0;
+ }
+
+ return -1;
+}
+
+int main(int argc, char *argv[], char *const envp[])
{
struct cpuidle_datas *datas;
struct cpuidle_datas *cluster;
struct idledebug_options options;
struct rusage rusage;
+ int args;
- if (getoptions(argc, argv, &options))
+ args = getoptions(argc, argv, &options);
+ if (args <= 0)
return 1;
/* We have to manipulate some files only accessible to root */
@@ -1128,7 +1163,7 @@ int main(int argc, char *argv[])
init_cpu_topo_info();
/* Acquisition time specified means we will get the traces */
- if (options.duration) {
+ if (options.duration || args < argc) {
/* Read cpu topology info from sysfs */
read_sysfs_cpu_topo();
@@ -1151,14 +1186,16 @@ int main(int argc, char *argv[])
/* Start the recording */
if (idlestat_trace_enable(true))
return -1;
+
/* We want to prevent to begin the acquisition with a cpu in
* idle state because we won't be able later to close the
* state and to determine which state it was. */
if (idlestat_wake_all())
return -1;
- /* Do nothing */
- sleep(options.duration);
+ /* Execute the command or wait a specified delay */
+ if (execute(argc - args, &argv[args], envp, &options))
+ return -1;
/* Wake up all cpus again to account for last idle state */
if (idlestat_wake_all())
--
1.7.9.5
Hi. I am interested in participating in Google Summer of Code - 2014 with
Linaro and working on two of the ideas from Ideas page [1]:
AArch64 porting of Free Software Packages - I am amazed going through the
details mentioned at [2] about the use of assembly in packages. I would
like to discover more, and figure out where I could contribute.
Port UEFI to Low-Cost Embedded Platform - Although I have not used a system
with UEFI before, I want to know more about the low level interaction that
occurs between the kernel and the hardware.
Please help me get started and gain a better understanding of what
implementing each of these ideas would involve.
About me:
I can program with C, Perl, Python, Processing and Shell Scripts. I built a
game for the Intel Perceptual Computing Challenge-2013 [3] and have
experience with development for the Beagleboard and Pandaboard. I am
currently reading Greg K-H's Linux Device Drivers to figure out how drivers
work. I am also learning the x86 assembly language. I have been an open source
user for a long time, and have a commit integrated into GNOME's Anjuta IDE
[4]
I recently worked with Red Hat on testing the effectiveness of random
number generators on a virtual machine with qemu.[5]
I also have a fair know-how of git.
[1] https://wiki.linaro.org/SummerOfCode2014/ProjectIdeas
[2] https://wiki.linaro.org/LEG/Engineering/OPTIM/Assembly
[3]
http://varadgautam.wordpress.com/2013/09/26/bender-a-game-using-the-intel-p…
[4]
https://git.gnome.org/browse/anjuta/commit/?id=eb10532632014b59505c788ffad4…
[5]
http://varadgautam.wordpress.com/2013/12/17/dieharder-tests-on-a-qemu-vm-1-…
Thanks.
Varad
Hello,
As final steps of migrating infrastructure/CI projects from bzr to git,
lci-build-tools repository (having a shortcut of lp:linaro-ci) was
migrated to https://git.linaro.org/ci/lci-build-tools.git . All jobs
directly referencing it on https://ci.linaro.org were already updated.
However, according to Fathi, there may be wrapper build scripts, hosted
elsewhere, which may fetch lci-build-tools on their own. So, if you
use/maintain such script, please update it to use git. It should be
something like replacing:
bzr branch lp:linaro-ci lci-build-tools
with:
git clone https://git.linaro.org/ci/lci-build-tools.git
Please kindly update your scripts during next week. On March 21, bzr
repository will be shutdown, in an effort to formally finish
the migration, catch last usages of the old repository, and avoid future
confusion.
Let us know if you have concerns with the plan above.
Thanks,
Linaro Infrastructure team
Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linarohttp://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog
Hi,
I'm struggling with this problem for days.
I've compiled kernel using yocto for beagleboard xm.
*After kernel is booted, no termial login prompt shows up :/*
I suppose that the problem is related with moving to ttyO2 from ttyS0
u-boot commands:
setenv bootcmd 'mmc init; fatload mmc 0:1 0x80300000 zImage.bin; bootz
0x80300000'
setenv bootargs 'console=tty0 console=ttyO2,115200n8 root=/dev/mmcblk0p2 rw
rootfstype=ext3 rootwait'
qemu :
/usr/local/bin/qemu-system-arm -M beaglexm -drive
if=sd,cache=writeback,file=/dev/sdb -clock unix -serial stdio
inittab line:
O2:12345:respawn:/sbin/getty 115200 ttyO2
nothing shows up in tty0 or ttyO2 (except kernel info)
Version of qemu: 1.7.0
It could be related to https://bugs.launchpad.net/qemu-linaro/+bug/714600
Hi,
After a solid few months of work the QEMU master branch [1] has now reached
instruction feature parity with the suse-1.6 [6] tree that a lot of people
have been using to build various aarch64 binaries. In addition to the
SUSE work we have fixed numerous edge cases and finished off classes of
instructions. All instructions have been verified with Peter's RISU
random instruction testing tool. I have also built and run many
packages as well as built gcc and passed most of the aarch64 specific tests.
I've tested against the following aarch64 rootfs:
* SUSE [2]
* Debian [3]
* Ubuntu Saucy [4]
In my tree the remaining insns that the GCC aarch64 tests need to
implement are:
FRECPE
FRECPX
CLS (2 misc variant)
CLZ (2 misc variant)
FSQRT
FRINTZ
FCVTZS
Which I'm currently working though now. However for most build tasks I
expect the instructions in master [1] will be enough.
If you want the latest instructions working their way to mainline you
are free to use my tree [5] which currently has:
* Additional NEON/SIMD instructions
* sendmsg syscall
* Improved helper scripts for setting up binfmt_misc
* The ability to set QEMU_LOG_FILENAME to /path/to/something-%d.log
- this is useful when tests are failing N-levels deep as %d is
replaced with the pid
Feedback I'm interested in
==========================
* Any instruction failure (please include the log line with the
unsupported message)
* Any aarch64 specific failures (i.e. not generic QEMU threading flakeiness).
If you need to catch me in real time I'm available on #qemu (stsquad)
and #linaro-virtualization (ajb-linaro).
Many thanks to the SUSE guys for getting the aarch64 train rolling. I
hope your happy with the final result ;-)
Cheers,
--
Alex Bennée
QEMU/KVM Hacker for Linaro
[1] git://git.qemu.org/qemu.git master
[2] http://download.opensuse.org/ports/aarch64/distribution/13.1/appliances/ope…
[3] http://people.debian.org/~wookey/bootstrap/rootfs/debian-unstable-arm64.tar…
[4] http://people.debian.org/~wookey/bootstrap/rootfs/saucy-arm64.tar.gz
[5] https://github.com/stsquad/qemu/tree/ajb-a64-working
[6] https://github.com/susematz/qemu/tree/aarch64-1.6
Hello,
I have two questions:
1- I was wondering what should be the expected semantics of
"flush_cache_all" on a Big.LITTLE architecture.
I can see that the implementation of this function under linux kernel
is doing the following:
a- Read the value of LoC ( level of coherency )
b- Flush each level of cache to that LoC value using DCCISW
co-processor register.
My expectation would be that if this is executed on one of the
processors of the Big cluster it should flush all L1 and L2 caches on
this cluster and then signal the CCI interconnect of the cache
cleaning operation and then the CCI interconnect would propagate this
signal downstream to the LITTLE cluster. This will mean that at the
end all cache will be flushed.
Is that the proper semantics of this operation ?
or it's only going to affect this CPU and no other CPUs in the cluster
( and consequently no other CPUs on the other cluster ). And if that's
the case, does this mean that I've to do the cache flushing per_cpu ?
2- and Is there a difference in semantics between flushing each cache
till I reach the Level of coherency ( using DCCISW register ) and
flushing the first cache only to the point of coherency ( using
DCCIMVAC register ) ?
Thanks.
--
Karim Allah Ahmed.
Anyone with a VE board ever encounter something like this?
---------- Forwarded message ----------
From: Bibhuti Panigrahi <bibhuti.panigrahi(a)linaro.org>
Date: Tue, Mar 11, 2014 at 5:14 AM
Subject: Issue while booting up VE board
To: Tom Gall <tom.gall(a)linaro.org>
Hi Tom,
I am finding below issues while booting the Versatile Express board.
The board boots and u-boot prompt comes but after that it gets powered
down because of exceeding power limit (seems to be some PMIC issue).
Please find the detailed log below:
Cmd>
ARM V2M Boot loader v1.1.2
HBI0190 build 2199
ARM V2M Firmware v3.1.1
Build Date: Aug 20 2012
Date: Wed 13 Sep 2006
Time: 05:38:05
Cmd>
Powering up system...
Daughterboard fitted to site 1.
Switching on ATXPSU...
ATX3V3: ON
VIOset: 1.8V
WARNING: PSU 1V0 : 0.79V (21% error)
ERROR: PSU 1V0 outside limit, switching off...
Powering down, switching on UART0 bypass.
Powering down...
Disabling debug USB.
Switching off ATX PSU.
Board powered down, use REBOOT to restart
Cmd>
Please let me know if you have any pointer to this.
Regards,
Bibhuti
--
Regards,
Tom
"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com