[ 
https://issues.apache.org/jira/browse/TS-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14724541#comment-14724541
 ] 

Bryan Call edited comment on TS-3877 at 9/1/15 1:34 AM:
--------------------------------------------------------

To use the TrackerClassAllocator you will need to replace the ClassAllocator 
with this class.

Example Code:
{code}
diff --git a/iocore/eventsystem/I_Lock.h b/iocore/eventsystem/I_Lock.h
index e90d1bf..0d9cc86 100644
--- a/iocore/eventsystem/I_Lock.h
+++ b/iocore/eventsystem/I_Lock.h
@@ -275,7 +275,7 @@ public:
 };

 // The ClassAlocator for ProxyMutexes
-extern inkcoreapi ClassAllocator<ProxyMutex> mutexAllocator;
+extern inkcoreapi TrackerClassAllocator<ProxyMutex> mutexAllocator;

 inline bool
 Mutex_trylock(
diff --git a/iocore/eventsystem/Lock.cc b/iocore/eventsystem/Lock.cc
index 098884c..83241e7 100644
--- a/iocore/eventsystem/Lock.cc
+++ b/iocore/eventsystem/Lock.cc
@@ -31,7 +31,7 @@
 #include "P_EventSystem.h"
 #include "ts/Diags.h"

-ClassAllocator<ProxyMutex> mutexAllocator("mutexAllocator");
+TrackerClassAllocator<ProxyMutex> mutexAllocator("mutexAllocator");

 void
 lock_waiting(const SrcLoc &srcloc, const char *handler)
{code}

Example Output:
{code}
Allocs     | Frees      | Size In-use          | Avg Size   | Location
-----------|------------|----------------------|------------|--------------------------------------------------------------------
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x000000010328ee13 _Z16initCacheControlv + 
19
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001032b2720 _ZN7IpAllow7startupEv + 
32
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001032ce41b main + 4619
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001032d1250 
_ZN12ParentConfig7startupEv + 32
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001032df6d3 _Z18init_reverse_proxyv 
+ 19
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001032e2aed _Z16start_stats_snapv + 
429
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001032e3091 
_Z27initialize_all_global_statsv + 1201
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x0000000103371f62 
_ZN10HttpConfig7startupEv + 82
        63 |          0 |                 6048 |         96 | 1   
traffic_server                      0x0000000103376ee8 _Z15http_pages_initv + 72
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001033776b1 
_Z20init_HttpProxyServeri + 449
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001033777ef 
_Z20init_HttpProxyServeri + 767
         2 |          0 |                  192 |         96 | 1   
traffic_server                      0x000000010339839d 
_ZN17ServerSessionPoolC2Ev + 29
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001033ef14e 
_Z21initCongestionControlv + 46
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001033fb5c9 
_ZN3Log17init_when_enabledEv + 249
        64 |          0 |                 6144 |         96 | 1   
traffic_server                      0x0000000103447208 
_ZN15HostDBProcessor5startEim + 56
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x000000010344754e 
_ZN15HostDBProcessor5startEim + 894
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001034476fe 
_ZN15HostDBProcessor5startEim + 1326
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x000000010346ec27 
_ZN14SplitDNSConfig7startupEv + 23
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x000000010346ecb7 
_ZN14SplitDNSConfig7startupEv + 167
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x0000000103470a83 _Z15clusterAPI_initv + 51
       256 |          0 |                24576 |         96 | 1   
traffic_server                      0x0000000103471dac 
_ZN23ClusterVConnectionCache4initEv + 60
       256 |          0 |                24576 |         96 | 1   
traffic_server                      0x0000000103471e59 
_ZN23ClusterVConnectionCache4initEv + 233
     16384 |          0 |              1572864 |         96 | 1   
traffic_server                      0x0000000103472808 
_ZN17CacheContinuation4initEv + 56
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x000000010348df86 
_ZN26GlobalClusterPeriodicEventC1Ev + 22
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x000000010348ee93 
_Z27create_this_cluster_machinev + 19
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001034979d6 
_ZN14CacheProcessor14start_internalEi + 166
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x0000000103497bee 
_ZN14CacheProcessor14start_internalEi + 702
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001034a4ead _ZN3VolC2Ev + 29
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001034a9cc7 _Z13dir_sync_initv + 39
       256 |          0 |                24576 |         96 | 1   
traffic_server                      0x00000001034dd228 _ZN15SSLSessionCacheC2Ev 
+ 152
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001034df8f3 
_ZN20SSLCertificateConfig7startupEv + 35
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001034f1d6e 
_Z25initialize_thread_for_netP7EThread + 366
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x00000001034f6266 
_ZN9NetAccept18do_blocking_acceptEP7EThread + 1590
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x0000000103513a77 _Z15RecProcessStartv + 71
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x0000000103513b4b _Z15RecProcessStartv + 
283
         1 |          0 |                   96 |         96 | 1   
traffic_server                      0x0000000103513c0d _Z15RecProcessStartv + 
477
        17 |          0 |                 1632 |         96 | 1   
traffic_server                      0x0000000103517c43 _ZN6ThreadC2Ev + 323
         2 |          1 |                 8192 |       8192 | 
memory/IOBuffer/HttpServerSession.cc:86
                                       1671584 |            | TOTAL
{code}


was (Author: bcall):
To use the TrackerClassAllocator you will need to replace the ClassAllocator 
with this class.

> Add a tracking ClassAllocator to keep track of where the allocation happened
> ----------------------------------------------------------------------------
>
>                 Key: TS-3877
>                 URL: https://issues.apache.org/jira/browse/TS-3877
>             Project: Traffic Server
>          Issue Type: Improvement
>            Reporter: Bryan Call
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to