Blame memcached_dtrace.d

Packit 4e8bc4
/*
Packit 4e8bc4
 * Copyright (c) <2008>, Sun Microsystems, Inc.
Packit 4e8bc4
 * All rights reserved.
Packit 4e8bc4
 *
Packit 4e8bc4
 * Redistribution and use in source and binary forms, with or without
Packit 4e8bc4
 * modification, are permitted provided that the following conditions are met:
Packit 4e8bc4
 *     * Redistributions of source code must retain the above copyright
Packit 4e8bc4
 *       notice, this list of conditions and the following disclaimer.
Packit 4e8bc4
 *     * Redistributions in binary form must reproduce the above copyright
Packit 4e8bc4
 *       notice, this list of conditions and the following disclaimer in the
Packit 4e8bc4
 *       documentation and/or other materials provided with the distribution.
Packit 4e8bc4
 *     * Neither the name of the  nor the
Packit 4e8bc4
 *       names of its contributors may be used to endorse or promote products
Packit 4e8bc4
 *       derived from this software without specific prior written permission.
Packit 4e8bc4
 *
Packit 4e8bc4
 * THIS SOFTWARE IS PROVIDED BY SUN MICROSYSTEMS, INC. ``AS IS'' AND ANY
Packit 4e8bc4
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
Packit 4e8bc4
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Packit 4e8bc4
 * DISCLAIMED. IN NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY
Packit 4e8bc4
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
Packit 4e8bc4
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
Packit 4e8bc4
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
Packit 4e8bc4
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Packit 4e8bc4
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
Packit 4e8bc4
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 4e8bc4
 */
Packit 4e8bc4
provider memcached {
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when a connection object is allocated from the connection pool.
Packit 4e8bc4
    * @param connid the connection id
Packit 4e8bc4
    */
Packit 4e8bc4
   probe conn__allocate(int connid);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when a connection object is released back to the connection pool.
Packit 4e8bc4
    * @param connid the connection id
Packit 4e8bc4
    */
Packit 4e8bc4
   probe conn__release(int connid);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when a new connection object is created (there are no more
Packit 4e8bc4
    * connection objects in the connection pool).
Packit 4e8bc4
    * @param ptr pointer to the connection object
Packit 4e8bc4
    */
Packit 4e8bc4
   probe conn__create(void *ptr);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when a connection object is destroyed ("released back to
Packit 4e8bc4
    * the memory subsystem").
Packit 4e8bc4
    * @param ptr pointer to the connection object
Packit 4e8bc4
    */
Packit 4e8bc4
   probe conn__destroy(void *ptr);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when a connection is dispatched from the "main thread" to a
Packit 4e8bc4
    * worker thread.
Packit 4e8bc4
    * @param connid the connection id
Packit 4e8bc4
    * @param threadid the thread id
Packit 4e8bc4
    */
Packit 4e8bc4
   probe conn__dispatch(int connid, int64_t threadid);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Allocate memory from the slab allocator.
Packit 4e8bc4
    * @param size the requested size
Packit 4e8bc4
    * @param slabclass the allocation will be fulfilled in this class
Packit 4e8bc4
    * @param slabsize the size of each item in this class
Packit 4e8bc4
    * @param ptr pointer to allocated memory
Packit 4e8bc4
    */
Packit 4e8bc4
   probe slabs__allocate(int size, int slabclass, int slabsize, void* ptr);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Failed to allocate memory (out of memory).
Packit 4e8bc4
    * @param size the requested size
Packit 4e8bc4
    * @param slabclass the class that failed to fulfill the request
Packit 4e8bc4
    */
Packit 4e8bc4
   probe slabs__allocate__failed(int size, int slabclass);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when a slab class attempts to allocate more space.
Packit 4e8bc4
    * @param slabclass class that needs more memory
Packit 4e8bc4
    */
Packit 4e8bc4
   probe slabs__slabclass__allocate(int slabclass);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Failed to allocate memory (out of memory).
Packit 4e8bc4
    * @param slabclass the class that failed grab more memory
Packit 4e8bc4
    */
Packit 4e8bc4
   probe slabs__slabclass__allocate__failed(int slabclass);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Release memory.
Packit 4e8bc4
    * @param size the size of the memory
Packit 4e8bc4
    * @param slabclass the class the memory belongs to
Packit 4e8bc4
    * @param ptr pointer to the memory to release
Packit 4e8bc4
    */
Packit 4e8bc4
   probe slabs__free(int size, int slabclass, void* ptr);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when the when we have searched the hash table for a named key.
Packit 4e8bc4
    * These two elements provide an insight in how well the hash function
Packit 4e8bc4
    * functions. Long traversals are a sign of a less optimal function,
Packit 4e8bc4
    * wasting cpu capacity.
Packit 4e8bc4
    *
Packit 4e8bc4
    * @param key the key searched for
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param depth the depth in the list of hash table
Packit 4e8bc4
    */
Packit 4e8bc4
   probe assoc__find(const char *key, int keylen, int depth);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when a new item has been inserted.
Packit 4e8bc4
    * @param key the key just inserted
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    */
Packit 4e8bc4
   probe assoc__insert(const char *key, int keylen);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when a new item has been removed.
Packit 4e8bc4
    * @param key the key just deleted
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    */
Packit 4e8bc4
   probe assoc__delete(const char *key, int keylen);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when an item is linked into the cache.
Packit 4e8bc4
    * @param key the items key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size the size of the data
Packit 4e8bc4
    */
Packit 4e8bc4
   probe item__link(const char *key, int keylen, int size);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when an item is deleted.
Packit 4e8bc4
    * @param key the items key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size the size of the data
Packit 4e8bc4
    */
Packit 4e8bc4
   probe item__unlink(const char *key, int keylen, int size);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when the refcount for an item is reduced.
Packit 4e8bc4
    * @param key the items key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size the size of the data
Packit 4e8bc4
    */
Packit 4e8bc4
   probe item__remove(const char *key, int keylen, int size);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when the "last refenced" time is updated.
Packit 4e8bc4
    * @param key the items key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size the size of the data
Packit 4e8bc4
    */
Packit 4e8bc4
   probe item__update(const char *key, int keylen, int size);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when an item is replaced with another item.
Packit 4e8bc4
    * @param oldkey the key of the item to replace
Packit 4e8bc4
    * @param oldkeylen the length of the old key
Packit 4e8bc4
    * @param oldsize the size of the old item
Packit 4e8bc4
    * @param newkey the key of the new item
Packit 4e8bc4
    * @param newkeylen the length of the new key
Packit 4e8bc4
    * @param newsize the size of the new item
Packit 4e8bc4
    */
Packit 4e8bc4
   probe item__replace(const char *oldkey, int oldkeylen, int oldsize,
Packit 4e8bc4
                       const char *newkey, int newkeylen, int newsize);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when the processing of a command starts.
Packit 4e8bc4
    * @param connid the connection id
Packit 4e8bc4
    * @param request the incoming request
Packit 4e8bc4
    * @param size the size of the request
Packit 4e8bc4
    */
Packit 4e8bc4
   probe process__command__start(int connid, const void *request, int size);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired when the processing of a command is done.
Packit 4e8bc4
    * @param connid the connection id
Packit 4e8bc4
    * @param response the response to send back to the client
Packit 4e8bc4
    * @param size the size of the response
Packit 4e8bc4
    */
Packit 4e8bc4
   probe process__command__end(int connid, const void *response, int size);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired for a get-command
Packit 4e8bc4
    * @param connid connection id
Packit 4e8bc4
    * @param key requested key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size size of the key's data (or signed int -1 if not found)
Packit 4e8bc4
    * @param casid the casid for the item
Packit 4e8bc4
    */
Packit 4e8bc4
   probe command__get(int connid, const char *key, int keylen, int size, int64_t casid);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired for an add-command.
Packit 4e8bc4
    * @param connid connection id
Packit 4e8bc4
    * @param key requested key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size the new size of the key's data (or signed int -1 if
Packit 4e8bc4
    *             not found)
Packit 4e8bc4
    * @param casid the casid for the item
Packit 4e8bc4
    */
Packit 4e8bc4
   probe command__add(int connid, const char *key, int keylen, int size, int64_t casid);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired for a set-command.
Packit 4e8bc4
    * @param connid connection id
Packit 4e8bc4
    * @param key requested key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size the new size of the key's data (or signed int -1 if
Packit 4e8bc4
    *             not found)
Packit 4e8bc4
    * @param casid the casid for the item
Packit 4e8bc4
    */
Packit 4e8bc4
   probe command__set(int connid, const char *key, int keylen, int size, int64_t casid);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired for a replace-command.
Packit 4e8bc4
    * @param connid connection id
Packit 4e8bc4
    * @param key requested key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size the new size of the key's data (or signed int -1 if
Packit 4e8bc4
    *             not found)
Packit 4e8bc4
    * @param casid the casid for the item
Packit 4e8bc4
    */
Packit 4e8bc4
   probe command__replace(int connid, const char *key, int keylen, int size, int64_t casid);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired for a prepend-command.
Packit 4e8bc4
    * @param connid connection id
Packit 4e8bc4
    * @param key requested key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size the new size of the key's data (or signed int -1 if
Packit 4e8bc4
    *             not found)
Packit 4e8bc4
    * @param casid the casid for the item
Packit 4e8bc4
    */
Packit 4e8bc4
   probe command__prepend(int connid, const char *key, int keylen, int size, int64_t casid);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired for an append-command.
Packit 4e8bc4
    * @param connid connection id
Packit 4e8bc4
    * @param key requested key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size the new size of the key's data (or signed int -1 if
Packit 4e8bc4
    *             not found)
Packit 4e8bc4
    * @param casid the casid for the item
Packit 4e8bc4
    */
Packit 4e8bc4
   probe command__append(int connid, const char *key, int keylen, int size, int64_t casid);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired for an touch-command.
Packit 4e8bc4
    * @param connid connection id
Packit 4e8bc4
    * @param key requested key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size the new size of the key's data (or signed int -1 if
Packit 4e8bc4
    *             not found)
Packit 4e8bc4
    * @param casid the casid for the item
Packit 4e8bc4
    */
Packit 4e8bc4
   probe command__touch(int connid, const char *key, int keylen, int size, int64_t casid);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired for a cas-command.
Packit 4e8bc4
    * @param connid connection id
Packit 4e8bc4
    * @param key requested key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param size size of the key's data (or signed int -1 if not found)
Packit 4e8bc4
    * @param casid the cas id requested
Packit 4e8bc4
    */
Packit 4e8bc4
   probe command__cas(int connid, const char *key, int keylen, int size, int64_t casid);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired for an incr command.
Packit 4e8bc4
    * @param connid connection id
Packit 4e8bc4
    * @param key the requested key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param val the new value
Packit 4e8bc4
    */
Packit 4e8bc4
   probe command__incr(int connid, const char *key, int keylen, int64_t val);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired for a decr command.
Packit 4e8bc4
    * @param connid connection id
Packit 4e8bc4
    * @param key the requested key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    * @param val the new value
Packit 4e8bc4
    */
Packit 4e8bc4
   probe command__decr(int connid, const char *key, int keylen, int64_t val);
Packit 4e8bc4
Packit 4e8bc4
   /**
Packit 4e8bc4
    * Fired for a delete command.
Packit 4e8bc4
    * @param connid connection id
Packit 4e8bc4
    * @param key the requested key
Packit 4e8bc4
    * @param keylen length of the key
Packit 4e8bc4
    */
Packit 4e8bc4
   probe command__delete(int connid, const char *key, int keylen);
Packit 4e8bc4
Packit 4e8bc4
};
Packit 4e8bc4
Packit 4e8bc4
#pragma D attributes Unstable/Unstable/Common provider memcached provider
Packit 4e8bc4
#pragma D attributes Private/Private/Common provider memcached module
Packit 4e8bc4
#pragma D attributes Private/Private/Common provider memcached function
Packit 4e8bc4
#pragma D attributes Unstable/Unstable/Common provider memcached name
Packit 4e8bc4
#pragma D attributes Unstable/Unstable/Common provider memcached args