Trace32 - command lock on sys.gtl - trace32

I am trying to debug a A53 and hexagon core.
I have attached the A53 core, which is now running. But when i run the hexagon core, I get command locked in SYS.GTL.LIBNAME "&GTLPATH\&GTLDllName" both the variables are substituted.
SYS.GTL.MODELNAME "model_name"
SYS.GTL.GPIONAME "GPIO_name"
SYS.GTL.LIBNAME "&GTLPATH\&GTLDllName"
cd "&DllPath"
SYS.GTL.CONNECT
cd "&currdir\.."
SYS.CONFIG.DAPNAME "dapname"
I have this config in startup.cmm of both a53 and hexagon cores.
But when I debug by stepping the cmm script, I am able to pass through the line and i am not facing any errors.
Is there any other config I am missing.

You have to execute the SYStem.GTL.LIBNAME command on both GUIs before any of them executes SYStem.Up or SYStem.Attach.

Related

Get user events from VTune doesn't work with attach to process

TLDR;
I am attempting to run a command line vtune attach to process analysis for some instrumented code with the application instrumentation lib supplied by intel. I have succeeded, in collecting user events when running within the vtune application (both command line and GUI). When I use -target-pid command line option to connect to the same application, user events do not show up in the profile. The environment setup suggested in the instructions for attaching to a process does not work.
The long version
I have broken this down again and again, and i have hit the minimum amount of things going on here. I am running Ubuntu 20.04 with intel vtune installed as part of the oneapi installer package. I have built an example application, which i can share, but it basically spawns threads and does some random computations. I have instrumented the code with itt as such:
#include <ittnotify.h>
__itt_event cloud_in_event = __itt_event_create( "CloudIn", 7 );
...
void add() {
__itt_event_start( cloud_in_event );
...
This works correctly when run through the gui. Aka, i compile my application with the following:
g++ -g -O3 -fno-asm -std=c++17 -I/opt/intel/oneapi/vtune/latest/sdk/include -DUSE_THR example.cpp -g -o ./example -lpthread -lm -L/opt/intel/oneapi/vtune/2021.4.0/sdk/lib64 -littnotify -ldl -D_LINUX
I start the gui using:
. /opt/intel/oneapi/setvars.sh && vtune-gui &
Run it using the cpu hotspot analysis in hw mode. The application runs and i get this in the output:
Yay, my user event is there. All is well.
The equivalent command line also works:
/opt/intel/oneapi/vtune/2021.4.0/bin64/vtune -collect hotspots -knob sampling-mode=hw -knob stack-size=0 -app-working-dir /home/development/example/example --app-working-dir=/home/development/example/example -- /home/development/hovermap/example/example
However, if i run the application on its own (using the correct setup for the link path in the environment variables for INTEL_LIBITTNOTIF), then attach with the GUI to that process (or with the command line). There are no user events (aka, the CloudIn event in the above image) in the profiler data.
If I print out the environment variables in the application, there are quite vast differences in the environments when profiling directly, vs when attaching. For example, there is the following:
INTEL_JIT_PROFILER32=/opt/intel/oneapi/vtune/2021.4.0/lib32/runtime/libittnotify_collector.so
INTEL_JIT_PROFILER64=/opt/intel/oneapi/vtune/2021.4.0/lib64/runtime/libittnotify_collector.so
ENABLE_JITPROFILING=1
Exists in the gui based run environment, but the setup instructional says nothing about these environment variables. I have also tried setting them with no luck.
Any ideas what extra stuff i need to set up?
If you want to attach to application that uses ITT API you need to set up additional environment variables before running it, for example:
export INTEL_LIBITTNOTIFY32=/opt/intel/oneapi/vtune/2021.4.0/lib64/runtime/libittnotify_collector.so
export INTEL_LIBITTNOTIFY64=/opt/intel/oneapi/vtune/2021.4.0/lib64/runtime/libittnotify_collector.so
./example
These environment variables are described in Attach ITT APIs to a Launched Application help topic in VTune User Guide.

Startup Multichain in WIndows Task Scheduler

I run command:
multichaind mychain -deamon
to start up the multichain program.
As per: https://www.multichain.com/developers/creating-connecting/
I'm running on Win 2012. I have tried putting this in a startup script using Windows Task Scheduler so that when the machine reboots, it will restart.
The task scheduler history shows it ran successfully, but it's not running. When I run the command
multichain-cli mychain getinfo
it says it cannot connect to the server.
And of course, that same command works when I start up multichain in a separate command prompt window.
My theory is that the command runs, but then the command windows is closed, but needs to remain open. Is there any way to do this, or debug what is going on?
I tried adding the parms as:
mychain -daemon >>d:\Software\Multichain\log.txt
hoping that it would write to the file so I could read it. But no file was created.
Update: I tried the .cmd file approach as recommended in the comment:
multichaind mychain -daemon
pause
That doesn't make sense to me because the first line should never finish.
It did create the log.txt file, but the whole thing still ran and quit in a few seconds:
d:\Software\Multichain>multichaind mychain -daemon 1>>d:\Software\Multichain\log.txt
d:\Software\Multichain>pause
Press any key to continue . . .

openocd freertos awareness can't start gdb

I have a setup with openocd and arm-none-eabi-gdb and I'm trying to debug a FreeRTOS fw.
I start openocd with:
openocd -f /usr/local/share/openocd/scripts/board/stm32f0discovery.cfg -c "stm32f0x.cpu configure -rtos auto"
That command works fine.
Then I run arm-none-eabi-gdb -tui and at the end of my .gdbinit I have:
target remote localhost:3333
monitor reset halt
file build/fw.elf
load
continue
focus next
But when I try to stop <ctrl>-c and start continue my fw all I get is the error:
Cannot execute this command without a live selected thread.
What am I missing?
I'm using a JLink Base debug probe.
My case is a bit different than yours, with a setup using QtCreator and its Baremetal plugin, but found a bug report where they state a workaround:
https://bugreports.qt.io/browse/QTCREATORBUG-18436
The workaround is pretty easy:
in GDB Init commands add "info threads" after load command. It fixes issue.
I tried it, and it worked, the error message was removed, and now I can see the different tasks in FreeRTOS.

Run python script with droneapi without terminal

I managed to run examples in command prompt after running mavproxy.py and loading droneapi. But when I double click on on my script, it throws me "'local_connect' is not defined", it runs in terminal as was told above, but I cannot run it only with double click. So my question is: Is there any way to run script using droneapi only with double click?
using Windows 8.1
Thanks in advance
You'll want to look at the Running an App/Example section of the guide. For now, you can only run a DroneKit script by launching it from inside the MAVProxy terminal. For example, after launching:
$ mavproxy.py --master=127.0.0.1:14550
MANUAL> module load droneapi.module.api
DroneAPI loaded
You can use the api start command to run a local script:
MANUAL> api start vehicle_state.py
STABILIZE>
Get all vehicle attribute values:
Location: Attitude: Attitude:pitch=-0.00405988190323,yaw=-0.0973932668567,roll=-0.00393210304901
Velocity: [0.06, -0.07, 0.0]
GPS: GPSInfo:fix=3,num_sat=10
groundspeed: 0.0
airspeed: 0.0
mount_status: [None, None, None]
Mode: STABILIZE
Armed: False
I think Sony Nguyen is asking for running the vehicle_state.py outside the Mavproxy command prompt, just like runnning the .py file normally.
I'm also looking for a solution as well.
You can only run dronekit from mavproxy at the moment (its structured as a mavproxy module, there are plans to restructure it), however if you simply want to avoid having to load up MavProxy and then running code manually, you can use the cmd flag:
mavproxy.py --cmd="api start app.py"

How to run a linux script before launching gdb debugging in Eclipse

How do I give commands to run before starting gdb debugging in Eclipse ?
Actually I want to execute few scripts that set environment variables (export vars) and execute a bunch of other programs before gdb process is launched from eclipse to debug my program.
I tried doing the following in debugger tab option:
<command> && <path-to-gdb-executable>
But I got the error that eclipse cannot execute gdb as given in above statement.
Please help - I actually want to execute a script called "before-launch-commands.sh" before debugging is started by gdb. I am trying to execute a cpp program under eclipse kepler.
Thanks.
The Eclipse Debug Configurations can already setup environment variables for you. I'm going to assume that that isn't sufficient, or you'd have already done it.
The first thing to do is create a new script, wrapped-gdb.sh:
#!/bin/sh
# Export any variables we need.
# Note that '.' (dot) is like an "include" statement.
. /path/to/before-launch-commands.sh
# Run GDB using the parameters passed in
exec /path/to/gdb "$#"
Next, set that script executable:
chmod +x /path/to/wrapped-gdb.sh
Finally, go to the Debugger tab in the debug configuration dialog, and in the box marked "GDB Debugger" enter /path/to/wrapped-gdb.sh.
When you launch your debug session it should now Do The Right Thing.