Skip to main content

Look into Palanteer and get an omniscient view of your program

Palanteer is a set of lean and efficient tools to improve the quality of software, for C++ and Python programs.

Simple code instrumentation, mostly automatic in Python, delivers powerful features:

  • Collection of meaningful atomic events on timings, memory, locks wait and usage, context switches, data values..
  • Visual and interactive observation of record: timeline, plot, histograms, flame graph...
  • Remote command call and events observation can be scripted in Python: deep testing has never been simpler
  • C++:
    • ultra-light single-header cross-platform instrumentation library
    • compile-time selection of groups of instrumentation
    • compile-time hashing of static string to minimize their cost
    • compile-time striping of all instrumentation static strings
    • enhanced assertions, stack trace dump...
  • Python:
    • Automatic instrumentation of functions enter/leave, memory allocations, raised exceptions, garbage collection runs
    • Support of multithread, coroutines, asyncio/gevent

Palanteer is an efficient, lean and comprehensive solution for better and enjoyable software development!

Usage

This scripting module processes the events sent by instrumented programs, independently of their language (Python or C++).

Typical usages are:

  • Tests based on stimulations/configuration with CLI and events observation, as data can also be traced
  • Evaluation of the program performance
  • Monitoring
  • ...

Below is a simple example of a Python program instrumented with Palanteer and generating 100 000 random integers.
The range can be remotely configured with a user-defined Palanteer CLI.

#! /usr/bin/env python3
import sys
import random
from palanteer import *

globalMinValue, globalMaxValue =  0, 10

# Handler (=implementation) of the example CLI, which sets the range
def setBoundsCliHandler(minValue, maxValue):              # 2 parameters (both integer) as declared
    global globalMinValue, globalMaxValue
    if minValue>maxValue:                                 # Case where the CLI execution fails (non null status). The text answer contains some information about it
        return 1, "Minimum value (%d) shall be lower than the maximum value (%d)" % (minValue, maxValue)

    # Modify the state of the program
    globalMinValue, globalMaxValue = minValue, maxValue
    # CLI execution was successful (null status)
    return 0, ""


def main(argv):
    global globalMinValue, globalMaxValue

    plInitAndStart("example")                             # Start the instrumentation
    plDeclareThread("Main")                               # Declare the current thread as "Main", so that it can be identified more easily in the script
    plRegisterCli(setBoundsCliHandler, "config:setRange", "min=int max=int", "Sets the value bounds of the random generator")  # Declare the CLI
    plFreezePoint()                                       # Add a freeze point here to be able to configure the program at a controlled moment

    plBegin("Generate some random values")
    for i in range(100000):
        value = int(globalMinValue + random.random()*(globalMaxValue+1-globalMinValue))
        plData("random data", value)                      # Here are the "useful" values
    plEnd("")                                             # Shortcut for plEnd("Generate some random values")

    plStopAndUninit()                                     # Stop and uninitialize the instrumentation

# Bootstrap
if __name__ == "__main__":
    main(sys.argv)

The Python scripting module can remotely control this program, in particular:

  • call the setBoundsCliHandler to change the configuration
  • temporarily halt the program at the freeze point
  • see all "random data" values and the timing of the scope event "Generate some random values"
#! /usr/bin/env python3
import sys
import palanteer_scripting as ps

def main(argv):
    if len(sys.argv)<2:
        print("Error: missing parameters (the program to launch)")
        sys.exit(1)

    # Initialize the scripting module
    ps.initialize_scripting()

    # Enable the freeze mode so that we can safely configure the program once stopped on its freeze point
    ps.program_set_freeze_mode(True)

    # Launch the program under test
    ps.process_launch(sys.argv[1], args=sys.argv[2:])
    # From here, we are connected to the remote program

    # Configure the selection of events to receive
    my_selection = ps.EvtSpec(thread="Main", events=["random data"]) # Thread "Main", only the event "random data"
    ps.data_configure_events(my_selection)

    # Configure the program
    status, response = ps.program_cli("config:setRange min=300 max=500")
    if status!=0:
        print("Error when configuring: %s\nKeeping original settings." % response)

    # Disable the freeze mode so that the program resumes its execution
    ps.program_set_freeze_mode(False)

    # Collect the events as long as the program is alive or we got some events in the last round
    qty, sum_values, min_value, max_value, has_worked = 0, 0, 1e9, 0, True
    while ps.process_is_running() or has_worked:
        has_worked = False
        for e in ps.data_collect_events(timeout_sec=1.):  # Loop on received events, per batch
            has_worked, qty, sum_values, min_value, max_value = True, qty+1, sum_values+e.value, min(min_value, e.value), max(max_value, e.value)

    # Display the result of the processed collection of data
    print("Quantity: %d\nMinimum : %d\nAverage : %d\nMaximum : %d" % (qty, min_value, sum_values/max(qty,1), max_value))

    # Cleaning
    ps.process_stop()            # Kills the launched process, if still running
    ps.uninitialize_scripting()  # Uninitialize the scripting module


# Bootstrap
if __name__ == "__main__":
    main(sys.argv)

The execution of this last script, with the first one as parameter, gives the following output:

> ./remoteScript.py example.py
Quantity: 100000
Minimum : 300
Average : 400
Maximum : 500

Details can be found here.

Installation of the scripting module

Directly from the PyPI storage (from sources on Linux, binary on Windows)

pip install palanteer_scripting

Directly from GitHub sources

pip install "git+https://github.com/dfeneyrou/palanteer#egg=palanteer_scripting&subdirectory=server/scripting"

From locally retrieved sources

Get the sources:

git clone https://github.com/dfeneyrou/palanteer
cd palanteer
mkdir build
cd build

Build on Linux:

cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc) install

Build on Windows:
(vcvarsall.bat or equivalent shall be called beforehand, so that the MSVC compiler is accessible)

cmake .. -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles"
nmake install

Important!

To be useful, this module requires an "instrumentation side" in the program under analysis (C++ or Python):

  • For Python language, the instrumentation module is available on PyPI or from the github sources
  • For C++ language, the instrumentation library is a single header file available in the github sources

Also, a graphical viewer is available for non-scripted analysis of the program behaviors.

NOTE: It is strongly recommended to have a matching version between the scripting module and the instrumentation sides

Metadata

Release files for palanteer-scripting 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for palanteer-scripting 0.8.0
File Size Uploaded
palanteer_scripting-0.8.0.tar.gz 546.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for palanteer-scripting 0.8.0
File
palanteer_scripting-0.8.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
palanteer_scripting-0.8.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
palanteer_scripting-0.8.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
palanteer_scripting-0.8.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
palanteer_scripting-0.8.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
palanteer_scripting-0.8.0-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
palanteer_scripting-0.8.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details

Total release size: 2.4 MB

Release files / palanteer_scripting-0.8.0.tar.gz

Download URL palanteer_scripting-0.8.0.tar.gz
Size 546.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fe104f236b38c8e298a87f3b0472e9d4f1498b5c6cb5152205fbdc4e0361d696
BLAKE2b-256 checksum
How to use checksums
fd4eb67e5df349d9b7a3841185dc5309d06a4f42bc5104c3d27212bc3a2fa7e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / palanteer_scripting-0.8.0-cp313-cp313-win_amd64.whl

Download URL palanteer_scripting-0.8.0-cp313-cp313-win_amd64.whl
Size 264.5 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
38dd52b2ccb34f4d9b411da08e9fb60795ff0440c3402b9d615c4ee5e56b6f9c
BLAKE2b-256 checksum
How to use checksums
fef91f94fa3f4beadc8bd6986456817e9ac146773217dce5f8b3f856be4ac197
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / palanteer_scripting-0.8.0-cp312-cp312-win_amd64.whl

Download URL palanteer_scripting-0.8.0-cp312-cp312-win_amd64.whl
Size 264.5 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
cd1f09320ad18062acba810062ddf7660ca0cb4c752a63330df69bb4c8614b02
BLAKE2b-256 checksum
How to use checksums
d205eccd476ecfac342638fca49ec77e8144401eb5f53ecad8e842b74cf1bc17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / palanteer_scripting-0.8.0-cp311-cp311-win_amd64.whl

Download URL palanteer_scripting-0.8.0-cp311-cp311-win_amd64.whl
Size 264.4 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
56a2ab76f97378b1f5cc07a7adeee241592fa64e3e3557e15ed01ba96f77cc0b
BLAKE2b-256 checksum
How to use checksums
5d2c92ac3de126213eff0809f45e85337625d42d82f1ad8fcaec5625f78ac48e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / palanteer_scripting-0.8.0-cp310-cp310-win_amd64.whl

Download URL palanteer_scripting-0.8.0-cp310-cp310-win_amd64.whl
Size 264.4 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
cc15da64282a49b556420032f8f042c9066818165b140791d8d49186daf22e98
BLAKE2b-256 checksum
How to use checksums
84966cf3b09d2627ce5643c6bb56deae435fbaa4af299c7ff93944cfd53c618b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / palanteer_scripting-0.8.0-cp39-cp39-win_amd64.whl

Download URL palanteer_scripting-0.8.0-cp39-cp39-win_amd64.whl
Size 264.4 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
20c3853a2e8b669b22dda069aceeeef62d7ef306a163bf37ea255ff84da67dcd
BLAKE2b-256 checksum
How to use checksums
e61b53a4211ca8e7b059b1bd1b9e206839a3b3b8082f18ff11bc8ad8e880711e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / palanteer_scripting-0.8.0-cp38-cp38-win_amd64.whl

Download URL palanteer_scripting-0.8.0-cp38-cp38-win_amd64.whl
Size 264.3 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
65dc1cb0267a84e6bcd1bac7d9f781981286a6b7761e9bb6aa7cb30d342b101c
BLAKE2b-256 checksum
How to use checksums
b38b02453a2bd528abc8508a0f33a9c7b2c79fdf189086ce2eed144d69a7add7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / palanteer_scripting-0.8.0-cp37-cp37m-win_amd64.whl

Download URL palanteer_scripting-0.8.0-cp37-cp37m-win_amd64.whl
Size 264.4 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
034518c8b3a45e912206f85c509e6326a4302906d7074c0c1f030958f5412e12
BLAKE2b-256 checksum
How to use checksums
1e78e1e84d0e203cdb6db09ec688fda86f8f91381bc2e2c70815d6eed09f5610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.8.0 This release

8 release files

0.7.1

6 release files

0.6

5 release files

0.5

5 release files

0.4

4 release files

0.3

4 release files

0.2.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page