STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
profiler_hashtable_size.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Copyright (C) 2009-2013 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
19 
20 // You should have received a copy of the GNU General Public License along
21 // with this library; see the file COPYING3. If not see
22 // <http://www.gnu.org/licenses/>.
23 
28 // Written by Lixia Liu and Silvius Rus.
29 
30 #ifndef _GLIBCXX_PROFILE_PROFILER_HASHTABLE_SIZE_H
31 #define _GLIBCXX_PROFILE_PROFILER_HASHTABLE_SIZE_H 1
32 
33 #include "profile/impl/profiler.h"
38 
39 namespace __gnu_profile
40 {
43  : public __trace_container_size
44  {
45  public:
48  { __id = "hashtable-size"; }
49  };
50 
51  inline void
53  { _GLIBCXX_PROFILE_DATA(_S_hashtable_size) = new __trace_hashtable_size(); }
54 
55  inline void
57  {
58  if (_GLIBCXX_PROFILE_DATA(_S_hashtable_size))
59  {
60  _GLIBCXX_PROFILE_DATA(_S_hashtable_size)->
61  __collect_warnings(__warnings);
62  _GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__write(__f);
63  }
64  }
65 
66  inline void
68  {
69  if (!__profcxx_init())
70  return;
71 
72  _GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__insert(__obj, __get_stack(),
73  __num);
74  }
75 
76  inline void
77  __trace_hashtable_size_destruct(const void* __obj, std::size_t __num,
78  std::size_t __inum)
79  {
80  if (!__profcxx_init())
81  return;
82 
83  _GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__destruct(__obj, __num, __inum);
84  }
85 
86  inline void
87  __trace_hashtable_size_resize(const void* __obj, std::size_t __from,
88  std::size_t __to)
89  {
90  if (!__profcxx_init())
91  return;
92 
93  _GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__resize(__obj, __from, __to);
94  }
95 
96 } // namespace __gnu_profile
97 
98 #endif /* _GLIBCXX_PROFILE_PROFILER_HASHTABLE_SIZE_H */
__stack_t __get_stack()
Definition: profiler_node.h:50
Global profiler state.
void __trace_hashtable_size_construct(const void *, std::size_t)
Definition: profiler_hashtable_size.h:67
void __trace_hashtable_size_destruct(const void *, std::size_t, std::size_t)
Definition: profiler_hashtable_size.h:77
__trace_hashtable_size()
Definition: profiler_hashtable_size.h:46
Container size instrumentation trace producer.
Definition: profiler_container_size.h:164
Data structures to represent profiling traces.
Diagnostics for container sizes.
std::_GLIBCXX_STD_C::vector< __warning_data > __warning_vector_t
Definition: profiler_trace.h:93
Interface of the profiling runtime library.
bool __profcxx_init()
This function must be called by each instrumentation point.
Definition: profiler_trace.h:649
void __trace_hashtable_size_resize(const void *, std::size_t, std::size_t)
Definition: profiler_hashtable_size.h:87
#define _GLIBCXX_PROFILE_DATA(__name)
Definition: profiler.h:48
void __trace_hashtable_size_report(FILE *__f, __warning_vector_t &__warnings)
Definition: profiler_hashtable_size.h:56
Hashtable size instrumentation trace producer.
Definition: profiler_hashtable_size.h:42
__SIZE_TYPE__ size_t
Definition: stddef.h:212
Data structures to represent a single profiling event.
void __trace_hashtable_size_init()
Definition: profiler_hashtable_size.h:52