run-y

run-y is the command to run y language script.

Usage

Usage: run-y [y language file] [OPTIONS]

OPTIONS:
    -a, --agent integer                Agent id. Specify the agent to run the y language script.
    -e string                          Y language script. Only one of y language file and -e option can be specified.
    -v, --verbose                      Print verbose informations.
    -q, --quiet                        Avoid print verbose informations.
    --print-job-uri                    Print the job uri after running the script.
    -p, --pid integer                  Target process ID.  Specify the process id to be analyzed by the y language.
    -f, --file string                  Process file. Specify the path to the process file to be analyzed in y language.

Example

1. run y language script by -e option

# run-y -e '_probe _begin { printf("Hello, world!\n"); _exit(); }'
info: agent: running tool cli-tool-988 ...
Start tracing...
Hello, world!

2. run y language script by y language file

# run-y hello.y
info: agent: running tool cli-tool-70878 ...
Start tracing...
Hello, world!

3. run y language script on the specified agent, the default agent is local machine

# run-y hello.y -a 1294
info: agent: running tool cli-tool-65009 ...
Start tracing...
Hello, world!

4. run y language script and print verbose informations

# run-y hello.y -v
info: start to run job(4371497725) on the console side
info: job directory: 2021-12-08/07/job-4371497725
info: analyze the whole system
info: job runtime: stap
info: start to compile opslang in cli-tool-34539
info: sending the compiled opslang to agent
info: agent: start to run the tool: cli-tool-34539
info: agent: start to collect process build info
info: agent: build info hit the cache
info: agent: orxray_cli_tool_87441_XXXXXXX.ko hit the cache
info: agent: start to run the tool
info: agent: running tool cli-tool-34539 ...
Start tracing...
Hello, world!
real    0m0.382s
user    0m0.013s
sys     0m0.043s

5. run y language script and print job uri

#run-y hello.y --print-job-uri
info: agent: running tool cli-tool-94185 ...
Start tracing...
Hello, world!
Goto https://xxxx.xray.xxx.com.cn/targets/1294/history/4371497759