PageRenderTime 32ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llcommon/llallocator_heap_profile.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 71 lines | 32 code | 13 blank | 26 comment | 0 complexity | b2e653726020e25eabf5fc154a2a3bee MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llallocator_heap_profile.h
  3. * @brief Declaration of the parser for tcmalloc heap profile data.
  4. * @author Brad Kittenbrink
  5. *
  6. * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #ifndef LL_LLALLOCATOR_HEAP_PROFILE_H
  28. #define LL_LLALLOCATOR_HEAP_PROFILE_H
  29. #include "stdtypes.h"
  30. #include <map>
  31. #include <vector>
  32. class LLAllocatorHeapProfile
  33. {
  34. public:
  35. typedef int stack_marker;
  36. typedef std::vector<stack_marker> stack_trace;
  37. struct line {
  38. line(U32 live_count, U64 live_size, U32 tot_count, U64 tot_size) :
  39. mLiveSize(live_size),
  40. mTotalSize(tot_size),
  41. mLiveCount(live_count),
  42. mTotalCount(tot_count)
  43. {
  44. }
  45. U64 mLiveSize, mTotalSize;
  46. U32 mLiveCount, mTotalCount;
  47. stack_trace mTrace;
  48. };
  49. typedef std::vector<line> lines_t;
  50. LLAllocatorHeapProfile()
  51. {
  52. }
  53. void parse(std::string const & prof_text);
  54. void dump(std::ostream & out) const;
  55. public:
  56. lines_t mLines;
  57. };
  58. #endif // LL_LLALLOCATOR_HEAP_PROFILE_H