Browse Source

Compile again on linux - Add Monitoring option in waf

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2718 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
moret 17 years ago
parent
commit
40fca29a79
6 changed files with 25 additions and 20 deletions
  1. +8
    -8
      common/JackNetDriver.cpp
  2. +2
    -2
      common/JackNetDriver.h
  3. +8
    -8
      common/JackNetManager.cpp
  4. +1
    -1
      common/JackNetManager.h
  5. +1
    -1
      common/JackNetTool.h
  6. +5
    -0
      wscript

+ 8
- 8
common/JackNetDriver.cpp View File

@@ -32,7 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


namespace Jack namespace Jack
{ {
#ifdef NETMONITOR
#ifdef JACK_MONITOR
std::string JackNetDriver::fMonitorPlotOptions[] = std::string JackNetDriver::fMonitorPlotOptions[] =
{ {
std::string ( "set xlabel \"audio cycles\"" ), std::string ( "set xlabel \"audio cycles\"" ),
@@ -62,7 +62,7 @@ namespace Jack
fParams.fTransportSync = transport_sync; fParams.fTransportSync = transport_sync;


//monitor //monitor
#ifdef NETMONITOR
#ifdef JACK_MONITOR
std::string plot_file_name = std::string ( fParams.fName ); std::string plot_file_name = std::string ( fParams.fName );
fMonitor.SetPlotFile ( plot_file_name, JackNetDriver::fMonitorPlotOptions, 2, JackNetDriver::fMonitorFieldNames, 5 ); fMonitor.SetPlotFile ( plot_file_name, JackNetDriver::fMonitorPlotOptions, 2, JackNetDriver::fMonitorFieldNames, 5 );
#endif #endif
@@ -99,7 +99,7 @@ namespace Jack
} }




#ifdef NETMONITOR
#ifdef JACK_MONITOR
int JackNetDriver::Close() int JackNetDriver::Close()
{ {
std::string filename = string ( fParams.fName ); std::string filename = string ( fParams.fName );
@@ -517,7 +517,7 @@ namespace Jack
//take the time at the beginning of the cycle //take the time at the beginning of the cycle
JackDriver::CycleTakeBeginTime(); JackDriver::CycleTakeBeginTime();


#ifdef NETMONITOR
#ifdef JACK_MONITOR
fUsecCycleStart = GetMicroSeconds(); fUsecCycleStart = GetMicroSeconds();
fMeasure.fTable[0] = GetMicroSeconds() - fUsecCycleStart; fMeasure.fTable[0] = GetMicroSeconds() - fUsecCycleStart;
#endif #endif
@@ -561,7 +561,7 @@ namespace Jack
fRxHeader.fCycle = rx_head->fCycle; fRxHeader.fCycle = rx_head->fCycle;




#ifdef NETMONITOR
#ifdef JACK_MONITOR
fMeasure.fTable[1] = GetMicroSeconds() - fUsecCycleStart; fMeasure.fTable[1] = GetMicroSeconds() - fUsecCycleStart;
#endif #endif


@@ -583,7 +583,7 @@ namespace Jack
for ( audio_port_index = 0; audio_port_index < fPlaybackChannels; audio_port_index++ ) for ( audio_port_index = 0; audio_port_index < fPlaybackChannels; audio_port_index++ )
fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, GetOutputBuffer ( audio_port_index )); fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, GetOutputBuffer ( audio_port_index ));


#ifdef NETMONITOR
#ifdef JACK_MONITOR
fMeasure.fTable[2] = GetMicroSeconds() - fUsecCycleStart; fMeasure.fTable[2] = GetMicroSeconds() - fUsecCycleStart;
#endif #endif


@@ -595,7 +595,7 @@ namespace Jack
SetSyncPacket(); SetSyncPacket();
tx_bytes = Send ( fParams.fMtu, 0 ); tx_bytes = Send ( fParams.fMtu, 0 );


#ifdef NETMONITOR
#ifdef JACK_MONITOR
fMeasure.fTable[3] = GetMicroSeconds() - fUsecCycleStart; fMeasure.fTable[3] = GetMicroSeconds() - fUsecCycleStart;
#endif #endif


@@ -631,7 +631,7 @@ namespace Jack
} }
} }


#ifdef NETMONITOR
#ifdef JACK_MONITOR
fMeasure.fTable[4] = GetMicroSeconds() - fUsecCycleStart; fMeasure.fTable[4] = GetMicroSeconds() - fUsecCycleStart;
fMonitor.Write ( fMeasure ); fMonitor.Write ( fMeasure );
#endif #endif


+ 2
- 2
common/JackNetDriver.h View File

@@ -61,7 +61,7 @@ namespace Jack
int fPayloadSize; int fPayloadSize;


//monitoring //monitoring
#ifdef NETMONITOR
#ifdef JACK_MONITOR
static std::string fMonitorPlotOptions[]; static std::string fMonitorPlotOptions[];
static std::string fMonitorFieldNames[]; static std::string fMonitorFieldNames[];
jack_time_t fUsecCycleStart; jack_time_t fUsecCycleStart;
@@ -95,7 +95,7 @@ namespace Jack
int inchannels, int outchannels, bool monitor, const char* capture_driver_name, 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 ); const char* playback_driver_name, jack_nframes_t capture_latency, jack_nframes_t playback_latency );


#ifdef NETMONITOR
#ifdef JACK_MONITOR
int Close(); int Close();
#endif #endif




+ 8
- 8
common/JackNetManager.cpp View File

@@ -27,7 +27,7 @@ using namespace std;
namespace Jack namespace Jack
{ {
//JackNetMaster****************************************************************************************************** //JackNetMaster******************************************************************************************************
#ifdef NETMONITOR
#ifdef JACK_MONITOR
std::string JackNetMaster::fMonitorPlotOptions[] = std::string JackNetMaster::fMonitorPlotOptions[] =
{ {
std::string ( "set xlabel \"audio cycles\"" ), std::string ( "set xlabel \"audio cycles\"" ),
@@ -115,7 +115,7 @@ namespace Jack
fPayloadSize = fParams.fMtu - sizeof ( packet_header_t ); fPayloadSize = fParams.fMtu - sizeof ( packet_header_t );


//monitor //monitor
#ifdef NETMONITOR
#ifdef JACK_MONITOR
std::string plot_file_name = std::string ( fParams.fName ); std::string plot_file_name = std::string ( fParams.fName );
fMonitor.SetPlotFile ( plot_file_name, fMonitorPlotOptions, 2, fMonitorFieldNames, 5 ); fMonitor.SetPlotFile ( plot_file_name, fMonitorPlotOptions, 2, fMonitorFieldNames, 5 );
#endif #endif
@@ -141,7 +141,7 @@ namespace Jack
delete[] fMidiPlaybackPorts; delete[] fMidiPlaybackPorts;
delete[] fTxBuffer; delete[] fTxBuffer;
delete[] fRxBuffer; delete[] fRxBuffer;
#ifdef NETMONITOR
#ifdef JACK_MONITOR
std::string filename = string ( fParams.fName ); std::string filename = string ( fParams.fName );
fMonitor.Save ( filename ); fMonitor.Save ( filename );
#endif #endif
@@ -385,7 +385,7 @@ fail:
fTxHeader.fIsLastPckt = 'n'; fTxHeader.fIsLastPckt = 'n';
packet_header_t* rx_head = reinterpret_cast<packet_header_t*> ( fRxBuffer ); packet_header_t* rx_head = reinterpret_cast<packet_header_t*> ( fRxBuffer );


#ifdef NETMONITOR
#ifdef JACK_MONITOR
NetMeasure<jack_nframes_t> measure; NetMeasure<jack_nframes_t> measure;
measure.fTable[0] = jack_frames_since_cycle_start( fJackClient ); measure.fTable[0] = jack_frames_since_cycle_start( fJackClient );
#endif #endif
@@ -420,7 +420,7 @@ fail:
if ( ( tx_bytes == 0 ) || ( tx_bytes == SOCKET_ERROR ) ) if ( ( tx_bytes == 0 ) || ( tx_bytes == SOCKET_ERROR ) )
return tx_bytes; return tx_bytes;


#ifdef NETMONITOR
#ifdef JACK_MONITOR
measure.fTable[1] = jack_frames_since_cycle_start( fJackClient ); measure.fTable[1] = jack_frames_since_cycle_start( fJackClient );
#endif #endif


@@ -460,7 +460,7 @@ fail:
} }
} }


#ifdef NETMONITOR
#ifdef JACK_MONITOR
measure.fTable[2] = jack_frames_since_cycle_start( fJackClient ); measure.fTable[2] = jack_frames_since_cycle_start( fJackClient );
#endif #endif


@@ -474,7 +474,7 @@ fail:
} }
while ( !rx_bytes && ( rx_head->fDataType != 's' ) ); while ( !rx_bytes && ( rx_head->fDataType != 's' ) );


#ifdef NETMONITOR
#ifdef JACK_MONITOR
measure.fTable[3] = jack_frames_since_cycle_start( fJackClient ); measure.fTable[3] = jack_frames_since_cycle_start( fJackClient );
#endif #endif


@@ -516,7 +516,7 @@ fail:
while ( fRxHeader.fIsLastPckt != 'y' ); while ( fRxHeader.fIsLastPckt != 'y' );
} }


#ifdef NETMONITOR
#ifdef JACK_MONITOR
measure.fTable[4] = jack_frames_since_cycle_start( fJackClient ); measure.fTable[4] = jack_frames_since_cycle_start( fJackClient );
fMonitor.Write ( measure ); fMonitor.Write ( measure );
#endif #endif


+ 1
- 1
common/JackNetManager.h View File

@@ -79,7 +79,7 @@ namespace Jack
int fPayloadSize; int fPayloadSize;


//monitoring //monitoring
#ifdef NETMONITOR
#ifdef JACK_MONITOR
static std::string fMonitorPlotOptions[]; static std::string fMonitorPlotOptions[];
static std::string fMonitorFieldNames[]; static std::string fMonitorFieldNames[];
NetMonitor<jack_nframes_t> fMonitor; NetMonitor<jack_nframes_t> fMonitor;


+ 1
- 1
common/JackNetTool.h View File

@@ -272,7 +272,7 @@ namespace Jack
return 0; 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 title = name + "_netmonitor";
string plot_filename = title + ".plt"; string plot_filename = title + ".plt";


+ 5
- 0
wscript View File

@@ -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('--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('--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') opt.sub_options('linux/dbus')


def configure(conf): def configure(conf):
@@ -80,6 +81,7 @@ def configure(conf):
conf.env['JACK_VERSION'] = VERSION conf.env['JACK_VERSION'] = VERSION


conf.env['BUILD_DOXYGEN_DOCS'] = Params.g_options.doxygen 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('ADDON_DIR', os.path.normpath(conf.env['PREFIX'] + '/lib/jack'))
conf.define('JACK_LOCATION', os.path.normpath(conf.env['PREFIX'] + '/bin')) conf.define('JACK_LOCATION', os.path.normpath(conf.env['PREFIX'] + '/bin'))
@@ -93,6 +95,8 @@ def configure(conf):
conf.define('JACKMP', 1) conf.define('JACKMP', 1)
if conf.env['BUILD_JACKDBUS'] == True: if conf.env['BUILD_JACKDBUS'] == True:
conf.define('JACK_DBUS', 1) conf.define('JACK_DBUS', 1)
if conf.env['BUILD_WITH_MONITOR'] == True:
conf.define('JACK_MONITOR', 1)
conf.write_config_header('config.h') conf.write_config_header('config.h')


display_msg("\n==================") display_msg("\n==================")
@@ -101,6 +105,7 @@ def configure(conf):
display_msg("Install prefix", conf.env['PREFIX'], 'CYAN') display_msg("Install prefix", conf.env['PREFIX'], 'CYAN')
display_msg("Drivers directory", conf.env['ADDON_DIR'], 'CYAN') display_msg("Drivers directory", conf.env['ADDON_DIR'], 'CYAN')
display_feature('Build doxygen documentation', conf.env['BUILD_DOXYGEN_DOCS']) 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']: if conf.env['IS_LINUX']:
display_feature('Build with ALSA support', conf.env['BUILD_DRIVER_ALSA'] == True) 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) display_feature('Build with FireWire (FreeBob) support', conf.env['BUILD_DRIVER_FREEBOB'] == True)


Loading…
Cancel
Save