PATROL Virtual Machine


The following figure depicts the workings of the PATROL virtual machine.

PATROL Virtual Machine

Patrol Virtual Machine.gif

The PATROL Virtual Machine is also known as the PATROL Agent. The agent acts like it is multi-tasking and can run various PSL processes at the same time. Also, the agent has a very lightweight mechanism of swapping PSL processes in and out.

PSL Code Life Cycle

The following figure displays the life cycle of PSL code. 

PSL Code Life Cycle 

PSL CodeLifeCycle.PNG

The code that the PSL compiler generates is the instruction code for the PATROL VM (quad code). The PATROL VM will behave as a Virtual Instruction Set Processor and quad code is the language it understands. After compilation of the PSL source code, you only have VM instructions left. These instructions are a "smart" translation of your source code into a language that the VM can understand. 

Before the VM will execute the code, it should be optimized first (by the optimizer). The optimizer works on compiled code and tries to turn it into even better code. The optimizer takes a couple of very complex steps where a smart, but lightweight interpretation takes place. Because the optimizer knows the exact capabilities of the VM execution engine, it can reformat/realign your code without changing the logic while increasing the effectiveness of your code. 

After optimization, the compiled PSL code can be saved into a PSL library which is then ready to be used by a PATROL Agent without need of further compilation or optimization. 

When the agent receives PSL source code that has to be executed more than once 1, the agent will store the compiled PSL in its PSL cache. If you even want to skip that first compilation step, you can pre-compile a parameter script to a .bin file, or you can save the mostly used code in a library. To compile your PSL scripts into bin files, you will have to use the standalone PSL interpreter. 

To view these quad instructions, type psl -q to dump the quad code table.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC PATROL Agent 10.7