diff --git a/common/JackNetDriver.cpp b/common/JackNetDriver.cpp index bf579714..e5f17f5b 100644 --- a/common/JackNetDriver.cpp +++ b/common/JackNetDriver.cpp @@ -32,7 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. namespace Jack { -#ifdef NETMONITOR +#ifdef JACK_MONITOR std::string JackNetDriver::fMonitorPlotOptions[] = { std::string ( "set xlabel \"audio cycles\"" ), @@ -62,7 +62,7 @@ namespace Jack fParams.fTransportSync = transport_sync; //monitor -#ifdef NETMONITOR +#ifdef JACK_MONITOR std::string plot_file_name = std::string ( fParams.fName ); fMonitor.SetPlotFile ( plot_file_name, JackNetDriver::fMonitorPlotOptions, 2, JackNetDriver::fMonitorFieldNames, 5 ); #endif @@ -99,7 +99,7 @@ namespace Jack } -#ifdef NETMONITOR +#ifdef JACK_MONITOR int JackNetDriver::Close() { std::string filename = string ( fParams.fName ); @@ -517,7 +517,7 @@ namespace Jack //take the time at the beginning of the cycle JackDriver::CycleTakeBeginTime(); -#ifdef NETMONITOR +#ifdef JACK_MONITOR fUsecCycleStart = GetMicroSeconds(); fMeasure.fTable[0] = GetMicroSeconds() - fUsecCycleStart; #endif @@ -561,7 +561,7 @@ namespace Jack fRxHeader.fCycle = rx_head->fCycle; -#ifdef NETMONITOR +#ifdef JACK_MONITOR fMeasure.fTable[1] = GetMicroSeconds() - fUsecCycleStart; #endif @@ -583,7 +583,7 @@ namespace Jack for ( audio_port_index = 0; audio_port_index < fPlaybackChannels; audio_port_index++ ) fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, GetOutputBuffer ( audio_port_index )); -#ifdef NETMONITOR +#ifdef JACK_MONITOR fMeasure.fTable[2] = GetMicroSeconds() - fUsecCycleStart; #endif @@ -595,7 +595,7 @@ namespace Jack SetSyncPacket(); tx_bytes = Send ( fParams.fMtu, 0 ); -#ifdef NETMONITOR +#ifdef JACK_MONITOR fMeasure.fTable[3] = GetMicroSeconds() - fUsecCycleStart; #endif @@ -631,7 +631,7 @@ namespace Jack } } -#ifdef NETMONITOR +#ifdef JACK_MONITOR fMeasure.fTable[4] = GetMicroSeconds() - fUsecCycleStart; fMonitor.Write ( fMeasure ); #endif diff --git a/common/JackNetDriver.h b/common/JackNetDriver.h index ac8cddb4..d0d5d09d 100644 --- a/common/JackNetDriver.h +++ b/common/JackNetDriver.h @@ -61,7 +61,7 @@ namespace Jack int fPayloadSize; //monitoring -#ifdef NETMONITOR +#ifdef JACK_MONITOR static std::string fMonitorPlotOptions[]; static std::string fMonitorFieldNames[]; jack_time_t fUsecCycleStart; @@ -95,7 +95,7 @@ namespace Jack int inchannels, int outchannels, bool monitor, const char* capture_driver_name, const char* playback_driver_name, jack_nframes_t capture_latency, jack_nframes_t playback_latency ); -#ifdef NETMONITOR +#ifdef JACK_MONITOR int Close(); #endif diff --git a/common/JackNetManager.cpp b/common/JackNetManager.cpp index 51cfab02..41006bee 100644 --- a/common/JackNetManager.cpp +++ b/common/JackNetManager.cpp @@ -27,7 +27,7 @@ using namespace std; namespace Jack { //JackNetMaster****************************************************************************************************** -#ifdef NETMONITOR +#ifdef JACK_MONITOR std::string JackNetMaster::fMonitorPlotOptions[] = { std::string ( "set xlabel \"audio cycles\"" ), @@ -115,7 +115,7 @@ namespace Jack fPayloadSize = fParams.fMtu - sizeof ( packet_header_t ); //monitor -#ifdef NETMONITOR +#ifdef JACK_MONITOR std::string plot_file_name = std::string ( fParams.fName ); fMonitor.SetPlotFile ( plot_file_name, fMonitorPlotOptions, 2, fMonitorFieldNames, 5 ); #endif @@ -141,7 +141,7 @@ namespace Jack delete[] fMidiPlaybackPorts; delete[] fTxBuffer; delete[] fRxBuffer; -#ifdef NETMONITOR +#ifdef JACK_MONITOR std::string filename = string ( fParams.fName ); fMonitor.Save ( filename ); #endif @@ -385,7 +385,7 @@ fail: fTxHeader.fIsLastPckt = 'n'; packet_header_t* rx_head = reinterpret_cast ( fRxBuffer ); -#ifdef NETMONITOR +#ifdef JACK_MONITOR NetMeasure measure; measure.fTable[0] = jack_frames_since_cycle_start( fJackClient ); #endif @@ -420,7 +420,7 @@ fail: if ( ( tx_bytes == 0 ) || ( tx_bytes == SOCKET_ERROR ) ) return tx_bytes; -#ifdef NETMONITOR +#ifdef JACK_MONITOR measure.fTable[1] = jack_frames_since_cycle_start( fJackClient ); #endif @@ -460,7 +460,7 @@ fail: } } -#ifdef NETMONITOR +#ifdef JACK_MONITOR measure.fTable[2] = jack_frames_since_cycle_start( fJackClient ); #endif @@ -474,7 +474,7 @@ fail: } while ( !rx_bytes && ( rx_head->fDataType != 's' ) ); -#ifdef NETMONITOR +#ifdef JACK_MONITOR measure.fTable[3] = jack_frames_since_cycle_start( fJackClient ); #endif @@ -516,7 +516,7 @@ fail: while ( fRxHeader.fIsLastPckt != 'y' ); } -#ifdef NETMONITOR +#ifdef JACK_MONITOR measure.fTable[4] = jack_frames_since_cycle_start( fJackClient ); fMonitor.Write ( measure ); #endif diff --git a/common/JackNetManager.h b/common/JackNetManager.h index f5e8e114..7d131e88 100644 --- a/common/JackNetManager.h +++ b/common/JackNetManager.h @@ -79,7 +79,7 @@ namespace Jack int fPayloadSize; //monitoring -#ifdef NETMONITOR +#ifdef JACK_MONITOR static std::string fMonitorPlotOptions[]; static std::string fMonitorFieldNames[]; NetMonitor fMonitor; diff --git a/common/JackNetTool.h b/common/JackNetTool.h index 17f8af54..fabc9c70 100644 --- a/common/JackNetTool.h +++ b/common/JackNetTool.h @@ -272,7 +272,7 @@ namespace Jack return 0; } - int SetPlotFile ( string& name, string* options_list = NULL, uint options_number = 0, string* field_names = NULL, uint field_number ) + int SetPlotFile ( string& name, string* options_list = NULL, uint options_number = 0, string* field_names = NULL, uint field_number = 0 ) { string title = name + "_netmonitor"; string plot_filename = title + ".plt"; diff --git a/wscript b/wscript index dbcc58a5..f08b820d 100644 --- a/wscript +++ b/wscript @@ -50,6 +50,7 @@ def set_options(opt): opt.add_option('--dbus', action='store_true', default=False, help='Enable D-Bus JACK (jackdbus)') opt.add_option('--doxygen', action='store_true', default=False, help='Enable build of doxygen documentation') + opt.add_option('--monitor', action='store_true', default=False, help='Build with monitoring records') opt.sub_options('linux/dbus') def configure(conf): @@ -80,6 +81,7 @@ def configure(conf): conf.env['JACK_VERSION'] = VERSION conf.env['BUILD_DOXYGEN_DOCS'] = Params.g_options.doxygen + conf.env['BUILD_WITH_MONITOR'] = Params.g_options.monitor conf.define('ADDON_DIR', os.path.normpath(conf.env['PREFIX'] + '/lib/jack')) conf.define('JACK_LOCATION', os.path.normpath(conf.env['PREFIX'] + '/bin')) @@ -93,6 +95,8 @@ def configure(conf): conf.define('JACKMP', 1) if conf.env['BUILD_JACKDBUS'] == True: conf.define('JACK_DBUS', 1) + if conf.env['BUILD_WITH_MONITOR'] == True: + conf.define('JACK_MONITOR', 1) conf.write_config_header('config.h') display_msg("\n==================") @@ -101,6 +105,7 @@ def configure(conf): display_msg("Install prefix", conf.env['PREFIX'], 'CYAN') display_msg("Drivers directory", conf.env['ADDON_DIR'], 'CYAN') display_feature('Build doxygen documentation', conf.env['BUILD_DOXYGEN_DOCS']) + display_feature('Build with monitoring records', conf.env['BUILD_WITH_MONITOR']) if conf.env['IS_LINUX']: display_feature('Build with ALSA support', conf.env['BUILD_DRIVER_ALSA'] == True) display_feature('Build with FireWire (FreeBob) support', conf.env['BUILD_DRIVER_FREEBOB'] == True)