diff options
author | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2009-02-11 12:31:20 +0000 |
---|---|---|
committer | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2009-02-11 12:31:20 +0000 |
commit | 32987ca1d2c885250e8f3b74fad368fe83e88c9f (patch) | |
tree | 9e9decf1c9e5fd8c7714a1c3fb9c6b32d3a5e2f3 /common/JackProfiler.h | |
parent | 4117315c2fb31d8b7ebd2c7dde53fe9c7b79d399 (diff) | |
download | jack2-32987ca1d2c885250e8f3b74fad368fe83e88c9f.tar.gz |
Merge Solaris branch back on trunk.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3306 0c269be4-1314-0410-8aa9-9f06e86f4224
Diffstat (limited to 'common/JackProfiler.h')
-rw-r--r-- | common/JackProfiler.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/common/JackProfiler.h b/common/JackProfiler.h new file mode 100644 index 00000000..bdf3419f --- /dev/null +++ b/common/JackProfiler.h @@ -0,0 +1,80 @@ +/* +Copyright (C) 2009 Grame + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __JackProfiler__ +#define __JackProfiler__ + +#include "JackConstants.h" +#include "JackPlatformPlug.h" +#include "jack.h" +#include "jslist.h" +#include <map> +#include <string> + +#ifdef JACK_MONITOR +#include "JackEngineProfiling.h" +#endif + +namespace Jack +{ + +struct JackProfilerClient { + + int fRefNum; + jack_client_t* fClient; + jack_port_t* fSchedulingPort; + jack_port_t* fDurationPort; + + JackProfilerClient(jack_client_t* client, const char* name); + ~JackProfilerClient(); + +}; + +/*! +\brief Server real-time monitoring +*/ + +class JackProfiler +{ + + private: + + jack_client_t* fClient; + jack_port_t* fCPULoadPort; + jack_port_t* fDriverPeriodPort; + jack_port_t* fDriverEndPort; + #ifdef JACK_MONITOR + JackTimingMeasure* fLastMeasure; + std::map<std::string, JackProfilerClient*> fClientTable; + JackMutex fMutex; + #endif + + public: + + JackProfiler(jack_client_t* jack_client, const JSList* params); + ~JackProfiler(); + + static int Process(jack_nframes_t nframes, void* arg); + static void ClientRegistration(const char* name, int val, void *arg); + +}; + +} + +#endif |