$darkmode
Elektra 0.11.0
Plugin: tracer

This plugin is added on every possible position within a backend. It allows you to trace when the backend is executed.

Installation

See installation. The package is called libelektra5-extra.

Usage

If you want to trace how and if the backend is called:

1 kdb mount file.ysp user:/trace_point your_storage_plugin tracer

So now we can trace whats below your trace point.

1 kdb ls user:/trace_point

Ok, no tracer is called because resolver immediately told that there is no file.

1 kdb get user:/trace_point
2 #> Did not find key

Ok, same conclusion.

1 kdb set user:/trace_point hello
2 #> create a new key user:/trace_point with string "hello"
3 #> tracer: set(0xd34cc0, user:/trace_point): user:/trace_point 1
4 #> tracer: set(0xd34cc0, user:/trace_point): user:/trace_point 1
5 #> tracer: set(0xd34cc0, user:/trace_point): user:/trace_point 1

Now the 3 placements in set are called.

1 kdb get user:/trace_point
2 #> tracer: get(0x22e1cc0, user:/trace_point): 0
3 #> tracer: get(0x22e1cc0, user:/trace_point): 0
4 #> hello

Now the 2 placements in get are called.

Module Loading

Will not log when loaded as module (config /module present), unless /logmodule is set:

1 kdb plugin-check -c "logmodule=" tracer