jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
1.8KB

  1. /*
  2. Copyright (C) 2009 Grame
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  14. */
  15. #ifndef __JackProfiler__
  16. #define __JackProfiler__
  17. #include "JackConstants.h"
  18. #include "JackPlatformPlug.h"
  19. #include "jack.h"
  20. #include "jslist.h"
  21. #include <map>
  22. #include <string>
  23. #ifdef JACK_MONITOR
  24. #include "JackEngineProfiling.h"
  25. #endif
  26. namespace Jack
  27. {
  28. struct JackProfilerClient {
  29. int fRefNum;
  30. jack_client_t* fClient;
  31. jack_port_t* fSchedulingPort;
  32. jack_port_t* fDurationPort;
  33. JackProfilerClient(jack_client_t* client, const char* name);
  34. ~JackProfilerClient();
  35. };
  36. /*!
  37. \brief Server real-time monitoring
  38. */
  39. class JackProfiler
  40. {
  41. private:
  42. jack_client_t* fClient;
  43. jack_port_t* fCPULoadPort;
  44. jack_port_t* fDriverPeriodPort;
  45. jack_port_t* fDriverEndPort;
  46. #ifdef JACK_MONITOR
  47. JackTimingMeasure* fLastMeasure;
  48. std::map<std::string, JackProfilerClient*> fClientTable;
  49. JackMutex fMutex;
  50. #endif
  51. public:
  52. JackProfiler(jack_client_t* jack_client, const JSList* params);
  53. ~JackProfiler();
  54. static int Process(jack_nframes_t nframes, void* arg);
  55. static void ClientRegistration(const char* name, int val, void *arg);
  56. };
  57. }
  58. #endif