kenj wrote:
> These commits provide a major upgrade for pmcpp, promoting it from a
> PMNS-helper to a more general purpose pre-processor with include
> file handling, conditional inclusion/exclusion and parameterless
> macro definition and expansion.
(Did you consider using plain /bin/cpp? But see below.)
> First consumer of this will be pmlogger that will (soon) process all
> configuration files with pmcpp -rs so that pmlogger configuration
> files may be enhanced, e.g. the following will be acceptable ...
>
> %include "commonloggerstuff"
>
> %define _cpu
> %define cpu_interval "30 seconds"
> %define cpu_prefix kernel.all.cpu.
>
> %ifdef _cpu
> log mandatory on %cpu_interval {
> %{cpu_prefix}user
> %{cpu_prefix}sys
> ...
> }
> %endif
These are real nice for abbrevation - anything else?
The sorts of logic I've been hoping for in the pmlogger language are
more sophisticated switching capabilities (more than "probe ..." as
per pmlogconf), for example:
- to exclude non-container-related metrics if running within a
container
- to vary the configuration according to -run-time- variables like
other metrics (or pmie expressions), so as to dynamically adjust
logging intensity according to specified conditions
- enough smarts to express the pmlogconf language directly, so we
can ditch the super-slow pmlogconf implementation
For such things, it's the "%if $condition" consruct that's key, for
rich enough $condition.
- FChE
|