gdb: make 'osv leak show' work with python3

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
gdb: fix 'osv leak show'

Traceback (most recent call last):
  File "/home/tgrabiec/src/osv/scripts/loader.py", line 1165, in invoke
    show_leak()
  File "/home/tgrabiec/src/osv/scripts/loader.py", line 1104, in show_leak
    si = syminfo(f)
  File "/home/tgrabiec/src/osv/scripts/loader.py", line 117, in syminfo
    return symbol_formatter(syminfo_resolver(addr))
TypeError: object() takes no parameters
Error occurred in Python command: object() takes no parameters

Reported-by: Gleb Natapov <gleb@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Remove warning from mgmt.log when no tests are present

Fixes #282

Signed-off-by: Jaspal Singh Dhillon <jaspal.iiith@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
aarch64: exceptions: implement interrupt table

implement a simple interrupt table with descriptors
which record interrupt IDs, handlers and interrupt type.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
ec2-upload: Fix batch upload with small instances

Due to a global variable in image type definition code
small instance directive becomes sticky and applies automatically
to all further images of the batch.

Fixed by making the variable local.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
shrinker: export to C

Export the shrinker interface to C users.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: fix trace list-timed

Broken by commit 1e53a52f6664b0c53a3d867386565511efeae25a.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: unify timed trace extraction

The algorithm was duplicated between 'prof-wait','prof-lock' and 'list
timed','summary --timed'. This change unifies all paths.

As a side effect, mutex_lock_wait/mutex_lock_wake pair is now
recognized as timed sample and appears in 'summary --timed' and
'trace list-timed'

This refactoring will also make it easy to declare timed samples which
are correlated by data rather than calling thread.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: introduce 'prof-timed' command

This command shows a duration profile like 'prof-wait' or 'prof-lock'
but is more generic, it can work with any timed traces.

'trace prof-wait' is equivalent of 'trace prof-timed -t sched_wait'
'trace prof-lock' is equivalent of 'trace prof-timed -t mutex_lock_wait'

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: increase coverage of trace.py

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: make timed-trace recognition handle discontinuous streams properly

This change aims to reduce the likelihood of running into issue
merged stream may not be. If samples cross CPUs and the CPU of the
second sample has its earliest sample after the first sample, we
ignore that pair as the second sample has a high chance of belonging
to other pair.

This change does not solve the problem completly because there may be
a situation when sample which was recorded on another CPU was
discarded and the next sample will be again on the first CPU.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
debug: allow debug_early to work really early again

an effect of commit 9bbbe9dc is that no output is possible
before prio 'console' initializers have been run.
This change allows to have at least one API available
really early (from boot code and premain).
Document the requirements for the early console class
regarding the write() method.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
aarch64: exceptions: fix debug statements

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
aarch64: smp: prepare GIC initialization per cpu

arch::init_on_cpu should initialize the gic cpu interface,
but not for the boot CPU, for which this has already been
done.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
aarch64: smp: do not forget to create incoming_wakeups

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
aarch64: implement basic General Timers infrastructure

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
aarch64: implement exception entry and exit

generate exception frame

Signed-off-by: Jani Kokkonen <jani.kokkonen@huawei.com>
Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
aarch64: arch-switch: implement switch to first

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
aarch64: implement page fault, fixup, backtrace

implement page fault handling, including fixup fault,
and backtrace which is the first simple user.

Signed-off-by: Jani Kokkonen <jani.kokkonen@huawei.com>

[claudio: added elf changes to allow lookup and demangling to work]

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
aarch64: loader: allow execution to main_cont

allow execution to flow until main_cont
so we can reach the backtrace.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>