# HG changeset patch # User Chris Cannam # Date 1484748801 0 # Node ID 9768b5ca710a7df88b95fd8021836721ced9de8c # Parent c3ddc4a725614462a0f2f139cc39249f6fa15be2 Log function entry/exit points (optionally) diff -r c3ddc4a72561 -r 9768b5ca710a vamp-client/CapnpRRClient.h --- a/vamp-client/CapnpRRClient.h Mon Jan 16 14:31:23 2017 +0000 +++ b/vamp-client/CapnpRRClient.h Wed Jan 18 14:13:21 2017 +0000 @@ -48,6 +48,14 @@ #include +#define LOG_ENTRYPOINTS 1 + +#ifdef LOG_ENTRYPOINTS +#define LOG_E(x) log(x) +#else +#define LOG_E(x) +#endif + namespace piper_vamp { namespace client { @@ -105,6 +113,8 @@ ListResponse listPluginData(const ListRequest &req) override { + LOG_E("CapnpRRClient::listPluginData called"); + if (!m_transport->isOK()) { log("Piper server crashed or failed to start (caller should have checked this)"); throw std::runtime_error("Piper server crashed or failed to start"); @@ -125,12 +135,17 @@ ListResponse lr; VampnProto::readListResponse(lr, reader.getResponse().getList()); + + LOG_E("CapnpRRClient::listPluginData returning"); + return lr; } LoadResponse loadPlugin(const LoadRequest &req) override { + LOG_E("CapnpRRClient::loadPlugin called"); + if (!m_transport->isOK()) { log("Piper server crashed or failed to start (caller should have checked this)"); throw std::runtime_error("Piper server crashed or failed to start"); @@ -153,6 +168,9 @@ m_mapper.addPlugin(handle, plugin); resp.plugin = plugin; + + LOG_E("CapnpRRClient::loadPlugin returning"); + return resp; } @@ -163,6 +181,8 @@ configure(PluginStub *plugin, PluginConfiguration config) override { + LOG_E("CapnpRRClient::configure called"); + if (!m_transport->isOK()) { log("Piper server crashed or failed to start (caller should have checked this)"); throw std::runtime_error("Piper server crashed or failed to start"); @@ -193,6 +213,8 @@ reader.getResponse().getConfigure(), m_mapper); + LOG_E("CapnpRRClient::configure returning"); + return cr.outputs; }; @@ -202,6 +224,8 @@ std::vector > inputBuffers, Vamp::RealTime timestamp) override { + LOG_E("CapnpRRClient::process called"); + if (!m_transport->isOK()) { log("Piper server crashed or failed to start (caller should have checked this)"); throw std::runtime_error("Piper server crashed or failed to start"); @@ -232,12 +256,16 @@ reader.getResponse().getProcess(), m_mapper); + LOG_E("CapnpRRClient::process returning"); + return pr.features; } virtual Vamp::Plugin::FeatureSet finish(PluginStub *plugin) override { + LOG_E("CapnpRRClient::finish called"); + if (!m_transport->isOK()) { log("Piper server crashed or failed to start (caller should have checked this)"); throw std::runtime_error("Piper server crashed or failed to start"); @@ -272,6 +300,8 @@ // Don't delete the plugin. It's the plugin that is supposed // to be calling us here + LOG_E("CapnpRRClient::finish returning"); + return pr.features; }