From 6c53f54485dccaf52b7e7ac52d44c14f6c3b39d3 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 30 Aug 2017 10:25:07 -0500 Subject: [PATCH] pvget reftrack --- pvtoolsSrc/pvget.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pvtoolsSrc/pvget.cpp b/pvtoolsSrc/pvget.cpp index e9c83b6..d2cec37 100644 --- a/pvtoolsSrc/pvget.cpp +++ b/pvtoolsSrc/pvget.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "pvutils.cpp" @@ -355,6 +356,7 @@ int main (int argc, char *argv[]) istream* inputStream = 0; ifstream ifs; bool fromStream = false; + epics::RefMonitor refmon; double timeOut = -1.0; bool explicit_timeout = false; @@ -363,7 +365,7 @@ int main (int argc, char *argv[]) // ================ Parse Arguments - while ((opt = getopt(argc, argv, ":hvr:w:tmp:qdcF:f:ni")) != -1) { + while ((opt = getopt(argc, argv, ":hvRr:w:tmp:qdcF:f:ni")) != -1) { switch (opt) { case 'h': /* Print usage */ usage(); @@ -378,6 +380,9 @@ int main (int argc, char *argv[]) fprintf(stdout, "%s\n", version.getVersionString().c_str()); return 0; } + case 'R': + refmon.start(5.0); + break; case 'w': /* Set PVA timeout value */ if((epicsScanDouble(optarg, &timeOut)) != 1 || timeOut <= 0.0) { @@ -609,6 +614,14 @@ int main (int argc, char *argv[]) } } + if(refmon.running()) { + refmon.stop(); + // drop refs to operations, but keep ref to ClientProvider + ops.clear(); + // show final counts + refmon.current(); + } + // ========================== All done now if(debugFlag)