00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __JackProfiler__
00021 #define __JackProfiler__
00022
00023 #include "JackConstants.h"
00024 #include "JackPlatformPlug.h"
00025 #include "jack.h"
00026 #include "jslist.h"
00027 #include <map>
00028 #include <string>
00029
00030 #ifdef JACK_MONITOR
00031 #include "JackEngineProfiling.h"
00032 #endif
00033
00034 namespace Jack
00035 {
00036
00037 struct JackProfilerClient {
00038
00039 int fRefNum;
00040 jack_client_t* fClient;
00041 jack_port_t* fSchedulingPort;
00042 jack_port_t* fDurationPort;
00043
00044 JackProfilerClient(jack_client_t* client, const char* name);
00045 ~JackProfilerClient();
00046
00047 };
00048
00053 class JackProfiler
00054 {
00055
00056 private:
00057
00058 jack_client_t* fClient;
00059 jack_port_t* fCPULoadPort;
00060 jack_port_t* fDriverPeriodPort;
00061 jack_port_t* fDriverEndPort;
00062 #ifdef JACK_MONITOR
00063 JackTimingMeasure* fLastMeasure;
00064 std::map<std::string, JackProfilerClient*> fClientTable;
00065 JackMutex fMutex;
00066 #endif
00067
00068 public:
00069
00070 JackProfiler(jack_client_t* jack_client, const JSList* params);
00071 ~JackProfiler();
00072
00073 static int Process(jack_nframes_t nframes, void* arg);
00074 static void ClientRegistration(const char* name, int val, void *arg);
00075
00076 };
00077
00078 }
00079
00080 #endif