pcp
[Top] [All Lists]

pcp updates: pmcpp

To: pcp@xxxxxxxxxxx
Subject: pcp updates: pmcpp
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Sat, 25 Jul 2015 10:57:04 +1000
Delivered-to: pcp@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
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.

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

Changes committed to git://git.pcp.io/kenj/pcp master

Ken McDonell (5):
      pmcpp: major revamp
      qa/group: assorted group changes
      pmcpp: more changes
      pmcpp: really ignore C-style comments for -s mode
      pmcpp: speed and robustness enhancements

 man/man1/pmcpp.1  |  224 ++++++++++++++++++---
 qa/853            |  183 ++++++++++++++++-
 qa/853.out        |  250 +++++++++++++++++++++++
 qa/group          |    7 
 src/pmcpp/pmcpp.c |  564 +++++++++++++++++++++++++++++++++++++++++-------------
 5 files changed%2C 1046 insertions(+)%2C 182 deletions(-)

Details ...

commit d2f1f0c50fcf2e3adab0ad48fa9e90532ee0becc
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Sat Jul 25 08:57:12 2015 +1000

    pmcpp: speed and robustness enhancements
    
    - dynamic allocation of input and output buffers and protection
      against buffer overrun for arbitrary line lengths
    - use memcpy() in preference to strcpy() where possible
      (speed improvement)
    - optimistic buffer processing that does not copy until a macro
      substitution happens within a line (bigger speed improvement)
    
    Measured a little below 10%25 reduction in CPU time with these changes.
    
    Updated QA to match.

commit f493878e656a57df75cad88de4a543ba9c1418f2
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Fri Jul 24 16:16:11 2015 +1000

    pmcpp: really ignore C-style comments for -s mode

commit aa43d60f5a99d1deb7945c3d7fea61f01347bfec
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Fri Jul 24 15:24:11 2015 +1000

    pmcpp: more changes
    
    - add #else support
    - increase coverage in qa/853

commit 05611d6dde4f9456273e878c5abf05512cb9d517
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Fri Jul 24 15:22:26 2015 +1000

    qa/group: assorted group changes
    
    Add new pmcpp group%2C add tests 464%2C 464 and 853 to this group.
    
    And qa/662: was missing from group file

commit c54724b797851bf9f9a81691f2dc615000764c13
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Fri Jul 24 10:08:18 2015 +1000

    pmcpp: major revamp
    
    Add -s flag to support shell-like input where # is a comment
    prefix and pmcpp changes from #... control lines to %25... control
    lines and generally emits fewer empty lines and on # lineno control
    lines.
    
    Add -r flag to restrict macro expansion to names that have additional
    syntactic sugar: #name or #{name} (or if -s%2C then %25name or %{name}).
    
    Cleanup man page.
    
    Add new qa/853 to give pmcpp a more thorough workout.
    
    All of this is in preparation for always processing pmlogger config
    files with pmcpp -rs to provide conditional%2C include file and macro
    capabilities for pmlogger config files.

<Prev in Thread] Current Thread [Next in Thread>